Skip to content

Commit 930eede

Browse files
authored
Merge pull request #1199 from cardstack/after-loader-refactoring-clenaup
After loader refactoring cleanup
2 parents 2001f68 + 8d05ecc commit 930eede

File tree

4 files changed

+6
-13
lines changed

4 files changed

+6
-13
lines changed

packages/host/app/lib/current-run.ts

+1-5
Original file line numberDiff line numberDiff line change
@@ -266,11 +266,7 @@ export class CurrentRun {
266266
} else {
267267
let localPath = this.#realmPaths.local(url);
268268

269-
let fileRef = await this.#reader.readFileAsText(
270-
localPath,
271-
{},
272-
this.loader,
273-
);
269+
let fileRef = await this.#reader.readFileAsText(localPath, {});
274270
if (!fileRef) {
275271
let error = new CardError(`missing file ${url.href}`, { status: 404 });
276272
error.deps = [url.href];

packages/runtime-common/realm.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ export interface RealmAdapter {
117117
},
118118
): AsyncGenerator<{ name: string; path: LocalPath; kind: Kind }, void>;
119119

120-
openFile(path: LocalPath, loader?: Loader): Promise<FileRef | undefined>;
120+
openFile(path: LocalPath): Promise<FileRef | undefined>;
121121

122122
exists(path: LocalPath): Promise<boolean>;
123123

@@ -1211,7 +1211,6 @@ export class Realm {
12111211
path,
12121212
this.#adapter.openFile.bind(this.#adapter),
12131213
fallbackExtensions,
1214-
this.loader,
12151214
);
12161215
}
12171216

packages/runtime-common/search-index.ts

-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ export interface Reader {
3636
readFileAsText: (
3737
path: LocalPath,
3838
opts?: { withFallbacks?: true },
39-
loader?: Loader,
4039
) => Promise<{ content: string; lastModified: number } | undefined>;
4140
readdir: (
4241
path: string,

packages/runtime-common/stream.ts

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { isNode, executableExtensions, Loader } from './index';
1+
import { isNode, executableExtensions } from './index';
22
import type { FileRef } from './realm';
33
import type { LocalPath } from './paths';
44

@@ -74,17 +74,16 @@ export async function readFileAsText(
7474
// explicit file extensions in your source code
7575
export async function getFileWithFallbacks(
7676
path: LocalPath,
77-
openFile: (path: string, loader?: Loader) => Promise<FileRef | undefined>,
77+
openFile: (path: string) => Promise<FileRef | undefined>,
7878
fallbackExtensions: string[],
79-
loader?: Loader,
8079
): Promise<FileRef | undefined> {
81-
let result = await openFile(path, loader);
80+
let result = await openFile(path);
8281
if (result) {
8382
return result;
8483
}
8584

8685
for (let extension of fallbackExtensions) {
87-
result = await openFile(path + extension, loader);
86+
result = await openFile(path + extension);
8887
if (result) {
8988
return result;
9089
}

0 commit comments

Comments
 (0)