Rename file to ref in WorkerBridge
MODIFY
packages/@romefrontend/core/common/bridges/WorkerBridge.ts
packages/@romefrontend/core/common/bridges/WorkerBridge.ts
@@ -104,7 +104,7 @@ export type PrefetchedModuleSignatures = {
}
| {
type: "OWNED";
- file: JSONFileReference;
+ ref: JSONFileReference;
}
| {
type: "POINTER";
@@ -190,7 +190,7 @@ export default class WorkerBridge extends Bridge {
format = this.createEvent<
{
- file: JSONFileReference;
+ ref: JSONFileReference;
parseOptions: WorkerParseOptions;
},
undefined | WorkerFormatResult
@@ -201,7 +201,7 @@ export default class WorkerBridge extends Bridge {
moduleSignatureJS = this.createEvent<
{
- file: JSONFileReference;
+ ref: JSONFileReference;
parseOptions: WorkerParseOptions;
},
ModuleSignature
@@ -212,7 +212,7 @@ export default class WorkerBridge extends Bridge {
analyzeDependencies = this.createEvent<
{
- file: JSONFileReference;
+ ref: JSONFileReference;
parseOptions: WorkerParseOptions;
},
AnalyzeDependencyResult
@@ -223,7 +223,7 @@ export default class WorkerBridge extends Bridge {
lint = this.createEvent<
{
- file: JSONFileReference;
+ ref: JSONFileReference;
options: WorkerLintOptions;
parseOptions: WorkerParseOptions;
},
@@ -232,7 +232,7 @@ export default class WorkerBridge extends Bridge {
updateInlineSnapshots = this.createEvent<
{
- file: JSONFileReference;
+ ref: JSONFileReference;
updates: InlineSnapshotUpdates;
parseOptions: WorkerParseOptions;
},
@@ -241,7 +241,7 @@ export default class WorkerBridge extends Bridge {
compile = this.createEvent<
{
- file: JSONFileReference;
+ ref: JSONFileReference;
stage: TransformStageName;
options: WorkerCompilerOptions;
parseOptions: WorkerParseOptions;
@@ -251,7 +251,7 @@ export default class WorkerBridge extends Bridge {
parse = this.createEvent<
{
- file: JSONFileReference;
+ ref: JSONFileReference;
options: WorkerParseOptions;
},
AnyRoot
@@ -270,7 +270,7 @@ export default class WorkerBridge extends Bridge {
updateBuffer = this.createEvent<
{
- file: JSONFileReference;
+ ref: JSONFileReference;
content: string;
},
void
@@ -281,7 +281,7 @@ export default class WorkerBridge extends Bridge {
patchBuffer = this.createEvent<
{
- file: JSONFileReference;
+ ref: JSONFileReference;
patches: Array<WorkerBufferPatch>;
},
string
@@ -292,7 +292,7 @@ export default class WorkerBridge extends Bridge {
clearBuffer = this.createEvent<
{
- file: JSONFileReference;
+ ref: JSONFileReference;
},
void
>({

MODIFY
packages/@romefrontend/core/server/ServerRequest.ts
packages/@romefrontend/core/server/ServerRequest.ts
@@ -912,8 +912,8 @@ export default class ServerRequest {
await this.wrapRequestDiagnostic(
"updateBuffer",
path,
- async (bridge, file) => {
- await bridge.updateBuffer.call({file, content});
+ async (bridge, ref) => {
+ await bridge.updateBuffer.call({ref, content});
this.server.memoryFs.addBuffer(path, content);
this.server.refreshFileEvent.send(path);
},
@@ -930,8 +930,8 @@ export default class ServerRequest {
return this.wrapRequestDiagnostic(
"patchBuffer",
path,
- async (bridge, file) => {
- const buffer = await bridge.patchBuffer.call({file, patches});
+ async (bridge, ref) => {
+ const buffer = await bridge.patchBuffer.call({ref, patches});
this.server.memoryFs.addBuffer(path, buffer);
this.server.refreshFileEvent.send(path);
return buffer;
@@ -946,8 +946,8 @@ export default class ServerRequest {
await this.wrapRequestDiagnostic(
"updateBuffer",
path,
- async (bridge, file) => {
- await bridge.clearBuffer.call({file});
+ async (bridge, ref) => {
+ await bridge.clearBuffer.call({ref});
this.server.memoryFs.clearBuffer(path);
this.server.refreshFileEvent.send(path);
},
@@ -964,7 +964,7 @@ export default class ServerRequest {
return this.wrapRequestDiagnostic(
"parse",
path,
- (bridge, file) => bridge.parse.call({file, options: opts}),
+ (bridge, ref) => bridge.parse.call({ref, options: opts}),
);
}
@@ -978,8 +978,8 @@ export default class ServerRequest {
return this.wrapRequestDiagnostic(
"updateInlineSnapshots",
path,
- (bridge, file) =>
- bridge.updateInlineSnapshots.call({file, updates, parseOptions})
+ (bridge, ref) =>
+ bridge.updateInlineSnapshots.call({ref, updates, parseOptions})
,
);
}
@@ -1011,7 +1011,7 @@ export default class ServerRequest {
const res = await this.wrapRequestDiagnostic(
"lint",
path,
- (bridge, file) => bridge.lint.call({file, options, parseOptions: {}}),
+ (bridge, ref) => bridge.lint.call({ref, options, parseOptions: {}}),
);
await cache.update(
@@ -1038,7 +1038,7 @@ export default class ServerRequest {
return await this.wrapRequestDiagnostic(
"format",
path,
- (bridge, file) => bridge.format.call({file, parseOptions}),
+ (bridge, ref) => bridge.format.call({ref, parseOptions}),
);
}
@@ -1066,13 +1066,13 @@ export default class ServerRequest {
const compileRes = await this.wrapRequestDiagnostic(
"compile",
path,
- (bridge, file) => {
+ (bridge, ref) => {
// We allow options to be passed in as undefined so we can compute an easy cache key
if (options === undefined) {
options = {};
}
- return bridge.compile.call({file, stage, options, parseOptions});
+ return bridge.compile.call({ref, stage, options, parseOptions});
},
);
@@ -1116,7 +1116,7 @@ export default class ServerRequest {
const res = await this.wrapRequestDiagnostic(
"analyzeDependencies",
path,
- (bridge, file) => bridge.analyzeDependencies.call({file, parseOptions}),
+ (bridge, ref) => bridge.analyzeDependencies.call({ref, parseOptions}),
);
await cache.update(
path,
@@ -1150,7 +1150,7 @@ export default class ServerRequest {
const res = await this.wrapRequestDiagnostic(
"moduleSignature",
path,
- (bridge, file) => bridge.moduleSignatureJS.call({file, parseOptions}),
+ (bridge, ref) => bridge.moduleSignatureJS.call({ref, parseOptions}),
);
await cache.update(
path,

MODIFY
packages/@romefrontend/core/server/WorkerManager.ts
packages/@romefrontend/core/server/WorkerManager.ts
@@ -178,7 +178,7 @@ export default class WorkerManager {
for (const {filename, content} of buffers) {
await newWorker.bridge.updateBuffer.call({
- file: this.server.projectManager.getTransportFileReference(
+ ref: this.server.projectManager.getTransportFileReference(
createAbsoluteFilePath(filename),
),
content,

MODIFY
packages/@romefrontend/core/worker/Worker.ts
packages/@romefrontend/core/worker/Worker.ts
@@ -146,7 +146,7 @@ export default class Worker {
bridge.compile.subscribe((payload) => {
return this.api.compile(
- convertTransportFileReference(payload.file),
+ convertTransportFileReference(payload.ref),
payload.stage,
payload.options,
payload.parseOptions,
@@ -155,14 +155,14 @@ export default class Worker {
bridge.parse.subscribe((payload) => {
return this.api.parse(
- convertTransportFileReference(payload.file),
+ convertTransportFileReference(payload.ref),
payload.options,
);
});
bridge.lint.subscribe((payload) => {
return this.api.lint(
- convertTransportFileReference(payload.file),
+ convertTransportFileReference(payload.ref),
payload.options,
payload.parseOptions,
);
@@ -170,14 +170,14 @@ export default class Worker {
bridge.format.subscribe((payload) => {
return this.api.format(
- convertTransportFileReference(payload.file),
+ convertTransportFileReference(payload.ref),
payload.parseOptions,
);
});
bridge.updateInlineSnapshots.subscribe((payload) => {
return this.api.updateInlineSnapshots(
- convertTransportFileReference(payload.file),
+ convertTransportFileReference(payload.ref),
payload.updates,
payload.parseOptions,
);
@@ -185,7 +185,7 @@ export default class Worker {
bridge.analyzeDependencies.subscribe((payload) => {
return this.api.analyzeDependencies(
- convertTransportFileReference(payload.file),
+ convertTransportFileReference(payload.ref),
payload.parseOptions,
);
});
@@ -197,7 +197,7 @@ export default class Worker {
bridge.moduleSignatureJS.subscribe((payload) => {
return this.api.moduleSignatureJS(
- convertTransportFileReference(payload.file),
+ convertTransportFileReference(payload.ref),
payload.parseOptions,
);
});
@@ -221,20 +221,20 @@ export default class Worker {
bridge.updateBuffer.subscribe((payload) => {
return this.updateBuffer(
- convertTransportFileReference(payload.file),
+ convertTransportFileReference(payload.ref),
payload.content,
);
});
bridge.patchBuffer.subscribe((payload) => {
return this.patchBuffer(
- convertTransportFileReference(payload.file),
+ convertTransportFileReference(payload.ref),
payload.patches,
);
});
bridge.clearBuffer.subscribe((payload) => {
- return this.clearBuffer(convertTransportFileReference(payload.file));
+ return this.clearBuffer(convertTransportFileReference(payload.ref));
});
bridge.getFileBuffers.subscribe(() => {
@@ -321,7 +321,7 @@ export default class Worker {
case "OWNED":
return this.api.moduleSignatureJS(
- convertTransportFileReference(value.file),
+ convertTransportFileReference(value.ref),
parseOptions,
);

Rename file to ref in WorkerBridge (#799)