-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
deps: use esbuild-plugins-node-modules-polyfill
#15405
Conversation
esbuild-plugins-node-modules-polyfill
esbuild-plugins-node-modules-polyfill
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.
Interesting, let's see if our CI jobs work. @connorjclark any thoughts?
@@ -16,6 +16,7 @@ import {createRequire} from 'module'; | |||
|
|||
import esMain from 'es-main'; | |||
import esbuild from 'esbuild'; | |||
import {nodeModulesPolyfillPlugin} from 'esbuild-plugins-node-modules-polyfill'; |
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.
Could you add this to the esbuild-plugins.js
file?
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.
It should be a drop in replacement normally 🤔
Added this line to esbuild-plugins.js
as well as requested
The failing tests show two critical issues:
This error seems very non-trivial, and I'm not sure where to begin to fix it. The current setup works with no issues for us so I don't think there's any urgent motivation for us to change right now. |
I think @imranbarbhuiya can probably help out with fixing all these errors |
Please let us know if get this to work, as we are interested in an alternative solution. For now we will close this PR |
@adamraine I checked the file lighthouse/build/build-bundle.js Line 111 in f33cf93
__zlib/inflate so can I know why it's needed? Are you using this polyfill anywhere in your code? If yes, why change it to empty export? maybe the empty option in modules can fix the issue? I'll play around with these options and will let you know
|
The intention is to exclude the large amount of code needed to decompress data. Our library only needs to compress. The empty functions being exported remain to prevent some other part of the esbuild process from erroring during bundle. |
just realized we use |
This PR replaces
@esbuild-plugins/node-modules-polyfill
with the up-to-date & maintainedesbuild-plugins-node-modules-polyfill
The
esbuild-plugins
repo itself points towards usingesbuild-plugin-polyfill-node
insteadhttps://github.com/remorses/esbuild-plugins/blob/373b44902ad3e669f7359c857de09a930ce1ce90/README.md?plain=1#L15-L16
After doing this in the Remix repo (see remix-run/remix#5274), we got quite some new bugs, so we chose to go for @imranbarbhuiya's
esbuild-plugins-node-modules-polyfill
instead (see remix-run/remix#6562), which is an up-to-date and well maintained alternativeAdded benefit is that we won't get the following deprecation warnings when installing
@esbuild-plugins/node-modules-polyfill
: