-
Notifications
You must be signed in to change notification settings - Fork 742
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
*DUPLICATE* [wrangler] Use esbuild-plugins-node-modules-polyfill
for Node.js polyfills instead of @esbuild-plugins
#4902
Conversation
🦋 Changeset detectedLatest commit: 7488a42 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 |
esbuild-plugins-node-modules-polyfill
inst…esbuild-plugins-node-modules-polyfill
instead of @esbuild-plugins
esbuild-plugins-node-modules-polyfill
instead of @esbuild-plugins
esbuild-plugins-node-modules-polyfill
for polyfills instead of @esbuild-plugins
esbuild-plugins-node-modules-polyfill
for polyfills instead of @esbuild-plugins
esbuild-plugins-node-modules-polyfill
for Node.js polyfills instead of @esbuild-plugins
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me see if I can get the CI checks running on this...
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/7783226811/npm-package-wrangler-4902 You can reference the automatically updated head of this PR with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/4902/npm-package-wrangler-4902 Or you can use npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/7783226811/npm-package-wrangler-4902 dev path/to/script.js Additional artifacts:npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/7783226811/npm-package-create-cloudflare-4902 --no-auto-update npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/7783226811/npm-package-miniflare-4902 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/7783226811/npm-package-cloudflare-pages-shared-4902 Note that these links will no longer work once the GitHub Actions artifact expires.
Please ensure constraints are pinned, and |
I can't push a fixup commit to your PR as you did not allow contributors to update your branch. diff --git a/packages/wrangler/src/deployment-bundle/bundle.ts b/packages/wrangler/src/deployment-bundle/bundle.ts
index dab86a06..cd7b0db9 100644
--- a/packages/wrangler/src/deployment-bundle/bundle.ts
+++ b/packages/wrangler/src/deployment-bundle/bundle.ts
@@ -325,12 +325,14 @@ export async function bundleWorker(
plugins: [
moduleCollector.plugin,
...(legacyNodeCompat
- ? [nodeModulesPolyfillPlugin({
- globals: {
- process: true,
- Buffer: true,
- },
- })]
+ ? [
+ nodeModulesPolyfillPlugin({
+ globals: {
+ process: true,
+ Buffer: true,
+ },
+ }),
+ ]
: []),
...(nodejsCompat ? [nodejsCompatPlugin] : []),
cloudflareInternalPlugin, You can fix this via the command line by running |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4902 +/- ##
==========================================
- Coverage 70.64% 70.61% -0.04%
==========================================
Files 292 292
Lines 15183 15186 +3
Branches 3863 3865 +2
==========================================
- Hits 10726 10723 -3
- Misses 4457 4463 +6
|
I'm a bit concerned about these issues with the proposed package:
I think we need to check that these do not impair Wrangler before we can merge this. |
…lyfill-node` See remorses/esbuild-plugins#41 for more information about the deprecated packages.
At a glance, the problems seem to appear at Vite-side and old Node.js runtimes. However, to examine a little bit more will be safer (especially for the users). |
I believe this is duplicate of #3832. Per #3832 (comment), we believe this would be a breaking change and as such need to wait until the next major release before we can land this. In the meantime, we recommend using Custom builds if you need additional polyfills. |
esbuild-plugins-node-modules-polyfill
for Node.js polyfills instead of @esbuild-plugins
esbuild-plugins-node-modules-polyfill
for Node.js polyfills instead of @esbuild-plugins
Closing. PS. It's surprising that to deprecate the packages is such a breaking change. |
What this PR solves / how to test:
Removes dependency
@esbuild-plugins/node-globals-polyfill
and@esbuild-plugins/node-modules-polyfill
since they're both out-of-date.Adds dependency
esbuild-plugin-polyfill-node
for support of Node.js polyfills.This is probably not needed to test, without breaking changes, I think.
Author has addressed the following: