-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Yarn #898
Support Yarn #898
Conversation
Note: We'll probably want to hold off publishing a version with Yarn enabled until this issue with scripts has been fixed. Currently, with Yarn v0.15.1, the |
There was also some issue about optionalDeps not getting installed. We need to make sure fsevents at least tries to get installed, or watcher will be slow. |
The issues @fson referenced has been fixed I believe. I'm not sure about the fsevents issue however. Anyone know? I'd love to have this support added. |
In the `create-react-app` command, try to install packages using Yarn. If Yarn is not installed, use npm instead. In `react-scripts`, detect if the project is using Yarn by checking if a `yarn.lock` file exists. If the project is using Yarn, display all the instructions with Yarn commands and use Yarn to install packages in `init` and `eject` scripts.
Run tests both with and without Yarn installed.
Rebased the changes and tested with Yarn 0.16.1. Everything seems to be working now! I believe the fsevents issue @gaearon was referring to was about optional dependencies not installing (yarnpkg/yarn#628)? It was fixed in yarnpkg/yarn#789. I checked |
How long does it take to run create-react-app before and after this pull request? |
(We'll also want to compare with and without bundledDeps, see #986) |
I did a quick benchmark of the time it took to run
Here's how I tested:
|
@fson Feel free to merge and release! |
I'll try to get the next release with this in it out in the next few days. |
* pull2: Support Yarn (facebook#898) Fix chrome tab reuse (facebook#1035) Remove unnecessary transform plugins for object spread to work (facebook#1052) Clears the usage of react-jsx-source & react-jsx-self (facebook#992) Update babel-present-env and use node: 'current' as target (facebook#1051) Remove redundant `function` from export statement (facebook#996) Add Gatsby to alternatives (facebook#995) Allow webpack 2 as peerDependency in react-dev-utils (facebook#963) Remove custom babel-loader cache dir config (facebook#983) Check for presence of folders before continuing eject. Closes facebook#939. (facebook#951) Fixes facebook#952 (facebook#953) Always build before deploying to gh-pages (facebook#959) Add collectCoverageFrom option to collect coverage on files without any tests. (facebook#961) Catch and noop call to open web browser. (facebook#964) Gently nudge users towards https by default (facebook#974) Enable compression on webpack-dev-server (facebook#966) (facebook#968) Add next.js to Alternatives Point people to npm Windows instructions Encourage people to try recent npm # Conflicts: # packages/react-scripts/config/webpack.config.dev.js # packages/react-scripts/package.json # packages/react-scripts/utils/createJestConfig.js
In the `create-react-app` command, try to install packages using Yarn. If Yarn is not installed, use npm instead. In `react-scripts`, detect if the project is using Yarn by checking if a `yarn.lock` file exists. If the project is using Yarn, display all the instructions with Yarn commands and use Yarn to install packages in `init` and `eject` scripts.
In the `create-react-app` command, try to install packages using Yarn. If Yarn is not installed, use npm instead. In `react-scripts`, detect if the project is using Yarn by checking if a `yarn.lock` file exists. If the project is using Yarn, display all the instructions with Yarn commands and use Yarn to install packages in `init` and `eject` scripts.
Okay so do we support |
I just saw the benchmarks now. It's a little misleading because it will vary largely depending on the machine. With my old mac air is over 2 minutes (linking took 95%) with fully cached deps for a clean install, while as it's less than half that to install on npm even with downloading everything. Not saying this means it shouldn't use yarn, I definitely prefer it, but it's not always faster 🙂 , especially on lower end machines. |
@tbillington you should raise this issue on the yarn repo, I'm pretty sure that they would like to hear this data point and potentially try to figure out why it was so slow in this case. |
I’m optimistic about yarnpkg/yarn#2620, a lot of linking time is due to duplicates. |
In the `create-react-app` command, try to install packages using Yarn. If Yarn is not installed, use npm instead. In `react-scripts`, detect if the project is using Yarn by checking if a `yarn.lock` file exists. If the project is using Yarn, display all the instructions with Yarn commands and use Yarn to install packages in `init` and `eject` scripts.
Yarn is a new fast, reliable and secure alternative to the npm client.
This pull request adds support for Yarn in Create React App. See discussion in #896.
In the
create-react-app
command, we try to install packages using Yarn. If Yarn is not installed, we use npm instead. Inreact-scripts
, we detect if the project is using Yarn by checking if ayarn.lock
file exists. If the project is using Yarn, all the instructions are displayed with Yarn commands and Yarn is used to install packages ininit
andeject
scripts.