Uh oh!
There was an error while loading. Please reload this page.
Add npm-shrinkwrap.json to npm - #5812
Conversation
skevy
commented
Feb 8, 2016
facebook-github-bot
commented
Feb 8, 2016
ide
commented
Feb 8, 2016
👍 |
mkonicek
commented
Feb 8, 2016
Sounds awesome to me! @martinbigio@davidaurelio does this look fine to you? |
Summary: This PR moves `react` from dependencies to peerDependencies. In general, this would have only been important for those people using packages that depend on `react` and were using npm@2...npm@3 would automatically de-dupe. However, when #5812 gets merged, dependencies will be scoped to react-native (on both npm@2 & npm@3), thus breaking projects that are using a package like `react-redux` for example, which depends on `react`. There would be two copies of React installed, and due to the use of haste modules in `react`, this would break the packager and cause naming collisions. This PR does three things - 1. Moves the dependency from dependencies to peerDependencies 2. Updates the local-cli to run `npm install react --save` when a new project is initialized. 3. Updates `react-native upgrade` to warn if `react` is not listed in the package.json's dependencies. **Note: This will require a shrinkwrap update.** Closes#5813 Reviewed By: svcscm Differential Revision: D2918380 Pulled By: androidtrunkagent fb-gh-sync-id: 6e4234a45284be2fdf6fedf29e70b2d2d0262486 shipit-source-id: 6e4234a45284be2fdf6fedf29e70b2d2d0262486
martinbigio
commented
Feb 12, 2016
Yeah, this is a great change. Would help reduce the number of weird bugs, if any, open-source users run due to using different versions of dependencies. Thanks @skevy! |
martinbigio
commented
Feb 12, 2016
@facebook-github-bot shipit |
facebook-github-bot
commented
Feb 12, 2016
Thanks for importing. If you are an FB employee go to https://our.intern.facebook.com/intern/opensource/github/pull_request/162639940782046/int_phab to review. |
martinbigio
commented
Feb 12, 2016
Please make sure to include this change on the release notes :) |
skevy
commented
Feb 13, 2016
Trying to ship again... |
skevy
commented
Feb 13, 2016
@facebook-github-bot shipit |
facebook-github-bot
commented
Feb 13, 2016
Thanks for importing. If you are an FB employee go to https://our.intern.facebook.com/intern/opensource/github/pull_request/162639940782046/int_phab to review. |
skevy
commented
Feb 14, 2016
@mkonicek Another one of mine that didn't close the PR after the merge...just FYI |
skevy
commented
Feb 14, 2016
Closed by: 7586951 |
This probably should have been done a long time ago, but alas, here we are.
This adds the shrinkwrap file to be included when
react-nativeis npm installed.Previously this wasn't possible due to how we were resolving Babel plugins in the transformer in the packager, but now that we've simplified that and added the preset, this should work fine.
This will be even better when we're able to add
reactas a peer dependency, rather than a normal dependency.NOTE: DO NOT MERGE until
reactis a peer dependency. It will break things for people who use things like Relay/Redux/etc. that depend on React. (#5813 addresses this)