forked from vercel/next.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Docs: Add supported browsers and features (vercel#13741)
[ch1981] Add the “Supported Browsers and Features” page. The content is taken mostly from the blog posts: [9.4](https://nextjs.org/blog/next-9-4), [9.3](https://nextjs.org/blog/next-9-3), and [9.1.7](https://nextjs.org/blog/next-9-1-7). - This page is added under “Basic Features” on the sidebar. - It still links to `with-polyfills` example, but [this example was updated recently](vercel@04fbe0b). I simplified the README. - Removed the FAQ section on supported browsers. - On ["Customizing Babel Config"](https://nextjs.org/docs/advanced-features/customizing-babel-config), remove the list of presets which were outdated and instead link to [the preset file](https://github.com/vercel/next.js/blob/canary/packages/next/build/babel/preset.ts) so it’s always up to date.
- Loading branch information
Showing
5 changed files
with
53 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
--- | ||
description: Browser support and which JavaScript features are supported by Next.js. | ||
--- | ||
|
||
# Supported Browsers and Features | ||
|
||
Next.js supports **IE11 and all modern browsers** (Edge, Firefox, Chrome, Safari, Opera, et al) with no required configuration. | ||
|
||
## Polyfills | ||
|
||
We transparently inject polyfills required for IE11 compatibility. In addition, we also inject widely used polyfills, including: | ||
|
||
- [**fetch()**](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) — Replacing: `whatwg-fetch` and `unfetch`. | ||
- [**URL**](https://developer.mozilla.org/en-US/docs/Web/API/URL) — Replacing: the [`url` package (Node.js API)](https://nodejs.org/api/url.html). | ||
- [**Object.assign()**](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) — Replacing: `object-assign`, `object.assign`, and `core-js/object/assign`. | ||
|
||
If any of your dependencies includes these polyfills, they’ll be eliminated automatically from the production build to avoid duplication. | ||
|
||
In addition, to reduce bundle size, Next.js will only load these polyfills for browsers that require them. The majority of the web traffic globally will not download these polyfills. | ||
|
||
### Server-side Polyfills | ||
|
||
In addition to `fetch()` on the client side, Next.js polyfills `fetch()` in the Node.js environment. You can use `fetch()` on your server code (such as `getStaticProps`) without using polyfills such as `isomorphic-unfetch` or `node-fetch`. | ||
|
||
### Custom Polyfills (Advanced) | ||
|
||
If your own code or any external npm dependencies require features not supported by your target browsers, you need to add polyfills yourself. In that case, you can take a look at the [with-polyfills](https://github.com/vercel/next.js/blob/canary/examples/with-polyfills/) example. | ||
|
||
## JavaScript Language Features | ||
|
||
Next.js allows you to use the latest JavaScript features out of the box. In addition to [ES6 features](https://github.com/lukehoban/es6features), Next.js also supports: | ||
|
||
- [Async/await](https://github.com/tc39/ecmascript-asyncawait) (ES2017) | ||
- [Object Rest/Spread Properties](https://github.com/tc39/proposal-object-rest-spread) (ES2018) | ||
- [Dynamic `import()`](https://github.com/tc39/proposal-dynamic-import) (ES2020) | ||
- [Optional Chaining](https://github.com/tc39/proposal-optional-chaining) (ES2020) | ||
- [Nullish Coalescing](https://github.com/tc39/proposal-nullish-coalescing) (ES2020) | ||
- [Class Fields](https://github.com/tc39/proposal-class-fields) and [Static Properties](https://github.com/tc39/proposal-static-class-features) (part of stage 3 proposal) | ||
- and more! | ||
|
||
### TypeScript Features | ||
|
||
Next.js has built-in TypeScript support. [Learn more here](/docs/basic-features/typescript.md). | ||
|
||
### Customizing Babel Config (Advanced) | ||
|
||
You can customize babel configuration. [Learn more here](/docs/advanced-features/customizing-babel-config.md). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters