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

Polyfill documentation #4572

Closed
andrewmclagan opened this issue Jun 9, 2018 · 8 comments · Fixed by #4601
Closed

Polyfill documentation #4572

andrewmclagan opened this issue Jun 9, 2018 · 8 comments · Fixed by #4601

Comments

@andrewmclagan
Copy link
Contributor

Feature request

Is your feature request related to a problem? Please describe.

Currently there is no clear guidelines on implementing polyfils for browsers. There exists examples to polyfill with core-js although there also exists examples to use .babelrc with the env preset to support older browsers.

There is allot of confusion and issues around this topic.

Describe the solution you'd like

A clear section in the documentation that describes using .babelrc and the env preset to polyfill older browsers.

Additional context

We (ethical-jobs) would be happy to write up a PR / example to address this issue if people think its needed.

@timneutkens
Copy link
Member

So to explain:
Next.js supports ie11 and all modern browsers out of the box without polyfills.

The only time you'd need a polyfill is when you are pulling in an external dependency which is using methods that should be polyfilled in ie11/etc, this is what the with-polyfill example shows. So basically we'd have to document that specific part. I'd be super happy to take in a PR with documentation around this if you're willing to write it up 🙏

@andrewmclagan
Copy link
Contributor Author

Sure I will try and get one fo the team to do this some time next week.

@andrewmclagan
Copy link
Contributor Author

PR is up at #4601

timneutkens pushed a commit that referenced this issue Jun 14, 2018
Fixes #4572

This PR intends to address #4572 around documenting browser support and what needs polyfills.

There are many outstanding issues on the tracker regarding browser support and polyfills. This may alleviate some of them.
lependu pushed a commit to lependu/next.js that referenced this issue Jun 19, 2018
…l#4601)

Fixes vercel#4572

This PR intends to address vercel#4572 around documenting browser support and what needs polyfills.

There are many outstanding issues on the tracker regarding browser support and polyfills. This may alleviate some of them.
@sheerun
Copy link
Contributor

sheerun commented Dec 17, 2018

btw. this is false claim this is fixed: #5783

Polyfills on native objects like [].includes() are not handled by current setup

@timneutkens
Copy link
Member

I'm not sure what's false here, my comment says exactly what your issue describes.

The only time you'd need a polyfill is when you are pulling in an external dependency which is using methods that should be polyfilled in ie11/etc

@timneutkens
Copy link
Member

Next.js by default with no external dependencies works fine in ie11.

@sheerun
Copy link
Contributor

sheerun commented Dec 17, 2018

@timneutkens My fault, sorry!

@chirag04
Copy link

@timneutkens - our app is crashing in IE because of this line in nextjs router: b88addf#diff-49f9285928f23ee1231af5aa2534c70aL66

looks like includes is not polyfilled by default

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants