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

Commit 4aa7199

Browse files
authored
Use native runtime on macOS (#386)
* Use `NativeRuntime` on macOS * Add `compatibilityDate` to miniflare injected workers (KV, R2, and Core Entry)
1 parent b929f02 commit 4aa7199

File tree

7 files changed

+7
-4
lines changed

7 files changed

+7
-4
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/tre/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ runtime... 👀
77
88
# Additional Development Setup
99

10-
1. Copy the open-source runtime binary to `./lib/cfwrkr`
10+
1. Copy the open-source runtime binary to `./lib/workerd`
1111
2. Copy the config files `sserve-conf.{capnp,capnp.d.ts,capnp.js,ts}` to
1212
`./src/runtime/config/`

packages/tre/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ type PluginRouters = {
101101
};
102102

103103
// `__dirname` relative to bundled output `dist/src/index.js`
104-
const RUNTIME_PATH = path.resolve(__dirname, "..", "..", "lib", "cfwrkr");
104+
const RUNTIME_PATH = path.resolve(__dirname, "..", "..", "lib", "workerd");
105105

106106
type StoppableServer = http.Server & stoppable.WithStop;
107107

packages/tre/src/plugins/core/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ export const CORE_PLUGIN: Plugin<
157157
worker: {
158158
serviceWorkerScript: SCRIPT_ENTRY,
159159
bindings: serviceEntryBindings,
160+
compatibilityDate: "2022-09-01",
160161
},
161162
},
162163
];

packages/tre/src/plugins/kv/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ export const KV_PLUGIN: Plugin<
106106
{ name: BINDING_TEXT_NAMESPACE, text: id },
107107
loopbackBinding,
108108
],
109+
compatibilityDate: "2022-09-01",
109110
},
110111
})
111112
);

packages/tre/src/plugins/r2/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ export const R2_PLUGIN: Plugin<
5757
{ name: BINDING_TEXT_NAMESPACE, text: id },
5858
loopbackBinding,
5959
],
60+
compatibilityDate: "2022-09-01",
6061
},
6162
})
6263
);

packages/tre/src/runtime/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function waitForExit(process: childProcess.ChildProcess): Promise<void> {
4242

4343
class NativeRuntime extends Runtime {
4444
static isSupported() {
45-
return process.platform === "linux"; // TODO: and "darwin"?
45+
return process.platform === "linux" || process.platform === "darwin";
4646
}
4747
static supportSuggestion = "Run using a Linux or macOS based system";
4848
static description = "natively ⚡️";

0 commit comments

Comments
 (0)