Skip to content

Commit c63f1b0

Browse files
authoredJan 10, 2025··
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

+5
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

+1
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

-1
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

+3-14
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

+5-5
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

+1-4
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

+2-2
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

-5
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

+4-1
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

-3
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
() =>

‎packages/wrangler/src/__tests__/dev.test.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1399,7 +1399,6 @@ describe.sequential("wrangler dev", () => {
13991399
--test-scheduled Test scheduled events by visiting /__scheduled in browser [boolean] [default: false]
14001400
--log-level Specify logging level [choices: \\"debug\\", \\"info\\", \\"log\\", \\"warn\\", \\"error\\", \\"none\\"] [default: \\"log\\"]
14011401
--show-interactive-dev-session Show interactive dev session (defaults to true if the terminal supports interactivity) [boolean]
1402-
--experimental-registry, --x-registry Use the experimental file based dev registry for multi-worker development [boolean] [default: true]
14031402
--experimental-vectorize-bind-to-prod Bind to production Vectorize indexes in local development mode [boolean] [default: false]",
14041403
"warn": "",
14051404
}

‎packages/wrangler/src/__tests__/pages/pages.test.ts

-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ describe("pages", () => {
7777
--persist-to Specify directory to use for local persistence (defaults to .wrangler/state) [string]
7878
--log-level Specify logging level [choices: \\"debug\\", \\"info\\", \\"log\\", \\"warn\\", \\"error\\", \\"none\\"]
7979
--show-interactive-dev-session Show interactive dev session (defaults to true if the terminal supports interactivity) [boolean]
80-
--experimental-registry, --x-registry Use the experimental file based dev registry for multi-worker development [boolean] [default: true]
8180
--experimental-vectorize-bind-to-prod Bind to production Vectorize indexes in local development mode [boolean] [default: false]"
8281
`);
8382
});

‎packages/wrangler/src/__tests__/unstableDev.test.ts

-62
This file was deleted.

‎packages/wrangler/src/api/dev.ts

-4
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ export async function unstable_dev(
125125
showInteractiveDevSession,
126126
testMode,
127127
testScheduled,
128-
fileBasedRegistry = true,
129128
vectorizeBindToProd,
130129
// 2. options for alpha/beta products/libs
131130
d1Databases,
@@ -218,16 +217,13 @@ export async function unstable_dev(
218217
logLevel: options?.logLevel ?? defaultLogLevel,
219218
port: options?.port ?? 0,
220219
experimentalProvision: undefined,
221-
experimentalDevEnv: undefined,
222-
experimentalRegistry: fileBasedRegistry,
223220
experimentalVectorizeBindToProd: vectorizeBindToProd ?? false,
224221
enableIpc: options?.experimental?.enableIpc,
225222
};
226223

227224
//outside of test mode, rebuilds work fine, but only one instance of wrangler will work at a time
228225
const devServer = await run(
229226
{
230-
FILE_BASED_REGISTRY: fileBasedRegistry,
231227
// TODO: can we make this work?
232228
MULTIWORKER: false,
233229
RESOURCES_PROVISION: false,

‎packages/wrangler/src/api/integrations/platform/index.ts

-7
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,6 @@ export type GetPlatformProxyOptions = {
5050
* If `false` is specified no data is persisted on the filesystem.
5151
*/
5252
persist?: boolean | { path: string };
53-
/**
54-
* Use the experimental file-based dev registry for service discovery
55-
*
56-
* Note: this feature is experimental
57-
*/
58-
experimentalRegistry?: boolean;
5953
};
6054

6155
/**
@@ -110,7 +104,6 @@ export async function getPlatformProxy<
110104

111105
const miniflareOptions = await run(
112106
{
113-
FILE_BASED_REGISTRY: Boolean(options.experimentalRegistry ?? true),
114107
MULTIWORKER: false,
115108
RESOURCES_PROVISION: false,
116109
},

‎packages/wrangler/src/cli.ts

-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ export * from "./api/integrations";
3838

3939
// Export internal APIs required by the Vitest integration as `unstable_`
4040
export { default as unstable_splitSqlQuery } from "./d1/splitter";
41-
export { startWorkerRegistryServer as unstable_startWorkerRegistryServer } from "./dev-registry";
4241

4342
// `miniflare-cli/assets` dynamically imports`@cloudflare/pages-shared/environment-polyfills`.
4443
// `@cloudflare/pages-shared/environment-polyfills/types.ts` defines `global`

‎packages/wrangler/src/deploy/index.ts

-1
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,6 @@ export type DeployArgs = StrictYargsOptionsToInterface<typeof deployOptions>;
245245
export async function deployHandler(args: DeployArgs) {
246246
await run(
247247
{
248-
FILE_BASED_REGISTRY: false,
249248
RESOURCES_PROVISION: args.experimentalProvision ?? false,
250249
MULTIWORKER: false,
251250
},

0 commit comments

Comments
 (0)
Please sign in to comment.