Skip to content

Commit a27d495

Browse files
christophpurrermeta-codesync[bot]
authored andcommitted
Drop RCT_EXPORT_METHOD from RCTExceptionsManager TurboModule (#57684)
Summary: Pull Request resolved: #57684 Changelog: [Internal] `RCTExceptionsManager` is a TurboModule: it conforms to `NativeExceptionsManagerSpec` and implements `getTurboModule:` returning the codegen'd `...SpecJSI`. For TurboModules, the JS->ObjC dispatch is driven by codegen (the generated spec supplies the `selector` and argument kinds, invoked at runtime via `NSMethodSignature` / `NSInvocation`), not by the `RCT_EXPORT_METHOD` macro's `__rct_export__` metadata. The exported methods here are async-void with concrete parameter types (no generic `id` requiring `RCTConvert` coercion), so the macro is not functionally required. Convert them to plain ObjC method declarations; conformance to the codegen'd `NativeExceptionsManagerSpec` protocol keeps compiler-enforced signature parity. Signature-only refactor with no change to the JS-facing API. Sync methods, methods with `id` params, and `constantsToExport` are intentionally left untouched. Reviewed By: cortinico Differential Revision: D113579875 fbshipit-source-id: 41aaed7f15443da5aadc0c18735732d4811dbe9b
1 parent 42cc2ec commit a27d495

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

packages/react-native/React/CoreModules/RCTExceptionsManager.mm

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,24 +87,22 @@ - (void)reportFatal:(NSString *)message
8787
}
8888

8989
// TODO(T205456329): This method is deprecated in favour of reportException. Delete in v0.77
90-
RCT_EXPORT_METHOD(
91-
reportSoftException : (NSString *)message stack : (NSArray<NSDictionary *> *)stack exceptionId : (double)
92-
exceptionId)
90+
- (void)reportSoftException:(NSString *)message stack:(NSArray<NSDictionary *> *)stack exceptionId:(double)exceptionId
9391
{
9492
[self reportSoft:message stack:stack exceptionId:exceptionId extraDataAsJSON:nil];
9593
}
9694

9795
// TODO(T205456329): This method is deprecated in favour of reportException. Delete in v0.77
98-
RCT_EXPORT_METHOD(
99-
reportFatalException : (NSString *)message stack : (NSArray<NSDictionary *> *)stack exceptionId : (double)
100-
exceptionId)
96+
- (void)reportFatalException:(NSString *)message stack:(NSArray<NSDictionary *> *)stack exceptionId:(double)exceptionId
10197
{
10298
[self reportFatal:message stack:stack exceptionId:exceptionId extraDataAsJSON:nil];
10399
}
104100

105-
RCT_EXPORT_METHOD(dismissRedbox) {}
101+
- (void)dismissRedbox
102+
{
103+
}
106104

107-
RCT_EXPORT_METHOD(reportException : (JS::NativeExceptionsManager::ExceptionData &)data)
105+
- (void)reportException:(JS::NativeExceptionsManager::ExceptionData &)data
108106
{
109107
NSMutableDictionary<NSString *, id> *mutableErrorData = [NSMutableDictionary new];
110108
mutableErrorData[@"message"] = data.message();

0 commit comments

Comments
 (0)