Commit db11646
Drop RCT_EXPORT_METHOD from RCTImageEditingManager (#57773)
Summary:
Pull Request resolved: #57773
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]
Reviewed By: shwanton
Differential Revision: D114288222
fbshipit-source-id: 09724f31d11929209d52b77795ebd1a28a7f81ce1 parent ed3229a commit db11646
1 file changed
Lines changed: 14 additions & 12 deletions
Lines changed: 14 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
42 | | - | |
43 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
44 | 45 | | |
| 46 | + | |
| 47 | + | |
45 | 48 | | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
55 | 57 | | |
56 | 58 | | |
57 | 59 | | |
| |||
0 commit comments