Skip to content

Commit 259db18

Browse files
committed
Rename Mixed Mode to remote proxy/remote bindings depending on context
1 parent 2671e77 commit 259db18

File tree

89 files changed

+850
-907
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+850
-907
lines changed

fixtures/vitest-pool-workers-mixed-mode/remote-worker.js

Lines changed: 0 additions & 7 deletions
This file was deleted.

fixtures/vitest-pool-workers-mixed-mode/wrangler.json

Lines changed: 0 additions & 8 deletions
This file was deleted.

fixtures/vitest-pool-workers-mixed-mode/package.json renamed to fixtures/vitest-pool-workers-remote-bindings/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@fixture/vitest-pool-workers-mixed-mode",
2+
"name": "@fixture/vitest-pool-workers-remote-bindings",
33
"private": true,
44
"scripts": {
55
"test": "vitest run --config vitest.workers.config.ts",
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export default {
2+
fetch() {
3+
return new Response(
4+
"Hello from a remote worker part of the vitest-pool-workers remote bindings fixture!"
5+
);
6+
},
7+
};

fixtures/vitest-pool-workers-mixed-mode/test/index.spec.ts renamed to fixtures/vitest-pool-workers-remote-bindings/test/index.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ describe("Hello World worker", () => {
1818
const response = await env.MY_WORKER.fetch(request, env, ctx);
1919
await waitOnExecutionContext(ctx);
2020
expect(await response.text()).toMatchInlineSnapshot(
21-
`"Hello from a remote worker part of the vitest-pool-workers mixed mode fixture!"`
21+
`"Hello from a remote worker part of the vitest-pool-workers remote bindings fixture!"`
2222
);
2323
}
2424
);
2525

2626
it("responds with Hello World! (integration style)", async () => {
2727
const response = await SELF.fetch("https://example.com");
2828
expect(await response.text()).toMatchInlineSnapshot(
29-
`"Response from remote worker: Hello from a remote worker part of the vitest-pool-workers mixed mode fixture!"`
29+
`"Response from remote worker: Hello from a remote worker part of the vitest-pool-workers remote bindings fixture!"`
3030
);
3131
});
3232
});

fixtures/vitest-pool-workers-mixed-mode/vitest.workers.config.ts renamed to fixtures/vitest-pool-workers-remote-bindings/vitest.workers.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default defineWorkersConfig({
1515
test: {
1616
poolOptions: {
1717
workers: {
18-
experimental_mixedMode: true,
18+
experimental_remoteBindings: true,
1919
wrangler: { configPath: "./wrangler.json" },
2020
},
2121
},
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "vitest-remote-bindings-fixture-test",
3+
"main": "src/index.js",
4+
"compatibility_date": "2025-06-01",
5+
"services": [
6+
{
7+
"binding": "MY_WORKER",
8+
"service": "my-worker-test",
9+
"experimental_remote": true
10+
}
11+
]
12+
}

packages/miniflare/src/index.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -432,12 +432,12 @@ function getExternalServiceEntrypoints(
432432
for (const [name, service] of Object.entries(
433433
workerOpts.core.serviceBindings
434434
)) {
435-
const { serviceName, entrypoint, mixedModeConnectionString } =
435+
const { serviceName, entrypoint, remoteProxyConnectionString } =
436436
normaliseServiceDesignator(service);
437437

438438
if (
439439
// Skip if it is a remote service
440-
mixedModeConnectionString === undefined &&
440+
remoteProxyConnectionString === undefined &&
441441
// Skip if the service is bound to another Worker defined in the Miniflare config
442442
serviceName &&
443443
!allWorkerNames.includes(serviceName)
@@ -466,12 +466,12 @@ function getExternalServiceEntrypoints(
466466
scriptName,
467467
unsafePreventEviction,
468468
enableSql: useSQLite,
469-
mixedModeConnectionString,
469+
remoteProxyConnectionString,
470470
} = normaliseDurableObject(designator);
471471

472472
if (
473473
// Skip if it is a remote durable object
474-
mixedModeConnectionString === undefined &&
474+
remoteProxyConnectionString === undefined &&
475475
// Skip if the durable object is bound to a Worker that exists in the current Miniflare config
476476
scriptName &&
477477
!allWorkerNames.includes(scriptName)
@@ -501,12 +501,12 @@ function getExternalServiceEntrypoints(
501501
const {
502502
serviceName = workerOpts.core.name,
503503
entrypoint,
504-
mixedModeConnectionString,
504+
remoteProxyConnectionString,
505505
} = normaliseServiceDesignator(workerOpts.core.tails[i]);
506506

507507
if (
508508
// Skip if it is a remote service
509-
mixedModeConnectionString === undefined &&
509+
remoteProxyConnectionString === undefined &&
510510
// Skip if the service is bound to the existing workers
511511
serviceName &&
512512
!allWorkerNames.includes(serviceName)
@@ -2196,7 +2196,7 @@ export class Miniflare {
21962196
workerOpts.do.durableObjects ?? {}
21972197
).reduce<WorkerDefinition["durableObjects"]>(
21982198
(internalObjects, [bindingName, designator]) => {
2199-
const { className, scriptName, mixedModeConnectionString } =
2199+
const { className, scriptName, remoteProxyConnectionString } =
22002200
normaliseDurableObject(designator);
22012201

22022202
if (
@@ -2205,7 +2205,7 @@ export class Miniflare {
22052205
// If the scriptName matches one of the workers defined, it is internal as well
22062206
allWorkerNames.includes(scriptName) ||
22072207
// If it is not a remote durable object
2208-
mixedModeConnectionString === undefined
2208+
remoteProxyConnectionString === undefined
22092209
) {
22102210
internalObjects.push({
22112211
name: bindingName,

0 commit comments

Comments
 (0)