[vitest-pool-workers] Support Workerd's new module registry - #15117
[vitest-pool-workers] Support Workerd's new module registry#15117edmundhung wants to merge 1 commit into
Conversation
🦋 Changeset detectedLatest commit: a38861c 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 |
|
✅ All changesets look good |
|
I've done a thorough review. Let me now consolidate my assessment. The code is well-structured and well-documented. The V1 path is untouched. The V2 path is properly gated behind protocol detection. Tests are comprehensive. Let me reconsider one genuine concern I noticed: Let me look for a real bug in the redirect workaround around stale cache entries. The Let me verify one final actual concern: in I've examined the logic paths thoroughly. Let me check the one thing that genuinely could be a bug: whether the The implementation is solid, well-tested, and the V1 path is preserved. The identified concerns (stale cache in a temporary workaround, error message wording for Let me confirm I'm reviewing the right PR and there are no compat/logic bugs I'm missing by checking the worker patch The I've completed a thorough review. The changes are correct, the V1 legacy path is untouched for backward compatibility, protocol selection is driven by miniflare's parser, and tests cover the key behaviors. The only observations are minor/non-actionable (temporary-workaround cache lifetime, LGTM |
@cloudflare/autoconfig
@cloudflare/build-output-utils
@cloudflare/config
create-cloudflare
@cloudflare/deploy-helpers
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-functions
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-auth
@cloudflare/workers-editor-shared
@cloudflare/workers-utils
wrangler
commit: |
e644528 to
a38861c
Compare
Close #15066
Support Workerd's V2 module fallback protocol in
@cloudflare/vitest-pool-workerswhen the new module registry is enabled, while leaving the legacy V1 handler unchanged for compatibility dates or configurations that selectlegacy_module_registry.The V2 path preserves URL-based
import.metabehavior, returns CommonJS dependencies as native CommonJS modules with named exports, and updates the Vitest module runner patches for runtime module URLs. It also includes an isolated, flag-selectable workaround for Workerd's current redirected-module identity mismatch; the canonical redirect implementation remains separate so the workaround can be removed cleanly after the runtime is fixed.A picture of a cute animal (not mandatory, but encouraged)