Repository navigation
[workers-utils] Share getWorkerZone and toApiComplianceRegion with the Vite and Vitest plugins - #16880
Conversation
🦋 Changeset detectedLatest commit: 7b75496 The changes in this PR will be included in the next version bump. This PR includes changesets to release 7 packages
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 |
|
LGTM! |
@cloudflare/autoconfig
@cloudflare/build-output-utils
@cloudflare/codemods
@cloudflare/config
@cloudflare/containers-shared
create-cloudflare
@cloudflare/deploy-helpers
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-functions
@cloudflare/pages-shared
@cloudflare/runtime-types
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-plugin
@cloudflare/workers-auth
@cloudflare/workers-editor-shared
@cloudflare/workers-utils
wrangler
commit: |
…ainer image preparation With #16880 underneath, the shared conversion replaces this file's own copy.
…ainer image preparation With #16880 underneath, the shared conversion replaces this file's own copy.
4fc3246 to
36bac57
Compare
…ainer image preparation With #16880 underneath, the shared conversion replaces this file's own copy.
|
Codeowners approval required for this PR:
Show detailed file reviewers |
There was a problem hiding this comment.
Superseded by the review of
1d43bd9c.
This review, of 36bac57f
✅ Approved — No issues found: the helpers are moved without changing what they do, the import path resolves, and the moved code has tests at the shared layer.
The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.
✅ All checks passed
🚀 Release: ✅ LGTM
Low risk. The changeset covers the new exports from @cloudflare/workers-utils.
🔒 Security: ✅ LGTM
Moving two pure helpers adds no new trust boundary, secret handling or authentication path.
📖 AGENTS.md: ✅ LGTM
Follows the repository guidance to put shared behavior in the lowest suitable shared package and to test it at that layer.
📋 Code Quality: ✅ LGTM
The shared getWorkerZone() and toApiComplianceRegion() behave the same as the copies they replace, and every call site matches the new signatures.
⚡ Performance: ✅ LGTM
No performance impact.
📝 Documentation: ✅ LGTM
The JSDoc on the new exported functions is accurate.
Reviewed commit: 36bac57f
…e Vite and Vitest plugins Move the two helpers that the Vite and Vitest plugins each copied into @cloudflare/workers-utils, so a fix reaches every tool. getWorkerZone sits next to getZoneFromRoute and takes a structural config type that input, loaded and Build Output Worker configs all satisfy, since workers-utils can't depend on @cloudflare/config. toApiComplianceRegion goes in the /compliance subpath, and @cloudflare/config's Wrangler conversion uses it too, with the same output.
…anceRegion exports containers-shared depends on workers-utils at runtime and, with #16877, imports toApiComplianceRegion from it, so a release needs a workers-utils version that has the new exports.
36bac57 to
1d43bd9
Compare
workers-devprod
left a comment
There was a problem hiding this comment.
Codeowners reviews satisfied
There was a problem hiding this comment.
Superseded by the review of
c7b1f670.
This review, of 1d43bd9c
✅ Approved — No issues found: the helpers move into workers-utils with the same behavior, all call sites match the new signatures, the moved code has tests in workers-utils, and a changeset covers the new exports.
The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.
✅ All checks passed
🚀 Release: ✅ LGTM
Release risk is low. The minor changeset for @cloudflare/workers-utils documents the new exports, which downstream packages need in a published version.
🔒 Security: ✅ LGTM
This pull request moves two pure helpers. It adds no new trust boundary, no secret handling and no authentication path.
📖 AGENTS.md: ✅ LGTM
The change follows the repository guidance: shared behavior goes in the lowest suitable shared package and is tested at that layer.
📋 Code Quality: ✅ LGTM
The shared getWorkerZone() and toApiComplianceRegion() behave the same as the copies they replace, and every call site matches the new signatures. Using fetchTrigger?.pattern === undefined as the guard gives the same result for fetch triggers. convert.ts produces the same output as before. The imports removed from the Vite and Vitest plugins are no longer used there.
⚡ Performance: ✅ LGTM
The helpers are pure and run once per config conversion, not in a hot path, so there is no performance impact.
📝 Documentation: ✅ LGTM
The JSDoc on the new exported functions is accurate.
Reviewed commit: 1d43bd9c
Drop the sentence about the Vite and Vitest plugins sharing the helpers, which describes the refactor rather than anything a reader of the changelog gains.
There was a problem hiding this comment.
Superseded by the review of
7b754967.
This review, of c7b1f670
✅ Approved — No issues found. The shared helpers behave the same as the copies they replace, every call site matches the new signatures, workers-utils has tests for the moved code, and the reworded changeset describes the new exports accurately.
The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.
✅ All checks passed
🚀 Release: ✅ LGTM
Release risk is low. The minor changeset for @cloudflare/workers-utils documents the new exports. Downstream packages need those exports in a published version.
🔒 Security: ✅ LGTM
This pull request moves two pure helpers. It adds no new trust boundary, no secret handling and no authentication path.
📖 AGENTS.md: ✅ LGTM
The change follows the repository guidance: shared behavior goes in the lowest suitable shared package, and it is tested at that layer.
📋 Code Quality: ✅ LGTM
The shared getWorkerZone() and toApiComplianceRegion() behave the same as the copies they replace, and every call site matches the new signatures.
- For fetch triggers, the
fetchTrigger?.pattern === undefinedguard gives the same result as the oldtype !== "fetch"check. convert.tsproduces the same output as before.- The imports removed from the Vite and Vitest plugins are no longer used there.
⚡ Performance: ✅ LGTM
The helpers are pure functions that run once per config conversion, not on a hot path, so the move has no performance impact.
📝 Documentation: ✅ LGTM
The JSDoc on the new exported functions is accurate. The changeset now describes only what the new exports do.
Reviewed commit: c7b1f670
The changeset now says what getWorkerZone() returns, not how one caller uses it.
There was a problem hiding this comment.
✅ Approved — No issues found. The only change since the last review is a changeset reword, and the new wording accurately describes what the exports do.
The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.
✅ All checks passed
🚀 Release: ✅ LGTM
Release risk is low. The minor changeset for @cloudflare/workers-utils documents the new exports, which downstream packages will need in a published version.
🔒 Security: ✅ LGTM
This pull request moves two pure helpers. It adds no new trust boundary, secret handling or authentication path.
📖 AGENTS.md: ✅ LGTM
The change follows the repository guidance: shared behavior goes in the lowest suitable shared package, and it is tested at that layer.
📋 Code Quality: ✅ LGTM
The shared getWorkerZone() and toApiComplianceRegion() behave the same as the copies they replace, and every call site matches the new signatures.
- For fetch triggers, the
fetchTrigger?.pattern === undefinedguard gives the same result as the oldtype !== "fetch"check. convert.tsproduces the same output as before.- The
@cloudflare/workers-utils/compliancesubpath is already exported. getWorkerZone()has tests inpackages/workers-utils/tests/route-utils.test.ts.
⚡ Performance: ✅ LGTM
The helpers are pure functions that run once per config conversion, so the move has no performance impact.
📝 Documentation: ✅ LGTM
The JSDoc on the new exports is accurate. The changeset describes only what the new exports do.
Reviewed commit: 7b754967
…ainer image preparation With #16880 underneath, the shared conversion replaces this file's own copy.
…ainer image preparation With #16880 underneath, the shared conversion replaces this file's own copy.
Part of RM-31812. The base of a stack: #16877 and #16798 build on this.
Moves
getWorkerZone()andtoApiComplianceRegion(), which the Vite and Vitest plugins each copy, into@cloudflare/workers-utils, so a fix reaches both and the test harness can adopt them in its own PR.@cloudflare/config's Wrangler conversion also uses the sharedtoApiComplianceRegion(); its output is unchanged.