vercel / next.js

The React Framework
https://nextjs.org
MIT License
123.72k stars 26.38k forks source link

Docs: polyfills and supported browsers #63469

Open hviksten opened 4 months ago

hviksten commented 4 months ago

What is the improvement or update you wish to see?

Next.js supports modern browsers with zero configuration.

The NextJS documentation is very unclear about the browser support and how polyfills work. Reading it without understanding how they are applied makes you believe that there is no configuration needed for the mentioned browser list to be polyfilled and work.

We inject widely used polyfills, including:

The link in above goes to the next-polyfill-nomodule which adds the polyfills by noModule property in the script tag. The attribute is set to indicate that the script should not be executed in browsers that support ES modules

Is there any context that might help us understand?

With the current solution it means that no browser with support for ES modules will use the (nomodule) polyfill file. As an example chrome got support for ES modules in version 61, while it did not get support for Promise.allSettled until version 76, that means that any chrome version above 61 won't get polyfilled.

The documentation is at minimum very misleading and potentially can be considered a bug. It seems like the polyfills that are in the nomodules file were made for IE11.

Does the docs page already exist? Please link to it.

https://nextjs.org/docs/architecture/supported-browsers

ritingliudd01 commented 4 months ago

Also, is it possible to add minimum version of Android Webview to the list?


Next.js supports modern browsers with zero configuration.

- Chrome 64+
- Edge 79+
- Firefox 67+
- Opera 51+
- Safari 12+
ritingliudd01 commented 4 months ago

Answered by gitHub Copilot

image