Drop RCT_EXPORT_METHOD from RCTImageEditingManager (#57773) - #57773
Open
christophpurrer wants to merge 1 commit into
Open
Drop RCT_EXPORT_METHOD from RCTImageEditingManager (#57773)#57773christophpurrer wants to merge 1 commit into
christophpurrer wants to merge 1 commit into
Conversation
|
@christophpurrer has exported this pull request. If you are a Meta employee, you can view the originating Diff in D114288222. |
Summary:
RCTImageEditingManager is a TurboModule conforming to `NativeImageEditorSpec`. For TurboModules, JS->ObjC dispatch is driven by codegen via the generated `NativeImageEditorSpecJSI`, not by `RCT_EXPORT_METHOD`'s `__rct_export__` metadata, so the macro is dead weight. Protocol conformance gives compiler-enforced signature parity.
This diff is part of the `CodemodConfigDevmateDropRctExportMethod` pipeline that removes the legacy macro from first-party ObjC TurboModules.
Change:
- Converts `RCT_EXPORT_METHOD(cropImage: ...)` to plain ObjC method `- (void)cropImage:(NSString *)...`
Type-mismatch reconciliation (cAST mod flagged `FLAG type-mismatch`):
- Generated spec requires `(NSString *)uri`, but the legacy impl declared `(NSURLRequest *)imageRequest`.
- The macro was silently coercing the arg via `RCTConvert`.
- Preserve coercion manually: signature now takes `NSString *imageRequestString`, body restores `NSURLRequest *imageRequest = [RCTConvert NSURLRequest:imageRequestString];` at top. Existing `loadImageWithURLRequest:` usage unchanged.
Generated spec (from `FBReactNativeSpec.h`):
```
protocol NativeImageEditorSpec <RCTBridgeModule, RCTTurboModule>
- (void)cropImage:(NSString *)uri
cropData:(JS::NativeImageEditor::Options &)cropData
successCallback:(RCTResponseSenderBlock)successCallback
errorCallback:(RCTResponseSenderBlock)errorCallback;
end
```
`RCT_EXPORT_MODULE()` and `getTurboModule:` are left untouched.
Changelog: [Internal]
Differential Revision: D114288222
christophpurrer
force-pushed
the
export-D114288222
branch
from
July 31, 2026 02:25
c77ba9c to
31693c5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
RCTImageEditingManager is a TurboModule conforming to
NativeImageEditorSpec. For TurboModules, JS->ObjC dispatch is driven by codegen via the generatedNativeImageEditorSpecJSI, not byRCT_EXPORT_METHOD's__rct_export__metadata, so the macro is dead weight. Protocol conformance gives compiler-enforced signature parity.This diff is part of the
CodemodConfigDevmateDropRctExportMethodpipeline that removes the legacy macro from first-party ObjC TurboModules.Change:
RCT_EXPORT_METHOD(cropImage: ...)to plain ObjC method- (void)cropImage:(NSString *)...Type-mismatch reconciliation (cAST mod flagged
FLAG type-mismatch):(NSString *)uri, but the legacy impl declared(NSURLRequest *)imageRequest.RCTConvert.NSString *imageRequestString, body restoresNSURLRequest *imageRequest = [RCTConvert NSURLRequest:imageRequestString];at top. ExistingloadImageWithURLRequest:usage unchanged.Generated spec (from
FBReactNativeSpec.h):RCT_EXPORT_MODULE()andgetTurboModule:are left untouched.Changelog: [Internal]
Differential Revision: D114288222