mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-24 04:16:00 +08:00
New upgrading process, relying on Git
Summary:
The upgrading process based on Yeoman is a pain. For each file, Yeoman (or the brand new copyAndReplace solution a477aec) compares the newly generated content with the existing one and prompts the user if it differs, with very basic options: overwrite or skip.
I have digged into this problem and came with [rn-diff](https://github.com/ncuillery/rn-diff) (you may have read [this article](https://medium.com/ncuillery/easier-react-native-upgrades-with-rn-diff-5020b5c3de2d#.llvy2dym5)). This repository helps people to upgrade RN on their projects. An alternative upgrading process using `git apply` instead of Yeoman is described [here](https://github.com/ncuillery/rn-diff/blob/master/USAGE.md).
This PR is the integration of this process into the core. I got rid of the drawbacks mentioned in the link below in order to make it a clean, elegant, one-step operation.
This process is based on some Shell operations that:
- Generate the blank sources of both old and new versions
Closes https://github.com/facebook/react-native/pull/11110
Differential Revision: D4237107
Pulled By: mkonicek
fbshipit-source-id: 15e82e030b762415c925ccb2a62ddb354a6e18b9
This commit is contained in:
committed by
Facebook Github Bot
parent
f520bb9a66
commit
7d89b773a7
@@ -32,6 +32,16 @@ function validateAndUpgrade() {
|
||||
fs.readFileSync(path.resolve(projectDir, 'package.json'), 'utf8')
|
||||
);
|
||||
|
||||
warn(
|
||||
'You should consider using the new upgrade tool based on Git. It ' +
|
||||
'makes upgrades easier by resolving most conflicts automatically.\n' +
|
||||
'To use it:\n' +
|
||||
'- Go back to the old version of React Native\n' +
|
||||
'- Run "npm install -g react-native-git-upgrade"\n' +
|
||||
'- Run "react-native-git-upgrade"\n' +
|
||||
'See https://facebook.github.io/react-native/docs/upgrading.html'
|
||||
);
|
||||
|
||||
const projectName = packageJSON.name;
|
||||
if (!projectName) {
|
||||
warn(
|
||||
|
||||
Reference in New Issue
Block a user