Skip to content

Commit bfb17b2

Browse files
committed
Tweak browser support section
1 parent d7bffca commit bfb17b2

File tree

2 files changed

+16
-19
lines changed

2 files changed

+16
-19
lines changed

packages/react-app-polyfill/README.md

+11-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
# react-app-polyfill
22

33
This package includes polyfills for various browsers.
4-
It includes minimum requirements and commonly used language features used by [Create React App](https://github.com/facebook/create-react-app) projects.<br>
5-
Please refer to its documentation:
6-
7-
- [Getting Started](https://github.com/facebook/create-react-app/blob/master/README.md#getting-started) – How to create a new app.
8-
- [User Guide](https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md) – How to develop apps bootstrapped with Create React App.
4+
It includes minimum requirements and commonly used language features used by [Create React App](https://github.com/facebook/create-react-app) projects.
95

106
### Features
117

@@ -17,9 +13,17 @@ Each polyfill ensures the following language features are present:
1713
1. `Symbol` (a built-in object used by `for...of` syntax and friends)
1814
1. `Array.from` (a built-in static method used by array spread, i.e. `[...arr]`)
1915

20-
### Entry Points
16+
### Usage
17+
18+
First, install the package using Yarn or npm:
19+
20+
```bash
21+
$ npm install react-app-polyfill --save
22+
$ # or
23+
$ yarn add react-app-polyfill
24+
```
2125

22-
You can import the entry point for the minimal version you intend to support. For example, if you import the IE9 entry point, this will include IE10 and IE11 support.
26+
Now, you can import the entry point for the minimal version you intend to support. For example, if you import the IE9 entry point, this will include IE10 and IE11 support.
2327

2428
#### Internet Explorer 9
2529

packages/react-scripts/template/README.md

+5-12
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ You can find the most recent version of this guide [here](https://github.com/fac
1414
- [npm run build](#npm-run-build)
1515
- [npm run eject](#npm-run-eject)
1616
- [Supported Browsers](#supported-browsers)
17-
- [Supported Language Features and Polyfills](#supported-language-features-and-polyfills)
17+
- [Supported Language Features](#supported-language-features)
1818
- [Syntax Highlighting in the Editor](#syntax-highlighting-in-the-editor)
1919
- [Displaying Lint Output in the Editor](#displaying-lint-output-in-the-editor)
2020
- [Debugging in the Editor](#debugging-in-the-editor)
@@ -203,11 +203,10 @@ You don’t have to ever use `eject`. The curated feature set is suitable for sm
203203

204204
## Supported Browsers
205205

206-
By default, the generated project uses the latest version of React.
206+
By default, the generated project supports all modern browsers.<br>
207+
Support for Internet Explorer 9, 10, and 11 requires [polyfills](https://github.com/facebook/create-react-app/blob/next/packages/react-app-polyfill/README.md).
207208

208-
You can refer [to the React documentation](https://reactjs.org/docs/react-dom.html#browser-support) for more information about supported browsers.
209-
210-
## Supported Language Features and Polyfills
209+
### Supported Language Features
211210

212211
This project supports a superset of the latest JavaScript standard.<br>
213212
In addition to [ES6](https://github.com/lukehoban/es6features) syntax features, it also supports:
@@ -223,16 +222,10 @@ Learn more about [different proposal stages](https://babeljs.io/docs/plugins/#pr
223222

224223
While we recommend using experimental proposals with some caution, Facebook heavily uses these features in the product code, so we intend to provide [codemods](https://medium.com/@cpojer/effective-javascript-codemods-5a6686bb46fb) if any of these proposals change in the future.
225224

226-
Note that **the project only includes a few ES6 [polyfills](https://en.wikipedia.org/wiki/Polyfill)**:
227-
228-
- [`Object.assign()`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) via [`object-assign`](https://github.com/sindresorhus/object-assign).
229-
- [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) via [`promise`](https://github.com/then/promise).
230-
- [`fetch()`](https://developer.mozilla.org/en/docs/Web/API/Fetch_API) via [`whatwg-fetch`](https://github.com/github/fetch).
225+
Note that **this project includes no [polyfills](https://en.wikipedia.org/wiki/Polyfill)** by default.
231226

232227
If you use any other ES6+ features that need **runtime support** (such as `Array.from()` or `Symbol`), make sure you are including the appropriate polyfills manually, or that the browsers you are targeting already support them.
233228

234-
Also note that using some newer syntax features like `for...of` or `[...nonArrayValue]` causes Babel to emit code that depends on ES6 runtime features and might not work without a polyfill. When in doubt, use [Babel REPL](https://babeljs.io/repl/) to see what any specific syntax compiles down to.
235-
236229
## Syntax Highlighting in the Editor
237230

238231
To configure the syntax highlighting in your favorite text editor, head to the [relevant Babel documentation page](https://babeljs.io/docs/editors) and follow the instructions. Some of the most popular editors are covered.

0 commit comments

Comments
 (0)