fix ReactActivity.getReactDelegate().reload()#44223
Closed
Kudo wants to merge 1 commit intofacebook:mainfrom
Closed
fix ReactActivity.getReactDelegate().reload()#44223Kudo wants to merge 1 commit intofacebook:mainfrom
Kudo wants to merge 1 commit intofacebook:mainfrom
Conversation
3 tasks
Base commit: 849da21 |
javache
reviewed
Apr 23, 2024
packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactDelegate.java
Show resolved
Hide resolved
arushikesarwani94
added a commit
to arushikesarwani94/react-native
that referenced
this pull request
Apr 23, 2024
Summary: In facebook#44223 kudo identified the incorrect return type. Differential Revision: D56497700
arushikesarwani94
added a commit
to arushikesarwani94/react-native
that referenced
this pull request
Apr 23, 2024
…ebook#44227) Summary: In facebook#44223 kudo identified the incorrect return type. Differential Revision: D56497700
packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactDelegate.java
Show resolved
Hide resolved
Contributor
Author
|
rebase main since #44227 was landed |
Contributor
|
@arushikesarwani94 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
|
This pull request was successfully merged by @Kudo in 5399223. When will my fix make it into a release? | How to file a pick request? |
Contributor
|
@arushikesarwani94 merged this pull request in 5399223. |
cipolleschi
pushed a commit
that referenced
this pull request
May 2, 2024
Summary: fixing some problem for `ReactActivity.getReactDelegate().reload()` from #43521: - the `reload()` does not work for bridge mode on release build [ANDROID] [FIXED] - Fixed app reloading for `ReactActivity.getReactDelegate().reload()`. Pull Request resolved: #44223 Test Plan: tried to temporary change toast.show as reload and test from rn-tester ```diff --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/toast/ToastModule.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/toast/ToastModule.kt @@ -10,6 +10,7 @@ package com.facebook.react.modules.toast import android.view.Gravity import android.widget.Toast import com.facebook.fbreact.specs.NativeToastAndroidSpec +import com.facebook.react.ReactActivity import com.facebook.react.bridge.NativeModule import com.facebook.react.bridge.ReactApplicationContext import com.facebook.react.bridge.UiThreadUtil @@ -30,9 +31,11 @@ public class ToastModule(reactContext: ReactApplicationContext) : ) override public fun show(message: String?, durationDouble: Double) { - val duration = durationDouble.toInt() - UiThreadUtil.runOnUiThread( - Runnable { Toast.makeText(getReactApplicationContext(), message, duration).show() }) +// val duration = durationDouble.toInt() +// UiThreadUtil.runOnUiThread( +// Runnable { Toast.makeText(getReactApplicationContext(), message, duration).show() }) + val activity = reactApplicationContext.currentActivity as? ReactActivity + activity?.reactDelegate?.reload() } override public fun showWithGravity( ``` tried for different mode - [x] bridge mode + debug build - [x] bridgeless mode + debug build - [x] bridge mode + release build - [x] bridgeless mode + release build Reviewed By: fkgozali Differential Revision: D56795975 Pulled By: arushikesarwani94 fbshipit-source-id: 895eab1927ba6db748ebb32c0fd5313f19cf9d1b
kosmydel
pushed a commit
to kosmydel/react-native
that referenced
this pull request
May 6, 2024
…ebook#44227) Summary: Pull Request resolved: facebook#44227 In facebook#44223 kudo identified the incorrect return type. Reviewed By: christophpurrer, philIip Differential Revision: D56497700 fbshipit-source-id: 5d7fc7ef21c3d3033a2567eba51b613eb41f0a1a
kosmydel
pushed a commit
to kosmydel/react-native
that referenced
this pull request
May 6, 2024
Summary: fixing some problem for `ReactActivity.getReactDelegate().reload()` from facebook#43521: - the `reload()` does not work for bridge mode on release build ## Changelog: [ANDROID] [FIXED] - Fixed app reloading for `ReactActivity.getReactDelegate().reload()`. Pull Request resolved: facebook#44223 Test Plan: tried to temporary change toast.show as reload and test from rn-tester ```diff --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/toast/ToastModule.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/toast/ToastModule.kt @@ -10,6 +10,7 @@ package com.facebook.react.modules.toast import android.view.Gravity import android.widget.Toast import com.facebook.fbreact.specs.NativeToastAndroidSpec +import com.facebook.react.ReactActivity import com.facebook.react.bridge.NativeModule import com.facebook.react.bridge.ReactApplicationContext import com.facebook.react.bridge.UiThreadUtil @@ -30,9 +31,11 @@ public class ToastModule(reactContext: ReactApplicationContext) : ) override public fun show(message: String?, durationDouble: Double) { - val duration = durationDouble.toInt() - UiThreadUtil.runOnUiThread( - Runnable { Toast.makeText(getReactApplicationContext(), message, duration).show() }) +// val duration = durationDouble.toInt() +// UiThreadUtil.runOnUiThread( +// Runnable { Toast.makeText(getReactApplicationContext(), message, duration).show() }) + val activity = reactApplicationContext.currentActivity as? ReactActivity + activity?.reactDelegate?.reload() } override public fun showWithGravity( ``` tried for different mode - [x] bridge mode + debug build - [x] bridgeless mode + debug build - [x] bridge mode + release build - [x] bridgeless mode + release build Reviewed By: fkgozali Differential Revision: D56795975 Pulled By: arushikesarwani94 fbshipit-source-id: 895eab1927ba6db748ebb32c0fd5313f19cf9d1b
kosmydel
pushed a commit
to kosmydel/react-native
that referenced
this pull request
Jun 11, 2024
…ebook#44227) Summary: Pull Request resolved: facebook#44227 In facebook#44223 kudo identified the incorrect return type. Reviewed By: christophpurrer, philIip Differential Revision: D56497700 fbshipit-source-id: 5d7fc7ef21c3d3033a2567eba51b613eb41f0a1a
kosmydel
pushed a commit
to kosmydel/react-native
that referenced
this pull request
Jun 11, 2024
Summary: fixing some problem for `ReactActivity.getReactDelegate().reload()` from facebook#43521: - the `reload()` does not work for bridge mode on release build ## Changelog: [ANDROID] [FIXED] - Fixed app reloading for `ReactActivity.getReactDelegate().reload()`. Pull Request resolved: facebook#44223 Test Plan: tried to temporary change toast.show as reload and test from rn-tester ```diff --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/toast/ToastModule.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/toast/ToastModule.kt @@ -10,6 +10,7 @@ package com.facebook.react.modules.toast import android.view.Gravity import android.widget.Toast import com.facebook.fbreact.specs.NativeToastAndroidSpec +import com.facebook.react.ReactActivity import com.facebook.react.bridge.NativeModule import com.facebook.react.bridge.ReactApplicationContext import com.facebook.react.bridge.UiThreadUtil @@ -30,9 +31,11 @@ public class ToastModule(reactContext: ReactApplicationContext) : ) override public fun show(message: String?, durationDouble: Double) { - val duration = durationDouble.toInt() - UiThreadUtil.runOnUiThread( - Runnable { Toast.makeText(getReactApplicationContext(), message, duration).show() }) +// val duration = durationDouble.toInt() +// UiThreadUtil.runOnUiThread( +// Runnable { Toast.makeText(getReactApplicationContext(), message, duration).show() }) + val activity = reactApplicationContext.currentActivity as? ReactActivity + activity?.reactDelegate?.reload() } override public fun showWithGravity( ``` tried for different mode - [x] bridge mode + debug build - [x] bridgeless mode + debug build - [x] bridge mode + release build - [x] bridgeless mode + release build Reviewed By: fkgozali Differential Revision: D56795975 Pulled By: arushikesarwani94 fbshipit-source-id: 895eab1927ba6db748ebb32c0fd5313f19cf9d1b
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
fixing some problem for
ReactActivity.getReactDelegate().reload()from #43521:reload()does not work for bridge mode on release buildChangelog:
[ANDROID] [FIXED] - Fixed app reloading for
ReactActivity.getReactDelegate().reload().Test Plan:
tried to temporary change toast.show as reload and test from rn-tester
tried for different mode