From 8fb4f6fbae48191ed7ac52589d32aecd15be76bf Mon Sep 17 00:00:00 2001 From: Jonathan Conway Date: Thu, 22 Dec 2016 18:43:37 +0100 Subject: [PATCH 1/2] reactjs/redux#2004 List features beyond ES6 supported by create-react-app --- packages/react-scripts/template/README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/react-scripts/template/README.md b/packages/react-scripts/template/README.md index fe4e7b31b12..2f94ba6b6db 100644 --- a/packages/react-scripts/template/README.md +++ b/packages/react-scripts/template/README.md @@ -13,6 +13,7 @@ You can find the most recent version of this guide [here](https://github.com/fac - [npm test](#npm-test) - [npm run build](#npm-run-build) - [npm run eject](#npm-run-eject) +- [Supported features beyond ES6](#supported-features-beyond-es6) - [Syntax Highlighting in the Editor](#syntax-highlighting-in-the-editor) - [Displaying Lint Output in the Editor](#displaying-lint-output-in-the-editor) - [Changing the Page ``](#changing-the-page-title) @@ -162,6 +163,14 @@ Instead, it will copy all the configuration files and the transitive dependencie You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. +## Supported Features Beyond ES6 + +The following language features beyond ES6 are supported (at the time of writing, stage 2 and 3 proposals): + +* [Public class fields](https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-class-properties) ([stage 2](https://tc39.github.io/proposal-class-public-fields/)) +* [ES2015 parameters](https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-object-rest-spread) ([stage 3](https://babeljs.io/docs/plugins/transform-es2015-parameters/)) +* [Object rest spread](https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-object-rest-spread) ([stage 3](https://github.com/tc39/ecma262)) + ## Syntax Highlighting in the Editor 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. From 06a1110b73688f496e823866297a7d1a89d95cd4 Mon Sep 17 00:00:00 2001 From: Dan Abramov <dan.abramov@gmail.com> Date: Sun, 12 Feb 2017 01:57:26 +0000 Subject: [PATCH 2/2] Add more info --- packages/react-scripts/template/README.md | 25 +++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/packages/react-scripts/template/README.md b/packages/react-scripts/template/README.md index 2f94ba6b6db..117818939c5 100644 --- a/packages/react-scripts/template/README.md +++ b/packages/react-scripts/template/README.md @@ -13,7 +13,7 @@ You can find the most recent version of this guide [here](https://github.com/fac - [npm test](#npm-test) - [npm run build](#npm-run-build) - [npm run eject](#npm-run-eject) -- [Supported features beyond ES6](#supported-features-beyond-es6) +- [Supported Language Features and Polyfills](#supported-language-features-and-polyfills) - [Syntax Highlighting in the Editor](#syntax-highlighting-in-the-editor) - [Displaying Lint Output in the Editor](#displaying-lint-output-in-the-editor) - [Changing the Page `<title>`](#changing-the-page-title) @@ -163,13 +163,26 @@ Instead, it will copy all the configuration files and the transitive dependencie You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. -## Supported Features Beyond ES6 +## Supported Language Features and Polyfills -The following language features beyond ES6 are supported (at the time of writing, stage 2 and 3 proposals): +The project supports a superset of the latest JavaScript standard. +In addition to ES6, it also supports: -* [Public class fields](https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-class-properties) ([stage 2](https://tc39.github.io/proposal-class-public-fields/)) -* [ES2015 parameters](https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-object-rest-spread) ([stage 3](https://babeljs.io/docs/plugins/transform-es2015-parameters/)) -* [Object rest spread](https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-object-rest-spread) ([stage 3](https://github.com/tc39/ecma262)) +* [JSX](https://facebook.github.io/react/docs/introducing-jsx.html) and [Flow](https://flowtype.org/) syntax. +* [Class Fields and Static Properties](https://github.com/tc39/proposal-class-public-fields) (stage 2 proposal). +* [Object Rest/Spread Properties](https://github.com/sebmarkbage/ecmascript-rest-spread) (stage 3 proposal). + +Learn more about [different proposal stages](https://babeljs.io/docs/plugins/#presets-stage-x-experimental-presets-). + +While we recommend to use 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. + +Note that **the project only includes a few ES6 [polyfills](https://en.wikipedia.org/wiki/Polyfill)**: + +* [`Object.assign()`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) via [`object-assign`](https://github.com/sindresorhus/object-assign). +* [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) via [`promise`](https://github.com/then/promise). +* [`fetch()`](https://developer.mozilla.org/en/docs/Web/API/Fetch_API) via [`whatwg-fetch`](https://github.com/github/fetch). + +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. ## Syntax Highlighting in the Editor