IMPORTANT: Do NOT do this if you didn't use 2.x alphas of react-scripts
.
Inside any created project that has not been ejected, run:
$ npm install --save --save-exact [email protected]
$ # or
$ yarn add --exact [email protected]
After running this command, follow the instructions for migrating from 1.1.15 to 2.0.3. Then proceed to the migration steps below.
Monorepo support was half-baked and didn't account for many cases, so we decided to remove it. We know this is frustrating for people relying on it, but it was blocking the release and we didn't really have a solution that would work well in longer term. This is something we still want to do in the future, but we don't have a comprehensive proposal for this yet.
We're sorry that there's no easy way to migrate this, but it can be done:
For Application Logic
Importing application code should just work, provided it does not contain any JSX.
For Components
Importing uncompiled components (any file that contains JSX) will not work. You will need to compile these packages using something like nwb
. Be sure your package.json
main
and module
keys point to the compiled code and not the source code.
We removed explicit support for importing .graphql
files in favor of a Babel Macro.
Install graphql.macro
and migrate your existing .graphql
imports to look like this:
import { loader as gqlLoader } from 'graphql.macro';
const query = gqlLoader('./query.graphql');
Remove the browserslist
key from package.json
and you will be prompted to accept the new defaults next time you run the development server or a build.
This was a large release, and we might have missed something.
Please file an issue and we will try to help.
I am so happy you decided to remove support for monorepos. We are using monorepos with react app in one of the workspaces and we were following all
2.0.0-next.xyz
releases where we had to fork and continuously change one line in react-scripts that was specifically disabling treating other monorepo dependencies as source dependencies (and as a result react-scripts were doing linting on already transpiled modules). I realised that version2.0.0-next.2150693d
was the first that removed that functionality and I was really uncertain if it will make it to the official release... I am so glad it did.