-
Notifications
You must be signed in to change notification settings - Fork 162
Post a notification when the global JS runtime vars finish initializing #761
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
Post a notification when the global JS runtime vars finish initializing #761
Conversation
* Update RCTCxxBridge.mm * add nullability checks
|
|
don't forget to bring it to main |
Yea want to verify all is good here first and then I'll merge it over to main |
…itializing (microsoft#761)" This reverts commit 202545e.
Please select one of the following
Summary
Downstream we load the JS bundles as platform specific packages. Doing this requires the JS runtime initialization to be completed. There's currently no notification or delegate call I've found that can easily transfer this information to our ReactNativeInstance. Essentially we need to be notified after the JS runtime has initialized but before the
executeSourceCodebegins as we have a requirement that part of our bundle loading uses the JS runtime.I've looked at when the notifications in
RCTBridge.hfire (e.g.RCTJavaScriptDidLoadNotification,RCTJavaScriptWillStartExecutingNotification, and a few others) and none of them fire at the time we need.Changelog
[iOS/macOS] [Task] - Fixes a race condition where the loadBundle thread that runs in a parallel to the JS runtime initialization thread tries to access global variables like
__fbbbatchedbbridgebefore they're set.Test Plan
I tested an analogous build downstream with
RCTJavaScriptDidLoadNotificationand everything seems to be able to get hooked up correctly, but the event comes at the wrong time and occasionally we still crash. Posting the notification when we do with this PR should remedy that.