Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/v1-dev-registry-runtime.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@cloudflare/vite-plugin": minor
---

Update the development registry to use the canonical Cloudflare path

Upgrade Miniflare to 5.20261023.1-beta and Wrangler to 4.154.0. Vite plugin v1 now uses `CLOUDFLARE_DEV_REGISTRY_PATH` or `<Cloudflare config directory>/dev-registry/v5` for Worker discovery. `MINIFLARE_REGISTRY_PATH` is no longer read. When mixing Vite and Wrangler development sessions, set the same `CLOUDFLARE_DEV_REGISTRY_PATH` for both because Wrangler retains its legacy default.
2 changes: 1 addition & 1 deletion fixtures/dev-registry/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
"typescript": "catalog:default",
"vite": "catalog:default",
"vitest": "catalog:default",
"wrangler": "4.151.0"
"wrangler": "4.154.0"
}
}
25 changes: 19 additions & 6 deletions fixtures/dev-registry/tests/dev-registry.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ async function runViteDev(
devRegistryPath?: string
): Promise<string> {
const proc = await runLongLived("pnpm", `vite --config ${config}`, cwd, {
MINIFLARE_REGISTRY_PATH: devRegistryPath,
CLOUDFLARE_DEV_REGISTRY_PATH: devRegistryPath,
});
const url = await waitForReady(proc);

Expand Down Expand Up @@ -78,7 +78,7 @@ async function runWranglerDev(
? config.map((configPath) => `--config=${configPath}`)
: [`--config=${config}`]
),
{ WRANGLER_REGISTRY_PATH: devRegistryPath }
{ CLOUDFLARE_DEV_REGISTRY_PATH: devRegistryPath }
);

onTestFailed(() => {
Expand Down Expand Up @@ -121,7 +121,7 @@ async function startTailPair(
}

async function setupPlatformProxy(config: string, devRegistryPath?: string) {
vi.stubEnv("WRANGLER_REGISTRY_PATH", devRegistryPath);
vi.stubEnv("CLOUDFLARE_DEV_REGISTRY_PATH", devRegistryPath);

onTestFinished(() => {
vi.unstubAllEnvs();
Expand Down Expand Up @@ -881,12 +881,25 @@ describe("Dev Registry: vite dev <-> vite dev", () => {
});

describe("Dev Registry: vite dev <-> wrangler dev", () => {
it("uses the same dev registry path by default", async () => {
it("shares the canonical registry override despite conflicting legacy paths", async ({
devRegistryPath,
}) => {
vi.stubEnv(
"WRANGLER_REGISTRY_PATH",
path.join(devRegistryPath, "wrangler")
);
vi.stubEnv(
"MINIFLARE_REGISTRY_PATH",
path.join(devRegistryPath, "miniflare")
);
onTestFinished(() => vi.unstubAllEnvs());
const workerEntrypoint = await runViteDev(
"vite.worker-entrypoint.config.ts"
"vite.worker-entrypoint.config.ts",
devRegistryPath
);
const exportedHandler = await runWranglerDev(
"wrangler.exported-handler.jsonc"
"wrangler.exported-handler.jsonc",
devRegistryPath
);

// Test wrangler dev -> vite dev yet
Expand Down
2 changes: 1 addition & 1 deletion fixtures/shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"description": "Shared fixtures for testing",
"devDependencies": {
"@cloudflare/workers-utils": "0.49.0",
"wrangler": "4.151.0"
"wrangler": "4.154.0"
}
}
10 changes: 8 additions & 2 deletions fixtures/shared/src/run-wrangler-long-lived.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,14 @@ async function runLongLivedWrangler(
if (!env?.WRANGLER_REGISTRY_PATH && !process.env.WRANGLER_REGISTRY_PATH) {
registryEnv.WRANGLER_REGISTRY_PATH = getIsolatedRegistryPath();
}
if (!env?.MINIFLARE_REGISTRY_PATH && !process.env.MINIFLARE_REGISTRY_PATH) {
registryEnv.MINIFLARE_REGISTRY_PATH = getIsolatedRegistryPath();
if (
!env?.CLOUDFLARE_DEV_REGISTRY_PATH &&
!process.env.CLOUDFLARE_DEV_REGISTRY_PATH
) {
registryEnv.CLOUDFLARE_DEV_REGISTRY_PATH =
env?.WRANGLER_REGISTRY_PATH ||
process.env.WRANGLER_REGISTRY_PATH ||
getIsolatedRegistryPath();
}

const wranglerProcess = fork(wranglerEntryPath, command, {
Expand Down
4 changes: 2 additions & 2 deletions packages/remote-bindings/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@
},
"dependencies": {
"@cloudflare/cli-shared-helpers": "0.2.7",
"@cloudflare/deploy-helpers": "0.24.0",
"@cloudflare/deploy-helpers": "0.24.1",
"@cloudflare/workers-auth": "0.15.1",
"@cloudflare/workers-utils": "0.49.0",
"chalk": "catalog:default",
"miniflare": "5.20261023.0-beta",
"miniflare": "5.20261023.1-beta",
"undici": "catalog:default",
"ws": "catalog:default"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@cloudflare/vite-plugin": "*",
"@cloudflare/workers-types": "^5.20260706.1",
"globals": "^15.14.0",
"miniflare": "5.20261023.0-beta",
"miniflare": "5.20261023.1-beta",
"typescript": "~5.7.2",
"vite": "^8.0.0",
"wrangler": "*"
Expand Down
6 changes: 3 additions & 3 deletions packages/vite-plugin-cloudflare/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@
},
"dependencies": {
"@cloudflare/unenv-preset": "2.16.2",
"miniflare": "5.20261023.0-beta",
"miniflare": "5.20261023.1-beta",
"unenv": "2.0.0-rc.24",
"wrangler": "4.153.0",
"wrangler": "4.154.0",
"ws": "8.22.0"
},
"devDependencies": {
Expand Down Expand Up @@ -82,7 +82,7 @@
},
"peerDependencies": {
"vite": "^6.1.0 || ^7.0.0 || ^8.0.0",
"wrangler": "^4.153.0"
"wrangler": "^4.154.0"
},
"workers-sdk": {
"prerelease": true
Expand Down
46 changes: 23 additions & 23 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading