Repository navigation
Post the bundle URL before a bridgeless bundle runs - #59838
Open
briantkelley wants to merge 1 commit into
Open
briantkelley wants to merge 1 commit into
briantkelley wants to merge 1 commit into
Conversation
Summary: Observers cannot tell which JavaScript is about to run in bridgeless mode on iOS: `RCTJavaScriptDidLoadNotification` arrives on the main queue only after a bundle finishes evaluating and names it only through the bridge's current bundle URL, so a bundle that throws goes unseen, a reload in between is attributed to the new URL, and segments are never announced. `RCTInstance` now posts `RCTJavaScriptWillStartExecutingNotification` synchronously right before a bundle runs (on the JS thread) and before a segment is registered (on the registering thread), with `bridge` and the bundle or segment file `url` in `userInfo`, and adds `url` to `RCTJavaScriptDidLoadNotification`. `RCTConstants.h` states when each notification is posted, on which thread and with which keys, and that will-execute observers must not use UIKit or wait on the main thread; existing will-execute observers now receive it in bridgeless mode. Only the iOS runtime changes: the macOS copy of `RCTInstance` still posts did-load alone. Changelog: [iOS][Added] - Post `RCTJavaScriptWillStartExecutingNotification` with the bundle or segment `url` before JavaScript runs in bridgeless mode, and add `url` to `RCTJavaScriptDidLoadNotification` Differential Revision: D128478252
|
@briantkelley has exported this pull request. If you are a Meta employee, you can view the originating Diff in D128478252. |
This branch has not been deployed
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:
Observers cannot tell which JavaScript is about to run in bridgeless mode on iOS:
RCTJavaScriptDidLoadNotificationarrives on the main queue only after a bundle finishes evaluating and names it only through the bridge's current bundle URL, so a bundle that throws goes unseen, a reload in between is attributed to the new URL, and segments are never announced.RCTInstancenow postsRCTJavaScriptWillStartExecutingNotificationsynchronously right before a bundle runs (on the JS thread) and before a segment is registered (on the registering thread), withbridgeand the bundle or segment fileurlinuserInfo, and addsurltoRCTJavaScriptDidLoadNotification.RCTConstants.hstates when each notification is posted, on which thread and with which keys, and that will-execute observers must not use UIKit or wait on the main thread; existing will-execute observers now receive it in bridgeless mode. Only the iOS runtime changes: the macOS copy ofRCTInstancestill posts did-load alone.Changelog:
[iOS][Added] - Post
RCTJavaScriptWillStartExecutingNotificationwith the bundle or segmenturlbefore JavaScript runs in bridgeless mode, and addurltoRCTJavaScriptDidLoadNotificationDifferential Revision: D128478252