chore(deps): update dependency react-scripts to v2 #146
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
^1.0.11
->^2.0.0
^1.1.4
->^2.0.0
By merging this PR, the issue #46 will be automatically resolved and closed:
By merging this PR, the issue #98 will be automatically resolved and closed:
By merging this PR, the issue #28 will be automatically resolved and closed:
Release Notes
facebook/create-react-app (react-scripts)
v2.0.3
Compare Source
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:
or
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
:or
Next, place one of the following lines at the very top of
src/index.js
:You can read more about these polyfills here.
Dynamic
import()
of a CommonJS module now has a.default
propertyWebpack 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.:require.ensure()
is superseded by dynamicimport()
We previously allowed code splitting with a webpack-specific directive,
require.ensure()
. It is now disabled in favor ofimport()
. To switch toimport()
, follow the examples below:Single Module
Multiple Module
The default Jest environment was changed to
jsdom
Look at the
test
entry in thescripts
section of yourpackage.json
.Here's a table how to change it from "before" and "after", depending on what you have there:
react-scripts test --env=jsdom
react-scripts test
react-scripts test
react-scripts test --env=node
Object
proxy
configuration is superseded bysrc/setupProxy.js
To check if action is required, look for the
proxy
key inpackage.json
and follow this table:proxy
key inpackage.json
proxy
is a string (e.g.http://localhost:5000
)proxy
is an objectIt's worth highlighting: if your
proxy
field is astring
, 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:or
Next, create
src/setupProxy.js
and place the following contents in it:Now, migrate each entry in your
proxy
object one by one, e.g.:Place entries into
src/setupProxy.js
like so:You can also use completely custom logic there now! This wasn't possible before.
.mjs
file extension support is removedChange 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 productionNormally, 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.
v2.0.2
Compare Source
v2.0.1
Compare Source
v2.0.0
Compare Source