Skip to content

Drop RCT_EXPORT_METHOD from RCTImageEditingManager (#57773) - #57773

Open
christophpurrer wants to merge 1 commit into
react:mainfrom
christophpurrer:export-D114288222
Open

Drop RCT_EXPORT_METHOD from RCTImageEditingManager (#57773)#57773
christophpurrer wants to merge 1 commit into
react:mainfrom
christophpurrer:export-D114288222

Conversation

@christophpurrer

@christophpurrer christophpurrer commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

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

@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 Jul 30, 2026
@meta-codesync

meta-codesync Bot commented Jul 30, 2026

Copy link
Copy Markdown

@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
@meta-codesync meta-codesync Bot changed the title Drop RCT_EXPORT_METHOD from RCTImageEditingManager Drop RCT_EXPORT_METHOD from RCTImageEditingManager (#57773) Jul 31, 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. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant