Skip to content

Drop RCT_EXPORT_METHOD from RCTTestModule TurboModule - #58095

Closed
christophpurrer wants to merge 1 commit into
react:mainfrom
christophpurrer:export-D117201272
Closed

Drop RCT_EXPORT_METHOD from RCTTestModule TurboModule#58095
christophpurrer wants to merge 1 commit into
react:mainfrom
christophpurrer:export-D117201272

Conversation

@christophpurrer

Copy link
Copy Markdown
Contributor

Summary:
RCTTestModule is a TurboModule: it conforms to NativeTestModuleSpec and returns
NativeTestModuleSpecJSI from getTurboModule:, so JS->ObjC dispatch is driven by
codegen, not by RCT_EXPORT_METHOD's __rct_export__ metadata. The macro is dead weight.
Convert the three spec-declared methods to plain ObjC declarations; conformance to
NativeTestModuleSpec keeps their signatures compiler-enforced.

- (void)markTestCompleted;
- (void)markTestPassed:(BOOL)success;
- (void)verifySnapshot:(RCTResponseSenderBlock)callback;

sendAppEvent:body: keeps its macro because it is not declared in the spec protocol, and
the two RCT_REMAP_METHOD exports keep theirs because they define custom JS names.

Changelog: [Internal]

Differential Revision: D117201272

Summary:
`RCTTestModule` is a TurboModule: it conforms to `NativeTestModuleSpec` and returns
`NativeTestModuleSpecJSI` from `getTurboModule:`, so JS->ObjC dispatch is driven by
codegen, not by `RCT_EXPORT_METHOD`'s `__rct_export__` metadata. The macro is dead weight.
Convert the three spec-declared methods to plain ObjC declarations; conformance to
`NativeTestModuleSpec` keeps their signatures compiler-enforced.

```
- (void)markTestCompleted;
- (void)markTestPassed:(BOOL)success;
- (void)verifySnapshot:(RCTResponseSenderBlock)callback;
```

`sendAppEvent:body:` keeps its macro because it is not declared in the spec protocol, and
the two `RCT_REMAP_METHOD` exports keep theirs because they define custom JS names.

Changelog: [Internal]

Differential Revision: D117201272
@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 Aug 24, 2026
@meta-codesync

meta-codesync Bot commented Aug 24, 2026

Copy link
Copy Markdown

@christophpurrer has exported this pull request. If you are a Meta employee, you can view the originating Diff in D117201272.

@meta-codesync meta-codesync Bot closed this in 21f0889 Aug 25, 2026
@meta-codesync meta-codesync Bot added the Merged This PR has been merged. label Aug 25, 2026
@meta-codesync

meta-codesync Bot commented Aug 25, 2026

Copy link
Copy Markdown

This pull request has been merged in 21f0889.

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. Merged This PR has been merged. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant