Repository navigation
[vite-plugin] Clear v1 Worker exports between dev servers - #16503
Conversation
🦋 Changeset detectedLatest commit: 353bd12 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
@Eshan05 (recorded author of #16457) and @dario-piotrowicz (verified human ant-core approver), could you please check this Vite plugin v1 backport and approve it if it looks good? V1 retains the same shared Worker export cache. The original cleanup is unchanged; the integration regression uses v1 |
|
Codeowners approval required for this PR:
|
|
✅ Approved — This is a small, well-scoped backport. Clearing The decision is advisory: this comment never approves, blocks or requests changes on the pull request. ✅ All checks passed🚀 Release: ✅ LGTMRisk: Low. A patch changeset for the plugin is included, which fits this bug fix. 🔒 Security: ✅ LGTMThis only clears dev-time state. It has no security implications. 📖 AGENTS.md: ✅ LGTMThe change follows the repository guidelines: there is a plugin changeset, the title uses the 📋 Code Quality: ✅ LGTM
⚡ Performance: ✅ LGTMNo performance impact. The map is rebuilt from config only after Miniflare has been disposed. 📝 Documentation: ✅ LGTMThe new method has a JSDoc comment explaining the reset. No public documentation changes are needed. Reviewed commit: |
commit: |
workers-devprod
left a comment
There was a problem hiding this comment.
Codeowners reviews satisfied
Looks right. It's the same change as the v2 fix, and v1 restarts don't call |
Backports #16457 to Vite plugin v1.
V1 also keeps detected Worker exports in module-level shared context after a dev server closes. Clear that map when disposing Miniflare so a later server derives exports from its own configuration. Otherwise a later Worker with a Durable Object can fail with
Class extends value undefined.Retain the original sequential-server integration regression, adapted to v1's
wrangler.jsonwithdurable_objectsand migrations. It starts and fetches from two real Vite servers in the same process; it does not restore the removed cf/cloudflare.config.ts configuration path or public dependency tests. The regression fails against the parent and passes with the fix.Stacked on #16502 (retained Zod). This PR has only the independently remaining context cleanup, adapted plugin test, and original plugin patch changeset.
Validation: Node 22.22.1 / pnpm 10.33.0;
pnpm build,pnpm check(including types),pnpm test:ci, andpnpm test:fixturespass.Note
This is a contribution from an AI agent: Codex.