-
Notifications
You must be signed in to change notification settings - Fork 24.2k
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
changes link file on Android to MainApplication.java for 0.29 update #8612
Conversation
By analyzing the blame information on this pull request, we identified @grabbou to be a potential reviewer. |
note, the methodology for checking the file is the latest method: http://stackoverflow.com/questions/4482686/check-synchronously-if-file-directory-exists-in-node-js |
cc @Kureev |
Hi @GantMan! Thanks for proposing this PR! I have a few small questions in order to process it faster :) |
Hi @Kureev! My guess use case where someone would care is this: "I created project X in RN 0.28 and I created project Y in 0.29". I should be able to still work on my 0.28 project and even use |
May be support old versions for few releases and then drop the support. |
Yeah, ideal would be 3 phases.
I'm happy to help with all 3 steps. |
@GantMan For your case with 0.28 & 0.29: if I understand correctly, app scaffolded by 0.28 will have a react-native@0.28 with current If 0.28 to 0.29 migration by using |
userConfig.mainApplicationPath || `src/main/java/${packageFolder}/MainApplication.java` | ||
); | ||
|
||
fs.accessSync(mainApplicationPath, fs.F_OK, function(err) { |
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.
There should be no callback (it's Sync):
try {
fs.accessSync(mainApplicationPath, fs.F_OK);
} catch (e) {
//...error
}
//...success
@Kureev is right. I forgot that the cli just forwards the commands to locally installed |
I will update accordingly, you'll see code soon :) |
@Kureev and @satya164 - Thanks for the feedback. I wasn't sure what the userConfig variable should be, but I figured consistency with the internal name would be best. We don't want users setting I did a quick test, and |
@GantMan Can you also update the commit title to reflect the actual change? |
@GantMan Yes, |
I don't think there is anything else. Seems you covered everything, @GantMan 😉 |
So, I'm going to check it on my local machine today and if everything is fine, I'm about to merge it |
Great work! I like it. Another thing is that we remove |
@facebook-github-bot shipit |
Thanks for importing. If you are an FB employee go to Phabricator to review. |
@satya164 into the 0.29 or 0.30 branch? |
@grabbou Both |
Ping me on Messagner later just in case |
Sorry, still waiting on review. If you need to patch locally, the fix is a one-liner, just change the filter call in
|
We missed one change here! Since we renamed |
Seems this is a real scope of the change: https://github.com/facebook/react-native/search?utf8=%E2%9C%93&q=mainActivityPath. Hopefully, it's just about find . -name '*.js' -type f -exec sed -i '' 's/mainActivityPath/mainFilePath/g' {} + |
see referenced PR for more info. |
Glad to know I wasn't insane. When are you guys going to finish fixing this? |
Summary: Attempt to fix #8612 We re-named `mainActivityPath` by `mainFilePath` in the `link` code, but we forgot to rename config parameters. Currently, link is broken. - [x] `react-native link` should work for react-native 0.29+ Closes #8807 Differential Revision: D3576176 fbshipit-source-id: 60ecbd660563923696bbef1ed3b0900a7d58469f
Summary: Attempt to fix #8612 We re-named `mainActivityPath` by `mainFilePath` in the `link` code, but we forgot to rename config parameters. Currently, link is broken. - [x] `react-native link` should work for react-native 0.29+ Closes #8807 Differential Revision: D3576176 fbshipit-source-id: 60ecbd660563923696bbef1ed3b0900a7d58469f
Summary: Attempt to fix #8612 We re-named `mainActivityPath` by `mainFilePath` in the `link` code, but we forgot to rename config parameters. Currently, link is broken. - [x] `react-native link` should work for react-native 0.29+ Closes #8807 Differential Revision: D3576176 fbshipit-source-id: 60ecbd660563923696bbef1ed3b0900a7d58469f
Summary: rnpm aka `react-native link` is broken with Android 0.29 - facebook#8603 This gets it back to working again by checking for new MyApplication.java file, and curtailing the path when needed. Closes facebook#8612 Differential Revision: D3533960 fbshipit-source-id: 95d799eaebb26ba1d876c88107ccd2af72427f55
Summary: Attempt to fix facebook#8612 We re-named `mainActivityPath` by `mainFilePath` in the `link` code, but we forgot to rename config parameters. Currently, link is broken. - [x] `react-native link` should work for react-native 0.29+ Closes facebook#8807 Differential Revision: D3576176 fbshipit-source-id: 60ecbd660563923696bbef1ed3b0900a7d58469f
Summary: rnpm aka `react-native link` is broken with Android 0.29 - facebook#8603 This gets it back to working again by checking for new MyApplication.java file, and curtailing the path when needed. Closes facebook#8612 Differential Revision: D3533960 fbshipit-source-id: 95d799eaebb26ba1d876c88107ccd2af72427f55
Summary: Attempt to fix facebook#8612 We re-named `mainActivityPath` by `mainFilePath` in the `link` code, but we forgot to rename config parameters. Currently, link is broken. - [x] `react-native link` should work for react-native 0.29+ Closes facebook#8807 Differential Revision: D3576176 fbshipit-source-id: 60ecbd660563923696bbef1ed3b0900a7d58469f
Summary: rnpm aka `react-native link` is broken with Android 0.29 - #8603 This gets it back to working again by checking for new MyApplication.java file, and curtailing the path when needed. Closes facebook/react-native#8612 Differential Revision: D3533960 fbshipit-source-id: 95d799eaebb26ba1d876c88107ccd2af72427f55
Summary: Attempt to fix facebook/react-native#8612 We re-named `mainActivityPath` by `mainFilePath` in the `link` code, but we forgot to rename config parameters. Currently, link is broken. - [x] `react-native link` should work for react-native 0.29+ Closes facebook/react-native#8807 Differential Revision: D3576176 fbshipit-source-id: 60ecbd660563923696bbef1ed3b0900a7d58469f
Summary: rnpm aka `react-native link` is broken with Android 0.29 - #8603 This gets it back to working again by checking for new MyApplication.java file, and curtailing the path when needed. Closes facebook/react-native#8612 Differential Revision: D3533960 fbshipit-source-id: 95d799eaebb26ba1d876c88107ccd2af72427f55
Summary: Attempt to fix facebook/react-native#8612 We re-named `mainActivityPath` by `mainFilePath` in the `link` code, but we forgot to rename config parameters. Currently, link is broken. - [x] `react-native link` should work for react-native 0.29+ Closes facebook/react-native#8807 Differential Revision: D3576176 fbshipit-source-id: 60ecbd660563923696bbef1ed3b0900a7d58469f
rnpm aka
react-native link
is broken with Android 0.29 - #8603This gets it back to working again by checking for new MyApplication.java file, and curtailing the path when needed.