-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Passing an instance of "ReactPage" should not be required (Windows) #943
Comments
@pre10der89 thanks for filing this, but I think we need to provide a reasonable alternative to grab the ReactInstanceManager from. We'll probably need an abstraction like |
@rozele I agree 100%. I believe that the need for ReactApplication/ReactNativeHost is evident and hopefully, we can work on getting that implemented and getting the code push module updated. I believe there is also another short-coming with the code-push "reload" bundle requirement that could require steps beyond the ReactApplication implementation. |
Hi @pre10der89, could you please confirm if your enhancement request has been implemented here #1051 ? |
@pre10der89, @rozele - hey guys, could you please take a look at this and let us know if the issue is still actual with the latest release of RN Windows 0.50+ or not? |
Hey guys, I believe we can close the issue as https://github.com/Microsoft/react-native-code-push/releases/tag/v5.2.0-beta has been released with #1051. Please let us know if any concerns. |
Description
This issue is strictly related to the Windows implementation (UWP and Net46)
The CodePushReactPackage and CodePushNativeModule require access to an instance of Type "ReactPage" The instance is used to check the "UseDeveloperSupport" flag and to obtain a reference to the IReactInstanceManager, which is used to force a reload of the bundle.
According to @rozele the "ReactPage" was only meant to be a template for jump-starting application development on ReactNativeWindows. It was always intended that a developer be able to write their own ReactNativeWindow bootstrapping implementation to replace "ReactPage".
While, it is possible to write a custom "ReactPage" implementation, it is not possible to do so and use react-native-code-push because of the requirement to pass in type "ReactPage"
Additional Information
The ReactPage is used by the CodePushNativeModule to obtain a reference to internal objects of ReactPage that allow for a Bundle reload... This is done by using NonPublic reflection is to obtain the reference to IReactInstanceManager inside ReactPage, which is then cast to type "ReactInstanceManager", which is then used to get access to the NonPublic field _jsBundleFile for the purposes of replacing the bundle value. The use of NonPublic reflection and the assumption of the concrete type behind IReactInstanceManager is fragile and assumes knowledge of the ReactNativeWindows code.
The text was updated successfully, but these errors were encountered: