-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[ios][android] Make redbox and rr (android) and cmd+r (ios) reload manifest and JS rather than just JS #6134
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
Conversation
e3bc833
to
8bc468d
Compare
ed9e723
to
7a5d2fc
Compare
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.
Android side of this looks fine to me (so much reflection 😶 ). Would be good to update this in react-native-lab as well -- unlike with iOS, the ReactAndroid
folder is copied rather than symlinked so this change wouldn't be persisted next SDK version. But we should definitely just make our own dev menu in the future so we don't have to modify the RN internals as much.
@@ -741,6 +741,26 @@ public void onEventFailure(String errorMessage) { | |||
killOrphanedLauncherActivities(); | |||
} | |||
|
|||
public static void reloadVisibleExperience(final int activityId) { |
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.
it looks like this needs a @DoNotStrip, and maybe the method below does not (since it's called from this one)
} | ||
|
||
@DoNotStrip | ||
public static String getManifestUrlForActivityId(final int activityId) { |
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.
is this ever called?
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.
it's not. i originally planned on using it but didn't, i thought i'd leave it in as someone might want it in the future but on second thought i'll just remove it
@DoNotStrip | ||
public static void reloadFromManifest(final int activityId) { | ||
try { | ||
Class.forName("host.exp.exponent.kernel.Kernel") |
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.
i'm confused about why the methods in this class are all using reflection to call static methods on Kernel (which is in the same package...) rather than just calling the methods directly. but maybe best to just leave it alone at this point 🤷♂
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.
yeah i'm not sure either but i just did what other things in here were doing
maybe we can chat briefly about the process here tmrw - i went to update everything in react-native-lab and found that there was already a large diff before my changes, eg: DevSuportManagerImpl.java on master of expo/expo and on react-native-lab are very different. |
…side of developer mode
7a5d2fc
to
581c966
Compare
++ to consistent refresh behavior. Are there any docs or old but popular forum posts about the refresh behavior we need to update? (If there are none, I don't think we need to write any, since this new behavior is closer to how things should be, subjectively speaking.) |
i don't believe that there are any, but the 'development mode' docs will need to be updated for the changes to the dev menu cc @cruzach who is already aware of this |
…po and :tools:execute Squashed three commits: - d8f3fbe - ae5e396 - 2217620 The first one introduced breaking changes for bare workflow in our React Native fork, the second one fixed them by integrating with ReactAndroidCodeTransformer used when we import the code into Expo Client, the third one added usage for `reloadExpoApp` to debugger UI. Co-Authored-By: brentvatne <brentvatne@gmail.com> Co-Authored-By: esamelson <eric@expo.io> Co-Authored-By: Kudo Chien <kudo@expo.dev>
…po and :tools:execute Squashed three commits: - d8f3fbe - ae5e396 - 2217620 The first one introduced breaking changes for bare workflow in our React Native fork, the second one fixed them by integrating with ReactAndroidCodeTransformer used when we import the code into Expo Client, the third one added usage for `reloadExpoApp` to debugger UI. Co-Authored-By: brentvatne <brentvatne@gmail.com> Co-Authored-By: esamelson <eric@expo.io> Co-Authored-By: Kudo Chien <kudo@expo.dev>
…po and :tools:execute Squashed three commits: - d8f3fbe - ae5e396 - 2217620 The first one introduced breaking changes for bare workflow in our React Native fork, the second one fixed them by integrating with ReactAndroidCodeTransformer used when we import the code into Expo Client, the third one added usage for `reloadExpoApp` to debugger UI. Co-Authored-By: brentvatne <brentvatne@gmail.com> Co-Authored-By: esamelson <eric@expo.io> Co-Authored-By: Kudo Chien <kudo@expo.dev>
…po and :tools:execute Squashed three commits: - d8f3fbe - ae5e396 - 2217620 The first one introduced breaking changes for bare workflow in our React Native fork, the second one fixed them by integrating with ReactAndroidCodeTransformer used when we import the code into Expo Client, the third one added usage for `reloadExpoApp` to debugger UI. Co-Authored-By: brentvatne <brentvatne@gmail.com> Co-Authored-By: esamelson <eric@expo.io> Co-Authored-By: Kudo Chien <kudo@expo.dev>
…po and :tools:execute Squashed three commits: - d8f3fbe - ae5e396 - 2217620 The first one introduced breaking changes for bare workflow in our React Native fork, the second one fixed them by integrating with ReactAndroidCodeTransformer used when we import the code into Expo Client, the third one added usage for `reloadExpoApp` to debugger UI. Co-Authored-By: brentvatne <brentvatne@gmail.com> Co-Authored-By: esamelson <eric@expo.io> Co-Authored-By: Kudo Chien <kudo@expo.dev>
…po and :tools:execute Squashed three commits: - d8f3fbe - ae5e396 - 2217620 The first one introduced breaking changes for bare workflow in our React Native fork, the second one fixed them by integrating with ReactAndroidCodeTransformer used when we import the code into Expo Client, the third one added usage for `reloadExpoApp` to debugger UI. Co-Authored-By: brentvatne <brentvatne@gmail.com> Co-Authored-By: esamelson <eric@expo.io> Co-Authored-By: Kudo Chien <kudo@expo.dev>
…po and :tools:execute Squashed three commits: - d8f3fbe - ae5e396 - 2217620 The first one introduced breaking changes for bare workflow in our React Native fork, the second one fixed them by integrating with ReactAndroidCodeTransformer used when we import the code into Expo Client, the third one added usage for `reloadExpoApp` to debugger UI. Co-Authored-By: brentvatne <brentvatne@gmail.com> Co-Authored-By: esamelson <eric@expo.io> Co-Authored-By: Kudo Chien <kudo@expo.dev>
…po and :tools:execute Squashed three commits: - d8f3fbe - ae5e396 - 2217620 The first one introduced breaking changes for bare workflow in our React Native fork, the second one fixed them by integrating with ReactAndroidCodeTransformer used when we import the code into Expo Client, the third one added usage for `reloadExpoApp` to debugger UI. Co-Authored-By: brentvatne <brentvatne@gmail.com> Co-Authored-By: esamelson <eric@expo.io> Co-Authored-By: Kudo Chien <kudo@expo.dev>
…po and :tools:execute Squashed three commits: - d8f3fbe - ae5e396 - 2217620 The first one introduced breaking changes for bare workflow in our React Native fork, the second one fixed them by integrating with ReactAndroidCodeTransformer used when we import the code into Expo Client, the third one added usage for `reloadExpoApp` to debugger UI. Co-Authored-By: brentvatne <brentvatne@gmail.com> Co-Authored-By: esamelson <eric@expo.io> Co-Authored-By: Kudo Chien <kudo@expo.dev>
…po and :tools:execute Squashed three commits: - d8f3fbe - ae5e396 - 2217620 The first one introduced breaking changes for bare workflow in our React Native fork, the second one fixed them by integrating with ReactAndroidCodeTransformer used when we import the code into Expo Client, the third one added usage for `reloadExpoApp` to debugger UI. Co-Authored-By: brentvatne <brentvatne@gmail.com> Co-Authored-By: esamelson <eric@expo.io> Co-Authored-By: Kudo Chien <kudo@expo.dev>
…po and :tools:execute Squashed three commits: - d8f3fbe - ae5e396 - 2217620 The first one introduced breaking changes for bare workflow in our React Native fork, the second one fixed them by integrating with ReactAndroidCodeTransformer used when we import the code into Expo Client, the third one added usage for `reloadExpoApp` to debugger UI. Co-Authored-By: brentvatne <brentvatne@gmail.com> Co-Authored-By: esamelson <eric@expo.io> Co-Authored-By: Kudo Chien <kudo@expo.dev>
…po and :tools:execute Squashed three commits: - d8f3fbe - ae5e396 - 2217620 The first one introduced breaking changes for bare workflow in our React Native fork, the second one fixed them by integrating with ReactAndroidCodeTransformer used when we import the code into Expo Client, the third one added usage for `reloadExpoApp` to debugger UI. Co-Authored-By: brentvatne <brentvatne@gmail.com> Co-Authored-By: esamelson <eric@expo.io> Co-Authored-By: Kudo Chien <kudo@expo.dev>
…po and :tools:execute Squashed three commits: - d8f3fbe - ae5e396 - 2217620 The first one introduced breaking changes for bare workflow in our React Native fork, the second one fixed them by integrating with ReactAndroidCodeTransformer used when we import the code into Expo Client, the third one added usage for `reloadExpoApp` to debugger UI. Co-Authored-By: brentvatne <brentvatne@gmail.com> Co-Authored-By: esamelson <eric@expo.io> Co-Authored-By: Kudo Chien <kudo@expo.dev>
…po and :tools:execute Squashed three commits: - d8f3fbe - ae5e396 - 2217620 The first one introduced breaking changes for bare workflow in our React Native fork, the second one fixed them by integrating with ReactAndroidCodeTransformer used when we import the code into Expo Client, the third one added usage for `reloadExpoApp` to debugger UI. Co-Authored-By: brentvatne <brentvatne@gmail.com> Co-Authored-By: esamelson <eric@expo.io> Co-Authored-By: Kudo Chien <kudo@expo.dev>
…po and :tools:execute Squashed three commits: - d8f3fbe - ae5e396 - 2217620 The first one introduced breaking changes for bare workflow in our React Native fork, the second one fixed them by integrating with ReactAndroidCodeTransformer used when we import the code into Expo Client, the third one added usage for `reloadExpoApp` to debugger UI. Co-Authored-By: brentvatne <brentvatne@gmail.com> Co-Authored-By: esamelson <eric@expo.io> Co-Authored-By: Kudo Chien <kudo@expo.dev>
…po and :tools:execute Squashed three commits: - d8f3fbe - ae5e396 - 2217620 The first one introduced breaking changes for bare workflow in our React Native fork, the second one fixed them by integrating with ReactAndroidCodeTransformer used when we import the code into Expo Client, the third one added usage for `reloadExpoApp` to debugger UI. Co-Authored-By: brentvatne <brentvatne@gmail.com> Co-Authored-By: esamelson <eric@expo.io> Co-Authored-By: Kudo Chien <kudo@expo.dev>
…po and :tools:execute Squashed three commits: - d8f3fbe - ae5e396 - 2217620 The first one introduced breaking changes for bare workflow in our React Native fork, the second one fixed them by integrating with ReactAndroidCodeTransformer used when we import the code into Expo Client, the third one added usage for `reloadExpoApp` to debugger UI. Co-Authored-By: brentvatne <brentvatne@gmail.com> Co-Authored-By: esamelson <eric@expo.io> Co-Authored-By: Kudo Chien <kudo@expo.dev>
…po and :tools:execute Squashed three commits: - d8f3fbe - ae5e396 - 2217620 The first one introduced breaking changes for bare workflow in our React Native fork, the second one fixed them by integrating with ReactAndroidCodeTransformer used when we import the code into Expo Client, the third one added usage for `reloadExpoApp` to debugger UI. Co-Authored-By: brentvatne <brentvatne@gmail.com> Co-Authored-By: esamelson <eric@expo.io> Co-Authored-By: Kudo Chien <kudo@expo.dev>
…po and :tools:execute Squashed three commits: - d8f3fbe - ae5e396 - 2217620 The first one introduced breaking changes for bare workflow in our React Native fork, the second one fixed them by integrating with ReactAndroidCodeTransformer used when we import the code into Expo Client, the third one added usage for `reloadExpoApp` to debugger UI. Co-Authored-By: brentvatne <brentvatne@gmail.com> Co-Authored-By: esamelson <eric@expo.io> Co-Authored-By: Kudo Chien <kudo@expo.dev>
…po and :tools:execute Squashed three commits: - d8f3fbe - ae5e396 - 2217620 The first one introduced breaking changes for bare workflow in our React Native fork, the second one fixed them by integrating with ReactAndroidCodeTransformer used when we import the code into Expo Client, the third one added usage for `reloadExpoApp` to debugger UI. Co-Authored-By: brentvatne <brentvatne@gmail.com> Co-Authored-By: esamelson <eric@expo.io> Co-Authored-By: Kudo Chien <kudo@expo.dev>
…po and :tools:execute Squashed three commits: - d8f3fbe - ae5e396 - 2217620 The first one introduced breaking changes for bare workflow in our React Native fork, the second one fixed them by integrating with ReactAndroidCodeTransformer used when we import the code into Expo Client, the third one added usage for `reloadExpoApp` to debugger UI. Co-Authored-By: brentvatne <brentvatne@gmail.com> Co-Authored-By: esamelson <eric@expo.io> Co-Authored-By: Kudo Chien <kudo@expo.dev>
…po and :tools:execute Squashed three commits: - d8f3fbe - ae5e396 - 2217620 The first one introduced breaking changes for bare workflow in our React Native fork, the second one fixed them by integrating with ReactAndroidCodeTransformer used when we import the code into Expo Client, the third one added usage for `reloadExpoApp` to debugger UI. Co-Authored-By: brentvatne <brentvatne@gmail.com> Co-Authored-By: esamelson <eric@expo.io> Co-Authored-By: Kudo Chien <kudo@expo.dev>
…po and :tools:execute Squashed three commits: - d8f3fbe - ae5e396 - 2217620 The first one introduced breaking changes for bare workflow in our React Native fork, the second one fixed them by integrating with ReactAndroidCodeTransformer used when we import the code into Expo Client, the third one added usage for `reloadExpoApp` to debugger UI. Co-Authored-By: brentvatne <brentvatne@gmail.com> Co-Authored-By: esamelson <eric@expo.io> Co-Authored-By: Kudo Chien <kudo@expo.dev>
…po and :tools:execute Squashed three commits: - d8f3fbe - ae5e396 - 2217620 The first one introduced breaking changes for bare workflow in our React Native fork, the second one fixed them by integrating with ReactAndroidCodeTransformer used when we import the code into Expo Client, the third one added usage for `reloadExpoApp` to debugger UI. Co-Authored-By: brentvatne <brentvatne@gmail.com> Co-Authored-By: esamelson <eric@expo.io> Co-Authored-By: Kudo Chien <kudo@expo.dev>
…po and :tools:execute Squashed three commits: - d8f3fbe - ae5e396 - 2217620 The first one introduced breaking changes for bare workflow in our React Native fork, the second one fixed them by integrating with ReactAndroidCodeTransformer used when we import the code into Expo Client, the third one added usage for `reloadExpoApp` to debugger UI. Co-Authored-By: brentvatne <brentvatne@gmail.com> Co-Authored-By: esamelson <eric@expo.io> Co-Authored-By: Kudo Chien <kudo@expo.dev>
…po and :tools:execute Squashed three commits: - d8f3fbe - ae5e396 - 2217620 The first one introduced breaking changes for bare workflow in our React Native fork, the second one fixed them by integrating with ReactAndroidCodeTransformer used when we import the code into Expo Client, the third one added usage for `reloadExpoApp` to debugger UI. Co-Authored-By: brentvatne <brentvatne@gmail.com> Co-Authored-By: esamelson <eric@expo.io> Co-Authored-By: Kudo Chien <kudo@expo.dev>
…po and :tools:execute Squashed three commits: - d8f3fbe - ae5e396 - 2217620 The first one introduced breaking changes for bare workflow in our React Native fork, the second one fixed them by integrating with ReactAndroidCodeTransformer used when we import the code into Expo Client, the third one added usage for `reloadExpoApp` to debugger UI. Co-Authored-By: brentvatne <brentvatne@gmail.com> Co-Authored-By: esamelson <eric@expo.io> Co-Authored-By: Kudo Chien <kudo@expo.dev>
…po and :tools:execute Squashed three commits: - d8f3fbe - ae5e396 - 2217620 The first one introduced breaking changes for bare workflow in our React Native fork, the second one fixed them by integrating with ReactAndroidCodeTransformer used when we import the code into Expo Client, the third one added usage for `reloadExpoApp` to debugger UI. Co-Authored-By: brentvatne <brentvatne@gmail.com> Co-Authored-By: esamelson <eric@expo.io> Co-Authored-By: Kudo Chien <kudo@expo.dev>
…po and :tools:execute Squashed three commits: - d8f3fbe - ae5e396 - 2217620 The first one introduced breaking changes for bare workflow in our React Native fork, the second one fixed them by integrating with ReactAndroidCodeTransformer used when we import the code into Expo Client, the third one added usage for `reloadExpoApp` to debugger UI. Co-Authored-By: brentvatne <brentvatne@gmail.com> Co-Authored-By: esamelson <eric@expo.io> Co-Authored-By: Kudo Chien <kudo@expo.dev>
…po and :tools:execute Squashed three commits: - d8f3fbe - ae5e396 - 2217620 The first one introduced breaking changes for bare workflow in our React Native fork, the second one fixed them by integrating with ReactAndroidCodeTransformer used when we import the code into Expo Client, the third one added usage for `reloadExpoApp` to debugger UI. Co-Authored-By: brentvatne <brentvatne@gmail.com> Co-Authored-By: esamelson <eric@expo.io> Co-Authored-By: Kudo Chien <kudo@expo.dev>
Why
It is confusing when you reload your app and the properties you changed in the manifest are not applied.
Now that we are getting rid of "Reload JS" and making of the distinction between "Reload Manifest and JS" and just "Reload" in the developer menu on iOS (#6110), I want to also get rid of the "Reload JS" behavior when you hit the reload hotkeys in the simulator/emulator.
More context on reloading changes in this public doc: https://www.notion.so/expo/Reloading-behavior-4be3c92671744110b93d3190c85d13f4
How
refreshVisibleApp
on browser control rather thanreloadBridge
on app manager when hotkey is pressed. override reload block in redbox.reloadExpoApp
inDevSupportManagerImpl
(andDevSupportManager
) which callsreloadFromManifest
with activity id onReactNativeStaticHelpers,
, which uses reflection to callreloadVisibleExperience
on the kernel. Update locations where we reload whenDoubleTapReloadRecognizer
is used to callreloadExpoApp
instead ofreloadJS
on theDevSupportManager
implementation, and make the reload button in redbox do the same.Test Plan
Use these hotkeys in simulator/emulator, try red box.
Implementation Notes
I'm not crazy about the Android implementation here. In the future it would be nice to:
Concerns