Skip to content
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

add option in 'Dev Settings' for never use cached bundle file #4738

Closed
wants to merge 1 commit into from

Conversation

qbig
Copy link
Contributor

@qbig qbig commented Dec 12, 2015

fix #2676

@facebook-github-bot
Copy link
Contributor

By analyzing the blame information on this pull request, we identified @mkonicek, @astreet and @foghina to be potential reviewers.

@facebook-github-bot facebook-github-bot added GH Review: review-needed CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. labels Dec 12, 2015
<CheckBoxPreference
android:key="use_cached_bundle"
android:title="Use Cached Bundle"
android:summary="Use prefetched JS bundle stored in local file."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stored in local file

"stored locally"

The way it's stored might change, making this message out of date.

@mkonicek
Copy link
Contributor

I like this, it's really annoying we try to load the bundle; this always fails for OSS apps.

Could we specify this to be true by default for all OSS apps? For example, here: https://github.com/facebook/react-native/blob/master/local-cli/generator-android/templates/package/MainActivity.java#L24

That way people won't have to set this setting manually and fb apps will still have this set to false.

@mkonicek
Copy link
Contributor

Alternatively, can we never read from file if the packager is running? I would expect the check here to do that but apparently it doesn't: https://github.com/facebook/react-native/blob/master/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManagerImpl.java#L291

@qbig
Copy link
Contributor Author

qbig commented Dec 15, 2015

Hi @mkonicek . Sorry but may I ask what is "OSS apps" ?

@facebook-github-bot
Copy link
Contributor

@qbig updated the pull request.

@qbig
Copy link
Contributor Author

qbig commented Dec 15, 2015

@ide @mkonicek the current PR achieved 'never load from cache' by setting in "Dev Setting". But even after this setting, the redbox behaviour is still a bit inconsistent as mentioned here #4739.

The update would fix #4739 as well.

@qbig
Copy link
Contributor Author

qbig commented Dec 27, 2015

@skevy could you update the 'needs-revision' flag ?

@facebook-github-bot
Copy link
Contributor

@qbig updated the pull request.

@satya164
Copy link
Contributor

Looks like this has conflicts now

@facebook-github-bot
Copy link
Contributor

@qbig updated the pull request.

@qbig
Copy link
Contributor Author

qbig commented Dec 30, 2015

@satya164 resolved :)

@satya164
Copy link
Contributor

@qbig OSS -> Open Source Software

@facebook-github-bot
Copy link
Contributor

@qbig updated the pull request.

@astreet
Copy link
Contributor

astreet commented Jan 5, 2016

I think we want to get rid of the cached bundle completely instead (let's wait to make sure Krzysztof didn't add it for some reason I'm not thinking of though).

In that case, I'd ask that we update this PR to remove that logic instead of adding a checkbox.

@@ -289,7 +289,7 @@ public void onPackagerStatusFetched(final boolean packagerIsRunning) {
new Runnable() {
@Override
public void run() {
if (packagerIsRunning) {
if (packagerIsRunning || !mDevSupportManager.hasUpToDateJSBundleInCache()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this change? We check it above on L278

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@astreet I did this for #4739 so that, when the packager is not running and there is no update-to-date bundle, it would try to load a existent bundle and throw a confusing redbox message( the else part)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe I will just not touch it and fix the redbox message in a different PR

@facebook-github-bot
Copy link
Contributor

@qbig updated the pull request.

@qbig
Copy link
Contributor Author

qbig commented Jan 9, 2016

@astreet updated accordingly. Would love to hear your thought on #4739

@@ -72,7 +78,7 @@ public boolean isJSDevModeEnabled() {
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
if (PREFS_FPS_DEBUG_KEY.equals(key) ||
PREFS_RELOAD_ON_JS_CHANGE_KEY.equals(key) ||
PREFS_JS_DEV_MODE_DEBUG_KEY.equals(key)) {
PREFS_JS_DEV_MODE_DEBUG_KEY.equals(key) || PREFS_USE_CACHED_BUNDLE.equals(key)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: can you move this to a new line like all the other checks?

@astreet
Copy link
Contributor

astreet commented Jan 11, 2016

Seems reasonable, see nit inline and I'll merge

@facebook-github-bot
Copy link
Contributor

@qbig updated the pull request.

@qbig
Copy link
Contributor Author

qbig commented Jan 12, 2016

@astreet fixed

@astreet
Copy link
Contributor

astreet commented Jan 12, 2016

Thank you!

@astreet
Copy link
Contributor

astreet commented Jan 12, 2016

@facebook-github-bot shipit

@facebook-github-bot
Copy link
Contributor

Thanks for importing. If you are an FB employee go to https://our.intern.facebook.com/intern/opensource/github/pull_request/492049884308119/int_phab to review.

@qbig
Copy link
Contributor Author

qbig commented Jan 18, 2016

@astreet Anything I could improve here ?

@mkonicek
Copy link
Contributor

There's a compilation error, scroll down in the CircleCI results:
https://circleci.com/gh/facebook/react-native/1287

@astreet
Copy link
Contributor

astreet commented Jan 19, 2016

Yay automated testing! Thanks Martin :)

@mkonicek
Copy link
Contributor

🏆

@mkonicek
Copy link
Contributor

@qbig Can you rebase please and resolve any failing tests?

@ghost
Copy link

ghost commented Mar 25, 2016

@qbig do you have any updates for this pull request? It's been a while so we wanted to check in and see if you've looked at the requested changes.

@mkonicek
Copy link
Contributor

Let's close this since there hasn't been a response from the author. If you want to continue working on this please send a new pull request based on top of master.

@mkonicek mkonicek closed this Apr 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Workflow][Android] Provide an option to never load JS from cache
6 participants