Skip to content
This repository was archived by the owner on Jul 6, 2025. It is now read-only.

Commit c996d6c

Browse files
committed
Revert: "Rename fetchModuleSource to fetchModuleSource"
1 parent 7621fdd commit c996d6c

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

examples/42-wasm/wasm_loader.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default <Plugin>{
44
name: 'wasm-loader',
55
setup: aleph => {
66
aleph.onLoad(/\.wasm$/i, async ({ specifier }) => {
7-
const { content } = await aleph.fetchModuleSource(specifier)
7+
const { content } = await aleph.fetchModule(specifier)
88
return {
99
code: [
1010
`const wasmBytes = new Uint8Array([${content.join(',')}])`,

plugins/css.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export const cssLoader = async ({ specifier, data }: LoadInput, aleph: Aleph): P
7676
} else if (util.isFilledString(data)) {
7777
sourceCode = data
7878
} else {
79-
const { content } = await aleph.fetchModuleSource(specifier)
79+
const { content } = await aleph.fetchModule(specifier)
8080
sourceCode = (new TextDecoder).decode(content)
8181
}
8282

plugins/markdown.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export const markdownResovler = (specifier: string): ResolveResult => {
1919

2020
export const markdownLoader = async ({ specifier }: LoadInput, aleph: Aleph): Promise<LoadOutput> => {
2121
const { framework } = aleph.config
22-
const { content } = await aleph.fetchModuleSource(specifier)
22+
const { content } = await aleph.fetchModule(specifier)
2323
const { __content, ...meta } = safeLoadFront((new TextDecoder).decode(content))
2424
const html = marked.parse(__content)
2525
const props = {

server/aleph.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,7 @@ export class Aleph implements IAleph {
733733

734734
/** parse the export names of the module. */
735735
async parseModuleExportNames(specifier: string): Promise<string[]> {
736-
const { content, contentType } = await this.fetchModuleSource(specifier)
736+
const { content, contentType } = await this.fetchModule(specifier)
737737
const sourceType = getSourceType(specifier, contentType || undefined)
738738
if (sourceType === SourceType.Unknown || sourceType === SourceType.CSS) {
739739
return []
@@ -925,7 +925,7 @@ export class Aleph implements IAleph {
925925
}
926926

927927
/** fetch module source by the specifier. */
928-
async fetchModuleSource(specifier: string): Promise<{ content: Uint8Array, contentType: string | null }> {
928+
async fetchModule(specifier: string): Promise<{ content: Uint8Array, contentType: string | null }> {
929929
if (!util.isLikelyHttpURL(specifier)) {
930930
const filepath = join(this.workingDir, this.config.srcDir, util.trimPrefix(specifier, 'file://'))
931931
if (await existsFile(filepath)) {
@@ -981,7 +981,7 @@ export class Aleph implements IAleph {
981981
sourceCode = code
982982
sourceMap = map || null
983983
} else {
984-
const source = await this.fetchModuleSource(specifier)
984+
const source = await this.fetchModule(specifier)
985985
sourceType = getSourceType(specifier, source.contentType || undefined)
986986
if (sourceType !== SourceType.Unknown) {
987987
sourceCode = (new TextDecoder).decode(source.content)

types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export interface Aleph {
77
readonly config: RequiredConfig
88
addDist(path: string, content: Uint8Array): Promise<void>
99
addModule(specifier: string, sourceCode?: string): Promise<void>
10-
fetchModuleSource(specifier: string): Promise<{ content: Uint8Array, contentType: string | null }>
10+
fetchModule(specifier: string): Promise<{ content: Uint8Array, contentType: string | null }>
1111
onResolve(test: RegExp, resolve: (specifier: string) => ResolveResult): void
1212
onLoad(test: RegExp, load: (input: LoadInput) => LoadOutput | Promise<LoadOutput>): void
1313
onTransform(test: 'hmr' | 'mainscript' | RegExp, transform: (input: TransformInput) => TransformOutput): void

0 commit comments

Comments
 (0)