Skip to content

Commit c63f1b0

Browse files
authored
Remove express-based dev registry (#7706)
* Remove Server Registry * some more * Create ten-eyes-tease.md * fix * remove metafile * fix rebase * fix lockfile
1 parent 45f45c3 commit c63f1b0

File tree

23 files changed

+359
-2311
lines changed

23 files changed

+359
-2311
lines changed

.changeset/ten-eyes-tease.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"wrangler": patch
3+
---
4+
5+
Remove the server-based dev registry in favour of the more stable file-based dev registry. There should be no user-facing impact.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ packages/quick-edit/vscode
188188
packages/quick-edit/web
189189

190190
packages/wrangler/config-schema.json
191+
packages/wrangler/metafile.json
191192
packages/chrome-devtools-patches/built-devtools
192193
packages/chrome-devtools-patches/.cipd
193194
packages/chrome-devtools-patches/.gclient

fixtures/get-platform-proxy/tests/shared.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,5 @@ export function getPlatformProxy<T>(
99
return originalGetPlatformProxy({
1010
...options,
1111
persist: false,
12-
experimentalRegistry: true,
1312
});
1413
}

fixtures/shared/src/run-wrangler-long-lived.ts

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,13 @@ export async function runWranglerPagesDev(
2525
) {
2626
if (publicPath) {
2727
return runLongLivedWrangler(
28-
[
29-
"pages",
30-
"dev",
31-
publicPath,
32-
"--x-registry",
33-
"--ip=127.0.0.1",
34-
...options,
35-
],
28+
["pages", "dev", publicPath, "--ip=127.0.0.1", ...options],
3629
cwd,
3730
env
3831
);
3932
} else {
4033
return runLongLivedWrangler(
41-
["pages", "dev", "--x-registry", "--ip=127.0.0.1", ...options],
34+
["pages", "dev", "--ip=127.0.0.1", ...options],
4235
cwd,
4336
env
4437
);
@@ -58,11 +51,7 @@ export async function runWranglerDev(
5851
options: string[],
5952
env?: NodeJS.ProcessEnv
6053
) {
61-
return runLongLivedWrangler(
62-
["dev", "--x-registry", "--ip=127.0.0.1", ...options],
63-
cwd,
64-
env
65-
);
54+
return runLongLivedWrangler(["dev", "--ip=127.0.0.1", ...options], cwd, env);
6655
}
6756

6857
async function runLongLivedWrangler(

packages/pages-shared/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@
2424
"devDependencies": {
2525
"@cloudflare/workers-tsconfig": "workspace:*",
2626
"@cloudflare/workers-types": "^4.20241230.0",
27-
"@miniflare/cache": "^2.14.2",
28-
"@miniflare/core": "^2.14.2",
29-
"@miniflare/html-rewriter": "^2.14.2",
30-
"@miniflare/storage-memory": "^2.14.2",
27+
"@miniflare/cache": "^2.14.4",
28+
"@miniflare/core": "^2.14.4",
29+
"@miniflare/html-rewriter": "^2.14.4",
30+
"@miniflare/storage-memory": "^2.14.4",
3131
"concurrently": "^8.2.2",
32-
"glob": "^10.3.3"
32+
"glob": "^10.4.5"
3333
},
3434
"volta": {
3535
"extends": "../../package.json"

packages/wrangler/e2e/dev-registry.test.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,7 @@ describe("unstable_dev()", () => {
138138
});
139139
});
140140

141-
describe.each([
142-
{ cmd: "wrangler dev" },
143-
{ cmd: "wrangler dev --no-x-registry" },
144-
])("dev registry $cmd", ({ cmd }) => {
141+
describe.each([{ cmd: "wrangler dev" }])("dev registry $cmd", ({ cmd }) => {
145142
let workerName: string;
146143
let workerName2: string;
147144
let workerName3: string;

packages/wrangler/e2e/get-platform-proxy.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ describe("getPlatformProxy()", () => {
120120
});
121121

122122
async function runInNode(code: string) {
123-
const w = helper.runLongLived("wrangler dev --x-registry", {
123+
const w = helper.runLongLived("wrangler dev", {
124124
cwd: worker,
125125
});
126126

@@ -130,7 +130,7 @@ describe("getPlatformProxy()", () => {
130130
"index.mjs": dedent/*javascript*/ `
131131
import { getPlatformProxy } from "${WRANGLER_IMPORT}"
132132
133-
const { env } = await getPlatformProxy({ experimentalRegistry: true });
133+
const { env } = await getPlatformProxy();
134134
135135
const resp = ${code}
136136

packages/wrangler/package.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,7 @@
102102
"@sentry/node": "^7.86.0",
103103
"@sentry/types": "^7.86.0",
104104
"@sentry/utils": "^7.86.0",
105-
"@types/body-parser": "^1.19.2",
106105
"@types/command-exists": "^1.2.0",
107-
"@types/express": "^4.17.13",
108106
"@types/glob-to-regexp": "^0.4.1",
109107
"@types/is-ci": "^3.0.0",
110108
"@types/javascript-time-ago": "^2.0.3",
@@ -119,7 +117,6 @@
119117
"@types/yargs": "^17.0.22",
120118
"@vitest/ui": "catalog:default",
121119
"@webcontainer/env": "^1.1.0",
122-
"body-parser": "^1.20.0",
123120
"chalk": "^5.2.0",
124121
"cli-table3": "^0.6.3",
125122
"cmd-shim": "^4.1.0",
@@ -128,11 +125,9 @@
128125
"devtools-protocol": "^0.0.1182435",
129126
"dotenv": "^16.3.1",
130127
"execa": "^6.1.0",
131-
"express": "^4.18.1",
132128
"find-up": "^6.3.0",
133129
"get-port": "^7.0.0",
134130
"glob-to-regexp": "^0.4.1",
135-
"http-terminator": "^3.2.0",
136131
"https-proxy-agent": "7.0.2",
137132
"ignore": "^5.2.0",
138133
"is-ci": "^3.0.1",

packages/wrangler/scripts/bundle.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { writeFileSync } from "node:fs";
12
import path from "node:path";
23
import * as esbuild from "esbuild";
34
import { EXTERNAL_DEPENDENCIES } from "./deps";
@@ -35,6 +36,7 @@ async function buildMain(flags: BuildFlags = {}) {
3536
outdir,
3637
platform: "node",
3738
format: "cjs",
39+
metafile: true,
3840
external: EXTERNAL_DEPENDENCIES,
3941
sourcemap: process.env.SOURCEMAPS !== "false",
4042
inject: [path.join(__dirname, "../import_meta_url.js")],
@@ -64,7 +66,8 @@ async function buildMain(flags: BuildFlags = {}) {
6466
const ctx = await esbuild.context(options);
6567
await ctx.watch();
6668
} else {
67-
await esbuild.build(options);
69+
const res = await esbuild.build(options);
70+
writeFileSync("metafile.json", JSON.stringify(res.metafile));
6871
}
6972
}
7073

packages/wrangler/src/__tests__/config/configuration.test.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2539,7 +2539,6 @@ describe("normalizeAndValidateConfig()", () => {
25392539
const { diagnostics } = run(
25402540
{
25412541
RESOURCES_PROVISION: true,
2542-
FILE_BASED_REGISTRY: false,
25432542
MULTIWORKER: false,
25442543
},
25452544
() =>
@@ -2695,7 +2694,6 @@ describe("normalizeAndValidateConfig()", () => {
26952694
const { diagnostics } = run(
26962695
{
26972696
RESOURCES_PROVISION: true,
2698-
FILE_BASED_REGISTRY: false,
26992697
MULTIWORKER: false,
27002698
},
27012699
() =>
@@ -3025,7 +3023,6 @@ describe("normalizeAndValidateConfig()", () => {
30253023
const { diagnostics } = run(
30263024
{
30273025
RESOURCES_PROVISION: true,
3028-
FILE_BASED_REGISTRY: false,
30293026
MULTIWORKER: false,
30303027
},
30313028
() =>

0 commit comments

Comments
 (0)