react-native-reanimated 3.8.0 → 3.9.0-layout-animation-experimental
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Common/cpp/Fabric/ShadowTreeCloner.cpp +5 -2
- package/Common/cpp/LayoutAnimations/LayoutAnimationsManager.cpp +42 -32
- package/Common/cpp/LayoutAnimations/LayoutAnimationsManager.h +5 -7
- package/Common/cpp/LayoutAnimations/LayoutAnimationsProxy.cpp +565 -0
- package/Common/cpp/LayoutAnimations/LayoutAnimationsProxy.h +74 -0
- package/Common/cpp/LayoutAnimations/LayoutAnimationsUtils.h +140 -0
- package/Common/cpp/NativeModules/NativeReanimatedModule.cpp +216 -58
- package/Common/cpp/NativeModules/NativeReanimatedModule.h +32 -11
- package/Common/cpp/NativeModules/NativeReanimatedModuleSpec.cpp +2 -17
- package/Common/cpp/NativeModules/NativeReanimatedModuleSpec.h +6 -8
- package/Common/cpp/ReanimatedRuntime/RNRuntimeDecorator.cpp +3 -0
- package/Common/cpp/ReanimatedRuntime/WorkletRuntime.cpp +3 -4
- package/Common/cpp/ReanimatedRuntime/WorkletRuntimeDecorator.cpp +8 -3
- package/Common/cpp/SharedItems/Shareables.cpp +31 -5
- package/Common/cpp/SharedItems/Shareables.h +18 -2
- package/Common/cpp/Tools/JSScheduler.cpp +29 -5
- package/Common/cpp/Tools/JSScheduler.h +21 -4
- package/Common/cpp/Tools/PlatformDepMethodsHolder.h +6 -2
- package/Common/cpp/Tools/UIRuntimeDecorator.cpp +6 -0
- package/Common/cpp/Tools/UIRuntimeDecorator.h +1 -0
- package/android/CMakeLists.txt +3 -0
- package/android/build.gradle +17 -5
- package/android/src/main/cpp/NativeProxy.cpp +77 -12
- package/android/src/main/cpp/NativeProxy.h +35 -1
- package/android/src/main/java/com/swmansion/reanimated/NodesManager.java +58 -19
- package/android/src/main/java/com/swmansion/reanimated/ReanimatedPackage.java +7 -2
- package/android/src/{reactNativeVersionPatch/ReanimatedUIManager/latest → main/java}/com/swmansion/reanimated/ReanimatedUIManagerFactory.java +5 -5
- package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/AnimationsManager.java +10 -6
- package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/ReanimatedNativeHierarchyManager.java +18 -1
- package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/SharedTransitionManager.java +105 -17
- package/android/src/main/java/com/swmansion/reanimated/sensor/ReanimatedSensor.java +2 -1
- package/android/src/paper/java/com/swmansion/reanimated/NativeReanimatedModuleSpec.java +37 -0
- package/android/src/{main/java/com/swmansion/reanimated → reactNativeVersionPatch/ReanimatedUIManager/73/com/swmansion}/ReanimatedModule.java +4 -3
- package/android/src/reactNativeVersionPatch/ReanimatedUIManager/{70 → 73}/com/swmansion/reanimated/layoutReanimation/ReanimatedUIManager.java +1 -22
- package/android/src/reactNativeVersionPatch/ReanimatedUIManager/latest/com/swmansion/reanimated/ReanimatedModule.java +176 -0
- package/android/src/reactNativeVersionPatch/ReanimatedUIManager/latest/com/swmansion/reanimated/layoutReanimation/ReanimatedUIManager.java +0 -26
- package/android/src/{fabric/java → reactNativeVersionPatch/RuntimeExecutor/73}/com/swmansion/reanimated/NativeProxy.java +16 -4
- package/android/src/reactNativeVersionPatch/RuntimeExecutor/latest/com/swmansion/reanimated/NativeProxy.java +143 -0
- package/apple/LayoutReanimation/REAAnimationsManager.h +3 -0
- package/apple/LayoutReanimation/REAAnimationsManager.m +11 -0
- package/apple/LayoutReanimation/REASharedTransitionManager.m +99 -23
- package/apple/LayoutReanimation/REASnapshot.h +1 -0
- package/apple/LayoutReanimation/REASnapshot.m +78 -37
- package/apple/REAModule.h +22 -2
- package/apple/REAModule.mm +97 -46
- package/apple/REANodesManager.h +3 -3
- package/apple/REANodesManager.mm +46 -22
- package/apple/native/NativeProxy.h +28 -2
- package/apple/native/NativeProxy.mm +65 -195
- package/apple/native/PlatformDepMethodsHolderImpl.h +59 -0
- package/apple/native/PlatformDepMethodsHolderImpl.mm +429 -0
- package/apple/sensor/ReanimatedSensor.m +5 -5
- package/lib/module/Animated.js.map +1 -1
- package/lib/module/ConfigHelper.js +1 -1
- package/lib/module/ConfigHelper.js.map +1 -1
- package/lib/module/animationBuilder.js +1 -0
- package/lib/module/animationBuilder.js.map +1 -1
- package/lib/module/createAnimatedComponent/InlinePropManager.js +4 -4
- package/lib/module/createAnimatedComponent/InlinePropManager.js.map +1 -1
- package/lib/module/createAnimatedComponent/JSPropsUpdater.js +9 -6
- package/lib/module/createAnimatedComponent/JSPropsUpdater.js.map +1 -1
- package/lib/module/createAnimatedComponent/JSPropsUpdater.web.js +11 -0
- package/lib/module/createAnimatedComponent/JSPropsUpdater.web.js.map +1 -0
- package/lib/module/createAnimatedComponent/PropsFilter.js +25 -9
- package/lib/module/createAnimatedComponent/PropsFilter.js.map +1 -1
- package/lib/module/createAnimatedComponent/commonTypes.js.map +1 -1
- package/lib/module/createAnimatedComponent/createAnimatedComponent.js +83 -52
- package/lib/module/createAnimatedComponent/createAnimatedComponent.js.map +1 -1
- package/lib/module/createAnimatedComponent/getViewInfo.js +37 -0
- package/lib/module/createAnimatedComponent/getViewInfo.js.map +1 -0
- package/lib/module/createAnimatedComponent/index.js.map +1 -1
- package/lib/module/createAnimatedComponent/setAndForwardRef.js +4 -5
- package/lib/module/createAnimatedComponent/setAndForwardRef.js.map +1 -1
- package/lib/module/createAnimatedComponent/utils.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/index.web.js +1 -2
- package/lib/module/index.web.js.map +1 -1
- package/lib/module/mock.js +12 -12
- package/lib/module/mock.js.map +1 -1
- package/lib/module/propsAllowlists.js.map +1 -1
- package/lib/module/reanimated2/Bezier.js.map +1 -1
- package/lib/module/reanimated2/Colors.js +4 -11
- package/lib/module/reanimated2/Colors.js.map +1 -1
- package/lib/module/reanimated2/Easing.js +3 -7
- package/lib/module/reanimated2/Easing.js.map +1 -1
- package/lib/module/reanimated2/NativeReanimated/NativeReanimated.js +16 -13
- package/lib/module/reanimated2/NativeReanimated/NativeReanimated.js.map +1 -1
- package/lib/module/reanimated2/NativeReanimated/index.js.map +1 -1
- package/lib/module/reanimated2/NativeReanimated/index.web.js.map +1 -1
- package/lib/module/reanimated2/PlatformChecker.js +2 -1
- package/lib/module/reanimated2/PlatformChecker.js.map +1 -1
- package/lib/module/reanimated2/PropAdapters.js +1 -1
- package/lib/module/reanimated2/PropAdapters.js.map +1 -1
- package/lib/module/reanimated2/PropsRegistry.js +1 -2
- package/lib/module/reanimated2/PropsRegistry.js.map +1 -1
- package/lib/module/reanimated2/Sensor.js +2 -2
- package/lib/module/reanimated2/Sensor.js.map +1 -1
- package/lib/module/reanimated2/SensorContainer.js +2 -2
- package/lib/module/reanimated2/SensorContainer.js.map +1 -1
- package/lib/module/reanimated2/UpdateLayoutAnimations.js +30 -8
- package/lib/module/reanimated2/UpdateLayoutAnimations.js.map +1 -1
- package/lib/module/reanimated2/UpdateProps.js.map +1 -1
- package/lib/module/reanimated2/ViewDescriptorsSet.js.map +1 -1
- package/lib/module/reanimated2/WorkletEventHandler.js +74 -31
- package/lib/module/reanimated2/WorkletEventHandler.js.map +1 -1
- package/lib/module/reanimated2/animation/clamp.js.map +1 -1
- package/lib/module/reanimated2/animation/commonTypes.js.map +1 -1
- package/lib/module/reanimated2/animation/decay/decay.js.map +1 -1
- package/lib/module/reanimated2/animation/decay/index.js.map +1 -1
- package/lib/module/reanimated2/animation/decay/rigidDecay.js.map +1 -1
- package/lib/module/reanimated2/animation/decay/rubberBandDecay.js.map +1 -1
- package/lib/module/reanimated2/animation/decay/utils.js.map +1 -1
- package/lib/module/reanimated2/animation/delay.js.map +1 -1
- package/lib/module/reanimated2/animation/index.js.map +1 -1
- package/lib/module/reanimated2/animation/repeat.js +1 -6
- package/lib/module/reanimated2/animation/repeat.js.map +1 -1
- package/lib/module/reanimated2/animation/sequence.js +1 -5
- package/lib/module/reanimated2/animation/sequence.js.map +1 -1
- package/lib/module/reanimated2/animation/spring.js.map +1 -1
- package/lib/module/reanimated2/animation/springUtils.js +8 -10
- package/lib/module/reanimated2/animation/springUtils.js.map +1 -1
- package/lib/module/reanimated2/animation/styleAnimation.js +5 -4
- package/lib/module/reanimated2/animation/styleAnimation.js.map +1 -1
- package/lib/module/reanimated2/animation/timing.js +4 -1
- package/lib/module/reanimated2/animation/timing.js.map +1 -1
- package/lib/module/reanimated2/animation/transformationMatrix/matrixUtils.js +1 -2
- package/lib/module/reanimated2/animation/transformationMatrix/matrixUtils.js.map +1 -1
- package/lib/module/reanimated2/animation/util.js +22 -2
- package/lib/module/reanimated2/animation/util.js.map +1 -1
- package/lib/module/reanimated2/commonTypes.js +3 -1
- package/lib/module/reanimated2/commonTypes.js.map +1 -1
- package/lib/module/reanimated2/component/FlatList.js +1 -0
- package/lib/module/reanimated2/component/FlatList.js.map +1 -1
- package/lib/module/reanimated2/component/Image.js +1 -0
- package/lib/module/reanimated2/component/Image.js.map +1 -1
- package/lib/module/reanimated2/component/LayoutAnimationConfig.js +1 -0
- package/lib/module/reanimated2/component/LayoutAnimationConfig.js.map +1 -1
- package/lib/module/reanimated2/component/PerformanceMonitor.js +169 -0
- package/lib/module/reanimated2/component/PerformanceMonitor.js.map +1 -0
- package/lib/module/reanimated2/component/ScrollView.js +1 -0
- package/lib/module/reanimated2/component/ScrollView.js.map +1 -1
- package/lib/module/reanimated2/component/Text.js +1 -0
- package/lib/module/reanimated2/component/Text.js.map +1 -1
- package/lib/module/reanimated2/component/View.js +1 -0
- package/lib/module/reanimated2/component/View.js.map +1 -1
- package/lib/module/reanimated2/core.js +6 -15
- package/lib/module/reanimated2/core.js.map +1 -1
- package/lib/module/reanimated2/errors.js +8 -8
- package/lib/module/reanimated2/errors.js.map +1 -1
- package/lib/module/reanimated2/fabricUtils.js +33 -8
- package/lib/module/reanimated2/fabricUtils.js.map +1 -1
- package/lib/module/reanimated2/fabricUtils.web.js.map +1 -1
- package/lib/module/reanimated2/frameCallback/FrameCallbackRegistryJS.js +2 -2
- package/lib/module/reanimated2/frameCallback/FrameCallbackRegistryJS.js.map +1 -1
- package/lib/module/reanimated2/frameCallback/FrameCallbackRegistryUI.js.map +1 -1
- package/lib/module/reanimated2/frameCallback/index.js.map +1 -1
- package/lib/module/reanimated2/globals.d.js.map +1 -1
- package/lib/module/reanimated2/helperTypes.js.map +1 -1
- package/lib/module/reanimated2/hook/commonTypes.js.map +1 -1
- package/lib/module/reanimated2/hook/index.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedGestureHandler.js +1 -0
- package/lib/module/reanimated2/hook/useAnimatedGestureHandler.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedKeyboard.js +3 -4
- package/lib/module/reanimated2/hook/useAnimatedKeyboard.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedProps.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedReaction.js +1 -0
- package/lib/module/reanimated2/hook/useAnimatedReaction.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedRef.js +12 -7
- package/lib/module/reanimated2/hook/useAnimatedRef.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedScrollHandler.js +3 -1
- package/lib/module/reanimated2/hook/useAnimatedScrollHandler.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedSensor.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedStyle.js +3 -6
- package/lib/module/reanimated2/hook/useAnimatedStyle.js.map +1 -1
- package/lib/module/reanimated2/hook/useDerivedValue.js +3 -1
- package/lib/module/reanimated2/hook/useDerivedValue.js.map +1 -1
- package/lib/module/reanimated2/hook/useEvent.js +4 -5
- package/lib/module/reanimated2/hook/useEvent.js.map +1 -1
- package/lib/module/reanimated2/hook/useFrameCallback.js +1 -2
- package/lib/module/reanimated2/hook/useFrameCallback.js.map +1 -1
- package/lib/module/reanimated2/hook/useHandler.js +3 -1
- package/lib/module/reanimated2/hook/useHandler.js.map +1 -1
- package/lib/module/reanimated2/hook/useReducedMotion.js.map +1 -1
- package/lib/module/reanimated2/hook/useScrollViewOffset.js +60 -16
- package/lib/module/reanimated2/hook/useScrollViewOffset.js.map +1 -1
- package/lib/module/reanimated2/hook/useSharedValue.js.map +1 -1
- package/lib/module/reanimated2/hook/useWorkletCallback.js.map +1 -1
- package/lib/module/reanimated2/hook/utils.js.map +1 -1
- package/lib/module/reanimated2/index.js +2 -0
- package/lib/module/reanimated2/index.js.map +1 -1
- package/lib/module/reanimated2/initializers.js +1 -5
- package/lib/module/reanimated2/initializers.js.map +1 -1
- package/lib/module/reanimated2/interpolateColor.js +2 -6
- package/lib/module/reanimated2/interpolateColor.js.map +1 -1
- package/lib/module/reanimated2/interpolation.js +1 -1
- package/lib/module/reanimated2/interpolation.js.map +1 -1
- package/lib/module/reanimated2/isSharedValue.js.map +1 -1
- package/lib/module/reanimated2/jestUtils.js +3 -6
- package/lib/module/reanimated2/jestUtils.js.map +1 -1
- package/lib/module/reanimated2/jestUtils.web.js.map +1 -1
- package/lib/module/reanimated2/js-reanimated/JSReanimated.js +5 -9
- package/lib/module/reanimated2/js-reanimated/JSReanimated.js.map +1 -1
- package/lib/module/reanimated2/js-reanimated/WebSensor.js.map +1 -1
- package/lib/module/reanimated2/js-reanimated/index.js +2 -2
- package/lib/module/reanimated2/js-reanimated/index.js.map +1 -1
- package/lib/module/reanimated2/js-reanimated/react-native-web.d.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js +4 -2
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js +12 -11
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/Keyframe.js +12 -10
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/Keyframe.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/commonTypes.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/index.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/animationsManager.js +11 -4
- package/lib/module/reanimated2/layoutReanimation/animationsManager.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Bounce.js +22 -22
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Bounce.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Fade.js +22 -22
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Fade.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Flip.js +26 -26
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Flip.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js +10 -10
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js +6 -6
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Roll.js +10 -10
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Roll.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Rotate.js +18 -18
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Rotate.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Slide.js +18 -18
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Slide.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Stretch.js +10 -10
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Stretch.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Zoom.js +34 -34
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Zoom.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/index.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js +17 -4
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js +4 -4
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js +4 -4
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js +4 -4
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js +4 -4
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js +4 -4
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/index.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/index.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/sharedTransitions/ProgressTransitionManager.js +16 -12
- package/lib/module/reanimated2/layoutReanimation/sharedTransitions/ProgressTransitionManager.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/sharedTransitions/SharedTransition.js +13 -7
- package/lib/module/reanimated2/layoutReanimation/sharedTransitions/SharedTransition.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/sharedTransitions/SharedTransition.web.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/sharedTransitions/index.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/animation/Bounce.web.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/animation/Fade.web.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/animation/Flip.web.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/animation/Lightspeed.web.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/animation/Pinwheel.web.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/animation/Roll.web.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/animation/Rotate.web.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/animation/Slide.web.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/animation/Stretch.web.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/animation/Zoom.web.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/animationParser.js +0 -2
- package/lib/module/reanimated2/layoutReanimation/web/animationParser.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/animationsManager.js +1 -2
- package/lib/module/reanimated2/layoutReanimation/web/animationsManager.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/componentStyle.js +3 -1
- package/lib/module/reanimated2/layoutReanimation/web/componentStyle.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/componentUtils.js +6 -7
- package/lib/module/reanimated2/layoutReanimation/web/componentUtils.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/config.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/createAnimation.js +2 -2
- package/lib/module/reanimated2/layoutReanimation/web/createAnimation.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/domUtils.js +4 -4
- package/lib/module/reanimated2/layoutReanimation/web/domUtils.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/index.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/transition/Fading.web.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/transition/Linear.web.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/transition/Sequenced.web.js.map +1 -1
- package/lib/module/reanimated2/mappers.js +2 -4
- package/lib/module/reanimated2/mappers.js.map +1 -1
- package/lib/module/reanimated2/mockedRequestAnimationFrame.js.map +1 -1
- package/lib/module/reanimated2/mutables.js +2 -4
- package/lib/module/reanimated2/mutables.js.map +1 -1
- package/lib/module/reanimated2/platform-specific/RNRenderer.js.map +1 -1
- package/lib/module/reanimated2/platform-specific/RNRenderer.web.js.map +1 -1
- package/lib/module/reanimated2/platform-specific/checkCppVersion.js.map +1 -1
- package/lib/module/reanimated2/platform-specific/jsVersion.js +1 -1
- package/lib/module/reanimated2/platform-specific/jsVersion.js.map +1 -1
- package/lib/module/reanimated2/platformFunctions/dispatchCommand.js +2 -4
- package/lib/module/reanimated2/platformFunctions/dispatchCommand.js.map +1 -1
- package/lib/module/reanimated2/platformFunctions/dispatchCommand.web.js.map +1 -1
- package/lib/module/reanimated2/platformFunctions/getRelativeCoords.js +2 -2
- package/lib/module/reanimated2/platformFunctions/getRelativeCoords.js.map +1 -1
- package/lib/module/reanimated2/platformFunctions/index.js.map +1 -1
- package/lib/module/reanimated2/platformFunctions/measure.js.map +1 -1
- package/lib/module/reanimated2/platformFunctions/measure.web.js.map +1 -1
- package/lib/module/reanimated2/platformFunctions/scrollTo.js.map +1 -1
- package/lib/module/reanimated2/platformFunctions/scrollTo.web.js +1 -1
- package/lib/module/reanimated2/platformFunctions/scrollTo.web.js.map +1 -1
- package/lib/module/reanimated2/platformFunctions/setGestureState.js.map +1 -1
- package/lib/module/reanimated2/platformFunctions/setGestureState.web.js.map +1 -1
- package/lib/module/reanimated2/platformFunctions/setNativeProps.js.map +1 -1
- package/lib/module/reanimated2/platformFunctions/setNativeProps.web.js.map +1 -1
- package/lib/module/reanimated2/pluginUtils.js.map +1 -1
- package/lib/module/reanimated2/publicGlobals.js.map +1 -1
- package/lib/module/reanimated2/runtimes.js +11 -19
- package/lib/module/reanimated2/runtimes.js.map +1 -1
- package/lib/module/reanimated2/screenTransition/RNScreensTurboModule.js +20 -0
- package/lib/module/reanimated2/screenTransition/RNScreensTurboModule.js.map +1 -0
- package/lib/module/reanimated2/screenTransition/animationManager.js +41 -0
- package/lib/module/reanimated2/screenTransition/animationManager.js.map +1 -0
- package/lib/module/reanimated2/screenTransition/commonTypes.js +4 -0
- package/lib/module/reanimated2/screenTransition/commonTypes.js.map +1 -0
- package/lib/module/reanimated2/screenTransition/index.js +5 -0
- package/lib/module/reanimated2/screenTransition/index.js.map +1 -0
- package/lib/module/reanimated2/screenTransition/presets.js +157 -0
- package/lib/module/reanimated2/screenTransition/presets.js.map +1 -0
- package/lib/module/reanimated2/screenTransition/styleUpdater.js +62 -0
- package/lib/module/reanimated2/screenTransition/styleUpdater.js.map +1 -0
- package/lib/module/reanimated2/screenTransition/swipeSimulator.js +190 -0
- package/lib/module/reanimated2/screenTransition/swipeSimulator.js.map +1 -0
- package/lib/module/reanimated2/shareableMappingCache.js.map +1 -1
- package/lib/module/reanimated2/shareables.js +27 -10
- package/lib/module/reanimated2/shareables.js.map +1 -1
- package/lib/module/reanimated2/threads.js +9 -34
- package/lib/module/reanimated2/threads.js.map +1 -1
- package/lib/module/reanimated2/valueSetter.js +1 -2
- package/lib/module/reanimated2/valueSetter.js.map +1 -1
- package/lib/module/reanimated2/valueUnpacker.js +4 -3
- package/lib/module/reanimated2/valueUnpacker.js.map +1 -1
- package/lib/module/specs/NativeReanimatedModule.js +5 -0
- package/lib/module/specs/NativeReanimatedModule.js.map +1 -0
- package/lib/typescript/ConfigHelper.d.ts +1 -0
- package/lib/typescript/createAnimatedComponent/InlinePropManager.d.ts +1 -1
- package/lib/typescript/createAnimatedComponent/JSPropsUpdater.web.d.ts +6 -0
- package/lib/typescript/createAnimatedComponent/PropsFilter.d.ts +3 -0
- package/lib/typescript/createAnimatedComponent/getViewInfo.d.ts +9 -0
- package/lib/typescript/reanimated2/NativeReanimated/NativeReanimated.d.ts +8 -13
- package/lib/typescript/reanimated2/UpdateLayoutAnimations.d.ts +12 -1
- package/lib/typescript/reanimated2/WorkletEventHandler.d.ts +16 -9
- package/lib/typescript/reanimated2/animation/util.d.ts +2 -0
- package/lib/typescript/reanimated2/component/LayoutAnimationConfig.d.ts +1 -1
- package/lib/typescript/reanimated2/component/PerformanceMonitor.d.ts +2 -0
- package/lib/typescript/reanimated2/core.d.ts +3 -4
- package/lib/typescript/reanimated2/hook/commonTypes.d.ts +6 -0
- package/lib/typescript/reanimated2/hook/useEvent.d.ts +2 -3
- package/lib/typescript/reanimated2/hook/useScrollViewOffset.d.ts +3 -1
- package/lib/typescript/reanimated2/index.d.ts +3 -0
- package/lib/typescript/reanimated2/js-reanimated/JSReanimated.d.ts +2 -2
- package/lib/typescript/reanimated2/layoutReanimation/animationBuilder/commonTypes.d.ts +2 -1
- package/lib/typescript/reanimated2/layoutReanimation/sharedTransitions/ProgressTransitionManager.d.ts +2 -2
- package/lib/typescript/reanimated2/layoutReanimation/sharedTransitions/SharedTransition.d.ts +2 -2
- package/lib/typescript/reanimated2/platform-specific/jsVersion.d.ts +1 -1
- package/lib/typescript/reanimated2/screenTransition/RNScreensTurboModule.d.ts +2 -0
- package/lib/typescript/reanimated2/screenTransition/animationManager.d.ts +3 -0
- package/lib/typescript/reanimated2/screenTransition/commonTypes.d.ts +38 -0
- package/lib/typescript/reanimated2/screenTransition/index.d.ts +3 -0
- package/lib/typescript/reanimated2/screenTransition/presets.d.ts +11 -0
- package/lib/typescript/reanimated2/screenTransition/styleUpdater.d.ts +3 -0
- package/lib/typescript/reanimated2/screenTransition/swipeSimulator.d.ts +2 -0
- package/lib/typescript/specs/NativeReanimatedModule.d.ts +6 -0
- package/package.json +29 -17
- package/plugin/build/plugin.js +7 -2
- package/src/ConfigHelper.ts +1 -1
- package/src/animationBuilder.tsx +2 -0
- package/src/createAnimatedComponent/InlinePropManager.ts +2 -2
- package/src/createAnimatedComponent/JSPropsUpdater.ts +7 -6
- package/src/createAnimatedComponent/JSPropsUpdater.web.ts +26 -0
- package/src/createAnimatedComponent/PropsFilter.tsx +31 -6
- package/src/createAnimatedComponent/createAnimatedComponent.tsx +108 -60
- package/src/createAnimatedComponent/getViewInfo.ts +39 -0
- package/src/mock.ts +13 -1
- package/src/reanimated2/NativeReanimated/NativeReanimated.ts +33 -35
- package/src/reanimated2/PlatformChecker.ts +3 -2
- package/src/reanimated2/PropsRegistry.ts +1 -3
- package/src/reanimated2/UpdateLayoutAnimations.ts +53 -13
- package/src/reanimated2/WorkletEventHandler.ts +98 -39
- package/src/reanimated2/animation/styleAnimation.ts +8 -6
- package/src/reanimated2/animation/timing.ts +9 -1
- package/src/reanimated2/animation/util.ts +28 -3
- package/src/reanimated2/commonTypes.ts +4 -1
- package/src/reanimated2/component/PerformanceMonitor.tsx +216 -0
- package/src/reanimated2/core.ts +9 -31
- package/src/reanimated2/errors.ts +1 -0
- package/src/reanimated2/fabricUtils.ts +43 -18
- package/src/reanimated2/globals.d.ts +11 -1
- package/src/reanimated2/hook/commonTypes.ts +10 -0
- package/src/reanimated2/hook/useAnimatedRef.ts +20 -11
- package/src/reanimated2/hook/useEvent.ts +4 -4
- package/src/reanimated2/hook/useScrollViewOffset.ts +94 -23
- package/src/reanimated2/index.ts +11 -0
- package/src/reanimated2/js-reanimated/JSReanimated.ts +7 -7
- package/src/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.ts +4 -0
- package/src/reanimated2/layoutReanimation/animationBuilder/Keyframe.ts +9 -1
- package/src/reanimated2/layoutReanimation/animationBuilder/commonTypes.ts +9 -1
- package/src/reanimated2/layoutReanimation/animationsManager.ts +10 -2
- package/src/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.ts +13 -0
- package/src/reanimated2/layoutReanimation/sharedTransitions/ProgressTransitionManager.ts +17 -8
- package/src/reanimated2/layoutReanimation/sharedTransitions/SharedTransition.ts +26 -7
- package/src/reanimated2/layoutReanimation/web/animationsManager.ts +1 -1
- package/src/reanimated2/layoutReanimation/web/componentStyle.ts +3 -1
- package/src/reanimated2/layoutReanimation/web/componentUtils.ts +1 -1
- package/src/reanimated2/layoutReanimation/web/createAnimation.ts +2 -2
- package/src/reanimated2/platform-specific/jsVersion.ts +1 -1
- package/src/reanimated2/platformFunctions/getRelativeCoords.ts +2 -2
- package/src/reanimated2/screenTransition/RNScreensTurboModule.ts +29 -0
- package/src/reanimated2/screenTransition/animationManager.ts +45 -0
- package/src/reanimated2/screenTransition/commonTypes.ts +63 -0
- package/src/reanimated2/screenTransition/index.ts +12 -0
- package/src/reanimated2/screenTransition/presets.ts +137 -0
- package/src/reanimated2/screenTransition/styleUpdater.ts +73 -0
- package/src/reanimated2/screenTransition/swipeSimulator.ts +238 -0
- package/src/reanimated2/shareables.ts +29 -6
- package/src/reanimated2/valueUnpacker.ts +10 -3
- package/src/specs/NativeReanimatedModule.ts +9 -0
- package/android/src/reactNativeVersionPatch/ReanimatedUIManager/70/com/swmansion/reanimated/ReanimatedUIManagerFactory.java +0 -16
- package/android/src/reactNativeVersionPatch/messageQueueThread/67/com/swmansion/reanimated/ReanimatedMessageQueueThread.java +0 -12
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
#include "UIScheduler.h"
|
|
21
21
|
|
|
22
22
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
23
|
+
#include "LayoutAnimationsProxy.h"
|
|
23
24
|
#include "PropsRegistry.h"
|
|
24
25
|
#include "ReanimatedCommitHook.h"
|
|
25
26
|
#if REACT_NATIVE_MINOR_VERSION >= 73
|
|
@@ -33,18 +34,20 @@ class NativeReanimatedModule : public NativeReanimatedModuleSpec {
|
|
|
33
34
|
public:
|
|
34
35
|
NativeReanimatedModule(
|
|
35
36
|
jsi::Runtime &rnRuntime,
|
|
36
|
-
const std::shared_ptr<
|
|
37
|
+
const std::shared_ptr<JSScheduler> &jsScheduler,
|
|
37
38
|
const std::shared_ptr<MessageQueueThread> &jsQueue,
|
|
38
39
|
const std::shared_ptr<UIScheduler> &uiScheduler,
|
|
39
40
|
const PlatformDepMethodsHolder &platformDepMethodsHolder,
|
|
40
|
-
const std::string &valueUnpackerCode
|
|
41
|
+
const std::string &valueUnpackerCode,
|
|
42
|
+
const bool isBridgeless);
|
|
41
43
|
|
|
42
44
|
~NativeReanimatedModule();
|
|
43
45
|
|
|
44
46
|
jsi::Value makeShareableClone(
|
|
45
47
|
jsi::Runtime &rt,
|
|
46
48
|
const jsi::Value &value,
|
|
47
|
-
const jsi::Value &shouldRetainRemote
|
|
49
|
+
const jsi::Value &shouldRetainRemote,
|
|
50
|
+
const jsi::Value &nativeStateSource) override;
|
|
48
51
|
|
|
49
52
|
void scheduleOnUI(jsi::Runtime &rt, const jsi::Value &worklet) override;
|
|
50
53
|
jsi::Value executeOnUIRuntimeSync(jsi::Runtime &rt, const jsi::Value &worklet)
|
|
@@ -70,7 +73,11 @@ class NativeReanimatedModule : public NativeReanimatedModuleSpec {
|
|
|
70
73
|
|
|
71
74
|
jsi::Value getViewProp(
|
|
72
75
|
jsi::Runtime &rt,
|
|
76
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
77
|
+
const jsi::Value &shadowNodeWrapper,
|
|
78
|
+
#else
|
|
73
79
|
const jsi::Value &viewTag,
|
|
80
|
+
#endif
|
|
74
81
|
const jsi::Value &propName,
|
|
75
82
|
const jsi::Value &callback) override;
|
|
76
83
|
|
|
@@ -80,12 +87,6 @@ class NativeReanimatedModule : public NativeReanimatedModuleSpec {
|
|
|
80
87
|
jsi::Runtime &rt,
|
|
81
88
|
const jsi::Value &uiProps,
|
|
82
89
|
const jsi::Value &nativeProps) override;
|
|
83
|
-
jsi::Value configureLayoutAnimation(
|
|
84
|
-
jsi::Runtime &rt,
|
|
85
|
-
const jsi::Value &viewTag,
|
|
86
|
-
const jsi::Value &type,
|
|
87
|
-
const jsi::Value &sharedTransitionTag,
|
|
88
|
-
const jsi::Value &config) override;
|
|
89
90
|
jsi::Value configureLayoutAnimationBatch(
|
|
90
91
|
jsi::Runtime &rt,
|
|
91
92
|
const jsi::Value &layoutAnimationsBatch) override;
|
|
@@ -127,9 +128,19 @@ class NativeReanimatedModule : public NativeReanimatedModuleSpec {
|
|
|
127
128
|
const jsi::Value &commandNameValue,
|
|
128
129
|
const jsi::Value &argsValue);
|
|
129
130
|
|
|
131
|
+
jsi::String obtainProp(
|
|
132
|
+
jsi::Runtime &rt,
|
|
133
|
+
const jsi::Value &shadowNodeWrapper,
|
|
134
|
+
const jsi::Value &propName);
|
|
135
|
+
|
|
130
136
|
jsi::Value measure(jsi::Runtime &rt, const jsi::Value &shadowNodeValue);
|
|
131
137
|
|
|
132
138
|
void initializeFabric(const std::shared_ptr<UIManager> &uiManager);
|
|
139
|
+
|
|
140
|
+
std::string obtainPropFromShadowNode(
|
|
141
|
+
jsi::Runtime &rt,
|
|
142
|
+
const std::string &propName,
|
|
143
|
+
const ShadowNode::Shared &shadowNode);
|
|
133
144
|
#endif
|
|
134
145
|
|
|
135
146
|
jsi::Value registerSensor(
|
|
@@ -151,14 +162,21 @@ class NativeReanimatedModule : public NativeReanimatedModuleSpec {
|
|
|
151
162
|
const jsi::Value &listenerId) override;
|
|
152
163
|
|
|
153
164
|
inline LayoutAnimationsManager &layoutAnimationsManager() {
|
|
154
|
-
return layoutAnimationsManager_;
|
|
165
|
+
return *layoutAnimationsManager_;
|
|
155
166
|
}
|
|
156
167
|
|
|
157
168
|
inline jsi::Runtime &getUIRuntime() {
|
|
158
169
|
return uiWorkletRuntime_->getJSIRuntime();
|
|
159
170
|
}
|
|
160
171
|
|
|
172
|
+
public:
|
|
173
|
+
inline bool isBridgeless() const {
|
|
174
|
+
return isBridgeless_;
|
|
175
|
+
}
|
|
176
|
+
|
|
161
177
|
private:
|
|
178
|
+
void commonInit(const PlatformDepMethodsHolder &platformDepMethodsHolder);
|
|
179
|
+
|
|
162
180
|
void requestAnimationFrame(jsi::Runtime &rt, const jsi::Value &callback);
|
|
163
181
|
|
|
164
182
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
@@ -168,6 +186,8 @@ class NativeReanimatedModule : public NativeReanimatedModuleSpec {
|
|
|
168
186
|
const jsi::Value &props);
|
|
169
187
|
#endif // RCT_NEW_ARCH_ENABLED
|
|
170
188
|
|
|
189
|
+
public:
|
|
190
|
+
const bool isBridgeless_;
|
|
171
191
|
const std::shared_ptr<MessageQueueThread> jsQueue_;
|
|
172
192
|
const std::shared_ptr<JSScheduler> jsScheduler_;
|
|
173
193
|
const std::shared_ptr<UIScheduler> uiScheduler_;
|
|
@@ -181,7 +201,7 @@ class NativeReanimatedModule : public NativeReanimatedModuleSpec {
|
|
|
181
201
|
const std::function<void(const double)> onRenderCallback_;
|
|
182
202
|
AnimatedSensorModule animatedSensorModule_;
|
|
183
203
|
const std::shared_ptr<JSLogger> jsLogger_;
|
|
184
|
-
LayoutAnimationsManager layoutAnimationsManager_;
|
|
204
|
+
std::shared_ptr<LayoutAnimationsManager> layoutAnimationsManager_;
|
|
185
205
|
|
|
186
206
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
187
207
|
const SynchronouslyUpdateUIPropsFunction synchronouslyUpdateUIPropsFunction_;
|
|
@@ -190,6 +210,7 @@ class NativeReanimatedModule : public NativeReanimatedModuleSpec {
|
|
|
190
210
|
std::unordered_set<std::string>
|
|
191
211
|
animatablePropNames_; // filled by configureProps
|
|
192
212
|
std::shared_ptr<UIManager> uiManager_;
|
|
213
|
+
std::shared_ptr<LayoutAnimationsProxy> layoutAnimationsProxy_;
|
|
193
214
|
|
|
194
215
|
// After app reload, surfaceId on iOS is still 1 but on Android it's 11.
|
|
195
216
|
// We can store surfaceId of the most recent ShadowNode as a workaround.
|
|
@@ -14,7 +14,8 @@ static jsi::Value SPEC_PREFIX(makeShareableClone)(
|
|
|
14
14
|
const jsi::Value *args,
|
|
15
15
|
size_t) {
|
|
16
16
|
return static_cast<NativeReanimatedModuleSpec *>(&turboModule)
|
|
17
|
-
->makeShareableClone(
|
|
17
|
+
->makeShareableClone(
|
|
18
|
+
rt, std::move(args[0]), std::move(args[1]), std::move(args[2]));
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
// scheduler
|
|
@@ -150,20 +151,6 @@ static jsi::Value SPEC_PREFIX(unsubscribeFromKeyboardEvents)(
|
|
|
150
151
|
return jsi::Value::undefined();
|
|
151
152
|
}
|
|
152
153
|
|
|
153
|
-
static jsi::Value SPEC_PREFIX(configureLayoutAnimation)(
|
|
154
|
-
jsi::Runtime &rt,
|
|
155
|
-
TurboModule &turboModule,
|
|
156
|
-
const jsi::Value *args,
|
|
157
|
-
size_t) {
|
|
158
|
-
return static_cast<NativeReanimatedModuleSpec *>(&turboModule)
|
|
159
|
-
->configureLayoutAnimation(
|
|
160
|
-
rt,
|
|
161
|
-
std::move(args[0]),
|
|
162
|
-
std::move(args[1]),
|
|
163
|
-
std::move(args[2]),
|
|
164
|
-
std::move(args[3]));
|
|
165
|
-
}
|
|
166
|
-
|
|
167
154
|
static jsi::Value SPEC_PREFIX(configureLayoutAnimationBatch)(
|
|
168
155
|
jsi::Runtime &rt,
|
|
169
156
|
TurboModule &turboModule,
|
|
@@ -214,8 +201,6 @@ NativeReanimatedModuleSpec::NativeReanimatedModuleSpec(
|
|
|
214
201
|
methodMap_["unsubscribeFromKeyboardEvents"] =
|
|
215
202
|
MethodMetadata{1, SPEC_PREFIX(unsubscribeFromKeyboardEvents)};
|
|
216
203
|
|
|
217
|
-
methodMap_["configureLayoutAnimation"] =
|
|
218
|
-
MethodMetadata{4, SPEC_PREFIX(configureLayoutAnimation)};
|
|
219
204
|
methodMap_["configureLayoutAnimationBatch"] =
|
|
220
205
|
MethodMetadata{1, SPEC_PREFIX(configureLayoutAnimationBatch)};
|
|
221
206
|
methodMap_["setShouldAnimateExitingForTag"] =
|
|
@@ -27,7 +27,8 @@ class JSI_EXPORT NativeReanimatedModuleSpec : public TurboModule {
|
|
|
27
27
|
virtual jsi::Value makeShareableClone(
|
|
28
28
|
jsi::Runtime &rt,
|
|
29
29
|
const jsi::Value &value,
|
|
30
|
-
const jsi::Value &shouldRetainRemote
|
|
30
|
+
const jsi::Value &shouldRetainRemote,
|
|
31
|
+
const jsi::Value &nativeStateSource) = 0;
|
|
31
32
|
|
|
32
33
|
// Scheduling
|
|
33
34
|
virtual void scheduleOnUI(jsi::Runtime &rt, const jsi::Value &worklet) = 0;
|
|
@@ -58,7 +59,11 @@ class JSI_EXPORT NativeReanimatedModuleSpec : public TurboModule {
|
|
|
58
59
|
// views
|
|
59
60
|
virtual jsi::Value getViewProp(
|
|
60
61
|
jsi::Runtime &rt,
|
|
62
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
63
|
+
const jsi::Value &shadowNodeWrapper,
|
|
64
|
+
#else
|
|
61
65
|
const jsi::Value &viewTag,
|
|
66
|
+
#endif
|
|
62
67
|
const jsi::Value &propName,
|
|
63
68
|
const jsi::Value &callback) = 0;
|
|
64
69
|
|
|
@@ -92,13 +97,6 @@ class JSI_EXPORT NativeReanimatedModuleSpec : public TurboModule {
|
|
|
92
97
|
const jsi::Value &nativeProps) = 0;
|
|
93
98
|
|
|
94
99
|
// layout animations
|
|
95
|
-
virtual jsi::Value configureLayoutAnimation(
|
|
96
|
-
jsi::Runtime &rt,
|
|
97
|
-
const jsi::Value &viewTag,
|
|
98
|
-
const jsi::Value &type,
|
|
99
|
-
const jsi::Value &sharedTransitionTag,
|
|
100
|
-
const jsi::Value &config) = 0;
|
|
101
|
-
|
|
102
100
|
virtual jsi::Value configureLayoutAnimationBatch(
|
|
103
101
|
jsi::Runtime &rt,
|
|
104
102
|
const jsi::Value &layoutAnimationsBatch) = 0;
|
|
@@ -29,6 +29,9 @@ void RNRuntimeDecorator::decorate(
|
|
|
29
29
|
#endif // RCT_NEW_ARCH_ENABLED
|
|
30
30
|
rnRuntime.global().setProperty(rnRuntime, "_IS_FABRIC", isFabric);
|
|
31
31
|
|
|
32
|
+
rnRuntime.global().setProperty(
|
|
33
|
+
rnRuntime, "_IS_BRIDGELESS", nativeReanimatedModule->isBridgeless());
|
|
34
|
+
|
|
32
35
|
#ifndef NDEBUG
|
|
33
36
|
checkJSVersion(rnRuntime, nativeReanimatedModule->getJSLogger());
|
|
34
37
|
#endif // NDEBUG
|
|
@@ -75,10 +75,9 @@ WorkletRuntime::WorkletRuntime(
|
|
|
75
75
|
|
|
76
76
|
auto codeBuffer = std::make_shared<const jsi::StringBuffer>(
|
|
77
77
|
"(" + valueUnpackerCode + "\n)");
|
|
78
|
-
auto valueUnpacker =
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
.asFunction(rt);
|
|
78
|
+
auto valueUnpacker = rt.evaluateJavaScript(codeBuffer, "valueUnpacker")
|
|
79
|
+
.asObject(rt)
|
|
80
|
+
.asFunction(rt);
|
|
82
81
|
rt.global().setProperty(rt, "__valueUnpacker", valueUnpacker);
|
|
83
82
|
}
|
|
84
83
|
|
|
@@ -62,7 +62,7 @@ void WorkletRuntimeDecorator::decorate(
|
|
|
62
62
|
jsi::PropNameID::forAscii(rt, "evalWithSourceUrl"),
|
|
63
63
|
1,
|
|
64
64
|
evalWithSourceUrl));
|
|
65
|
-
#endif
|
|
65
|
+
#endif // NDEBUG
|
|
66
66
|
|
|
67
67
|
jsi_utils::installJsiFunction(
|
|
68
68
|
rt, "_toString", [](jsi::Runtime &rt, const jsi::Value &value) {
|
|
@@ -75,9 +75,14 @@ void WorkletRuntimeDecorator::decorate(
|
|
|
75
75
|
});
|
|
76
76
|
|
|
77
77
|
jsi_utils::installJsiFunction(
|
|
78
|
-
rt,
|
|
78
|
+
rt,
|
|
79
|
+
"_makeShareableClone",
|
|
80
|
+
[](jsi::Runtime &rt,
|
|
81
|
+
const jsi::Value &value,
|
|
82
|
+
const jsi::Value &nativeStateSource) {
|
|
79
83
|
auto shouldRetainRemote = jsi::Value::undefined();
|
|
80
|
-
return reanimated::makeShareableClone(
|
|
84
|
+
return reanimated::makeShareableClone(
|
|
85
|
+
rt, value, shouldRetainRemote, nativeStateSource);
|
|
81
86
|
});
|
|
82
87
|
|
|
83
88
|
jsi_utils::installJsiFunction(
|
|
@@ -41,7 +41,8 @@ jsi::Function getCallGuard(jsi::Runtime &rt) {
|
|
|
41
41
|
jsi::Value makeShareableClone(
|
|
42
42
|
jsi::Runtime &rt,
|
|
43
43
|
const jsi::Value &value,
|
|
44
|
-
const jsi::Value &shouldRetainRemote
|
|
44
|
+
const jsi::Value &shouldRetainRemote,
|
|
45
|
+
const jsi::Value &nativeStateSource) {
|
|
45
46
|
std::shared_ptr<Shareable> shareable;
|
|
46
47
|
if (value.isObject()) {
|
|
47
48
|
auto object = value.asObject(rt);
|
|
@@ -76,10 +77,11 @@ jsi::Value makeShareableClone(
|
|
|
76
77
|
std::make_shared<ShareableHostObject>(rt, object.getHostObject(rt));
|
|
77
78
|
} else {
|
|
78
79
|
if (shouldRetainRemote.isBool() && shouldRetainRemote.getBool()) {
|
|
79
|
-
shareable =
|
|
80
|
-
|
|
80
|
+
shareable = std::make_shared<RetainingShareable<ShareableObject>>(
|
|
81
|
+
rt, object, nativeStateSource);
|
|
81
82
|
} else {
|
|
82
|
-
shareable =
|
|
83
|
+
shareable =
|
|
84
|
+
std::make_shared<ShareableObject>(rt, object, nativeStateSource);
|
|
83
85
|
}
|
|
84
86
|
}
|
|
85
87
|
} else if (value.isString()) {
|
|
@@ -198,6 +200,24 @@ ShareableObject::ShareableObject(jsi::Runtime &rt, const jsi::Object &object)
|
|
|
198
200
|
auto value = extractShareableOrThrow(rt, object.getProperty(rt, key));
|
|
199
201
|
data_.emplace_back(key.utf8(rt), value);
|
|
200
202
|
}
|
|
203
|
+
#if REACT_NATIVE_MINOR_VERSION >= 71
|
|
204
|
+
if (object.hasNativeState(rt)) {
|
|
205
|
+
nativeState_ = object.getNativeState(rt);
|
|
206
|
+
}
|
|
207
|
+
#endif
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
ShareableObject::ShareableObject(
|
|
211
|
+
jsi::Runtime &rt,
|
|
212
|
+
const jsi::Object &object,
|
|
213
|
+
const jsi::Value &nativeStateSource)
|
|
214
|
+
: ShareableObject(rt, object) {
|
|
215
|
+
#if REACT_NATIVE_MINOR_VERSION >= 71
|
|
216
|
+
if (nativeStateSource.isObject() &&
|
|
217
|
+
nativeStateSource.asObject(rt).hasNativeState(rt)) {
|
|
218
|
+
nativeState_ = nativeStateSource.asObject(rt).getNativeState(rt);
|
|
219
|
+
}
|
|
220
|
+
#endif
|
|
201
221
|
}
|
|
202
222
|
|
|
203
223
|
jsi::Value ShareableObject::toJSValue(jsi::Runtime &rt) {
|
|
@@ -206,6 +226,11 @@ jsi::Value ShareableObject::toJSValue(jsi::Runtime &rt) {
|
|
|
206
226
|
obj.setProperty(
|
|
207
227
|
rt, data_[i].first.c_str(), data_[i].second->getJSValue(rt));
|
|
208
228
|
}
|
|
229
|
+
#if REACT_NATIVE_MINOR_VERSION >= 71
|
|
230
|
+
if (nativeState_ != nullptr) {
|
|
231
|
+
obj.setNativeState(rt, nativeState_);
|
|
232
|
+
}
|
|
233
|
+
#endif
|
|
209
234
|
return obj;
|
|
210
235
|
}
|
|
211
236
|
|
|
@@ -238,7 +263,8 @@ jsi::Value ShareableRemoteFunction::toJSValue(jsi::Runtime &rt) {
|
|
|
238
263
|
return getValueUnpacker(rt).call(
|
|
239
264
|
rt,
|
|
240
265
|
ShareableJSRef::newHostObject(rt, shared_from_this()),
|
|
241
|
-
jsi::String::createFromAscii(rt, "RemoteFunction")
|
|
266
|
+
jsi::String::createFromAscii(rt, "RemoteFunction"),
|
|
267
|
+
jsi::String::createFromUtf8(rt, name_));
|
|
242
268
|
#else
|
|
243
269
|
return ShareableJSRef::newHostObject(rt, shared_from_this());
|
|
244
270
|
#endif
|
|
@@ -146,7 +146,8 @@ class ShareableJSRef : public jsi::HostObject {
|
|
|
146
146
|
jsi::Value makeShareableClone(
|
|
147
147
|
jsi::Runtime &rt,
|
|
148
148
|
const jsi::Value &value,
|
|
149
|
-
const jsi::Value &shouldRetainRemote
|
|
149
|
+
const jsi::Value &shouldRetainRemote,
|
|
150
|
+
const jsi::Value &nativeStateSource);
|
|
150
151
|
|
|
151
152
|
std::shared_ptr<Shareable> extractShareableOrThrow(
|
|
152
153
|
jsi::Runtime &rt,
|
|
@@ -182,10 +183,18 @@ class ShareableObject : public Shareable {
|
|
|
182
183
|
public:
|
|
183
184
|
ShareableObject(jsi::Runtime &rt, const jsi::Object &object);
|
|
184
185
|
|
|
186
|
+
ShareableObject(
|
|
187
|
+
jsi::Runtime &rt,
|
|
188
|
+
const jsi::Object &object,
|
|
189
|
+
const jsi::Value &nativeStateSource);
|
|
190
|
+
|
|
185
191
|
jsi::Value toJSValue(jsi::Runtime &rt) override;
|
|
186
192
|
|
|
187
193
|
protected:
|
|
188
194
|
std::vector<std::pair<std::string, std::shared_ptr<Shareable>>> data_;
|
|
195
|
+
#if REACT_NATIVE_MINOR_VERSION >= 71
|
|
196
|
+
std::shared_ptr<jsi::NativeState> nativeState_;
|
|
197
|
+
#endif
|
|
189
198
|
};
|
|
190
199
|
|
|
191
200
|
class ShareableHostObject : public Shareable {
|
|
@@ -256,13 +265,20 @@ class ShareableRemoteFunction
|
|
|
256
265
|
public std::enable_shared_from_this<ShareableRemoteFunction> {
|
|
257
266
|
private:
|
|
258
267
|
jsi::Runtime *runtime_;
|
|
268
|
+
#ifndef NDEBUG
|
|
269
|
+
const std::string name_;
|
|
270
|
+
#endif
|
|
259
271
|
std::unique_ptr<jsi::Value> function_;
|
|
260
272
|
|
|
261
273
|
public:
|
|
262
274
|
ShareableRemoteFunction(jsi::Runtime &rt, jsi::Function &&function)
|
|
263
275
|
: Shareable(RemoteFunctionType),
|
|
264
276
|
runtime_(&rt),
|
|
265
|
-
|
|
277
|
+
#ifndef NDEBUG
|
|
278
|
+
name_(function.getProperty(rt, "name").asString(rt).utf8(rt)),
|
|
279
|
+
#endif
|
|
280
|
+
function_(std::make_unique<jsi::Value>(rt, std::move(function))) {
|
|
281
|
+
}
|
|
266
282
|
|
|
267
283
|
~ShareableRemoteFunction() {
|
|
268
284
|
cleanupIfRuntimeExists(runtime_, function_);
|
|
@@ -1,12 +1,36 @@
|
|
|
1
1
|
#include "JSScheduler.h"
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
using namespace facebook;
|
|
3
|
+
using namespace react;
|
|
4
4
|
|
|
5
5
|
namespace reanimated {
|
|
6
|
+
JSScheduler::JSScheduler(
|
|
7
|
+
jsi::Runtime &rnRuntime,
|
|
8
|
+
const std::shared_ptr<CallInvoker> &jsCallInvoker)
|
|
9
|
+
: scheduleOnJS([&](Job job) {
|
|
10
|
+
jsCallInvoker_->invokeAsync(
|
|
11
|
+
[job = std::move(job), &rt = rnRuntime_] { job(rt); });
|
|
12
|
+
}),
|
|
13
|
+
rnRuntime_(rnRuntime),
|
|
14
|
+
jsCallInvoker_(jsCallInvoker) {}
|
|
15
|
+
|
|
16
|
+
#if REACT_NATIVE_MINOR_VERSION >= 74 && defined(RCT_NEW_ARCH_ENABLED)
|
|
17
|
+
// With `runtimeExecutor`.
|
|
18
|
+
JSScheduler::JSScheduler(
|
|
19
|
+
jsi::Runtime &rnRuntime,
|
|
20
|
+
RuntimeExecutor runtimeExecutor)
|
|
21
|
+
: scheduleOnJS([&](Job job) {
|
|
22
|
+
runtimeExecutor_(
|
|
23
|
+
[job = std::move(job)](jsi::Runtime &runtime) { job(runtime); });
|
|
24
|
+
}),
|
|
25
|
+
rnRuntime_(rnRuntime),
|
|
26
|
+
runtimeExecutor_(runtimeExecutor) {}
|
|
27
|
+
#endif // REACT_NATIVE_MINOR_VERSION >= 74 && defined(RCT_NEW_ARCH_ENABLED
|
|
6
28
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
29
|
+
const std::shared_ptr<CallInvoker> JSScheduler::getJSCallInvoker() const {
|
|
30
|
+
assert(
|
|
31
|
+
jsCallInvoker_ != nullptr &&
|
|
32
|
+
"[Reanimated] Expected jsCallInvoker, got nullptr instead.");
|
|
33
|
+
return jsCallInvoker_;
|
|
10
34
|
}
|
|
11
35
|
|
|
12
36
|
} // namespace reanimated
|
|
@@ -1,25 +1,42 @@
|
|
|
1
1
|
#pragma once
|
|
2
2
|
|
|
3
3
|
#include <ReactCommon/CallInvoker.h>
|
|
4
|
+
#include <ReactCommon/RuntimeExecutor.h>
|
|
4
5
|
#include <jsi/jsi.h>
|
|
5
6
|
|
|
6
7
|
#include <memory>
|
|
8
|
+
#include <utility>
|
|
7
9
|
|
|
8
10
|
using namespace facebook;
|
|
11
|
+
using namespace react;
|
|
12
|
+
|
|
13
|
+
using Job = std::function<void(jsi::Runtime &rt)>;
|
|
9
14
|
|
|
10
15
|
namespace reanimated {
|
|
11
16
|
|
|
12
17
|
class JSScheduler {
|
|
13
18
|
public:
|
|
19
|
+
// With `jsCallInvoker`.
|
|
14
20
|
explicit JSScheduler(
|
|
15
21
|
jsi::Runtime &rnRuntime,
|
|
16
|
-
const std::shared_ptr<
|
|
17
|
-
|
|
18
|
-
|
|
22
|
+
const std::shared_ptr<CallInvoker> &jsCallInvoker);
|
|
23
|
+
|
|
24
|
+
#if REACT_NATIVE_MINOR_VERSION >= 74 && defined(RCT_NEW_ARCH_ENABLED)
|
|
25
|
+
// With `runtimeExecutor`.
|
|
26
|
+
explicit JSScheduler(
|
|
27
|
+
jsi::Runtime &rnRuntime,
|
|
28
|
+
RuntimeExecutor runtimeExecutor);
|
|
29
|
+
#endif // REACT_NATIVE_MINOR_VERSION >= 74 && defined(RCT_NEW_ARCH_ENABLED
|
|
30
|
+
|
|
31
|
+
const std::function<void(Job)> scheduleOnJS = nullptr;
|
|
32
|
+
const std::shared_ptr<CallInvoker> getJSCallInvoker() const;
|
|
19
33
|
|
|
20
34
|
protected:
|
|
21
35
|
jsi::Runtime &rnRuntime_;
|
|
22
|
-
|
|
36
|
+
#if REACT_NATIVE_MINOR_VERSION >= 74 && defined(RCT_NEW_ARCH_ENABLED)
|
|
37
|
+
RuntimeExecutor runtimeExecutor_ = nullptr;
|
|
38
|
+
#endif // REACT_NATIVE_MINOR_VERSION >= 74 && defined(RCT_NEW_ARCH_ENABLED
|
|
39
|
+
const std::shared_ptr<CallInvoker> jsCallInvoker_ = nullptr;
|
|
23
40
|
};
|
|
24
41
|
|
|
25
42
|
} // namespace reanimated
|
|
@@ -26,6 +26,10 @@ using UpdatePropsFunction =
|
|
|
26
26
|
std::function<void(jsi::Runtime &rt, const jsi::Value &operations)>;
|
|
27
27
|
using RemoveFromPropsRegistryFunction =
|
|
28
28
|
std::function<void(jsi::Runtime &rt, const jsi::Value &viewTags)>;
|
|
29
|
+
using ObtainPropFunction = std::function<jsi::Value(
|
|
30
|
+
jsi::Runtime &rt,
|
|
31
|
+
const jsi::Value &shadowNodeWrapper,
|
|
32
|
+
const jsi::Value &propName)>;
|
|
29
33
|
using DispatchCommandFunction = std::function<void(
|
|
30
34
|
jsi::Runtime &rt,
|
|
31
35
|
const jsi::Value &shadowNodeValue,
|
|
@@ -46,13 +50,13 @@ using DispatchCommandFunction = std::function<void(
|
|
|
46
50
|
const jsi::Value &argsValue)>;
|
|
47
51
|
using MeasureFunction =
|
|
48
52
|
std::function<std::vector<std::pair<std::string, double>>(int)>;
|
|
53
|
+
using ObtainPropFunction =
|
|
54
|
+
std::function<jsi::Value(jsi::Runtime &, const int, const jsi::Value &)>;
|
|
49
55
|
|
|
50
56
|
#endif // RCT_NEW_ARCH_ENABLED
|
|
51
57
|
|
|
52
58
|
using RequestRenderFunction =
|
|
53
59
|
std::function<void(std::function<void(const double)>, jsi::Runtime &)>;
|
|
54
|
-
using ObtainPropFunction =
|
|
55
|
-
std::function<jsi::Value(jsi::Runtime &, const int, const jsi::String &)>;
|
|
56
60
|
using GetAnimationTimestampFunction = std::function<double(void)>;
|
|
57
61
|
|
|
58
62
|
using ProgressLayoutAnimationFunction =
|
|
@@ -10,6 +10,7 @@ void UIRuntimeDecorator::decorate(
|
|
|
10
10
|
#else
|
|
11
11
|
const ScrollToFunction scrollTo,
|
|
12
12
|
#endif
|
|
13
|
+
const ObtainPropFunction obtainPropFunction,
|
|
13
14
|
const UpdatePropsFunction updateProps,
|
|
14
15
|
const MeasureFunction measure,
|
|
15
16
|
const DispatchCommandFunction dispatchCommand,
|
|
@@ -44,6 +45,8 @@ void UIRuntimeDecorator::decorate(
|
|
|
44
45
|
}
|
|
45
46
|
return resultObject;
|
|
46
47
|
});
|
|
48
|
+
jsi_utils::installJsiFunction(
|
|
49
|
+
uiRuntime, "_obtainPropPaper", obtainPropFunction);
|
|
47
50
|
#endif // RCT_NEW_ARCH_ENABLED
|
|
48
51
|
|
|
49
52
|
jsi_utils::installJsiFunction(
|
|
@@ -59,6 +62,9 @@ void UIRuntimeDecorator::decorate(
|
|
|
59
62
|
jsi_utils::installJsiFunction(uiRuntime, "_setGestureState", setGestureState);
|
|
60
63
|
jsi_utils::installJsiFunction(
|
|
61
64
|
uiRuntime, "_maybeFlushUIUpdatesQueue", maybeFlushUIUpdatesQueue);
|
|
65
|
+
|
|
66
|
+
jsi_utils::installJsiFunction(
|
|
67
|
+
uiRuntime, "_obtainPropFabric", obtainPropFunction);
|
|
62
68
|
}
|
|
63
69
|
|
|
64
70
|
} // namespace reanimated
|
package/android/CMakeLists.txt
CHANGED
|
@@ -99,6 +99,8 @@ if(${REACT_NATIVE_MINOR_VERSION} GREATER_EQUAL 71)
|
|
|
99
99
|
"${REACT_NATIVE_DIR}/ReactCommon/react/renderer/graphics/platform/cxx"
|
|
100
100
|
"${REACT_NATIVE_DIR}/ReactCommon/runtimeexecutor"
|
|
101
101
|
"${REACT_NATIVE_DIR}/ReactCommon/yoga"
|
|
102
|
+
"${REACT_NATIVE_DIR}/ReactCommon/react/renderer/componentregistry"
|
|
103
|
+
"${REACT_NATIVE_DIR}/ReactCommon/react/renderer/core"
|
|
102
104
|
)
|
|
103
105
|
else()
|
|
104
106
|
file(GLOB LIBFBJNI_INCLUDE_DIR ${FBJNI_HEADERS_DIR})
|
|
@@ -307,6 +309,7 @@ if(${IS_NEW_ARCHITECTURE_ENABLED})
|
|
|
307
309
|
ReactAndroid::react_debug
|
|
308
310
|
ReactAndroid::react_render_core
|
|
309
311
|
ReactAndroid::react_render_mounting
|
|
312
|
+
ReactAndroid::react_render_componentregistry
|
|
310
313
|
ReactAndroid::react_render_scheduler
|
|
311
314
|
ReactAndroid::react_render_uimanager
|
|
312
315
|
ReactAndroid::rrc_view
|
package/android/build.gradle
CHANGED
|
@@ -130,6 +130,10 @@ def toPlatformFileString(String path) {
|
|
|
130
130
|
return path
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
+
if (isNewArchitectureEnabled()) {
|
|
134
|
+
apply plugin: "com.facebook.react"
|
|
135
|
+
}
|
|
136
|
+
|
|
133
137
|
def reactNativeRootDir = resolveReactNativeDirectory()
|
|
134
138
|
|
|
135
139
|
def reactProperties = new Properties()
|
|
@@ -362,9 +366,7 @@ android {
|
|
|
362
366
|
|
|
363
367
|
// messageQueueThread
|
|
364
368
|
if (REANIMATED_MAJOR_VERSION > 2) {
|
|
365
|
-
if (REACT_NATIVE_MINOR_VERSION <=
|
|
366
|
-
srcDirs += "src/reactNativeVersionPatch/messageQueueThread/67"
|
|
367
|
-
} else if (REACT_NATIVE_MINOR_VERSION <= 72) {
|
|
369
|
+
if (REACT_NATIVE_MINOR_VERSION <= 72) {
|
|
368
370
|
srcDirs += "src/reactNativeVersionPatch/messageQueueThread/72"
|
|
369
371
|
} else {
|
|
370
372
|
srcDirs += "src/reactNativeVersionPatch/messageQueueThread/latest"
|
|
@@ -372,8 +374,8 @@ android {
|
|
|
372
374
|
}
|
|
373
375
|
|
|
374
376
|
// ReanimatedUIManager & ReanimatedUIImplementation
|
|
375
|
-
if (REACT_NATIVE_MINOR_VERSION <=
|
|
376
|
-
srcDirs += "src/reactNativeVersionPatch/ReanimatedUIManager/
|
|
377
|
+
if (REACT_NATIVE_MINOR_VERSION <= 73) {
|
|
378
|
+
srcDirs += "src/reactNativeVersionPatch/ReanimatedUIManager/73"
|
|
377
379
|
} else {
|
|
378
380
|
srcDirs += "src/reactNativeVersionPatch/ReanimatedUIManager/latest"
|
|
379
381
|
}
|
|
@@ -386,6 +388,16 @@ android {
|
|
|
386
388
|
srcDirs += "src/reactNativeVersionPatch/ReactFeatureFlagsWrapper/latest"
|
|
387
389
|
}
|
|
388
390
|
}
|
|
391
|
+
|
|
392
|
+
// RuntimeExecutor
|
|
393
|
+
if (IS_NEW_ARCHITECTURE_ENABLED) {
|
|
394
|
+
if (REACT_NATIVE_MINOR_VERSION <= 73) {
|
|
395
|
+
srcDirs += "src/reactNativeVersionPatch/RuntimeExecutor/73"
|
|
396
|
+
} else {
|
|
397
|
+
srcDirs += "src/reactNativeVersionPatch/RuntimeExecutor/latest"
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
|
|
389
401
|
}
|
|
390
402
|
}
|
|
391
403
|
}
|