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

Reconsider bundled polyfills #3343

Closed
gaearon opened this issue Oct 28, 2017 · 5 comments
Closed

Reconsider bundled polyfills #3343

gaearon opened this issue Oct 28, 2017 · 5 comments

Comments

@gaearon
Copy link
Contributor

gaearon commented Oct 28, 2017

See my comment in #3200 (comment). We should remove any polyfills that are only necessary for browsers that aren't supported out of the box by React 16 anyway. We should also document the most efficient way polyfill for the lowest possible supported browsers by React 16 (AFAIK IE9). This would be a breaking change.

@viankakrisna
Copy link
Contributor

with the recent changes regarding to babel and browserslist, do we still need to include this file? https://github.com/facebookincubator/create-react-app/blob/next/packages/react-scripts/config/polyfills.js

@andriijas
Copy link
Contributor

@Timer im testing the upcoming react-scripts 2.0 release on my app, if i set last 1 chrome versions in browserlist i dont expect the pollyfills to be bundled, just wanted to check if this issue is till under consideration for 2.0 - thanks

@Timer
Copy link
Contributor

Timer commented Jan 18, 2018

We'll probably do away with the fetch and promise polyfill.

@jpeg729
Copy link

jpeg729 commented Apr 10, 2018

I would love to see two js bundles being produced, one to be served via <script type="module" src="modern.js"> and one to be served via <script nomodule src="legacy.js">.

Justification

  • Pushing large bundles to evergreen browsers is wasteful. If they support type="module" then they need much less polyfilling.
  • Firefox will very soon support type="module".
  • Safari 10.1 downloads and runs both bundles, but safari 10.1 is dying out and a tiny bit of boilerplate can prevent both bundles from running.
  • IE<=11 may download both bundles, but only runs the legacy one. That said, IE<=11 is mostly used on desktop computers with good internet connections, so the dual download isn't a huge issue.
  • Mobile browsers that download both bundles are also dying out.

@Timer
Copy link
Contributor

Timer commented Sep 26, 2018

We're dropping IE 11 support with v2. See more instructions in the migration section when released.

@Timer Timer closed this as completed Sep 26, 2018
@lock lock bot locked and limited conversation to collaborators Jan 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants