Conversation
🦋 Changeset detectedLatest commit: 9af37dc The changes in this PR will be included in the next version bump. 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 |
|
Claude finished @jamesopstad's task —— View job Changeset Review✅ All changesets look good The changeset at
|
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
@cloudflare/workers-utils
wrangler
commit: |
74deed5 to
0704c22
Compare
petebacondarwin
left a comment
There was a problem hiding this comment.
A few non-blocking questions.
| if (id === `\0${VIRTUAL_WORKER_ENTRY}`) { | ||
| const nodeJsCompat = ctx.getNodeJsCompat(this.environment.name); | ||
| load: { | ||
| filter: { id: virtualCloudflareLoadRE }, |
There was a problem hiding this comment.
Are there other virtual modules that could trigger this filter but are not handled by the loader?
Could we lock down this filter even more so that it only triggers if the three handled virtual entry-points are loaded?
There was a problem hiding this comment.
I think it's OK as the we are reserving the virtual:cloudflare/ prefix for virtual modules handled by this plugin.
| id: [nodeBuiltinsRE, /^unenv\//, /^@cloudflare\/unenv-preset\//], | ||
| }, | ||
| async handler(source, importer, options) { | ||
| const nodeJsCompat = ctx.getNodeJsCompat(this.environment.name); |
There was a problem hiding this comment.
No fallback filtering here?
There was a problem hiding this comment.
I don't think it's needed here because it already returns early if there is no result:
workers-sdk/packages/vite-plugin-cloudflare/src/plugins/nodejs-compat.ts
Lines 116 to 121 in 0704c22
0704c22 to
9af37dc
Compare
Use Hook Filters to optimize plugin performance with Vite 8. This skips unnecessary Rust-to-JS calls with Rolldown powered Vite.
A picture of a cute animal (not mandatory, but encouraged)