-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
refactor(remix-dev): replace esbuild-plugin-polyfill-node
with esbuild-plugins-node-modules-polyfill
#6414
Conversation
…uild-plugins-node-modules-polyfill`
|
Hi @LukeAskew, Welcome, and thank you for contributing to Remix! Before we consider your pull request, we ask that you sign our Contributor License Agreement (CLA). We require this only once. You may review the CLA and sign it by adding your name to contributors.yml. Once the CLA is signed, the If you have already signed the CLA and received this response in error, or if you have any questions, please contact us at hello@remix.run. Thanks! - The Remix team |
Thank you for signing the Contributor License Agreement. Let's get this merged! 🥳 |
I've noticed that the esbuild-plugin-polyfill-node also polyfills node:async_hooks etc (makes them unavailable with a stub unimplemented). Basically making Is this PR handling these correctly and we can use nodejs_compat? |
@ivogt If I understand correctly this should only affect browser code so you should be able to use |
@LukeAskew Sorry, let me clarify. So, for Cloudflare Workers the build is handled as 'neutral'. Since workers support nodejs_compat and there are couple of modules with node: prefix (e.g. node:utils and node:async_hooks which these polyfills override. In https://github.com/remix-run/remix/pull/6414/files#diff-833c098a2a1bb29fb7094fb9a15af9f299cadbd1fb35bcc0cd7f078807fa8358 we remove the imports of I suggest we exclude the workers from the polyfill e.g. Don't think we need to polyfill for workers runtime, do we? Thank you |
Also mentioned here #6348 |
Co-authored-by: Ivo Todorov <ivo.gtodorov@gmail.com>
Thanks for the PR. This should also close #6348 thanks to the last commit. |
Hello, I'm working on a project that's quite dependent on this fix. Will this be merged soon? 🙏 |
likewise |
Superseded by #6547 |
I have broken this PR up into two parts:
We can't accept this as is as it changes existing behavior for users. Thank you for the contribution and pointing us at a better alternative :) |
Part 1 merged: #6562 |
I did. |
esbuild-plugin-polyfill-node
was introduced as part of #5274. Unfortunately, that plugin introduces some issues:This change replaces
esbuild-plugin-polyfill-node
withesbuild-plugins-node-modules-polyfill
, which also uses jspm (via modern-node-polyfills).Closes: #6380
Testing Strategy: Replaced plugin in my remix app and did not encounter errors.