Skip to content

Simplify constructWranglerConfig to accept a single worker instead of an array#14146

Merged
dario-piotrowicz merged 1 commit into
mainfrom
dario/constructWranglerConfig-no-array
Jun 3, 2026
Merged

Simplify constructWranglerConfig to accept a single worker instead of an array#14146
dario-piotrowicz merged 1 commit into
mainfrom
dario/constructWranglerConfig-no-array

Conversation

@dario-piotrowicz

@dario-piotrowicz dario-piotrowicz commented Jun 1, 2026

Copy link
Copy Markdown
Member

Followup from #14084 (comment) (cc. @petebacondarwin)

constructWranglerConfig accepts an array of workers, I believe that this functionality was introduced for a specific use case which is no longer present, so I don't think that the function needs to accept an array of workers anymore.

For the sake of simplicity and YAGNI I'm proposing to remove it here.


  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: changes to not a public facing utility

A picture of a cute animal (not mandatory, but encouraged)

@changeset-bot

changeset-bot Bot commented Jun 1, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 316453e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@cloudflare/workers-utils Minor
@cloudflare/cli-shared-helpers Patch
@cloudflare/deploy-helpers Patch
@cloudflare/workers-auth Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@ask-bonk

ask-bonk Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

The change is clean and well-scoped. The only call site already passes a single object, the removed constants imports are still used elsewhere, tests are appropriately updated, and a changeset exists. Let me verify the changeset bot's mention of @cloudflare/cli-shared-helpers - that's likely a dependent package and not a concern from this diff.

The refactor is correct and simple: dead code removal of the array/multi-environment branch which no longer has any callers. No logic bugs, no API behavior issues for the remaining single-worker path (it's identical to the prior convertWorkerToWranglerConfig / topLevelEnv path).

LGTM

github run

@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

✅ All changesets look good

@pkg-pr-new

pkg-pr-new Bot commented Jun 1, 2026

Copy link
Copy Markdown
create-cloudflare

npm i https://pkg.pr.new/cloudflare/workers-sdk/create-cloudflare@14146

@cloudflare/deploy-helpers

npm i https://pkg.pr.new/cloudflare/workers-sdk/@cloudflare/deploy-helpers@14146

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/cloudflare/workers-sdk/@cloudflare/kv-asset-handler@14146

miniflare

npm i https://pkg.pr.new/cloudflare/workers-sdk/miniflare@14146

@cloudflare/pages-shared

npm i https://pkg.pr.new/cloudflare/workers-sdk/@cloudflare/pages-shared@14146

@cloudflare/unenv-preset

npm i https://pkg.pr.new/cloudflare/workers-sdk/@cloudflare/unenv-preset@14146

@cloudflare/vite-plugin

npm i https://pkg.pr.new/cloudflare/workers-sdk/@cloudflare/vite-plugin@14146

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/cloudflare/workers-sdk/@cloudflare/vitest-pool-workers@14146

@cloudflare/workers-auth

npm i https://pkg.pr.new/cloudflare/workers-sdk/@cloudflare/workers-auth@14146

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/cloudflare/workers-sdk/@cloudflare/workers-editor-shared@14146

@cloudflare/workers-utils

npm i https://pkg.pr.new/cloudflare/workers-sdk/@cloudflare/workers-utils@14146

wrangler

npm i https://pkg.pr.new/cloudflare/workers-sdk/wrangler@14146

@cloudflare/wrangler-bundler

npm i https://pkg.pr.new/cloudflare/workers-sdk/@cloudflare/wrangler-bundler@14146

commit: 316453e

@dario-piotrowicz dario-piotrowicz marked this pull request as ready for review June 1, 2026 18:02
@workers-devprod workers-devprod requested review from a team and emily-shen and removed request for a team June 1, 2026 18:03
@workers-devprod

workers-devprod commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • ✅ @cloudflare/wrangler
Show detailed file reviewers

@dario-piotrowicz

Copy link
Copy Markdown
Member Author

@penalosa you have the most context here, could you give this PR a review? 🙏

@dario-piotrowicz dario-piotrowicz requested a review from penalosa June 1, 2026 18:07
@petebacondarwin petebacondarwin requested review from petebacondarwin and removed request for emily-shen and penalosa June 3, 2026 08:37

@petebacondarwin petebacondarwin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given we have only a single user of this code, it is safe to make this change.

@petebacondarwin petebacondarwin force-pushed the dario/constructWranglerConfig-no-array branch from a089923 to 316453e Compare June 3, 2026 08:40

@workers-devprod workers-devprod left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codeowners reviews satisfied

@github-project-automation github-project-automation Bot moved this from Untriaged to Approved in workers-sdk Jun 3, 2026

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

@dario-piotrowicz dario-piotrowicz merged commit c4f45e8 into main Jun 3, 2026
57 of 58 checks passed
@dario-piotrowicz dario-piotrowicz deleted the dario/constructWranglerConfig-no-array branch June 3, 2026 09:17
@github-project-automation github-project-automation Bot moved this from Approved to Done in workers-sdk Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants