Releases: facebook/create-react-app
v2.0.3
2.0.3 (October 1, 2018)
Create React App 2.0 brings a year’s worth of improvements in a single dependency update.
We summarized all of the changes in a blog post!
Check it out: Create React App 2.0: Babel 7, Sass, and More.
It provides a high-level overview of new features and improvements. Now let's see how to update your app to the latest version in detail.
Migrating from 1.x to 2.0.3
Inside any created project that has not been ejected, run:
npm install --save --save-exact react-scripts@2.0.3
or
yarn add --exact react-scripts@2.0.3
If you previously ejected but now want to upgrade, one common solution is to find the commits where you ejected (and any subsequent commits changing the configuration), revert them, upgrade, and later optionally eject again. It’s also possible that the feature you ejected for (maybe Sass or CSS Modules?) is now supported out of the box. You can find a list of notable new features in the Create React App 2.0 blog post.
Breaking Changes
Like any major release, react-scripts@2.0
contains a few breaking changes. We expect that they won't affect every user, but we recommend to scan over these sections to see if something is relevant to you. If we missed something, please file a new issue.
Node 6 is no longer supported
Please upgrade to Node 8 (LTS) or later.
Polyfills for IE 9, IE 10, and IE 11 are no longer included by default (but you can opt in!)
We have dropped default support for Internet Explorer 9, 10, and 11. If you still need to support these browsers, follow the instructions below.
First, install react-app-polyfill
:
npm install react-app-polyfill
or
yarn add react-app-polyfill
Next, place one of the following lines at the very top of src/index.js
:
import 'react-app-polyfill/ie9'; // For IE 9-11 support
import 'react-app-polyfill/ie11'; // For IE 11 support
You can read more about these polyfills here.
Dynamic import()
of a CommonJS module now has a .default
property
Webpack 4 changed the behavior of import()
to be closer in line with the specification.
Previously, importing a CommonJS module did not require you specify the default export. In most cases, this is now required.
If you see errors in your application about ... is not a function
, you likely need to update your dynamic import, e.g.:
const throttle = await import('lodash/throttle');
// replace with
const throttle = await import('lodash/throttle').then(m => m.default);
require.ensure()
is superseded by dynamic import()
We previously allowed code splitting with a webpack-specific directive, require.ensure()
. It is now disabled in favor of import()
. To switch to import()
, follow the examples below:
Single Module
require.ensure(['module-a'], function() {
var a = require('module-a');
// ...
});
// Replace with:
import('module-a').then(a => {
// ...
});
Multiple Module
require.ensure(['module-a', 'module-b'], function() {
var a = require('module-a');
var b = require('module-b');
// ...
});
// Replace with:
Promise.all([import('module-a'), import('module-b')]).then(([a, b]) => {
// ...
});
The default Jest environment was changed to jsdom
Look at the test
entry in the scripts
section of your package.json
.
Here's a table how to change it from "before" and "after", depending on what you have there:
1.x (if you have this...) | 2.x (...change it to this!) |
---|---|
react-scripts test --env=jsdom |
react-scripts test |
react-scripts test |
react-scripts test --env=node |
Object proxy
configuration is superseded by src/setupProxy.js
To check if action is required, look for the proxy
key in package.json
and follow this table:
- I couldn't find a
proxy
key inpackage.json
- No action is required!
- The value of
proxy
is a string (e.g.http://localhost:5000
)- No action is required!
- The value of
proxy
is an object- Follow the migration instructions below.
It's worth highlighting: if your proxy
field is a string
, e.g. http://localhost:5000
, or you don't have it, skip this section. This feature is still supported and has the same behavior.
If your proxy
is an object, that means you are using the advanced proxy configuration. It has become fully customizable so we removed the limited support for the object-style configuration. Here's how to recreate it.
First, install http-proxy-middleware
using npm or Yarn:
npm install http-proxy-middleware
or
yarn add http-proxy-middleware
Next, create src/setupProxy.js
and place the following contents in it:
const proxy = require('http-proxy-middleware');
module.exports = function(app) {
// ...
};
Now, migrate each entry in your proxy
object one by one, e.g.:
"proxy": {
"/api": {
"target": "http://localhost:5000/"
},
"/*.svg": {
"target": "http://localhost:5000/"
}
}
Place entries into src/setupProxy.js
like so:
const proxy = require('http-proxy-middleware');
module.exports = function(app) {
app.use(proxy('/api', { target: 'http://localhost:5000/' }));
app.use(proxy('/*.svg', { target: 'http://localhost:5000/' }));
};
You can also use completely custom logic there now! This wasn't possible before.
.mjs
file extension support is removed
Change the extension of any files in your project using .mjs
to just .js
.
It was removed because of inconsistent support from underlying tools. We will add it back after it stops being experimental, and Jest gets built-in support for it.
PropTypes
definitions are now removed in production
Normally, this shouldn't affect your logic and should make the resulting bundle smaller. However, you may be relying on PropTypes definition for production logic. This is not recommended, and will break now. If a library does it, one possible solution is to file an issue in it with a proposal to use a different field (not propTypes
) to signal that the declaration needs to be retained.
Anything missing?
This was a large release, and we might have missed something.
Please file an issue and we will try to help.
Migrating from 2.0.0-next.xyz
If you used 2.x alphas, please follow these instructions.
Detailed Changelog
For a readable summary of the changes, check out our blog post.
For the detailed changelog, please see CHANGELOG.md.
v1.1.5
1.1.5 (August 24, 2018)
-
react-scripts
- Update the
webpack-dev-server
dependency
- Update the
-
react-dev-utils
- #4866 Fix a Windows-only vulnerability (
CVE-2018-6342
) in the development server (@acdlite)- Note: the fix is included in a patch version for every major release of
react-dev-utils
:react-dev-utils@1.0.4
,react-dev-utils@2.0.2
,react-dev-utils@3.1.2
,react-dev-utils@4.2.2
,react-dev-utils@5.0.2
, andreact-dev-utils@6.0.0-next.a671462c
- Note: the fix is included in a patch version for every major release of
- Update the
sockjs-client
dependency
- #4866 Fix a Windows-only vulnerability (
Committers: 1
- Andrew Clark (acdlite)
Migrating from 1.1.4 to 1.1.5
Inside any created project that has not been ejected, run:
npm install --save --save-exact react-scripts@1.1.5
or
yarn add --exact react-scripts@1.1.5
v1.1.4
1.1.4 (April 3, 2018)
🐛 Bug Fix
Committers: 1
- Joe Haddad (Timer)
Migrating from 1.1.3 to 1.1.4
Inside any created project that has not been ejected, run:
npm install --save --save-exact react-scripts@1.1.4
or
yarn add --exact react-scripts@1.1.4
v1.1.3
1.1.3 (April 3, 2018)
🐛 Bug Fix
-
react-scripts
Committers: 1
- Dan Abramov (gaearon)
Migrating from 1.1.2 to 1.1.3
Inside any created project that has not been ejected, run:
npm install --save --save-exact react-scripts@1.1.3
or
yarn add --exact react-scripts@1.1.3
v1.1.2
1.1.2 (April 3, 2018)
🐛 Bug Fix
-
react-scripts
📝 Documentation
Committers: 2
Migrating from 1.1.1 to 1.1.2
Inside any created project that has not been ejected, run:
npm install --save --save-exact react-scripts@1.1.2
or
yarn add --exact react-scripts@1.1.2
v1.1.1
1.1.1 (February 2, 2018)
🐛 Bug Fix
💅 Enhancement
📝 Documentation
react-scripts
- #3971 Update instructions for continuous delivery with Netlify. (@hubgit)
- #3894 Include
{json,css}
files in prettier command. (@reyronald)
🏠 Internal
Committers: 6
Migrating from 1.1.0 to 1.1.1
Inside any created project that has not been ejected, run:
npm install --save --save-exact react-scripts@1.1.1
or
yarn add --exact react-scripts@1.1.1
v1.1.0
1.1.0 (January 15, 2018)
🚀 New Feature
-
react-scripts
-
react-error-overlay
-
create-react-app
- #3408 Add
--info
flag to help gather bug reports. (@tabrindle) - #3409 Add
--use-npm
flag to bypass Yarn even on systems that have it. (@tabrindle) - #3725 Extend
--scripts-version
to include.tar.gz
format. (@SaschaDens) - #3629 Allowing
"file:<path>"
--scripts-version
values. (@GreenGremlin)
- #3408 Add
🐛 Bug Fix
-
babel-preset-react-app
,react-scripts
-
react-dev-utils
- #3784 Detach browser process from the shell on Linux. (@gaearon)
- #3726 Use proxy for all request methods other than
GET
. (@doshisid) - #3440 Print full directory name from
lsof
. (@rmccue) - #2071 Fix broken console clearing on Windows. (@danielverejan)
- #3686 Fix starting a project in directory with
++
in the name. (@Norris1z)
-
create-react-app
- #3320 Fix offline installation to respect proxy from
.npmrc
. (@mdogadailo)
- #3320 Fix offline installation to respect proxy from
-
react-scripts
💅 Enhancement
-
react-scripts
-
create-react-app
- #3740 Allow more non-conflicting files in initial project directory. (@GreenGremlin)
-
react-dev-utils
- #3104 Add link to deployment docs after build. (@viankakrisna)
- #3652 Add
code-insiders
to the editor list. (@shrynx) - #3700 Add editor support for Sublime Dev & VSCode Insiders. (@yyx990803)
- #3545 Autodetect MacVim editor. (@gnapse)
-
react-dev-utils
,react-error-overlay
- #3465 Open editor to exact column from build error overlay. (@tharakawj)
-
react-dev-utils
,react-scripts
-
eslint-config-react-app
📝 Documentation
-
User Guide
- #3659 Add info about service-worker and HTTP caching headers into Firebase section. (@bobrosoft)
- #3515 Add Powershell commands to README.md. (@Gua-naiko-che)
- #3656 Better documentation for setupTests.js when ejecting. (@dannycalleri)
- #1791 Add link for automatic deployment to azure. (@ulrikstrid)
- #3717 Update README.md. (@maecapozzi)
- #3710 Link to an explanation for forking react-scripts. (@gaearon)
- #3709 Document adding a router. (@gaearon)
- #3670 Fix typo in the User Guide. (@qbahers)
- #3645 Update README.md. (@elie222)
- #3533 Use safer/more aesthetic syntax for setting environment variables on Windows. (@cdanielsen)
- #3605 Updated Debugging Tests for VSCode. (@amadeogallardo)
- #3601 Fixed typo in webpack.config.dev.js. (@nmenglund)
- #3576 Updates comment to reflect codebase. (@rahulcs)
- #3510 Update User Guide with deploying to GitHub User pages. (@aaronlna)
- #3503 Update Prettier editor integration link. (@gaving)
- #3453 Fix dead links. (@vannio)
- #2992 Docs: How to Debug Unit Tests. (@MattMorgis)
-
Other
- #3729 Update README.md to note Neutrino's support of react components. (@eliperelman)
- #2841 Documentation to help windows contributors. (@Dubes)
- #3489 Add link to nvm-windows. (@davidgilbertson)
-
eslint-config-react-app
🏠 Internal
-
Other
- #3769 Enable Yarn check files. (@Timer)
- #3756 Clean up changes to npm and yarn registry in E2E tests. (@viankakrisna)
- #3744 Use private registry in E2E tests. (@Timer)
- #3738 Always use Yarn on CI. (@gaearon)
- #2309 Port
cra.sh
development task to javascript. (@ianschmitz) - #3411 Simplify waiting for app start in E2E tests. (@xjlim)
- #3755 Switch to Yarn Workspaces. (@gaearon)
- #3757 Try updating Flow. (@gaearon)
- #3414 Export
dismissRuntimeErrors
function. (@skidding) - [#3036](https://github.com/facebookincubator/create-react-...
v1.0.17
1.0.17 (November 3, 2017)
💅 Enhancement
📝 Documentation
-
react-scripts
- #3399 Add link to VS Code troubleshooting guide. (@auchenberg)
- #3400 Update VS Code debug configuration. (@auchenberg)
Committers: 3
- Dan Abramov (gaearon)
- Kenneth Auchenberg (auchenberg)
- Loren Sands-Ramshaw (lorensr)
Migrating from 1.0.16 to 1.0.17
Inside any created project that has not been ejected, run:
npm install --save --save-exact react-scripts@1.0.17
or
yarn add --exact react-scripts@1.0.17
v1.0.16
1.0.16 (October 31, 2017) 🎃
🐛 Bug Fix
-
react-scripts
-
react-dev-utils
Committers: 2
Migrating from 1.0.15 to 1.0.16
Inside any created project that has not been ejected, run:
npm install --save --save-exact react-scripts@1.0.16
or
yarn add --exact react-scripts@1.0.16
v1.0.15
1.0.15 (October 30, 2017)
🐛 Bug Fix
-
react-scripts
- #3287 Fix favicon sizes value in the project manifest. (@ryansully)
-
react-dev-utils
,react-scripts
💅 Enhancement
-
react-scripts
-
babel-preset-react-app
,react-dev-utils
,react-error-overlay
,react-scripts
-
react-dev-utils
,react-error-overlay
- #3100 Add click-to-open support for build errors. (@tharakawj)
-
create-react-app
📝 Documentation
-
User Guide
- #2957 Use
npm-run-all
to build Sass and JS. (@shime) - #3108 Update the Service Worker opt-out documentation. (@captDaylight)
- #3286 Add documentation for Enzyme 3 integration. (@ryansully)
- #3328 Recommend react-snap as an alternative to react-snapshot. (@aaronshaf)
- #3279 Add jest coverage configuration docs. (@mattphillips)
- #3303 Update link to Jest Expect docs. (@jbranchaud)
- #3289 Fix dead link to Jest "expect" docs. (@alexkrolick)
- #3265 Add external links to deployment services. (@aericson)
- #3075 Minor docs change to highlight dev proxy behaviour. (@davidjb)
- #3185 Correct manual proxy documentation. (@robertpanzer)
- #2957 Use
-
README
- #3227 Fix package management link in README for issue #3218. (@nishina555)
- #3211 Improve grammar in README. (@Mohamed3on)
🏠 Internal
-
Other
-
react-error-overlay
- #3122 Fix for add .gitattributes file #3080. (@ijajmulani)
- #3267 Use production React version for bundled overlay. (@Timer)
- #3264 Add warning when using
react-error-overlay
in production. (@Timer) - #3263
react-error-overlay
has no dependencies now (it's bundled). (@Timer) - #3142 Make error overlay run in the context of the iframe. (@tharakawj)
-
react-scripts
- #3150 Remove an useless negation in
registerServiceWorker.js
. (@dunglas) - #3158 Remove
output.path
from dev webpack config. (@nikolas) - #3281 Add a workaround for Uglify incompatiblity with Safari 10.0 in the future. (@satyavh)
- #3146 Fix
reason-react
support. (@lpalmes) - #3236 Update
style-loader
and disable inclusion of its HMR code in builds. (@insin) - #3246 Update
url-loader
to 0.6.2 for mime ReDoS vulnerability. (@d3viant0ne) - #2914
<!doctype html>
-><!DOCTYPE html>
. (@Hurtak)
- #3150 Remove an useless negation in
Committers: 24
- Aaron Shafovaloff (aaronshaf)
- Alex (alexkrolick)
- André Ericson (aericson)
- Dan Abramov (gaearon)
- David Beitey (davidjb)
- Hrvoje Šimić (shime)
- IJAJ MULANI (ijajmulani)
- Joe Haddad (Timer)
- Joe Lim (xjlim)
- Jonny Buchanan (insin)
- Josh Branchaud (jbranchaud)
- Joshua Wiens (d3viant0ne)
- Kévin Dunglas (dunglas)
- Lorenzo Palmes (lpalmes)
- Matt Phillips (mattphillips)
- Mohamed Oun (Mohamed3on)
- Nik Nyby (nikolas)
- Petr Huřťák (Hurtak)
- Robert Panzer (robertpanzer)
- Ryan Sullivan (ryansully)
- Satya van Heummen (satyavh)
- Tharaka Wijebandara (tharakawj)
- Toshiharu Nishina (nishina555)
- captDaylight
Migrating from 1.0.14 to 1.0.15
Inside any created project that has not been ejected, run:
npm install --save --save-exact react-scripts@1.0.15
or
yarn add --exact react-scripts@1.0.15