-
-
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
Use most recent React version #477
Conversation
Hmm. Can we change the script to run |
@gaearon that would be way better than trying to move dev dependencies around and re-run npm blindly on the host folder! |
Should I also run |
Yes please. (We might remove it until some issues are solved but I'll make the call before cutting the release.) |
@gaearon Updated it to run separate installs for each package. |
pkg === 'react-test-renderer' ? '--save-dev' : '--save', | ||
verbose && '--verbose' | ||
].filter(function(e) { return e; }); | ||
var result = spawnSync('npm', args, {stdio: 'inherit'}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should not be three separate spawns.
Let's just use --save
for all of them, and do it as one spawn.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok!
Thanks! |
* Get latest version numbers of react and react-dom from npm before install. * Run separate npm installs for react, react-dom, and react-test-renderer. * Consolidate into a single npm install. * Fix misplaced parenthesis, add missing semicolon. * Add missing semicolon.
* Get latest version numbers of react and react-dom from npm before install. * Run separate npm installs for react, react-dom, and react-test-renderer. * Consolidate into a single npm install. * Fix misplaced parenthesis, add missing semicolon. * Add missing semicolon.
* Get latest version numbers of react and react-dom from npm before install. * Run separate npm installs for react, react-dom, and react-test-renderer. * Consolidate into a single npm install. * Fix misplaced parenthesis, add missing semicolon. * Add missing semicolon.
Fixes #473. I thought the best approach would be calling
npm view react[-dom] version
and then using the output. If it fails, it falls back to the old method of getting the version. The other alternative I considered was just doing a separate install of react and react-dom, but then you'd end up with more extra npm installs.Test plan: I ran
init
and the new app had version^15.3.1
in the package.json, instead of^15.3.0
, which is how it is in thecreate-react-app
repo and when creating a new app off of master.