Skip to content

Commit 8f53555

Browse files
alanjhughesmeta-codesync[bot]
authored andcommitted
Move the SampleTurboModule main-queue annotation back to rn-tester (#58516)
Summary: #56723 moved `SampleTurboModule`'s `unstableRequiresMainQueueSetup` annotation from rn-tester's `codegenConfig` into react-native's. Codegen collects these annotations from every library and emits them into `RCTUnstableModulesRequiringMainQueueSetupProvider`, so every app now lists `SampleTurboModule`, and `RCTInstance` eagerly requests it at startup. The native class only ships with rn-tester, so every other app logs "Unable to find module for SampleTurboModule", which is a redbox in development. The annotation is keyed by module name and does not need to live next to the spec, so move it back to rn-tester, the one app that links the class. Running the generator with react-native alone now yields the six core modules; adding rn-tester's config yields the same list plus `SampleTurboModule`. Changelog: [iOS] [Fixed] - Stop apps from requesting the sample TurboModule that only rn-tester provides Pull Request resolved: #58516 Test Plan: Ran `generateUnstableModulesRequiringMainQueueSetupProvider` against `packages/react-native` alone and against `packages/react-native` plus `packages/rn-tester`: rn-only: AccessibilityManager, Appearance, AppState, DeviceInfo, PlatformConstants, StatusBarManager with-rn-tester: AccessibilityManager, Appearance, AppState, DeviceInfo, PlatformConstants, StatusBarManager, SampleTurboModule Reproduced the redbox in Expo Go on 0.87.0, 0.87.1 and 0.88.0-rc.0. Reviewed By: cipolleschi Differential Revision: D120190436 Pulled By: christophpurrer fbshipit-source-id: b1991cca7d8bce889e57866eb507e4259f61425f
1 parent 7ce27d0 commit 8f53555

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

‎packages/react-native/package.json‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,6 @@
203203
"PlatformConstants": {
204204
"unstableRequiresMainQueueSetup": true
205205
},
206-
"SampleTurboModule": {
207-
"unstableRequiresMainQueueSetup": true
208-
},
209206
"StatusBarManager": {
210207
"unstableRequiresMainQueueSetup": true
211208
}

‎packages/rn-tester/package.json‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@
4646
"javaPackageName": "com.facebook.fbreact.specs"
4747
},
4848
"ios": {
49+
"modules": {
50+
"SampleTurboModule": {
51+
"unstableRequiresMainQueueSetup": true
52+
}
53+
},
4954
"components": {
5055
"RNTMyNativeView": {
5156
"className": "RNTMyNativeViewComponentView"

0 commit comments

Comments
 (0)