Skip to content

Commit

Permalink
Default --x-registry to on (#7081)
Browse files Browse the repository at this point in the history
  • Loading branch information
penalosa authored Nov 16, 2024
1 parent d4d3062 commit b4a0e74
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/tricky-bottles-bow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"wrangler": patch
---

Default the file based registry (`--x-registry`) to on. This should improve stability of multi-worker development
2 changes: 2 additions & 0 deletions packages/wrangler/e2e/dev-registry.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ describe("unstable_dev()", () => {
}
);
await setTimeout(2000)
const parentWorker = await unstable_dev(
"src/index.ts",
{
Expand Down
2 changes: 1 addition & 1 deletion packages/wrangler/src/__tests__/dev.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1419,7 +1419,7 @@ describe.sequential("wrangler dev", () => {
--test-scheduled Test scheduled events by visiting /__scheduled in browser [boolean] [default: false]
--log-level Specify logging level [choices: \\"debug\\", \\"info\\", \\"log\\", \\"warn\\", \\"error\\", \\"none\\"] [default: \\"log\\"]
--show-interactive-dev-session Show interactive dev session (defaults to true if the terminal supports interactivity) [boolean]
--experimental-registry, --x-registry Use the experimental file based dev registry for multi-worker development [boolean] [default: false]
--experimental-registry, --x-registry Use the experimental file based dev registry for multi-worker development [boolean] [default: true]
--experimental-vectorize-bind-to-prod Bind to production Vectorize indexes in local development mode [boolean] [default: false]",
"warn": "",
}
Expand Down
2 changes: 1 addition & 1 deletion packages/wrangler/src/api/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export async function unstable_dev(
showInteractiveDevSession,
testMode,
testScheduled,
fileBasedRegistry = false,
fileBasedRegistry = true,
vectorizeBindToProd,
// 2. options for alpha/beta products/libs
d1Databases,
Expand Down
2 changes: 1 addition & 1 deletion packages/wrangler/src/api/integrations/platform/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export async function getPlatformProxy<

const miniflareOptions = await run(
{
FILE_BASED_REGISTRY: Boolean(options.experimentalRegistry),
FILE_BASED_REGISTRY: Boolean(options.experimentalRegistry ?? true),
JSON_CONFIG_FILE: Boolean(options.experimentalJsonConfig),
},
() => getMiniflareOptionsFromConfig(rawConfig, env, options)
Expand Down
2 changes: 2 additions & 0 deletions packages/wrangler/src/dev-registry/file-registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ async function devRegistry(
async function startWorkerRegistry(
cb?: (registry: WorkerRegistry | undefined) => void
) {
await loadWorkerDefinitions();
cb?.({ ...globalWorkers });
globalWatcher ??= watch(DEV_REGISTRY_PATH, {
persistent: true,
}).on("all", async () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/wrangler/src/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ const command = defineCommand({
type: "boolean",
describe:
"Use the experimental file based dev registry for multi-worker development",
default: false,
default: true,
},
"experimental-vectorize-bind-to-prod": {
type: "boolean",
Expand Down

0 comments on commit b4a0e74

Please sign in to comment.