From 52caae5efaa3e36cfa7214b625590526cb4cff66 Mon Sep 17 00:00:00 2001 From: Christoph Purrer Date: Tue, 11 Aug 2026 19:12:27 -0700 Subject: [PATCH] Delete legacy RCTNativeAnimatedModule from RN iOS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: The Old Architecture has been deleted from React Native iOS, which makes the legacy `RCTNativeAnimatedModule` unreachable: - Its JS spec only requests `'NativeAnimatedModule'` when `shouldUseTurboAnimatedModule()` is false, but `ReactInstance.cpp` sets `RN$Bridgeless = true` unconditionally on iOS, so that branch never runs. - Its only entry points were `-setBridge:` and `RCTUIManagerObserver`, and `RCTBridge` is now an all-nil stub with `RCTCxxBridge` deleted. - Nothing referenced it by filename except a single `legacy = True` Buck plugin provider. iOS Animated is served by `RCTNativeAnimatedTurboModule` (bridgeless ObjC) and by the C++ `facebook::react::AnimatedModule` behind `cxxNativeAnimatedEnabled()`. Deleted `RCTNativeAnimatedModule.h` / `.mm` and its registrations: the `legacy = True` `react_module_plugin_providers` entry in `xplat/js/react-native-github/BUCK`, the `RCTNativeAnimatedModuleCls` shim in the `generated` `RCTAnimationPlugins.{h,mm}`, the `getCoreModuleClasses()` entry in `RCTBridge.mm`, the `headers-include-baseline.json` entries, and the `js1 rn-arch` codemod skip-list entry. With the last bridge-dependent Animated consumer gone, also stripped the dead bridge plumbing it was the only reason for: - `RCTNativeAnimatedNodesManager -initWithBridge:surfacePresenter:` loses `bridge:`. - `RCTPropsAnimatedNode -connectToView:viewName:bridge:surfacePresenter:` loses `bridge:` and the `RCTUIManager` fallback in `-updateView`, which collapses to the single `synchronouslyUpdateViewOnUIThread:props:` call. - `viewName:` goes too, since it was only used to look up a legacy view manager. The C++ (`connectAnimatedNodeToView(Tag, Tag)`) and Kotlin (`connectAnimatedNodeToView(animatedNodeTag, viewTag)`) nodes managers already take two arguments, and the sole remaining ObjC caller passed `nil`. `RCTNativeAnimatedTurboModule` is deliberately NOT renamed back to `RCTNativeAnimatedModule` — that is a much wider rename, best done separately. Changelog: [INTERNAL] Differential Revision: D115663619 --- .../Nodes/RCTPropsAnimatedNode.h | 6 +- .../Nodes/RCTPropsAnimatedNode.mm | 25 +- .../NativeAnimation/RCTAnimationPlugins.h | 1 - .../NativeAnimation/RCTAnimationPlugins.mm | 4 - .../NativeAnimation/RCTNativeAnimatedModule.h | 28 -- .../RCTNativeAnimatedModule.mm | 391 ------------------ .../RCTNativeAnimatedNodesManager.h | 8 +- .../RCTNativeAnimatedNodesManager.mm | 13 +- .../RCTNativeAnimatedTurboModule.h | 3 - .../RCTNativeAnimatedTurboModule.mm | 5 +- packages/react-native/React/Base/RCTBridge.mm | 1 - .../headers-include-baseline.json | 2 - .../RCTNativeAnimatedNodesManagerTests.m | 312 ++++++-------- .../api-snapshots/ReactAppleDebugCxx.api | 9 +- .../api-snapshots/ReactAppleNewarchCxx.api | 9 +- .../api-snapshots/ReactAppleReleaseCxx.api | 9 +- 16 files changed, 154 insertions(+), 672 deletions(-) delete mode 100644 packages/react-native/Libraries/NativeAnimation/RCTNativeAnimatedModule.h delete mode 100644 packages/react-native/Libraries/NativeAnimation/RCTNativeAnimatedModule.mm diff --git a/packages/react-native/Libraries/NativeAnimation/Nodes/RCTPropsAnimatedNode.h b/packages/react-native/Libraries/NativeAnimation/Nodes/RCTPropsAnimatedNode.h index 8c11a438eb72..d14154e907a6 100644 --- a/packages/react-native/Libraries/NativeAnimation/Nodes/RCTPropsAnimatedNode.h +++ b/packages/react-native/Libraries/NativeAnimation/Nodes/RCTPropsAnimatedNode.h @@ -9,15 +9,11 @@ #import -@class RCTBridge; @class RCTViewPropertyMapper; @interface RCTPropsAnimatedNode : RCTAnimatedNode -- (void)connectToView:(NSNumber *)viewTag - viewName:(NSString *)viewName - bridge:(RCTBridge *)bridge - surfacePresenter:(id)surfacePresenter; +- (void)connectToView:(NSNumber *)viewTag surfacePresenter:(id)surfacePresenter; - (void)disconnectFromView:(NSNumber *)viewTag; diff --git a/packages/react-native/Libraries/NativeAnimation/Nodes/RCTPropsAnimatedNode.mm b/packages/react-native/Libraries/NativeAnimation/Nodes/RCTPropsAnimatedNode.mm index 2d8c6494c161..306ae3ca7c8d 100644 --- a/packages/react-native/Libraries/NativeAnimation/Nodes/RCTPropsAnimatedNode.mm +++ b/packages/react-native/Libraries/NativeAnimation/Nodes/RCTPropsAnimatedNode.mm @@ -11,13 +11,11 @@ #import #import #import -#import +#import #import @implementation RCTPropsAnimatedNode { NSNumber *_connectedViewTag; - NSString *_connectedViewName; - __weak RCTBridge *_bridge; __weak id _surfacePresenter; NSMutableDictionary *_propsDictionary; // TODO: use RawProps or folly::dynamic directly BOOL _managedByFabric; @@ -36,40 +34,23 @@ - (BOOL)isManagedByFabric return _managedByFabric; } -- (void)connectToView:(NSNumber *)viewTag - viewName:(NSString *)viewName - bridge:(RCTBridge *)bridge - surfacePresenter:(id)surfacePresenter +- (void)connectToView:(NSNumber *)viewTag surfacePresenter:(id)surfacePresenter { - _bridge = bridge; _surfacePresenter = surfacePresenter; _connectedViewTag = viewTag; - _connectedViewName = viewName; _managedByFabric = RCTUIManagerTypeForTagIsFabric(viewTag); } - (void)disconnectFromView:(NSNumber *)viewTag { - _bridge = nil; _surfacePresenter = nil; _connectedViewTag = nil; - _connectedViewName = nil; _managedByFabric = NO; } - (void)updateView { - if (_managedByFabric) { - if (_bridge.surfacePresenter) { - [_bridge.surfacePresenter synchronouslyUpdateViewOnUIThread:_connectedViewTag props:_propsDictionary]; - } else { - [_surfacePresenter synchronouslyUpdateViewOnUIThread:_connectedViewTag props:_propsDictionary]; - } - } else { - [_bridge.uiManager synchronouslyUpdateViewOnUIThread:_connectedViewTag - viewName:_connectedViewName - props:_propsDictionary]; - } + [_surfacePresenter synchronouslyUpdateViewOnUIThread:_connectedViewTag props:_propsDictionary]; } - (void)restoreDefaultValues diff --git a/packages/react-native/Libraries/NativeAnimation/RCTAnimationPlugins.h b/packages/react-native/Libraries/NativeAnimation/RCTAnimationPlugins.h index 37e3cc8643c7..7796d071e75c 100644 --- a/packages/react-native/Libraries/NativeAnimation/RCTAnimationPlugins.h +++ b/packages/react-native/Libraries/NativeAnimation/RCTAnimationPlugins.h @@ -29,7 +29,6 @@ extern "C" { Class RCTAnimationClassProvider(const char *name); // Lookup functions -Class RCTNativeAnimatedModuleCls(void) __attribute__((used)); Class RCTNativeAnimatedTurboModuleCls(void) __attribute__((used)); #ifdef __cplusplus diff --git a/packages/react-native/Libraries/NativeAnimation/RCTAnimationPlugins.mm b/packages/react-native/Libraries/NativeAnimation/RCTAnimationPlugins.mm index 927d7192d5b5..33d8277c6dea 100644 --- a/packages/react-native/Libraries/NativeAnimation/RCTAnimationPlugins.mm +++ b/packages/react-native/Libraries/NativeAnimation/RCTAnimationPlugins.mm @@ -20,10 +20,6 @@ Class RCTAnimationClassProvider(const char *name) { - if (name == "NativeAnimatedModule"sv) { - return RCTNativeAnimatedModuleCls(); - } - if (name == "NativeAnimatedTurboModule"sv) { return RCTNativeAnimatedTurboModuleCls(); } diff --git a/packages/react-native/Libraries/NativeAnimation/RCTNativeAnimatedModule.h b/packages/react-native/Libraries/NativeAnimation/RCTNativeAnimatedModule.h deleted file mode 100644 index f316c7f6374e..000000000000 --- a/packages/react-native/Libraries/NativeAnimation/RCTNativeAnimatedModule.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -#import -#import -#import -#import -#import -#import -#import - -#import "RCTValueAnimatedNode.h" - -// TODO T69437152 @petetheheat - Delete this fork when Fabric ships to 100%. -// NOTE: This module is temporarily forked (see RCTNativeAnimatedTurboModule). -// When making any changes, be sure to apply them to the fork as well. -@interface RCTNativeAnimatedModule : RCTEventEmitter < - RCTBridgeModule, - RCTValueAnimatedNodeObserver, - RCTEventDispatcherObserver, - RCTUIManagerObserver, - RCTSurfacePresenterObserver> - -@end diff --git a/packages/react-native/Libraries/NativeAnimation/RCTNativeAnimatedModule.mm b/packages/react-native/Libraries/NativeAnimation/RCTNativeAnimatedModule.mm deleted file mode 100644 index 9120e8c4754b..000000000000 --- a/packages/react-native/Libraries/NativeAnimation/RCTNativeAnimatedModule.mm +++ /dev/null @@ -1,391 +0,0 @@ -/* - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -#import -#import -#import -#import -#import - -#import - -#import "RCTAnimationPlugins.h" - -typedef void (^AnimatedOperation)(RCTNativeAnimatedNodesManager *nodesManager); - -@interface RCTNativeAnimatedModule () -@end - -@implementation RCTNativeAnimatedModule { - RCTNativeAnimatedNodesManager *_nodesManager; - - // Operations called after views have been updated. - NSMutableArray *_operations; - // Operations called before views have been updated. - NSMutableArray *_preOperations; - NSMutableDictionary *_animIdIsManagedByFabric; -} - -RCT_EXPORT_MODULE(); - -+ (BOOL)requiresMainQueueSetup -{ - return NO; -} - -- (instancetype)init -{ - if (self = [super init]) { - _operations = [NSMutableArray new]; - _preOperations = [NSMutableArray new]; - _animIdIsManagedByFabric = [NSMutableDictionary new]; - } - return self; -} - -- (void)invalidate -{ - [super invalidate]; - [_nodesManager stopAnimationLoop]; - [[self.moduleRegistry moduleForName:"EventDispatcher"] removeDispatchObserver:self]; - [self.bridge.uiManager.observerCoordinator removeObserver:self]; - [self.bridge.surfacePresenter removeObserver:self]; -} - -- (dispatch_queue_t)methodQueue -{ - // This module needs to be on the same queue as the UIManager to avoid - // having to lock `_operations` and `_preOperations` since `uiManagerWillPerformMounting` - // will be called from that queue. - return RCTGetUIManagerQueue(); -} - -- (void)setBridge:(RCTBridge *)bridge -{ - [super setBridge:bridge]; - _nodesManager = [[RCTNativeAnimatedNodesManager alloc] initWithBridge:self.bridge - surfacePresenter:bridge.surfacePresenter]; - [bridge.uiManager.observerCoordinator addObserver:self]; - [bridge.surfacePresenter addObserver:self]; -} - -- (void)initialize -{ - [[self.moduleRegistry moduleForName:"EventDispatcher"] addDispatchObserver:self]; -} - -/* - * This selector should only be invoked in bridgeless mode, which is not compatible with this non turbo module. - */ -- (void)setSurfacePresenter:(id)surfacePresenter -{ - RCTLogWarn(@"setSurfacePresenter should only be invoked in RCTNativeAnimatedTurboModule"); -} - -#pragma mark-- API - -RCT_EXPORT_METHOD(createAnimatedNode : (double)tag config : (NSDictionary *)config) -{ - [self addOperationBlock:^(RCTNativeAnimatedNodesManager *nodesManager) { - [nodesManager createAnimatedNode:[NSNumber numberWithDouble:tag] config:config]; - }]; -} - -RCT_EXPORT_METHOD(updateAnimatedNodeConfig : (double)tag config : (NSDictionary *)config) -{ - [self addOperationBlock:^(RCTNativeAnimatedNodesManager *nodesManager) { - [nodesManager updateAnimatedNodeConfig:[NSNumber numberWithDouble:tag] config:config]; - }]; -} - -RCT_EXPORT_METHOD(connectAnimatedNodes : (double)parentTag childTag : (double)childTag) -{ - [self addOperationBlock:^(RCTNativeAnimatedNodesManager *nodesManager) { - [nodesManager connectAnimatedNodes:[NSNumber numberWithDouble:parentTag] - childTag:[NSNumber numberWithDouble:childTag]]; - }]; -} - -RCT_EXPORT_METHOD(disconnectAnimatedNodes : (double)parentTag childTag : (double)childTag) -{ - [self addOperationBlock:^(RCTNativeAnimatedNodesManager *nodesManager) { - [nodesManager disconnectAnimatedNodes:[NSNumber numberWithDouble:parentTag] - childTag:[NSNumber numberWithDouble:childTag]]; - }]; -} - -RCT_EXPORT_METHOD( - startAnimatingNode : (double)animationId nodeTag : (double)nodeTag config : (NSDictionary *) - config endCallback : (RCTResponseSenderBlock)callBack) -{ - [self addOperationBlock:^(RCTNativeAnimatedNodesManager *nodesManager) { - [nodesManager startAnimatingNode:[NSNumber numberWithDouble:animationId] - nodeTag:[NSNumber numberWithDouble:nodeTag] - config:config - endCallback:callBack]; - }]; - - RCTExecuteOnMainQueue(^{ - if (![self->_nodesManager isNodeManagedByFabric:[NSNumber numberWithDouble:nodeTag]]) { - return; - } - - RCTExecuteOnUIManagerQueue(^{ - self->_animIdIsManagedByFabric[[NSNumber numberWithDouble:animationId]] = @YES; - [self flushOperationQueues]; - }); - }); -} - -RCT_EXPORT_METHOD(stopAnimation : (double)animationId) -{ - [self addOperationBlock:^(RCTNativeAnimatedNodesManager *nodesManager) { - [nodesManager stopAnimation:[NSNumber numberWithDouble:animationId]]; - }]; - if ([_animIdIsManagedByFabric[[NSNumber numberWithDouble:animationId]] boolValue]) { - [self flushOperationQueues]; - } -} - -RCT_EXPORT_METHOD(setAnimatedNodeValue : (double)nodeTag value : (double)value) -{ - [self addOperationBlock:^(RCTNativeAnimatedNodesManager *nodesManager) { - [nodesManager setAnimatedNodeValue:[NSNumber numberWithDouble:nodeTag] value:[NSNumber numberWithDouble:value]]; - }]; -} - -RCT_EXPORT_METHOD(setAnimatedNodeOffset : (double)nodeTag offset : (double)offset) -{ - [self addOperationBlock:^(RCTNativeAnimatedNodesManager *nodesManager) { - [nodesManager setAnimatedNodeOffset:[NSNumber numberWithDouble:nodeTag] offset:[NSNumber numberWithDouble:offset]]; - }]; -} - -RCT_EXPORT_METHOD(flattenAnimatedNodeOffset : (double)nodeTag) -{ - [self addOperationBlock:^(RCTNativeAnimatedNodesManager *nodesManager) { - [nodesManager flattenAnimatedNodeOffset:[NSNumber numberWithDouble:nodeTag]]; - }]; -} - -RCT_EXPORT_METHOD(extractAnimatedNodeOffset : (double)nodeTag) -{ - [self addOperationBlock:^(RCTNativeAnimatedNodesManager *nodesManager) { - [nodesManager extractAnimatedNodeOffset:[NSNumber numberWithDouble:nodeTag]]; - }]; -} - -RCT_EXPORT_METHOD(connectAnimatedNodeToView : (double)nodeTag viewTag : (double)viewTag) -{ - NSString *viewName = [self.bridge.uiManager viewNameForReactTag:[NSNumber numberWithDouble:viewTag]]; - [self addOperationBlock:^(RCTNativeAnimatedNodesManager *nodesManager) { - [nodesManager connectAnimatedNodeToView:[NSNumber numberWithDouble:nodeTag] - viewTag:[NSNumber numberWithDouble:viewTag] - viewName:viewName]; - }]; -} - -RCT_EXPORT_METHOD(disconnectAnimatedNodeFromView : (double)nodeTag viewTag : (double)viewTag) -{ - [self addOperationBlock:^(RCTNativeAnimatedNodesManager *nodesManager) { - [nodesManager disconnectAnimatedNodeFromView:[NSNumber numberWithDouble:nodeTag] - viewTag:[NSNumber numberWithDouble:viewTag]]; - }]; -} - -RCT_EXPORT_METHOD(restoreDefaultValues : (double)nodeTag) -{ - [self addPreOperationBlock:^(RCTNativeAnimatedNodesManager *nodesManager) { - [nodesManager restoreDefaultValues:[NSNumber numberWithDouble:nodeTag]]; - }]; -} - -RCT_EXPORT_METHOD(dropAnimatedNode : (double)tag) -{ - [self addOperationBlock:^(RCTNativeAnimatedNodesManager *nodesManager) { - [nodesManager dropAnimatedNode:[NSNumber numberWithDouble:tag]]; - }]; -} - -RCT_EXPORT_METHOD(startListeningToAnimatedNodeValue : (double)tag) -{ - __weak id valueObserver = self; - [self addOperationBlock:^(RCTNativeAnimatedNodesManager *nodesManager) { - [nodesManager startListeningToAnimatedNodeValue:[NSNumber numberWithDouble:tag] valueObserver:valueObserver]; - }]; -} - -RCT_EXPORT_METHOD(stopListeningToAnimatedNodeValue : (double)tag) -{ - [self addOperationBlock:^(RCTNativeAnimatedNodesManager *nodesManager) { - [nodesManager stopListeningToAnimatedNodeValue:[NSNumber numberWithDouble:tag]]; - }]; -} - -RCT_EXPORT_METHOD( - addAnimatedEventToView : (double)viewTag eventName : (nonnull NSString *) - eventName eventMapping : (JS::NativeAnimatedModule::EventMapping &)eventMapping) -{ - NSMutableDictionary *eventMappingDict = [NSMutableDictionary new]; - eventMappingDict[@"nativeEventPath"] = RCTConvertVecToArray(eventMapping.nativeEventPath()); - - if (eventMapping.animatedValueTag()) { - eventMappingDict[@"animatedValueTag"] = @(*eventMapping.animatedValueTag()); - } - - [self addOperationBlock:^(RCTNativeAnimatedNodesManager *nodesManager) { - [nodesManager addAnimatedEventToView:[NSNumber numberWithDouble:viewTag] - eventName:eventName - eventMapping:eventMappingDict]; - }]; -} - -RCT_EXPORT_METHOD( - removeAnimatedEventFromView : (double)viewTag eventName : (nonnull NSString *)eventName animatedNodeTag : (double) - animatedNodeTag) -{ - [self addOperationBlock:^(RCTNativeAnimatedNodesManager *nodesManager) { - [nodesManager removeAnimatedEventFromView:[NSNumber numberWithDouble:viewTag] - eventName:eventName - animatedNodeTag:[NSNumber numberWithDouble:animatedNodeTag]]; - }]; -} - -RCT_EXPORT_METHOD(getValue : (double)nodeTag saveValueCallback : (RCTResponseSenderBlock)saveValueCallback) -{ - [self addOperationBlock:^(RCTNativeAnimatedNodesManager *nodesManager) { - [nodesManager getValue:[NSNumber numberWithDouble:nodeTag] saveCallback:saveValueCallback]; - }]; -} - -RCT_EXPORT_METHOD(queueAndExecuteBatchedOperations : (NSArray *)operationsAndArgs) -{ - // TODO: implement in the future if we want the same optimization here as on Android -} - -#pragma mark-- Batch handling - -- (void)addOperationBlock:(AnimatedOperation)operation -{ - [_operations addObject:operation]; -} - -- (void)addPreOperationBlock:(AnimatedOperation)operation -{ - [_preOperations addObject:operation]; -} - -- (void)flushOperationQueues -{ - if (_preOperations.count == 0 && _operations.count == 0) { - return; - } - NSArray *preOperations = _preOperations; - NSArray *operations = _operations; - _preOperations = [NSMutableArray new]; - _operations = [NSMutableArray new]; - - RCTExecuteOnMainQueue(^{ - for (AnimatedOperation operation in preOperations) { - operation(self->_nodesManager); - } - for (AnimatedOperation operation in operations) { - operation(self->_nodesManager); - } - [self->_nodesManager updateAnimations]; - }); -} - -#pragma mark - RCTSurfacePresenterObserver - -- (void)willMountComponentsWithRootTag:(NSInteger)rootTag -{ - RCTAssertMainQueue(); - RCTExecuteOnUIManagerQueue(^{ - NSArray *preOperations = self->_preOperations; - self->_preOperations = [NSMutableArray new]; - - RCTExecuteOnMainQueue(^{ - for (AnimatedOperation preOperation in preOperations) { - preOperation(self->_nodesManager); - } - }); - }); -} - -- (void)didMountComponentsWithRootTag:(NSInteger)rootTag -{ - RCTAssertMainQueue(); - RCTExecuteOnUIManagerQueue(^{ - NSArray *operations = self->_operations; - self->_operations = [NSMutableArray new]; - - RCTExecuteOnMainQueue(^{ - for (AnimatedOperation operation in operations) { - operation(self->_nodesManager); - } - }); - }); -} - -#pragma mark - RCTUIManagerObserver - -- (void)uiManagerWillPerformMounting:(RCTUIManager *)uiManager -{ - if (_preOperations.count == 0 && _operations.count == 0) { - return; - } - - NSArray *preOperations = _preOperations; - NSArray *operations = _operations; - _preOperations = [NSMutableArray new]; - _operations = [NSMutableArray new]; - - [uiManager - prependUIBlock:^(__unused RCTUIManager *manager, __unused NSDictionary *viewRegistry) { - for (AnimatedOperation operation in preOperations) { - operation(self->_nodesManager); - } - }]; - [uiManager addUIBlock:^(__unused RCTUIManager *manager, __unused NSDictionary *viewRegistry) { - for (AnimatedOperation operation in operations) { - operation(self->_nodesManager); - } - - [self->_nodesManager updateAnimations]; - }]; -} - -#pragma mark-- Events - -- (NSArray *)supportedEvents -{ - // We need to declare the `onUserDrivenAnimationEnded` for compatibility with the New Architecture - // even if it will never be fired in the Old Architecture. - return @[ @"onAnimatedValueUpdate", @"onUserDrivenAnimationEnded" ]; -} - -- (void)animatedNode:(RCTValueAnimatedNode *)node didUpdateValue:(CGFloat)value -{ - [self sendEventWithName:@"onAnimatedValueUpdate" body:@{@"tag" : node.nodeTag, @"value" : @(value)}]; -} - -- (void)eventDispatcherWillDispatchEvent:(id)event -{ - // Events can be dispatched from any queue so we have to make sure handleAnimatedEvent - // is run from the main queue. - RCTExecuteOnMainQueue(^{ - [self->_nodesManager handleAnimatedEvent:event]; - }); -} - -@end - -Class RCTNativeAnimatedModuleCls(void) -{ - return RCTNativeAnimatedModule.class; -} diff --git a/packages/react-native/Libraries/NativeAnimation/RCTNativeAnimatedNodesManager.h b/packages/react-native/Libraries/NativeAnimation/RCTNativeAnimatedNodesManager.h index 60798329cd8d..72467d9414c0 100644 --- a/packages/react-native/Libraries/NativeAnimation/RCTNativeAnimatedNodesManager.h +++ b/packages/react-native/Libraries/NativeAnimation/RCTNativeAnimatedNodesManager.h @@ -9,7 +9,6 @@ #import #import #import -#import @protocol RCTValueAnimatedNodeObserver; @@ -17,8 +16,7 @@ NS_ASSUME_NONNULL_BEGIN @interface RCTNativeAnimatedNodesManager : NSObject -- (nonnull instancetype)initWithBridge:(nullable RCTBridge *)bridge - surfacePresenter:(id)surfacePresenter; +- (nonnull instancetype)initWithSurfacePresenter:(id)surfacePresenter; - (void)updateAnimations; @@ -36,9 +34,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)disconnectAnimatedNodes:(NSNumber *)parentTag childTag:(NSNumber *)childTag; -- (void)connectAnimatedNodeToView:(NSNumber *)nodeTag - viewTag:(NSNumber *)viewTag - viewName:(nullable NSString *)viewName; +- (void)connectAnimatedNodeToView:(NSNumber *)nodeTag viewTag:(NSNumber *)viewTag; - (void)restoreDefaultValues:(NSNumber *)nodeTag; diff --git a/packages/react-native/Libraries/NativeAnimation/RCTNativeAnimatedNodesManager.mm b/packages/react-native/Libraries/NativeAnimation/RCTNativeAnimatedNodesManager.mm index 11146ca1f23c..4571f0effc9e 100644 --- a/packages/react-native/Libraries/NativeAnimation/RCTNativeAnimatedNodesManager.mm +++ b/packages/react-native/Libraries/NativeAnimation/RCTNativeAnimatedNodesManager.mm @@ -46,7 +46,6 @@ } @implementation RCTNativeAnimatedNodesManager { - __weak RCTBridge *_bridge; __weak id _surfacePresenter; NSMutableDictionary *_animationNodes; // Mapping of a view tag and an event name to a list of event animation drivers. 99% of the time @@ -56,11 +55,9 @@ @implementation RCTNativeAnimatedNodesManager { CADisplayLink *_displayLink; } -- (instancetype)initWithBridge:(nullable RCTBridge *)bridge - surfacePresenter:(id)surfacePresenter +- (instancetype)initWithSurfacePresenter:(id)surfacePresenter { if ((self = [super init]) != nullptr) { - _bridge = bridge; _surfacePresenter = surfacePresenter; _animationNodes = [NSMutableDictionary new]; _eventDrivers = [NSMutableDictionary new]; @@ -147,15 +144,11 @@ - (void)disconnectAnimatedNodes:(NSNumber *)parentTag childTag:(NSNumber *)child [childNode setNeedsUpdate]; } -- (void)connectAnimatedNodeToView:(NSNumber *)nodeTag viewTag:(NSNumber *)viewTag viewName:(nullable NSString *)viewName +- (void)connectAnimatedNodeToView:(NSNumber *)nodeTag viewTag:(NSNumber *)viewTag { RCTAnimatedNode *node = _animationNodes[nodeTag]; if ([node isKindOfClass:[RCTPropsAnimatedNode class]]) { - // viewName is not used when node is managed by Fabric - [(RCTPropsAnimatedNode *)node connectToView:viewTag - viewName:viewName - bridge:_bridge - surfacePresenter:_surfacePresenter]; + [(RCTPropsAnimatedNode *)node connectToView:viewTag surfacePresenter:_surfacePresenter]; } [node setNeedsUpdate]; } diff --git a/packages/react-native/Libraries/NativeAnimation/RCTNativeAnimatedTurboModule.h b/packages/react-native/Libraries/NativeAnimation/RCTNativeAnimatedTurboModule.h index ca09f5b466cf..91901916c8ab 100644 --- a/packages/react-native/Libraries/NativeAnimation/RCTNativeAnimatedTurboModule.h +++ b/packages/react-native/Libraries/NativeAnimation/RCTNativeAnimatedTurboModule.h @@ -13,9 +13,6 @@ #import "RCTValueAnimatedNode.h" -// TODO T69437152 @petetheheat - Delete this fork when Fabric ships to 100%. -// NOTE: This module is temporarily forked (see RCTNativeAnimatedModule). -// When making any changes, be sure to apply them to the fork as well. @interface RCTNativeAnimatedTurboModule : RCTEventEmitter < RCTBridgeModule, RCTValueAnimatedNodeObserver, diff --git a/packages/react-native/Libraries/NativeAnimation/RCTNativeAnimatedTurboModule.mm b/packages/react-native/Libraries/NativeAnimation/RCTNativeAnimatedTurboModule.mm index 48c7a526d070..59a3066cd1f5 100644 --- a/packages/react-native/Libraries/NativeAnimation/RCTNativeAnimatedTurboModule.mm +++ b/packages/react-native/Libraries/NativeAnimation/RCTNativeAnimatedTurboModule.mm @@ -52,7 +52,7 @@ - (instancetype)init - (void)initialize { // _surfacePresenter set in setSurfacePresenter: - _nodesManager = [[RCTNativeAnimatedNodesManager alloc] initWithBridge:nil surfacePresenter:_surfacePresenter]; + _nodesManager = [[RCTNativeAnimatedNodesManager alloc] initWithSurfacePresenter:_surfacePresenter]; [_surfacePresenter addObserver:self]; [[self.moduleRegistry moduleForName:"EventDispatcher"] addDispatchObserver:self]; } @@ -163,8 +163,7 @@ - (void)extractAnimatedNodeOffset:(double)nodeTag - (void)connectAnimatedNodeToView:(double)nodeTag viewTag:(double)viewTag { [self queueOperationBlock:^(RCTNativeAnimatedNodesManager *nodesManager) { - // viewName is not used when node is managed by Fabric, and nodes are always managed by Fabric in Bridgeless. - [nodesManager connectAnimatedNodeToView:@(nodeTag) viewTag:@(viewTag) viewName:nil]; + [nodesManager connectAnimatedNodeToView:@(nodeTag) viewTag:@(viewTag)]; }]; } diff --git a/packages/react-native/React/Base/RCTBridge.mm b/packages/react-native/React/Base/RCTBridge.mm index d7379488d371..4e6a1b286b76 100644 --- a/packages/react-native/React/Base/RCTBridge.mm +++ b/packages/react-native/React/Base/RCTBridge.mm @@ -83,7 +83,6 @@ @"RCTStatusBarManager", @"RCTTiming", @"RCTWebSocketModule", - @"RCTNativeAnimatedModule", @"RCTNativeAnimatedTurboModule", @"RCTBlobManager", @"RCTFileReaderModule", diff --git a/packages/react-native/scripts/ios-prebuild/headers-include-baseline.json b/packages/react-native/scripts/ios-prebuild/headers-include-baseline.json index 9221b6945ba3..90bd59b5049d 100644 --- a/packages/react-native/scripts/ios-prebuild/headers-include-baseline.json +++ b/packages/react-native/scripts/ios-prebuild/headers-include-baseline.json @@ -9,10 +9,8 @@ "notShipped react/renderer/mounting/stubs.h -> react/renderer/mounting/stubs/StubView.h", "notShipped react/renderer/mounting/stubs.h -> react/renderer/mounting/stubs/StubViewTree.h", "quotedNotShipped RCTAnimation/RCTEventAnimation.h -> \"RCTValueAnimatedNode.h\"", - "quotedNotShipped RCTAnimation/RCTNativeAnimatedModule.h -> \"RCTValueAnimatedNode.h\"", "quotedNotShipped RCTAnimation/RCTNativeAnimatedTurboModule.h -> \"RCTValueAnimatedNode.h\"", "quotedNotShipped React/RCTEventAnimation.h -> \"RCTValueAnimatedNode.h\"", - "quotedNotShipped React/RCTNativeAnimatedModule.h -> \"RCTValueAnimatedNode.h\"", "quotedNotShipped React/RCTNativeAnimatedTurboModule.h -> \"RCTValueAnimatedNode.h\"", "quotedNotShipped react/nativemodule/dom/NativeDOM.h -> \"FBReactNativeSpecJSI.h\"", "quotedNotShipped react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h -> \"FBReactNativeSpecJSI.h\"", diff --git a/packages/rn-tester/RNTesterUnitTests/RCTNativeAnimatedNodesManagerTests.m b/packages/rn-tester/RNTesterUnitTests/RCTNativeAnimatedNodesManagerTests.m index 7e0c3fcefddd..bfcbfbfb2339 100644 --- a/packages/rn-tester/RNTesterUnitTests/RCTNativeAnimatedNodesManagerTests.m +++ b/packages/rn-tester/RNTesterUnitTests/RCTNativeAnimatedNodesManagerTests.m @@ -10,7 +10,7 @@ #import "OCMock/OCMock.h" #import -#import +#import #import static const NSTimeInterval FRAME_LENGTH = 1.0 / 60.0; @@ -114,7 +114,7 @@ @interface RCTNativeAnimatedNodesManagerTests : XCTestCase @end @implementation RCTNativeAnimatedNodesManagerTests { - id _uiManager; + id _surfacePresenter; RCTNativeAnimatedNodesManager *_nodesManager; RCTFakeDisplayLink *_displayLink; } @@ -123,11 +123,8 @@ - (void)setUp { [super setUp]; - RCTBridge *bridge = [OCMockObject niceMockForClass:[RCTBridge class]]; - _uiManager = [OCMockObject niceMockForClass:[RCTUIManager class]]; - OCMStub([bridge uiManager]).andReturn(_uiManager); - _nodesManager = [[RCTNativeAnimatedNodesManager alloc] initWithBridge:bridge - surfacePresenter:bridge.surfacePresenter]; + _surfacePresenter = [OCMockObject niceMockForProtocol:@protocol(RCTSurfacePresenterStub)]; + _nodesManager = [[RCTNativeAnimatedNodesManager alloc] initWithSurfacePresenter:_surfacePresenter]; _displayLink = [RCTFakeDisplayLink new]; } @@ -146,12 +143,12 @@ - (void)createSimpleAnimatedView:(NSNumber *)viewTag withOpacity:(CGFloat)opacit [_nodesManager connectAnimatedNodes:@101 childTag:@201]; [_nodesManager connectAnimatedNodes:@201 childTag:@301]; - [_nodesManager connectAnimatedNodeToView:@301 viewTag:viewTag viewName:@"UIView"]; + [_nodesManager connectAnimatedNodeToView:@301 viewTag:viewTag]; } - (void)testFramesAnimation { - [self createSimpleAnimatedView:@1001 withOpacity:0]; + [self createSimpleAnimatedView:@1002 withOpacity:0]; NSArray *frames = @[ @0, @0.2, @0.4, @0.6, @0.8, @1 ]; [_nodesManager startAnimatingNode:@1 nodeTag:@101 @@ -159,25 +156,23 @@ - (void)testFramesAnimation endCallback:nil]; for (NSNumber *frame in frames) { - [[_uiManager expect] synchronouslyUpdateViewOnUIThread:@1001 - viewName:@"UIView" - props:RCTPropChecker(@"opacity", frame)]; + [[_surfacePresenter expect] synchronouslyUpdateViewOnUIThread:@1002 props:RCTPropChecker(@"opacity", frame)]; [_nodesManager stepAnimations:_displayLink]; - [_uiManager verify]; + [_surfacePresenter verify]; } - [[_uiManager expect] synchronouslyUpdateViewOnUIThread:@1001 viewName:@"UIView" props:RCTPropChecker(@"opacity", @1)]; + [[_surfacePresenter expect] synchronouslyUpdateViewOnUIThread:@1002 props:RCTPropChecker(@"opacity", @1)]; [_nodesManager stepAnimations:_displayLink]; - [_uiManager verify]; + [_surfacePresenter verify]; - [[_uiManager reject] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY viewName:OCMOCK_ANY props:OCMOCK_ANY]; + [[_surfacePresenter reject] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY props:OCMOCK_ANY]; [_nodesManager stepAnimations:_displayLink]; - [_uiManager verify]; + [_surfacePresenter verify]; } - (void)testFramesAnimationLoop { - [self createSimpleAnimatedView:@1001 withOpacity:0]; + [self createSimpleAnimatedView:@1002 withOpacity:0]; NSArray *frames = @[ @0, @0.2, @0.4, @0.6, @0.8, @1 ]; [_nodesManager startAnimatingNode:@1 nodeTag:@101 @@ -186,28 +181,26 @@ - (void)testFramesAnimationLoop for (NSUInteger it = 0; it < 5; it++) { for (NSNumber *frame in frames) { - [[_uiManager expect] synchronouslyUpdateViewOnUIThread:@1001 - viewName:@"UIView" - props:RCTPropChecker(@"opacity", frame)]; + [[_surfacePresenter expect] synchronouslyUpdateViewOnUIThread:@1002 props:RCTPropChecker(@"opacity", frame)]; [_nodesManager stepAnimations:_displayLink]; - [_uiManager verify]; + [_surfacePresenter verify]; } } - [[_uiManager expect] synchronouslyUpdateViewOnUIThread:@1001 viewName:@"UIView" props:RCTPropChecker(@"opacity", @1)]; + [[_surfacePresenter expect] synchronouslyUpdateViewOnUIThread:@1002 props:RCTPropChecker(@"opacity", @1)]; [_nodesManager stepAnimations:_displayLink]; - [_uiManager verify]; + [_surfacePresenter verify]; - [[_uiManager reject] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY viewName:OCMOCK_ANY props:OCMOCK_ANY]; + [[_surfacePresenter reject] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY props:OCMOCK_ANY]; [_nodesManager stepAnimations:_displayLink]; - [_uiManager verify]; + [_surfacePresenter verify]; } - (void)testNodeValueListenerIfNotListening { NSNumber *nodeId = @101; - [self createSimpleAnimatedView:@1001 withOpacity:0]; + [self createSimpleAnimatedView:@1002 withOpacity:0]; NSArray *frames = @[ @0, @0.2, @0.4, @0.6, @0.8, @1 ]; RCTFakeValueObserver *observer = [RCTFakeValueObserver new]; @@ -231,7 +224,7 @@ - (void)testNodeValueListenerIfNotListening - (void)testNodeValueListenerIfListening { NSNumber *nodeId = @101; - [self createSimpleAnimatedView:@1001 withOpacity:0]; + [self createSimpleAnimatedView:@1002 withOpacity:0]; NSArray *frames = @[ @0, @0.2, @0.4, @0.6, @0.8, @1 ]; RCTFakeValueObserver *observer = [RCTFakeValueObserver new]; @@ -258,17 +251,17 @@ - (void)testNodeValueListenerIfListening - (void)performSpringAnimationTestWithConfig:(NSDictionary *)config isCriticallyDamped:(BOOL)testForCriticallyDamped { - [self createSimpleAnimatedView:@1001 withOpacity:0]; + [self createSimpleAnimatedView:@1002 withOpacity:0]; [_nodesManager startAnimatingNode:@1 nodeTag:@101 config:config endCallback:nil]; BOOL wasGreaterThanOne = NO; CGFloat previousValue = 0; __block CGFloat currentValue; - [[[_uiManager stub] andDo:^(NSInvocation *invocation) { + [[[_surfacePresenter stub] andDo:^(NSInvocation *invocation) { __unsafe_unretained NSDictionary *props; - [invocation getArgument:&props atIndex:4]; + [invocation getArgument:&props atIndex:3]; currentValue = props[@"opacity"].doubleValue; - }] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY viewName:OCMOCK_ANY props:OCMOCK_ANY]; + }] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY props:OCMOCK_ANY]; // Run for 3 seconds. for (NSUInteger i = 0; i < 3 * 60; i++) { @@ -294,9 +287,9 @@ - (void)performSpringAnimationTestWithConfig:(NSDictionary *)config isCritically XCTAssertTrue(wasGreaterThanOne); } - [[_uiManager reject] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY viewName:OCMOCK_ANY props:OCMOCK_ANY]; + [[_surfacePresenter reject] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY props:OCMOCK_ANY]; [_nodesManager stepAnimations:_displayLink]; - [_uiManager verify]; + [_surfacePresenter verify]; } - (void)testUnderdampedSpringAnimation @@ -333,7 +326,7 @@ - (void)testCritcallyDampedSpringAnimation - (void)testDecayAnimation { - [self createSimpleAnimatedView:@1001 withOpacity:0]; + [self createSimpleAnimatedView:@1002 withOpacity:0]; [_nodesManager startAnimatingNode:@1 nodeTag:@101 config:@{@"type" : @"decay", @"velocity" : @0.5, @"deceleration" : @0.998} @@ -345,11 +338,11 @@ - (void)testDecayAnimation [_nodesManager stepAnimations:_displayLink]; - [[[_uiManager stub] andDo:^(NSInvocation *invocation) { + [[[_surfacePresenter stub] andDo:^(NSInvocation *invocation) { __unsafe_unretained NSDictionary *props; - [invocation getArgument:&props atIndex:4]; + [invocation getArgument:&props atIndex:3]; currentValue = props[@"opacity"].doubleValue; - }] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY viewName:OCMOCK_ANY props:OCMOCK_ANY]; + }] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY props:OCMOCK_ANY]; // Run 3 secs of animation. for (NSUInteger i = 0; i < 3 * 60; i++) { @@ -365,14 +358,14 @@ - (void)testDecayAnimation } // Should be done in 3 secs. - [[_uiManager reject] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY viewName:OCMOCK_ANY props:OCMOCK_ANY]; + [[_surfacePresenter reject] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY props:OCMOCK_ANY]; [_nodesManager stepAnimations:_displayLink]; - [_uiManager verify]; + [_surfacePresenter verify]; } - (void)testDecayAnimationLoop { - [self createSimpleAnimatedView:@1001 withOpacity:0]; + [self createSimpleAnimatedView:@1002 withOpacity:0]; [_nodesManager startAnimatingNode:@1 nodeTag:@101 @@ -384,11 +377,11 @@ - (void)testDecayAnimationLoop BOOL didComeToRest = NO; NSUInteger numberOfResets = 0; - [[[_uiManager stub] andDo:^(NSInvocation *invocation) { + [[[_surfacePresenter stub] andDo:^(NSInvocation *invocation) { __unsafe_unretained NSDictionary *props; - [invocation getArgument:&props atIndex:4]; + [invocation getArgument:&props atIndex:3]; currentValue = props[@"opacity"].doubleValue; - }] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY viewName:OCMOCK_ANY props:OCMOCK_ANY]; + }] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY props:OCMOCK_ANY]; // Run 3 secs of animation five times. for (NSUInteger i = 0; i < 3 * 60 * 5; i++) { @@ -413,14 +406,14 @@ - (void)testDecayAnimationLoop // The animation should have reset 4 times. XCTAssertEqual(numberOfResets, 4u); - [[_uiManager reject] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY viewName:OCMOCK_ANY props:OCMOCK_ANY]; + [[_surfacePresenter reject] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY props:OCMOCK_ANY]; [_nodesManager stepAnimations:_displayLink]; - [_uiManager verify]; + [_surfacePresenter verify]; } - (void)testSpringAnimationLoop { - [self createSimpleAnimatedView:@1001 withOpacity:0]; + [self createSimpleAnimatedView:@1002 withOpacity:0]; [_nodesManager startAnimatingNode:@1 nodeTag:@101 config:@{ @@ -441,11 +434,11 @@ - (void)testSpringAnimationLoop CGFloat previousValue = 0; NSUInteger numberOfResets = 0; __block CGFloat currentValue; - [[[_uiManager stub] andDo:^(NSInvocation *invocation) { + [[[_surfacePresenter stub] andDo:^(NSInvocation *invocation) { __unsafe_unretained NSDictionary *props; - [invocation getArgument:&props atIndex:4]; + [invocation getArgument:&props atIndex:3]; currentValue = props[@"opacity"].doubleValue; - }] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY viewName:OCMOCK_ANY props:OCMOCK_ANY]; + }] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY props:OCMOCK_ANY]; // Run for 3 seconds five times. for (NSUInteger i = 0; i < 3 * 60 * 5; i++) { @@ -472,14 +465,14 @@ - (void)testSpringAnimationLoop XCTAssertEqual(numberOfResets, 4u); XCTAssertTrue(didComeToRest); - [[_uiManager reject] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY viewName:OCMOCK_ANY props:OCMOCK_ANY]; + [[_surfacePresenter reject] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY props:OCMOCK_ANY]; [_nodesManager stepAnimations:_displayLink]; - [_uiManager verify]; + [_surfacePresenter verify]; } - (void)testAnimationCallbackFinish { - [self createSimpleAnimatedView:@1001 withOpacity:0]; + [self createSimpleAnimatedView:@1002 withOpacity:0]; NSArray *frames = @[ @0, @1 ]; __block NSInteger endCallbackCalls = 0; @@ -526,12 +519,12 @@ - (void)createAnimatedGraphWithAdditionNode:(NSNumber *)viewTag [_nodesManager connectAnimatedNodes:@201 childTag:@301]; [_nodesManager connectAnimatedNodes:@301 childTag:@401]; [_nodesManager connectAnimatedNodes:@401 childTag:@501]; - [_nodesManager connectAnimatedNodeToView:@501 viewTag:viewTag viewName:@"UIView"]; + [_nodesManager connectAnimatedNodeToView:@501 viewTag:viewTag]; } - (void)testAdditionNode { - NSNumber *viewTag = @51; + NSNumber *viewTag = @52; [self createAnimatedGraphWithAdditionNode:viewTag firstValue:100 secondValue:1000]; NSArray *frames = @[ @0, @1 ]; @@ -544,27 +537,21 @@ - (void)testAdditionNode config:@{@"type" : @"frames", @"frames" : frames, @"toValue" : @1010} endCallback:nil]; - [[_uiManager expect] synchronouslyUpdateViewOnUIThread:viewTag - viewName:@"UIView" - props:RCTPropChecker(@"translateX", @1100)]; + [[_surfacePresenter expect] synchronouslyUpdateViewOnUIThread:viewTag props:RCTPropChecker(@"translateX", @1100)]; [_nodesManager stepAnimations:_displayLink]; - [_uiManager verify]; + [_surfacePresenter verify]; - [[_uiManager expect] synchronouslyUpdateViewOnUIThread:viewTag - viewName:@"UIView" - props:RCTPropChecker(@"translateX", @1111)]; + [[_surfacePresenter expect] synchronouslyUpdateViewOnUIThread:viewTag props:RCTPropChecker(@"translateX", @1111)]; [_nodesManager stepAnimations:_displayLink]; - [_uiManager verify]; + [_surfacePresenter verify]; - [[_uiManager expect] synchronouslyUpdateViewOnUIThread:viewTag - viewName:@"UIView" - props:RCTPropChecker(@"translateX", @1111)]; + [[_surfacePresenter expect] synchronouslyUpdateViewOnUIThread:viewTag props:RCTPropChecker(@"translateX", @1111)]; [_nodesManager stepAnimations:_displayLink]; - [_uiManager verify]; + [_surfacePresenter verify]; - [[_uiManager reject] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY viewName:OCMOCK_ANY props:OCMOCK_ANY]; + [[_surfacePresenter reject] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY props:OCMOCK_ANY]; [_nodesManager stepAnimations:_displayLink]; - [_uiManager verify]; + [_surfacePresenter verify]; } /** @@ -576,7 +563,7 @@ - (void)testAdditionNode */ - (void)testViewReceiveUpdatesIfOneOfAnimationHasntStarted { - NSNumber *viewTag = @51; + NSNumber *viewTag = @52; [self createAnimatedGraphWithAdditionNode:viewTag firstValue:100 secondValue:1000]; NSArray *frames = @[ @0, @1 ]; @@ -585,27 +572,21 @@ - (void)testViewReceiveUpdatesIfOneOfAnimationHasntStarted config:@{@"type" : @"frames", @"frames" : frames, @"toValue" : @101} endCallback:nil]; - [[_uiManager expect] synchronouslyUpdateViewOnUIThread:viewTag - viewName:@"UIView" - props:RCTPropChecker(@"translateX", @1100)]; + [[_surfacePresenter expect] synchronouslyUpdateViewOnUIThread:viewTag props:RCTPropChecker(@"translateX", @1100)]; [_nodesManager stepAnimations:_displayLink]; - [_uiManager verify]; + [_surfacePresenter verify]; - [[_uiManager expect] synchronouslyUpdateViewOnUIThread:viewTag - viewName:@"UIView" - props:RCTPropChecker(@"translateX", @1101)]; + [[_surfacePresenter expect] synchronouslyUpdateViewOnUIThread:viewTag props:RCTPropChecker(@"translateX", @1101)]; [_nodesManager stepAnimations:_displayLink]; - [_uiManager verify]; + [_surfacePresenter verify]; - [[_uiManager expect] synchronouslyUpdateViewOnUIThread:viewTag - viewName:@"UIView" - props:RCTPropChecker(@"translateX", @1101)]; + [[_surfacePresenter expect] synchronouslyUpdateViewOnUIThread:viewTag props:RCTPropChecker(@"translateX", @1101)]; [_nodesManager stepAnimations:_displayLink]; - [_uiManager verify]; + [_surfacePresenter verify]; - [[_uiManager reject] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY viewName:OCMOCK_ANY props:OCMOCK_ANY]; + [[_surfacePresenter reject] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY props:OCMOCK_ANY]; [_nodesManager stepAnimations:_displayLink]; - [_uiManager verify]; + [_surfacePresenter verify]; } /** @@ -618,7 +599,7 @@ - (void)testViewReceiveUpdatesIfOneOfAnimationHasntStarted */ - (void)testViewReceiveUpdatesWhenOneOfAnimationHasFinished { - NSNumber *viewTag = @51; + NSNumber *viewTag = @52; [self createAnimatedGraphWithAdditionNode:viewTag firstValue:100 secondValue:1000]; NSArray *firstFrames = @[ @0, @1 ]; @@ -632,35 +613,30 @@ - (void)testViewReceiveUpdatesWhenOneOfAnimationHasFinished config:@{@"type" : @"frames", @"frames" : secondFrames, @"toValue" : @1010} endCallback:nil]; - [[_uiManager expect] synchronouslyUpdateViewOnUIThread:viewTag - viewName:@"UIView" - props:RCTPropChecker(@"translateX", @1100)]; + [[_surfacePresenter expect] synchronouslyUpdateViewOnUIThread:viewTag props:RCTPropChecker(@"translateX", @1100)]; [_nodesManager stepAnimations:_displayLink]; - [_uiManager verify]; + [_surfacePresenter verify]; for (NSUInteger i = 1; i < secondFrames.count; i++) { CGFloat expected = 1200.0 + secondFrames[i].doubleValue * 10.0; - [[_uiManager expect] synchronouslyUpdateViewOnUIThread:viewTag - viewName:@"UIView" - props:RCTPropChecker(@"translateX", @(expected))]; + [[_surfacePresenter expect] synchronouslyUpdateViewOnUIThread:viewTag + props:RCTPropChecker(@"translateX", @(expected))]; [_nodesManager stepAnimations:_displayLink]; - [_uiManager verify]; + [_surfacePresenter verify]; } - [[_uiManager expect] synchronouslyUpdateViewOnUIThread:viewTag - viewName:@"UIView" - props:RCTPropChecker(@"translateX", @1210)]; + [[_surfacePresenter expect] synchronouslyUpdateViewOnUIThread:viewTag props:RCTPropChecker(@"translateX", @1210)]; [_nodesManager stepAnimations:_displayLink]; - [_uiManager verify]; + [_surfacePresenter verify]; - [[_uiManager reject] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY viewName:OCMOCK_ANY props:OCMOCK_ANY]; + [[_surfacePresenter reject] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY props:OCMOCK_ANY]; [_nodesManager stepAnimations:_displayLink]; - [_uiManager verify]; + [_surfacePresenter verify]; } - (void)testMultiplicationNode { - NSNumber *viewTag = @51; + NSNumber *viewTag = @52; [_nodesManager createAnimatedNode:@101 config:@{@"type" : @"value", @"value" : @1, @"offset" : @0}]; [_nodesManager createAnimatedNode:@201 config:@{@"type" : @"value", @"value" : @5, @"offset" : @0}]; [_nodesManager createAnimatedNode:@301 config:@{@"type" : @"multiplication", @"input" : @[ @101, @201 ]}]; @@ -671,7 +647,7 @@ - (void)testMultiplicationNode [_nodesManager connectAnimatedNodes:@201 childTag:@301]; [_nodesManager connectAnimatedNodes:@301 childTag:@401]; [_nodesManager connectAnimatedNodes:@401 childTag:@501]; - [_nodesManager connectAnimatedNodeToView:@501 viewTag:viewTag viewName:@"UIView"]; + [_nodesManager connectAnimatedNodeToView:@501 viewTag:viewTag]; NSArray *frames = @[ @0, @1 ]; [_nodesManager startAnimatingNode:@1 @@ -683,32 +659,26 @@ - (void)testMultiplicationNode config:@{@"type" : @"frames", @"frames" : frames, @"toValue" : @10} endCallback:nil]; - [[_uiManager expect] synchronouslyUpdateViewOnUIThread:viewTag - viewName:@"UIView" - props:RCTPropChecker(@"translateX", @5)]; + [[_surfacePresenter expect] synchronouslyUpdateViewOnUIThread:viewTag props:RCTPropChecker(@"translateX", @5)]; [_nodesManager stepAnimations:_displayLink]; - [_uiManager verify]; + [_surfacePresenter verify]; - [[_uiManager expect] synchronouslyUpdateViewOnUIThread:viewTag - viewName:@"UIView" - props:RCTPropChecker(@"translateX", @20)]; + [[_surfacePresenter expect] synchronouslyUpdateViewOnUIThread:viewTag props:RCTPropChecker(@"translateX", @20)]; [_nodesManager stepAnimations:_displayLink]; - [_uiManager verify]; + [_surfacePresenter verify]; - [[_uiManager expect] synchronouslyUpdateViewOnUIThread:viewTag - viewName:@"UIView" - props:RCTPropChecker(@"translateX", @20)]; + [[_surfacePresenter expect] synchronouslyUpdateViewOnUIThread:viewTag props:RCTPropChecker(@"translateX", @20)]; [_nodesManager stepAnimations:_displayLink]; - [_uiManager verify]; + [_surfacePresenter verify]; - [[_uiManager reject] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY viewName:OCMOCK_ANY props:OCMOCK_ANY]; + [[_surfacePresenter reject] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY props:OCMOCK_ANY]; [_nodesManager stepAnimations:_displayLink]; - [_uiManager verify]; + [_surfacePresenter verify]; } - (void)testHandleStoppingAnimation { - [self createSimpleAnimatedView:@1001 withOpacity:0]; + [self createSimpleAnimatedView:@1002 withOpacity:0]; NSArray *frames = @[ @0, @0.2, @0.4, @0.6, @0.8, @1 ]; __block BOOL endCallbackCalled = NO; @@ -724,12 +694,12 @@ - (void)testHandleStoppingAnimation config:@{@"type" : @"frames", @"frames" : frames, @"toValue" : @1} endCallback:endCallback]; - [[_uiManager expect] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY viewName:OCMOCK_ANY props:OCMOCK_ANY]; + [[_surfacePresenter expect] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY props:OCMOCK_ANY]; [_nodesManager stepAnimations:_displayLink]; - [_uiManager verify]; - [[_uiManager expect] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY viewName:OCMOCK_ANY props:OCMOCK_ANY]; + [_surfacePresenter verify]; + [[_surfacePresenter expect] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY props:OCMOCK_ANY]; [_nodesManager stepAnimations:_displayLink]; - [_uiManager verify]; + [_surfacePresenter verify]; [_nodesManager stopAnimation:@404]; XCTAssertEqual(endCallbackCalled, YES); @@ -737,15 +707,15 @@ - (void)testHandleStoppingAnimation // Run "update" loop a few more times -> we expect no further updates nor callback calls to be // triggered for (NSUInteger i = 0; i < 5; i++) { - [[_uiManager reject] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY viewName:OCMOCK_ANY props:OCMOCK_ANY]; + [[_surfacePresenter reject] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY props:OCMOCK_ANY]; [_nodesManager stepAnimations:_displayLink]; - [_uiManager verify]; + [_surfacePresenter verify]; } } - (void)testInterpolationNode { - NSNumber *viewTag = @51; + NSNumber *viewTag = @52; [_nodesManager createAnimatedNode:@101 config:@{@"type" : @"value", @"value" : @10, @"offset" : @0}]; [_nodesManager createAnimatedNode:@201 config:@{ @@ -761,7 +731,7 @@ - (void)testInterpolationNode [_nodesManager connectAnimatedNodes:@101 childTag:@201]; [_nodesManager connectAnimatedNodes:@201 childTag:@301]; [_nodesManager connectAnimatedNodes:@301 childTag:@401]; - [_nodesManager connectAnimatedNodeToView:@401 viewTag:viewTag viewName:@"UIView"]; + [_nodesManager connectAnimatedNodeToView:@401 viewTag:viewTag]; NSArray *frames = @[ @0, @0.2, @0.4, @0.6, @0.8, @1 ]; [_nodesManager startAnimatingNode:@1 @@ -770,22 +740,18 @@ - (void)testInterpolationNode endCallback:nil]; for (NSNumber *frame in frames) { - [[_uiManager expect] synchronouslyUpdateViewOnUIThread:viewTag - viewName:@"UIView" - props:RCTPropChecker(@"opacity", frame)]; + [[_surfacePresenter expect] synchronouslyUpdateViewOnUIThread:viewTag props:RCTPropChecker(@"opacity", frame)]; [_nodesManager stepAnimations:_displayLink]; - [_uiManager verify]; + [_surfacePresenter verify]; } - [[_uiManager expect] synchronouslyUpdateViewOnUIThread:viewTag - viewName:@"UIView" - props:RCTPropChecker(@"opacity", @1)]; + [[_surfacePresenter expect] synchronouslyUpdateViewOnUIThread:viewTag props:RCTPropChecker(@"opacity", @1)]; [_nodesManager stepAnimations:_displayLink]; - [_uiManager verify]; + [_surfacePresenter verify]; - [[_uiManager reject] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY viewName:OCMOCK_ANY props:OCMOCK_ANY]; + [[_surfacePresenter reject] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY props:OCMOCK_ANY]; [_nodesManager stepAnimations:_displayLink]; - [_uiManager verify]; + [_surfacePresenter verify]; } - (id)createScrollEventWithTag:(NSNumber *)viewTag value:(CGFloat)value @@ -797,7 +763,7 @@ - (void)testInterpolationNode - (void)testNativeAnimatedEventDoUpdate { - NSNumber *viewTag = @1001; + NSNumber *viewTag = @1002; [self createSimpleAnimatedView:viewTag withOpacity:0]; [_nodesManager @@ -807,20 +773,18 @@ - (void)testNativeAnimatedEventDoUpdate // Make sure that the update actually happened synchronously in `handleAnimatedEvent` and does // not wait for the next animation loop. - [[_uiManager expect] synchronouslyUpdateViewOnUIThread:viewTag - viewName:@"UIView" - props:RCTPropChecker(@"opacity", @10)]; + [[_surfacePresenter expect] synchronouslyUpdateViewOnUIThread:viewTag props:RCTPropChecker(@"opacity", @10)]; [_nodesManager handleAnimatedEvent:[self createScrollEventWithTag:viewTag value:10]]; - [_uiManager verify]; + [_surfacePresenter verify]; - [[_uiManager reject] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY viewName:OCMOCK_ANY props:OCMOCK_ANY]; + [[_surfacePresenter reject] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY props:OCMOCK_ANY]; [_nodesManager stepAnimations:_displayLink]; - [_uiManager verify]; + [_surfacePresenter verify]; } - (void)testNativeAnimatedEventDoNotUpdate { - NSNumber *viewTag = @1001; + NSNumber *viewTag = @1002; [self createSimpleAnimatedView:viewTag withOpacity:0]; [_nodesManager @@ -833,9 +797,9 @@ - (void)testNativeAnimatedEventDoNotUpdate eventName:@"topScroll" eventMapping:@{@"animatedValueTag" : @101, @"nativeEventPath" : @[ @"contentOffset", @"y" ]}]; - [[_uiManager reject] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY viewName:OCMOCK_ANY props:OCMOCK_ANY]; + [[_surfacePresenter reject] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY props:OCMOCK_ANY]; [_nodesManager handleAnimatedEvent:[self createScrollEventWithTag:viewTag value:10]]; - [_uiManager verify]; + [_surfacePresenter verify]; } - (void)testGetValue @@ -881,7 +845,7 @@ - (void)createAnimatedGraphWithTrackingNode:(NSNumber *)viewTag [_nodesManager connectAnimatedNodes:@101 childTag:@201]; [_nodesManager connectAnimatedNodes:@301 childTag:@401]; [_nodesManager connectAnimatedNodes:@401 childTag:@501]; - [_nodesManager connectAnimatedNodeToView:@501 viewTag:viewTag viewName:@"UIView"]; + [_nodesManager connectAnimatedNodeToView:@501 viewTag:viewTag]; } /** @@ -893,14 +857,12 @@ - (void)testTracking { NSArray *frames = @[ @0, @0.25, @0.5, @0.75, @1 ]; NSDictionary *animationConfig = @{@"type" : @"frames", @"frames" : frames}; - [self createAnimatedGraphWithTrackingNode:@1001 initialValue:0 animationConfig:animationConfig]; + [self createAnimatedGraphWithTrackingNode:@1002 initialValue:0 animationConfig:animationConfig]; [_nodesManager stepAnimations:_displayLink]; // kick off the tracking - [[_uiManager expect] synchronouslyUpdateViewOnUIThread:@1001 - viewName:@"UIView" - props:RCTPropChecker(@"translateX", 0)]; + [[_surfacePresenter expect] synchronouslyUpdateViewOnUIThread:@1002 props:RCTPropChecker(@"translateX", 0)]; [_nodesManager stepAnimations:_displayLink]; - [_uiManager verify]; + [_surfacePresenter verify]; // update "toValue" to 100, we expect tracking animation to animate now from 0 to 100 in 5 steps [_nodesManager setAnimatedNodeValue:@101 value:@100]; @@ -908,11 +870,9 @@ - (void)testTracking for (NSNumber *frame in frames) { NSNumber *expected = @([frame doubleValue] * 100); - [[_uiManager expect] synchronouslyUpdateViewOnUIThread:@1001 - viewName:@"UIView" - props:RCTPropChecker(@"translateX", expected)]; + [[_surfacePresenter expect] synchronouslyUpdateViewOnUIThread:@1002 props:RCTPropChecker(@"translateX", expected)]; [_nodesManager stepAnimations:_displayLink]; - [_uiManager verify]; + [_surfacePresenter verify]; } // update "toValue" to 0 but run only two frames from the animation, @@ -922,11 +882,9 @@ - (void)testTracking for (int i = 0; i < 2; i++) { NSNumber *expected = @(100. * (1. - [frames[i] doubleValue])); - [[_uiManager expect] synchronouslyUpdateViewOnUIThread:@1001 - viewName:@"UIView" - props:RCTPropChecker(@"translateX", expected)]; + [[_surfacePresenter expect] synchronouslyUpdateViewOnUIThread:@1002 props:RCTPropChecker(@"translateX", expected)]; [_nodesManager stepAnimations:_displayLink]; - [_uiManager verify]; + [_surfacePresenter verify]; } // at this point we expect tracking value to be at 75 @@ -936,17 +894,15 @@ - (void)testTracking for (NSNumber *frame in frames) { NSNumber *expected = @(50. + 50. * [frame doubleValue]); - [[_uiManager expect] synchronouslyUpdateViewOnUIThread:@1001 - viewName:@"UIView" - props:RCTPropChecker(@"translateX", expected)]; + [[_surfacePresenter expect] synchronouslyUpdateViewOnUIThread:@1002 props:RCTPropChecker(@"translateX", expected)]; [_nodesManager stepAnimations:_displayLink]; - [_uiManager verify]; + [_surfacePresenter verify]; } [_nodesManager stepAnimations:_displayLink]; - [[_uiManager reject] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY viewName:OCMOCK_ANY props:OCMOCK_ANY]; + [[_surfacePresenter reject] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY props:OCMOCK_ANY]; [_nodesManager stepAnimations:_displayLink]; - [_uiManager verify]; + [_surfacePresenter verify]; } /** @@ -961,15 +917,15 @@ - (void)testTrackingPausesWhenEndValueIsReached { NSArray *frames = @[ @0, @0.5, @1 ]; NSDictionary *animationConfig = @{@"type" : @"frames", @"frames" : frames}; - [self createAnimatedGraphWithTrackingNode:@1001 initialValue:0 animationConfig:animationConfig]; + [self createAnimatedGraphWithTrackingNode:@1002 initialValue:0 animationConfig:animationConfig]; [_nodesManager setAnimatedNodeValue:@101 value:@100]; [_nodesManager stepAnimations:_displayLink]; // kick off the tracking __block int callCount = 0; - [[[_uiManager stub] andDo:^(NSInvocation *__unused invocation) { + [[[_surfacePresenter stub] andDo:^(NSInvocation *__unused invocation) { callCount++; - }] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY viewName:OCMOCK_ANY props:OCMOCK_ANY]; + }] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY props:OCMOCK_ANY]; for (NSUInteger i = 0; i < frames.count; i++) { [_nodesManager stepAnimations:_displayLink]; @@ -978,17 +934,17 @@ - (void)testTrackingPausesWhenEndValueIsReached XCTAssertEqual(callCount, 4); // the animation has completed, we expect no updates to be done - [[[_uiManager stub] andDo:^(NSInvocation *__unused invocation) { + [[[_surfacePresenter stub] andDo:^(NSInvocation *__unused invocation) { XCTFail("Expected not to be called"); - }] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY viewName:OCMOCK_ANY props:OCMOCK_ANY]; + }] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY props:OCMOCK_ANY]; [_nodesManager stepAnimations:_displayLink]; - [_uiManager verify]; + [_surfacePresenter verify]; // restore rejected method, we will use it later on callCount = 0; - [[[_uiManager stub] andDo:^(NSInvocation *__unused invocation) { + [[[_surfacePresenter stub] andDo:^(NSInvocation *__unused invocation) { callCount++; - }] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY viewName:OCMOCK_ANY props:OCMOCK_ANY]; + }] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY props:OCMOCK_ANY]; // we update end value and expect the animation to restart [_nodesManager setAnimatedNodeValue:@101 value:@200]; @@ -1001,9 +957,9 @@ - (void)testTrackingPausesWhenEndValueIsReached XCTAssertEqual(callCount, 4); // the animation has completed, we expect no updates to be done - [[_uiManager reject] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY viewName:OCMOCK_ANY props:OCMOCK_ANY]; + [[_surfacePresenter reject] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY props:OCMOCK_ANY]; [_nodesManager stepAnimations:_displayLink]; - [_uiManager verify]; + [_surfacePresenter verify]; } /** @@ -1025,14 +981,14 @@ - (void)testSpringTrackingRetainsSpeed @"stiffness" : @157.8, @"overshootClamping" : @NO }; - [self createAnimatedGraphWithTrackingNode:@1001 initialValue:0 animationConfig:springConfig]; + [self createAnimatedGraphWithTrackingNode:@1002 initialValue:0 animationConfig:springConfig]; __block CGFloat lastTranslateX = 0; - [[[_uiManager stub] andDo:^(NSInvocation *invocation) { + [[[_surfacePresenter stub] andDo:^(NSInvocation *invocation) { __unsafe_unretained NSDictionary *props = nil; - [invocation getArgument:&props atIndex:4]; + [invocation getArgument:&props atIndex:3]; lastTranslateX = [props[@"translateX"] doubleValue]; - }] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY viewName:OCMOCK_ANY props:OCMOCK_ANY]; + }] synchronouslyUpdateViewOnUIThread:OCMOCK_ANY props:OCMOCK_ANY]; // update "toValue" to 1, we expect tracking animation to animate now from 0 to 1 [_nodesManager setAnimatedNodeValue:@101 value:@1]; diff --git a/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api index 225cad4e1df4..f24cfe784f94 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api @@ -1476,15 +1476,12 @@ interface RCTMultipartStreamReader : public NSObject { interface RCTMultiplicationAnimatedNode : public RCTValueAnimatedNode { } -interface RCTNativeAnimatedModule : public RCTEventEmitter { -} - interface RCTNativeAnimatedNodesManager : public NSObject { public virtual BOOL isNodeManagedByFabric:(NSNumber* tag); public virtual NSSet* getTagsOfConnectedNodesFrom:andEvent:(NSNumber* tag, NSString* eventName); - public virtual _Nonnull instancetype initWithBridge:surfacePresenter:(_Nullable RCTBridge* bridge, id surfacePresenter); + public virtual _Nonnull instancetype initWithSurfacePresenter:(id surfacePresenter); public virtual void addAnimatedEventToView:eventName:eventMapping:(NSNumber* viewTag, NSString* eventName, NSDictionary* eventMapping); - public virtual void connectAnimatedNodeToView:viewTag:viewName:(NSNumber* nodeTag, NSNumber* viewTag, _Nullable NSString* viewName); + public virtual void connectAnimatedNodeToView:viewTag:(NSNumber* nodeTag, NSNumber* viewTag); public virtual void connectAnimatedNodes:childTag:(NSNumber* parentTag, NSNumber* childTag); public virtual void createAnimatedNode:config:(NSNumber* tag, NSDictionary* config); public virtual void disconnectAnimatedNodeFromView:viewTag:(NSNumber* nodeTag, NSNumber* viewTag); @@ -1576,7 +1573,7 @@ interface RCTPlatform : public NSObject { } interface RCTPropsAnimatedNode : public RCTAnimatedNode { - public virtual void connectToView:viewName:bridge:surfacePresenter:(NSNumber* viewTag, NSString* viewName, RCTBridge* bridge, id surfacePresenter); + public virtual void connectToView:surfacePresenter:(NSNumber* viewTag, id surfacePresenter); public virtual void disconnectFromView:(NSNumber* viewTag); public virtual void restoreDefaultValues(); } diff --git a/scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api index 5beeba82b5b1..2877a6ffc5c3 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api @@ -1476,15 +1476,12 @@ interface RCTMultipartStreamReader : public NSObject { interface RCTMultiplicationAnimatedNode : public RCTValueAnimatedNode { } -interface RCTNativeAnimatedModule : public RCTEventEmitter { -} - interface RCTNativeAnimatedNodesManager : public NSObject { public virtual BOOL isNodeManagedByFabric:(NSNumber* tag); public virtual NSSet* getTagsOfConnectedNodesFrom:andEvent:(NSNumber* tag, NSString* eventName); - public virtual _Nonnull instancetype initWithBridge:surfacePresenter:(_Nullable RCTBridge* bridge, id surfacePresenter); + public virtual _Nonnull instancetype initWithSurfacePresenter:(id surfacePresenter); public virtual void addAnimatedEventToView:eventName:eventMapping:(NSNumber* viewTag, NSString* eventName, NSDictionary* eventMapping); - public virtual void connectAnimatedNodeToView:viewTag:viewName:(NSNumber* nodeTag, NSNumber* viewTag, _Nullable NSString* viewName); + public virtual void connectAnimatedNodeToView:viewTag:(NSNumber* nodeTag, NSNumber* viewTag); public virtual void connectAnimatedNodes:childTag:(NSNumber* parentTag, NSNumber* childTag); public virtual void createAnimatedNode:config:(NSNumber* tag, NSDictionary* config); public virtual void disconnectAnimatedNodeFromView:viewTag:(NSNumber* nodeTag, NSNumber* viewTag); @@ -1576,7 +1573,7 @@ interface RCTPlatform : public NSObject { } interface RCTPropsAnimatedNode : public RCTAnimatedNode { - public virtual void connectToView:viewName:bridge:surfacePresenter:(NSNumber* viewTag, NSString* viewName, RCTBridge* bridge, id surfacePresenter); + public virtual void connectToView:surfacePresenter:(NSNumber* viewTag, id surfacePresenter); public virtual void disconnectFromView:(NSNumber* viewTag); public virtual void restoreDefaultValues(); } diff --git a/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api index bf60fe2808aa..984acf54bb55 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api @@ -1476,15 +1476,12 @@ interface RCTMultipartStreamReader : public NSObject { interface RCTMultiplicationAnimatedNode : public RCTValueAnimatedNode { } -interface RCTNativeAnimatedModule : public RCTEventEmitter { -} - interface RCTNativeAnimatedNodesManager : public NSObject { public virtual BOOL isNodeManagedByFabric:(NSNumber* tag); public virtual NSSet* getTagsOfConnectedNodesFrom:andEvent:(NSNumber* tag, NSString* eventName); - public virtual _Nonnull instancetype initWithBridge:surfacePresenter:(_Nullable RCTBridge* bridge, id surfacePresenter); + public virtual _Nonnull instancetype initWithSurfacePresenter:(id surfacePresenter); public virtual void addAnimatedEventToView:eventName:eventMapping:(NSNumber* viewTag, NSString* eventName, NSDictionary* eventMapping); - public virtual void connectAnimatedNodeToView:viewTag:viewName:(NSNumber* nodeTag, NSNumber* viewTag, _Nullable NSString* viewName); + public virtual void connectAnimatedNodeToView:viewTag:(NSNumber* nodeTag, NSNumber* viewTag); public virtual void connectAnimatedNodes:childTag:(NSNumber* parentTag, NSNumber* childTag); public virtual void createAnimatedNode:config:(NSNumber* tag, NSDictionary* config); public virtual void disconnectAnimatedNodeFromView:viewTag:(NSNumber* nodeTag, NSNumber* viewTag); @@ -1576,7 +1573,7 @@ interface RCTPlatform : public NSObject { } interface RCTPropsAnimatedNode : public RCTAnimatedNode { - public virtual void connectToView:viewName:bridge:surfacePresenter:(NSNumber* viewTag, NSString* viewName, RCTBridge* bridge, id surfacePresenter); + public virtual void connectToView:surfacePresenter:(NSNumber* viewTag, id surfacePresenter); public virtual void disconnectFromView:(NSNumber* viewTag); public virtual void restoreDefaultValues(); }