-
Notifications
You must be signed in to change notification settings - Fork 63
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
Update plugin rollup polyfill package #3621
Conversation
Codecov Report
@@ Coverage Diff @@
## main #3621 +/- ##
=======================================
Coverage 62.96% 62.97%
=======================================
Files 871 871
Lines 30193 30193
Branches 7271 7271
=======================================
+ Hits 19012 19014 +2
+ Misses 10996 10994 -2
Partials 185 185
... and 4 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
the jsx transform one is interesting, may fix GMOD/jbrowse-plugin-template#20 I would say the alternative to this approach is making the user be more 'explicit' in what is polyfilled, but this may be ok. we could even provide e.g. a commented out section of the rollup config showing the 'explicit' method of polyfilling perhaps, but that doesn't need to block this |
* Replace node polyfill rollup plugins * Re-export 'react/jsx-runtime' * Comment on usage of include:null in nodePolyfill * Fix typos
This replaces
rollup-plugin-node-builtins
androllup-plugin-node-globals
withrollup-plugin-polyfill-node
. It's a drop-in replacement, and plugin authors won't have to change anything in their code.The reason for this update is that the prior packages were not maintained, and when trying to bundle code into a plugin that used newer JS syntax, (such as optional chaining), the prior packages could not handle it.
I tried to also see if there was a way to limit which node polyfills were scanned for and bundled, but neither the prior or new plugins provide a way to do that. As it stands, though, the polyfills are only included if their use is detected, so it won't needlessly increase the bundle size.
This also adds
react/jsx-runtime
to the ReExports list. It's not something that's ever imported directly by the user, but if their code uses the JSX transform (e.g. theirtsconfig.json
uses"jsx": "react-jsx"
), this allows them to reduce their bundle size by relying on the package that JBrowse has already loaded.