Skip to content

Commit b2f5704

Browse files
Deprecate Timing native module ahead of legacy-arch removal (#57081)
Summary: The legacy Timing native module (`RCTTiming` on iOS, `TimingModule` on Android) is scheduled for removal in a future React Native release as part of the legacy architecture cleanup. Changelog: [iOS][Deprecated] - Deprecate `RCTTiming Native Module usage`; will be removed in a future React Native release [Android][Deprecated] - Deprecate `TimingModule`; will be removed in a future React Native release Differential Revision: D107540262
1 parent c0ee408 commit b2f5704

3 files changed

Lines changed: 9 additions & 2 deletions

File tree

packages/react-native/React/Base/RCTDisplayLink.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@
2121
- (instancetype)init;
2222
- (void)invalidate;
2323
- (void)registerModuleForFrameUpdates:(id<RCTBridgeModule>)module
24-
withModuleHolder:(id<RCTDisplayLinkModuleHolder>)moduleHolder;
24+
withModuleHolder:(id<RCTDisplayLinkModuleHolder>)moduleHolder
25+
__attribute__((deprecated(
26+
"registerModuleForFrameUpdates is part of the legacy architecture and will be removed in a future React Native release.")));
2527
- (void)addToRunLoop:(NSRunLoop *)runLoop;
2628

2729
@end

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/core/TimingModule.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ import com.facebook.react.devsupport.interfaces.DevSupportManager
1515
import com.facebook.react.module.annotations.ReactModule
1616

1717
/** Native module for JS timer execution. Timers fire on frame boundaries. */
18+
@Deprecated(
19+
"TimingModule is part of the legacy architecture and will be removed in a future React Native release."
20+
)
1821
@ReactModule(name = NativeTimingSpec.NAME)
1922
public class TimingModule(
2023
reactContext: ReactApplicationContext,

packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ void RCTInstanceSetRuntimeDiagnosticFlags(NSString *flags)
7272
sRuntimeDiagnosticFlags = [flags copy];
7373
}
7474

75-
@interface RCTBridgelessDisplayLinkModuleHolder : NSObject <RCTDisplayLinkModuleHolder>
75+
__attribute__((deprecated(
76+
"RCTBridgelessDisplayLinkModuleHolder is part of the legacy architecture and will be removed in a future React Native release.")))
77+
@interface RCTBridgelessDisplayLinkModuleHolder : NSObject<RCTDisplayLinkModuleHolder>
7678
- (instancetype)initWithModule:(id<RCTBridgeModule>)module;
7779
@end
7880

0 commit comments

Comments
 (0)