Move the SampleTurboModule main-queue annotation back to rn-tester (#58516)

Summary:
https://github.com/react/react-native/issues/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: https://github.com/react/react-native/pull/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
This commit is contained in:
Alan Hughes authored and meta-codesync[bot] committed 2026-09-16 11:31:20 -07:00
1 parent 7ce27d0d07
commit 8f5355575a
2 files changed
+5 -3

No files matched your search

-3
View File
@@ -203,9 +203,6 @@
"PlatformConstants": {
"unstableRequiresMainQueueSetup": true
},
"SampleTurboModule": {
"unstableRequiresMainQueueSetup": true
},
"StatusBarManager": {
"unstableRequiresMainQueueSetup": true
}
+5
View File
@@ -46,6 +46,11 @@
"javaPackageName": "com.facebook.fbreact.specs"
},
"ios": {
"modules": {
"SampleTurboModule": {
"unstableRequiresMainQueueSetup": true
}
},
"components": {
"RNTMyNativeView": {
"className": "RNTMyNativeViewComponentView"