Skip to content

Commit 29cfb0e

Browse files
Drop RCT_EXPORT_METHOD from RCTDevSettings TurboModule (#57682)
Summary: Changelog: [Internal] `RCTDevSettings` is a TurboModule: it conforms to `NativeDevSettingsSpec` 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 `NativeDevSettingsSpec` 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. Differential Revision: D113579870
1 parent d12361a commit 29cfb0e

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -313,22 +313,22 @@ - (BOOL)isHotLoadingAvailable
313313
return NO;
314314
}
315315

316-
RCT_EXPORT_METHOD(reload)
316+
- (void)reload
317317
{
318318
RCTTriggerReloadCommandListeners(@"Unknown From JS");
319319
}
320320

321-
RCT_EXPORT_METHOD(reloadWithReason : (NSString *)reason)
321+
- (void)reloadWithReason:(NSString *)reason
322322
{
323323
RCTTriggerReloadCommandListeners(reason);
324324
}
325325

326-
RCT_EXPORT_METHOD(onFastRefresh)
326+
- (void)onFastRefresh
327327
{
328328
[self.bridge onFastRefresh];
329329
}
330330

331-
RCT_EXPORT_METHOD(setIsShakeToShowDevMenuEnabled : (BOOL)enabled)
331+
- (void)setIsShakeToShowDevMenuEnabled:(BOOL)enabled
332332
{
333333
[self _updateSettingWithValue:@(enabled) forKey:kRCTDevSettingShakeToShowDevMenu];
334334
}
@@ -338,7 +338,7 @@ - (BOOL)isShakeToShowDevMenuEnabled
338338
return _isShakeGestureEnabled && [[self settingForKey:kRCTDevSettingShakeToShowDevMenu] boolValue];
339339
}
340340

341-
RCT_EXPORT_METHOD(setProfilingEnabled : (BOOL)enabled)
341+
- (void)setProfilingEnabled:(BOOL)enabled
342342
{
343343
[self _updateSettingWithValue:@(enabled) forKey:kRCTDevSettingProfilingEnabled];
344344
[self _profilingSettingDidChange];
@@ -368,7 +368,7 @@ - (void)_profilingSettingDidChange
368368
}
369369
}
370370

371-
RCT_EXPORT_METHOD(setHotLoadingEnabled : (BOOL)enabled)
371+
- (void)setHotLoadingEnabled:(BOOL)enabled
372372
{
373373
if (self.isHotLoadingEnabled != enabled) {
374374
[self _updateSettingWithValue:@(enabled) forKey:kRCTDevSettingHotLoadingEnabled];
@@ -390,7 +390,7 @@ - (BOOL)isHotLoadingEnabled
390390
return [[self settingForKey:kRCTDevSettingHotLoadingEnabled] boolValue];
391391
}
392392

393-
RCT_EXPORT_METHOD(toggleElementInspector)
393+
- (void)toggleElementInspector
394394
{
395395
BOOL value = [[self settingForKey:kRCTDevSettingIsInspectorShown] boolValue];
396396
[self _updateSettingWithValue:@(!value) forKey:kRCTDevSettingIsInspectorShown];
@@ -403,7 +403,7 @@ - (BOOL)isHotLoadingEnabled
403403
}
404404
}
405405

406-
RCT_EXPORT_METHOD(addMenuItem : (NSString *)title)
406+
- (void)addMenuItem:(NSString *)title
407407
{
408408
__weak __typeof(self) weakSelf = self;
409409
[(RCTDevMenu *)[self.moduleRegistry moduleForName:"DevMenu"]
@@ -494,7 +494,7 @@ - (void)setupHMRClientWithAdditionalBundleURL:(NSURL *)bundleURL
494494
}
495495
}
496496

497-
RCT_EXPORT_METHOD(openDebugger)
497+
- (void)openDebugger
498498
{
499499
#if RCT_ENABLE_INSPECTOR
500500
[RCTInspectorDevServerHelper

0 commit comments

Comments
 (0)