-
Notifications
You must be signed in to change notification settings - Fork 778
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(vitest-pool-workers): enable dependency pre-bundling #7810
Conversation
A wrangler prerelease is available for testing. You can install this latest build in your project with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13267584468/npm-package-wrangler-7810 You can reference the automatically updated head of this PR with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/7810/npm-package-wrangler-7810 Or you can use npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13267584468/npm-package-wrangler-7810 dev path/to/script.js Additional artifacts:cloudflare-workers-bindings-extension: wget https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13267584468/npm-package-cloudflare-workers-bindings-extension-7810 -O ./cloudflare-workers-bindings-extension.0.0.0-v68add64e7.vsix && code --install-extension ./cloudflare-workers-bindings-extension.0.0.0-v68add64e7.vsix create-cloudflare: npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13267584468/npm-package-create-cloudflare-7810 --no-auto-update @cloudflare/kv-asset-handler: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13267584468/npm-package-cloudflare-kv-asset-handler-7810 miniflare: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13267584468/npm-package-miniflare-7810 @cloudflare/pages-shared: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13267584468/npm-package-cloudflare-pages-shared-7810 @cloudflare/unenv-preset: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13267584468/npm-package-cloudflare-unenv-preset-7810 @cloudflare/vite-plugin: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13267584468/npm-package-cloudflare-vite-plugin-7810 @cloudflare/vitest-pool-workers: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13267584468/npm-package-cloudflare-vitest-pool-workers-7810 @cloudflare/workers-editor-shared: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13267584468/npm-package-cloudflare-workers-editor-shared-7810 @cloudflare/workers-shared: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13267584468/npm-package-cloudflare-workers-shared-7810 @cloudflare/workflows-shared: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13267584468/npm-package-cloudflare-workflows-shared-7810 Note that these links will no longer work once the GitHub Actions artifact expires.
Please ensure constraints are pinned, and |
🦋 Changeset detectedLatest commit: c88e19b 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 |
d386b79
to
87c26db
Compare
I think this should probably have some docs added to the testing section, calling out the problem and solution? What about doing this automatically for e.g. all packages in package.json? |
How about updating the recipes page and add a link to the
I am not sure. The vite/vitest team seems to have concern about the performance if all dependencies are pre-bundled. It might increase the start-up time quite a bit 🤔 |
Sounds good! Maybe also a callout on the https://developers.cloudflare.com/workers/testing/vitest-integration/known-issues/ page?
Fair enough—and just to double check (I know we've talked about this in the past), there's no way to discover which dependencies to pre-bundle automatically? |
👍🏼
Not that I know of. But it might be worth updating the error message in the module fallback service to suggest people enabling pre-bundling. Wdyt? |
That's a great idea! |
f40257c
to
b73d6cf
Compare
66e4047
to
43ba7a9
Compare
c4de8ac
to
c88e19b
Compare
c88e19b
to
4d4a05c
Compare
Fixes #5672.
This PR adds Vite dependency pre-bundling support. If you see module resolution issues—such as:
Error: Cannot use require() to import an ES Module
orError: No such module
—you can now bundle these dependencies using the deps.optimizer option:This is tested against #6591, #6581 & #6405.