-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[core][iOS] Fix expo modules aren't added to global #21037
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
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.
confirmed this is a regression from #20506 which as @lukmccall mentioned, only happening on expo go with extraModulesForBridge
.
this is from bare-expo without extraModulesForBridge
. there is an enqueue on main thread.
this is from expo go with extraModulesForBridge
, from main to setBridge directly.
so the current solution simulates the main thread enqueue makes sense to me. thanks for investigating the issue 👏
@@ -41,6 +41,30 @@ public final class ExpoBridgeModule: NSObject, RCTBridgeModule { | |||
public var bridge: RCTBridge! { | |||
didSet { | |||
appContext.reactBridge = bridge | |||
|
|||
if bridge.responds(to: Selector(("runtime"))) { |
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.
Not too much parentheses? 😂
if bridge.responds(to: Selector(("runtime"))) { | |
if bridge.responds(to: Selector("runtime")) { |
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.
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.
Ah ok, I didn't know this suppresses that warning 🙂
Can confirm this fix works for me |
Hi there! 👋 I'm a bot whose goal is to ensure your contributions meet our guidelines. I've found some issues in your pull request that should be addressed (click on them for more details) 👇
|
…flipper * upstream/main: (47 commits) [docs] Update Hermes guide to state that Hermes is the new default engine (expo#21047) chore: don't mark issues with the "Issue accepted" label as stale (expo#21058) Switch default JS engine to Hermes (expo#21001) [mail-composer][android] fix composeAsync not resolving after send/ discard (expo#20869) Update CHANGELOG.md (expo#21061) [core][iOS] Fix expo modules aren't added to global (expo#21037) [test-suite] Fix import in the Image example (expo#21043) [test-suite] fix video hanging (expo#21057) [av][ncl][go] fix audio and video qa issues (expo#21055) [tools] Selecting pull requests to label in the publish command (expo#20991) [document-picker] fill missing descriptions in `DocumentResult` type (expo#21040) [tools] Bump http-cache-semantics from 4.1.0 to 4.1.1 (expo#21049) Bump http-cache-semantics from 4.1.0 to 4.1.1 in /docs (expo#21050) [apps][yarn-workspace] replace deprecated activateKeepAwake update changelogs for react-native 0.71 upgrade (expo#20858) Upgrade react native to 0.71.2 (expo#21045) [go] update @shopify/react-native-skia to 0.1.172 (expo#21014) [stripe] Upgrade stripe to 0.23.1 (expo#20964) [expo-firebase-*] Remove libraries (expo#20979) [docs] Update expo-secure-store to add info about Export compliance (expo#21021) ...
Why
Fixes https://www.notion.so/expo/iOS-Unversioned-QA-47e54e52912a4dfc9e4127cdb136e5a7?d=5791b37a93d245209352457d6d677358#399ef36c314643de8b633106ee652067.
How
It has been discovered that jsiRuntime is null in the code at
expo/packages/expo-modules-core/ios/JSI/EXJSIInstaller.mm
Lines 32 to 33 in 720c844
However, in a normal (non-test) scenario, it should have been set to the current runtime. This issue only occurs in Expo Go and is related to using extraModulesForBridge to add modules in the Go app, causing a change in the execution order and preventing the runtime from initializing when needed.
Test Plan