-
Notifications
You must be signed in to change notification settings - Fork 1.6k
When main.jsbundle newer than app.jsbundle time, load main.jsbundle #38
Conversation
Hi @qingfeng, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution! TTYL, MSBOT; |
@msftclas done |
We had actually planned to implement this behavior for the 1.1 update, but I forgot :/ the Cordova plugin already does this, so it would be great to get parity for React. Did you want to review this PR for merge? |
CodePush.m
Outdated
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.
This looks great. If you do want to merge this, I would make a couple of tweaks:
- Name the variables
packageFileAttributes
andpackageDate
instead ofappFileAttribs
andappDate
.binaryFileAttributes
andbinaryDate
probably also sound more obvious that we are refering to the file in the app store binary instead ofmainFileAttribs
andmainDate
. - Rename
jsCodeLocation
tobinaryJsBundleUrl
- Replace lines 44-53 with a simple if-else statement, that way we save a few lines and make the code look cleaner.
if ([binaryDate compare:packageDate] == NSOrderedAscending) {
// Return package file because it is newer than the app store binary's JS bundle
return [[NSURL alloc] initFileURLWithPath:packageFile];
} else {
return binaryJsBundleUrl;
}
@lostintangent @geof90 I want to know my idea is reasonable? |
@qingfeng yes it is :) |
@geof90 @lostintangent I changed over, please review, thanks |
This change looks good to me. @qingfeng could you check that you completed the entire workflow for the CLA? It should have added a new tag to this PR when you finished it. Thanks! |
@qingfeng, Thanks for signing the contribution license agreement so quickly! Actual humans will now validate the agreement and then evaluate the PR. |
|
I just tested this and it works perfectly. Nice work @qingfeng! I'll merge this as soon as @geof90 signs off, and we can include this in the next release. I'll probably release a new version to NPM on Monday, since this is an important fix, and my other PR resolves a regression, so I'd like to get them out their quickly. |
LGTM |
When main.jsbundle newer than app.jsbundle time, load main.jsbundle
🍻 |
Hey @qingfeng, would you be interested in doing a Skype call to discuss what you're up to? You've been so helpful so far and I'd love to understand what cool stuff you're doing :) |
http://facebook.github.io/react-native/showcase.html This is our company developed APP,Can you use email? ~ Skype, I may not be very convenient :) |
Please do not merge, this is a question I found, send pullrequest facilitate discussions
E.g:
user install 0.9.5,For example, using the react-native-keyboard event
user upgrade to 0.9.6,but, Still default read app.jsbundle, on a crash
So, I changed main.jsbundle update if the machine, the priority is read main.jsbundle