Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 3.16.5 #6804

Merged
merged 2 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions apps/fabric-example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1747,7 +1747,7 @@ PODS:
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- Yoga
- RNReanimated (3.16.4):
- RNReanimated (3.16.5):
- DoubleConversion
- glog
- hermes-engine
Expand All @@ -1767,10 +1767,10 @@ PODS:
- ReactCodegen
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- RNReanimated/reanimated (= 3.16.4)
- RNReanimated/worklets (= 3.16.4)
- RNReanimated/reanimated (= 3.16.5)
- RNReanimated/worklets (= 3.16.5)
- Yoga
- RNReanimated/reanimated (3.16.4):
- RNReanimated/reanimated (3.16.5):
- DoubleConversion
- glog
- hermes-engine
Expand All @@ -1790,9 +1790,9 @@ PODS:
- ReactCodegen
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- RNReanimated/reanimated/apple (= 3.16.4)
- RNReanimated/reanimated/apple (= 3.16.5)
- Yoga
- RNReanimated/reanimated/apple (3.16.4):
- RNReanimated/reanimated/apple (3.16.5):
- DoubleConversion
- glog
- hermes-engine
Expand All @@ -1813,7 +1813,7 @@ PODS:
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- Yoga
- RNReanimated/worklets (3.16.4):
- RNReanimated/worklets (3.16.5):
- DoubleConversion
- glog
- hermes-engine
Expand Down Expand Up @@ -2229,7 +2229,7 @@ SPEC CHECKSUMS:
RNCPicker: d051e0647af8b2ad01a3d39a6b5dd9b7c0ccc166
RNFlashList: 6f169ad83e52579b7754cbbcec1b004c27d82c93
RNGestureHandler: c374c750a0a9bacd95f5c740d146ab9428549d6b
RNReanimated: b6a4bd4c15d97f9fe83034de369dcf7491fd0bde
RNReanimated: 3b2f758f9c4e3ef573d2cef3bb1a633153c9028c
RNScreens: de6e57426ba0e6cbc3fb5b4f496e7f08cb2773c2
RNSVG: 08750404f92a36162a92522cc77dee437be1d257
SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748
Expand Down
16 changes: 8 additions & 8 deletions apps/macos-example/macos/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1023,25 +1023,25 @@ PODS:
- glog
- RCT-Folly (= 2022.05.16.00)
- React-Core
- RNReanimated (3.16.4):
- RNReanimated (3.16.5):
- glog
- RCT-Folly (= 2022.05.16.00)
- React-Core
- ReactCommon/turbomodule/core
- RNReanimated/reanimated (= 3.16.4)
- RNReanimated/worklets (= 3.16.4)
- RNReanimated/reanimated (3.16.4):
- RNReanimated/reanimated (= 3.16.5)
- RNReanimated/worklets (= 3.16.5)
- RNReanimated/reanimated (3.16.5):
- glog
- RCT-Folly (= 2022.05.16.00)
- React-Core
- ReactCommon/turbomodule/core
- RNReanimated/reanimated/apple (= 3.16.4)
- RNReanimated/reanimated/apple (3.16.4):
- RNReanimated/reanimated/apple (= 3.16.5)
- RNReanimated/reanimated/apple (3.16.5):
- glog
- RCT-Folly (= 2022.05.16.00)
- React-Core
- ReactCommon/turbomodule/core
- RNReanimated/worklets (3.16.4):
- RNReanimated/worklets (3.16.5):
- glog
- RCT-Folly (= 2022.05.16.00)
- React-Core
Expand Down Expand Up @@ -1270,7 +1270,7 @@ SPEC CHECKSUMS:
RNCAsyncStorage: ec53e44dc3e75b44aa2a9f37618a49c3bc080a7a
RNCPicker: 0173dedc74776227ec6dcc61bb85cd9f07bbb2ac
RNGestureHandler: bb81850add626ddd265294323310fec6e861c96b
RNReanimated: 372250f6264fdb16d23e4d3b0ce2aebe39152e35
RNReanimated: 49cdcf66acb8b750c72b0172bd804eb7d2e6b385
RNSVG: 01eb8d8a0e2289ec3ecc9626ce920e00d2174992
SocketRocket: f6c6249082c011e6de2de60ed641ef8bbe0cfac9
Yoga: 329461de6a23b9e0c108d197fd0f6e87c8c8ecf2
Expand Down
16 changes: 8 additions & 8 deletions apps/paper-example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1601,7 +1601,7 @@ PODS:
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- Yoga
- RNReanimated (3.16.4):
- RNReanimated (3.16.5):
- DoubleConversion
- glog
- hermes-engine
Expand All @@ -1621,10 +1621,10 @@ PODS:
- ReactCodegen
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- RNReanimated/reanimated (= 3.16.4)
- RNReanimated/worklets (= 3.16.4)
- RNReanimated/reanimated (= 3.16.5)
- RNReanimated/worklets (= 3.16.5)
- Yoga
- RNReanimated/reanimated (3.16.4):
- RNReanimated/reanimated (3.16.5):
- DoubleConversion
- glog
- hermes-engine
Expand All @@ -1644,9 +1644,9 @@ PODS:
- ReactCodegen
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- RNReanimated/reanimated/apple (= 3.16.4)
- RNReanimated/reanimated/apple (= 3.16.5)
- Yoga
- RNReanimated/reanimated/apple (3.16.4):
- RNReanimated/reanimated/apple (3.16.5):
- DoubleConversion
- glog
- hermes-engine
Expand All @@ -1667,7 +1667,7 @@ PODS:
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- Yoga
- RNReanimated/worklets (3.16.4):
- RNReanimated/worklets (3.16.5):
- DoubleConversion
- glog
- hermes-engine
Expand Down Expand Up @@ -2019,7 +2019,7 @@ SPEC CHECKSUMS:
RNCPicker: 0173dedc74776227ec6dcc61bb85cd9f07bbb2ac
RNFlashList: 115dd44377580761bff386a0caebf165424cf16f
RNGestureHandler: 6dfe7692a191ee224748964127114edf057a1475
RNReanimated: d0dd0abbaf6588d52772b2ddafe045744cbbfbe2
RNReanimated: 19ba9608c1284fa084e20995150974f2d0ee279c
RNScreens: 19719a9c326e925498ac3b2d35c4e50fe87afc06
RNSVG: 01eb8d8a0e2289ec3ecc9626ce920e00d2174992
SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748
Expand Down
16 changes: 8 additions & 8 deletions apps/tvos-example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1031,25 +1031,25 @@ PODS:
- React-jsi (= 0.73.4-0)
- React-logger (= 0.73.4-0)
- React-perflogger (= 0.73.4-0)
- RNReanimated (3.16.4):
- RNReanimated (3.16.5):
- glog
- RCT-Folly (= 2022.05.16.00)
- React-Core
- ReactCommon/turbomodule/core
- RNReanimated/reanimated (= 3.16.4)
- RNReanimated/worklets (= 3.16.4)
- RNReanimated/reanimated (3.16.4):
- RNReanimated/reanimated (= 3.16.5)
- RNReanimated/worklets (= 3.16.5)
- RNReanimated/reanimated (3.16.5):
- glog
- RCT-Folly (= 2022.05.16.00)
- React-Core
- ReactCommon/turbomodule/core
- RNReanimated/reanimated/apple (= 3.16.4)
- RNReanimated/reanimated/apple (3.16.4):
- RNReanimated/reanimated/apple (= 3.16.5)
- RNReanimated/reanimated/apple (3.16.5):
- glog
- RCT-Folly (= 2022.05.16.00)
- React-Core
- ReactCommon/turbomodule/core
- RNReanimated/worklets (3.16.4):
- RNReanimated/worklets (3.16.5):
- glog
- RCT-Folly (= 2022.05.16.00)
- React-Core
Expand Down Expand Up @@ -1267,7 +1267,7 @@ SPEC CHECKSUMS:
React-runtimescheduler: 20b2202e3396589a71069d12ae9f328949c7c7b8
React-utils: 0307d396f233e47a167b5aaf045b0e4e1dc19d74
ReactCommon: 17891ca337bfa5a7263649b09f27a8c664537bf2
RNReanimated: cfd0d2000a1fbe15236382a499efa6d0d4648352
RNReanimated: 6cdbb482adb78b9a6efe045e09e454349b637dda
SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17
Yoga: e7f2a2256464d4ef7b3825d216bd22aac3b449c1

Expand Down
2 changes: 1 addition & 1 deletion packages/react-native-reanimated/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-reanimated",
"version": "3.16.4",
"version": "3.16.5",
"description": "More powerful alternative to Animated library for React Native.",
"scripts": {
"test": "jest",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use strict';
import { NativeEventEmitter, Platform } from 'react-native';
import { findNodeHandle } from '../platformFunctions/findNodeHandle';
import type { NativeModule } from 'react-native';
import { shouldBeUseWeb } from '../PlatformChecker';
import type { StyleProps } from '../commonTypes';
Expand Down Expand Up @@ -39,7 +38,7 @@ class JSPropsUpdaterPaper implements IJSPropsUpdater {
> &
IAnimatedComponentInternal
) {
const viewTag = findNodeHandle(animatedComponent);
const viewTag = animatedComponent.getComponentViewTag();
JSPropsUpdaterPaper._tagToComponentMapping.set(viewTag, animatedComponent);
if (JSPropsUpdaterPaper._tagToComponentMapping.size === 1) {
const listener = (data: ListenerData) => {
Expand All @@ -61,7 +60,7 @@ class JSPropsUpdaterPaper implements IJSPropsUpdater {
> &
IAnimatedComponentInternal
) {
const viewTag = findNodeHandle(animatedComponent);
const viewTag = animatedComponent.getComponentViewTag();
JSPropsUpdaterPaper._tagToComponentMapping.delete(viewTag);
if (JSPropsUpdaterPaper._tagToComponentMapping.size === 0) {
this._reanimatedEventEmitter.removeAllListeners(
Expand Down Expand Up @@ -101,7 +100,7 @@ class JSPropsUpdaterFabric implements IJSPropsUpdater {
if (!JSPropsUpdaterFabric.isInitialized) {
return;
}
const viewTag = findNodeHandle(animatedComponent);
const viewTag = animatedComponent.getComponentViewTag();
JSPropsUpdaterFabric._tagToComponentMapping.set(viewTag, animatedComponent);
}

Expand All @@ -114,7 +113,7 @@ class JSPropsUpdaterFabric implements IJSPropsUpdater {
if (!JSPropsUpdaterFabric.isInitialized) {
return;
}
const viewTag = findNodeHandle(animatedComponent);
const viewTag = animatedComponent.getComponentViewTag();
JSPropsUpdaterFabric._tagToComponentMapping.delete(viewTag);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class NativeEventsManager implements INativeEventsManager {
public updateEvents(
prevProps: AnimatedComponentProps<InitialComponentProps>
) {
const computedEventTag = this.getEventViewTag();
const computedEventTag = this.getEventViewTag(true);
// If the event view tag changes, we need to completely re-mount all events
if (this.#eventViewTag !== computedEventTag) {
// Remove all bindings from previous props that ran on the old viewTag
Expand Down Expand Up @@ -77,23 +77,54 @@ export class NativeEventsManager implements INativeEventsManager {
});
}

private getEventViewTag() {
private getEventViewTag(componentUpdate: boolean = false) {
// Get the tag for registering events - since the event emitting view can be nested inside the main component
const componentAnimatedRef = this.#managedComponent
._component as AnimatedComponentRef;
let newTag: number;
._componentRef as AnimatedComponentRef & {
// Fabric
__nativeTag?: number;
// Paper
_nativeTag?: number;
};
if (componentAnimatedRef.getScrollableNode) {
/*
In most cases, getScrollableNode() returns a view tag, and findNodeHandle is not required.
However, to cover more exotic list cases, we will continue to use findNodeHandle
for consistency. For numerical values, findNodeHandle should return the value immediately,
as documented here: https://github.com/facebook/react/blob/91061073d57783c061889ac6720ef1ab7f0c2149/packages/react-native-renderer/src/ReactNativePublicCompat.js#L113
*/
const scrollableNode = componentAnimatedRef.getScrollableNode();
newTag = findNodeHandle(scrollableNode) ?? -1;
} else {
newTag =
findNodeHandle(
this.#componentOptions?.setNativeProps
? this.#managedComponent
: componentAnimatedRef
) ?? -1;
if (typeof scrollableNode === 'number') {
return scrollableNode;
}
return findNodeHandle(scrollableNode) ?? -1;
}
if (this.#componentOptions?.setNativeProps) {
// This case ensures backward compatibility with components that
// have their own setNativeProps method passed as an option.
return findNodeHandle(this.#managedComponent) ?? -1;
}
if (!componentUpdate) {
// On the first render of a component, we may already receive a resolved view tag.
return this.#managedComponent.getComponentViewTag();
}
if (componentAnimatedRef.__nativeTag || componentAnimatedRef._nativeTag) {
/*
Fast path for native refs,
_nativeTag is used by Paper components,
__nativeTag is used by Fabric components.
*/
return (
componentAnimatedRef.__nativeTag ??
componentAnimatedRef._nativeTag ??
-1
);
}
return newTag;
/*
When a component is updated, a child could potentially change and have a different
view tag. This can occur with a GestureDetector component.
*/
return findNodeHandle(componentAnimatedRef) ?? -1;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,10 @@ export interface AnimatedComponentRef extends Component {
export interface IAnimatedComponentInternal {
_styles: StyleProps[] | null;
_animatedProps?: Partial<AnimatedComponentProps<AnimatedProps>>;
/**
* Used for Shared Element Transitions, Layout Animations and Animated Styles.
* It is not related to event handling.
*/
_componentViewTag: number;
_isFirstRender: boolean;
jestInlineStyle: NestedArray<StyleProps> | undefined;
jestAnimatedStyle: { value: StyleProps };
_component: AnimatedComponentRef | HTMLElement | null;
_componentRef: AnimatedComponentRef | HTMLElement | null;
_sharedElementTransition: SharedTransition | null;
_jsPropsUpdater: IJSPropsUpdater;
_InlinePropManager: IInlinePropManager;
Expand All @@ -117,6 +112,11 @@ export interface IAnimatedComponentInternal {
_NativeEventsManager?: INativeEventsManager;
_viewInfo?: ViewInfo;
context: React.ContextType<typeof SkipEnteringContext>;
/**
* Used for Shared Element Transitions, Layout Animations and Animated Styles.
* It is not related to event handling.
*/
getComponentViewTag: () => number;
}

export type NestedArray<T> = T | NestedArray<T>[];
Expand Down
Loading
Loading