Skip to content
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

feat(gatsby): add polyfill chunk to gatsby #24799

Closed
wants to merge 5 commits into from

Conversation

wardpeet
Copy link
Contributor

@wardpeet wardpeet commented Jun 5, 2020

Description

Creates a separate polyfill chunk that contains all legacy browser modules. We reduce around 40kb of javascript for Modern browsers.

Gatsby-legacy-polyfills

A package that contains all polyfills necessary for legacy browsers. It get compiled by microbundle so everything is compressed and everything is inside the bundle (no externals). This gives us the opportunity to improve user's code even more. (That's for a next PR)

Babel-preset-gatsby

Make sure that all modules are excluded by babel-preset-env so we do not add these unnecessarily

Upgrade to core-js 3

I've also upgraded to core-js 3 as core-js 2 was old. The reason why we didn't do it sooner is because core-js 3 compact table includes more polyfills than core-js 2. Now this point is moot as we exclude most of them.

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Jun 5, 2020
@freiksenet freiksenet added status: needs core review Currently awaiting review from Core team member and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Jun 5, 2020
@wardpeet wardpeet force-pushed the feat/polyfills branch 2 times, most recently from c5bea12 to a581e36 Compare June 20, 2020 14:10
@wardpeet
Copy link
Contributor Author

Closing because I need it on the upstream to have #15601 as a base branch

@wardpeet wardpeet closed this Jun 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs core review Currently awaiting review from Core team member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants