-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Conversation
<CheckBoxPreference | ||
android:key="use_cached_bundle" | ||
android:title="Use Cached Bundle" | ||
android:summary="Use prefetched JS bundle stored in local file." |
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.
stored in local file
"stored locally"
The way it's stored might change, making this message out of date.
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 That way people won't have to set this setting manually and fb apps will still have this set to false. |
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 |
Hi @mkonicek . Sorry but may I ask what is "OSS apps" ? |
beaa9f4
to
310dcbf
Compare
@qbig updated the pull request. |
@skevy could you update the 'needs-revision' flag ? |
@qbig updated the pull request. |
Looks like this has conflicts now |
f6b8fa0
to
d6a4159
Compare
@qbig updated the pull request. |
@satya164 resolved :) |
@qbig OSS -> Open Source Software |
@qbig updated the pull request. |
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()) { |
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.
Why this change? We check it above on L278
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 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.
maybe I will just not touch it and fix the redbox message in a different PR
@qbig updated the pull request. |
@@ -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)) { |
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.
nit: can you move this to a new line like all the other checks?
Seems reasonable, see nit inline and I'll merge |
@qbig updated the pull request. |
@astreet fixed |
Thank you! |
@facebook-github-bot shipit |
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. |
@astreet Anything I could improve here ? |
There's a compilation error, scroll down in the CircleCI results: |
Yay automated testing! Thanks Martin :) |
🏆 |
@qbig Can you rebase please and resolve any failing tests? |
@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. |
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. |
fix #2676