hyperformula
hyperformula copied to clipboard
Remove the polyfills for unsupported browsers (previously: Remove core-js and regenerator-runtime dependencies)
Description
Remove unused dependencies:
core-jsregenerator-runtime
Links
- https://handsoncode.slack.com/archives/C031GBX62SE/p1654729678790179 (internal discussion)
- #1006
- #896
In this issue we will be changing the Webpack config. While at it, please also remove unused workaround for GPU: https://github.com/handsontable/hyperformula/blob/3e412092ff5ddafeeec77605c1d44c7559e7f785/.config/webpack/production.js#L23-L24
Maybe it will improve the bundle size (#1006).
My assumptions for this issue:
- Core-js will be removed as a dependency, because we no longer need polyfills
- Regenerator-runtime will be removed as a dependency. We don't use async/await, so I am not sure if it is even needed currently
- The supported browsers and Node 14+ will continue to work
I think we need to make sure that all builds are verified in the supported envs:
- ES Module - (1) in browser, through a bundler; (2) in Node; (3) directly in a browser (only if that's possible now)
- CommonJS - (1) in browser, through a bundler; (2) in Node
- UMD (
dist) - (1) directly in a browser
I pushed the above assumptions to a branch https://github.com/handsontable/hyperformula/tree/feature/issue-1011-experiment and I got promising results.
In this PR, the size of hyperformula.full.min.js dropped from 1.9 MB to 0.8 MB. This might be an improvement that brings us close to solving, or at least updating #1006. I didn't verify if my changes in this branch work in all supported envs.
Why I think it also solves #896 is - in a simple test file https://gist.github.com/warpech/03438a2b1471fdec424f5eaad0db946f initialization performance improved from 2.9s to 2.2s on my computer thanks to the removed polyfills.
When completed, please re-verify https://github.com/handsontable/handsontable/issues/8118
Closed as released in version 2.1.0.