[wrangler] Fix circular dependency build warning in cli.ts#14197
[wrangler] Fix circular dependency build warning in cli.ts#14197emily-shen wants to merge 1 commit into
Conversation
|
|
Codeowners approval required for this PR:
Show detailed file reviewers
|
|
The remaining This is worth noting: the change only removes one value import from cli.ts, but cli.ts continues to import other values from The change is correct, minimal, behavior-preserving, and the public API surface is unchanged. No logic bugs, security issues, or compatibility concerns. LGTM |
create-cloudflare
@cloudflare/deploy-helpers
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-auth
@cloudflare/workers-editor-shared
@cloudflare/workers-utils
wrangler
@cloudflare/wrangler-bundler
commit: |
9a42fb6 to
4614d73
Compare
|
Would an alternative approach be to move Or rather than "picking" from it in |
d8ae66f to
b3e805f
Compare
Break the circular dependency between src/api/index.ts and src/api/startDevWorker/utils.ts by having internal modules import directly from the source module instead of through the api barrel. The cycle was: api/index.ts re-exports from startDevWorker/utils.ts, which transitively depends (through types.ts, ConfigController, etc.) on files that import back from the api barrel. Pointing those imports at the actual source modules breaks every back-edge.
b3e805f to
1f697ba
Compare
Import
convertConfigBindingsToStartWorkerBindingsdirectly from./api/startDevWorker/utilsinstead of through the./apibarrel to break a circular chunk dependency that Rollup warns about during the DTS build.The cycle was:
api/index.tsre-exports fromstartDevWorker/utils.tsstartDevWorker/utils.tstype-imports from../../dev.tsdev.tstype-imports from./api(back to step 1)I think it was an explicit decision to export from "api/index.ts" but it seems a bit difficult to preserve that without making invasive changes that are probably going to give incoming refactors some bad merge conflicts...