Skip to content

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

Open
alanjhughes wants to merge 1 commit into
mainfrom
alanhughes/sample-turbo-module-annotation
Open

Move the SampleTurboModule main-queue annotation back to rn-tester#58516
alanjhughes wants to merge 1 commit into
mainfrom
alanhughes/sample-turbo-module-annotation

Conversation

@alanjhughes

Copy link
Copy Markdown
Collaborator

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

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.

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 (the `ReactCommon-Samples` pod), 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 eagerly requesting the sample TurboModule that only rn-tester provides

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.
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 14, 2026
@facebook-github-tools facebook-github-tools Bot added p: Expo Partner: Expo Partner Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. labels Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Expo Partner: Expo Partner Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant