react-native-reanimated 3.0.2 → 3.2.0-nightly-20230516-474ca875c
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/FabricUtils.h +1 -1
- package/Common/cpp/NativeModules/NativeReanimatedModule.cpp +38 -27
- package/Common/cpp/SharedItems/Shareables.h +22 -0
- package/Common/cpp/Tools/PlatformDepMethodsHolder.h +2 -0
- package/Common/cpp/Tools/RuntimeDecorator.cpp +4 -1
- package/Common/cpp/Tools/RuntimeDecorator.h +2 -1
- package/Common/cpp/Tools/SingleInstanceChecker.h +14 -2
- package/RNReanimated.podspec +5 -2
- package/android/CMakeLists.txt +4 -0
- package/android/build.gradle +75 -50
- package/android/src/main/cpp/NativeProxy.cpp +316 -337
- package/android/src/main/cpp/NativeProxy.h +53 -11
- package/android/src/main/java/com/swmansion/reanimated/NativeMethodsHelper.java +7 -12
- package/android/src/main/java/com/swmansion/reanimated/NodesManager.java +11 -8
- package/android/src/main/java/com/swmansion/reanimated/keyboardObserver/ReanimatedKeyboardEventListener.java +1 -1
- package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/AnimationsManager.java +3 -3
- package/android/src/main/java/com/swmansion/reanimated/nativeProxy/NativeProxyCommon.java +21 -14
- package/android/src/main/java/com/swmansion/reanimated/sensor/ReanimatedSensorListener.java +3 -1
- package/android/src/paper/java/com/swmansion/reanimated/NativeProxy.java +0 -3
- package/ios/Fabric/REAInitializerRCTFabricSurface.mm +1 -0
- package/ios/LayoutReanimation/REAAnimationsManager.m +2 -1
- package/ios/REANodesManager.h +1 -0
- package/ios/REANodesManager.mm +92 -20
- package/ios/keyboardObserver/REAKeyboardEventObserver.m +51 -130
- package/ios/native/NativeMethods.mm +1 -1
- package/ios/native/NativeProxy.mm +4 -1
- package/ios/native/REAIOSErrorHandler.mm +1 -1
- package/ios/native/REAIOSLogger.mm +1 -1
- package/ios/native/REAIOSScheduler.mm +1 -1
- package/ios/native/REAInitializer.mm +1 -1
- package/ios/native/REAMessageThread.mm +2 -2
- package/lib/commonjs/Animated.js +0 -8
- package/lib/commonjs/Animated.js.map +1 -1
- package/lib/commonjs/ConfigHelper.js +8 -19
- package/lib/commonjs/ConfigHelper.js.map +1 -1
- package/lib/commonjs/createAnimatedComponent.js +20 -158
- package/lib/commonjs/createAnimatedComponent.js.map +1 -1
- package/lib/commonjs/index.js +0 -9
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/index.web.js +0 -7
- package/lib/commonjs/index.web.js.map +1 -1
- package/lib/commonjs/reanimated2/Bezier.js +14 -34
- package/lib/commonjs/reanimated2/Bezier.js.map +1 -1
- package/lib/commonjs/reanimated2/Colors.js +60 -132
- package/lib/commonjs/reanimated2/Colors.js.map +1 -1
- package/lib/commonjs/reanimated2/Easing.js +81 -34
- package/lib/commonjs/reanimated2/Easing.js.map +1 -1
- package/lib/commonjs/reanimated2/NativeMethods.js +8 -20
- package/lib/commonjs/reanimated2/NativeMethods.js.map +1 -1
- package/lib/commonjs/reanimated2/NativeReanimated/NativeReanimated.js +6 -33
- package/lib/commonjs/reanimated2/NativeReanimated/NativeReanimated.js.map +1 -1
- package/lib/commonjs/reanimated2/NativeReanimated/index.js +0 -7
- package/lib/commonjs/reanimated2/NativeReanimated/index.js.map +1 -1
- package/lib/commonjs/reanimated2/PlatformChecker.js +0 -6
- package/lib/commonjs/reanimated2/PlatformChecker.js.map +1 -1
- package/lib/commonjs/reanimated2/PropAdapters.js +10 -12
- package/lib/commonjs/reanimated2/PropAdapters.js.map +1 -1
- package/lib/commonjs/reanimated2/Sensor.js +69 -0
- package/lib/commonjs/reanimated2/Sensor.js.map +1 -0
- package/lib/commonjs/reanimated2/SensorContainer.js +53 -0
- package/lib/commonjs/reanimated2/SensorContainer.js.map +1 -0
- package/lib/commonjs/reanimated2/UpdateProps.js +3 -12
- package/lib/commonjs/reanimated2/UpdateProps.js.map +1 -1
- package/lib/commonjs/reanimated2/ViewDescriptorsSet.js +0 -10
- package/lib/commonjs/reanimated2/ViewDescriptorsSet.js.map +1 -1
- package/lib/commonjs/reanimated2/WorkletEventHandler.js +5 -22
- package/lib/commonjs/reanimated2/WorkletEventHandler.js.map +1 -1
- package/lib/commonjs/reanimated2/animation/decay.js +7 -18
- package/lib/commonjs/reanimated2/animation/decay.js.map +1 -1
- package/lib/commonjs/reanimated2/animation/delay.js +0 -11
- package/lib/commonjs/reanimated2/animation/delay.js.map +1 -1
- package/lib/commonjs/reanimated2/animation/index.js +0 -8
- package/lib/commonjs/reanimated2/animation/index.js.map +1 -1
- package/lib/commonjs/reanimated2/animation/repeat.js +6 -22
- package/lib/commonjs/reanimated2/animation/repeat.js.map +1 -1
- package/lib/commonjs/reanimated2/animation/sequence.js +3 -20
- package/lib/commonjs/reanimated2/animation/sequence.js.map +1 -1
- package/lib/commonjs/reanimated2/animation/spring.js +11 -23
- package/lib/commonjs/reanimated2/animation/spring.js.map +1 -1
- package/lib/commonjs/reanimated2/animation/styleAnimation.js +3 -35
- package/lib/commonjs/reanimated2/animation/styleAnimation.js.map +1 -1
- package/lib/commonjs/reanimated2/animation/timing.js +0 -11
- package/lib/commonjs/reanimated2/animation/timing.js.map +1 -1
- package/lib/commonjs/reanimated2/animation/util.js +36 -41
- package/lib/commonjs/reanimated2/animation/util.js.map +1 -1
- package/lib/commonjs/reanimated2/commonTypes.js +16 -23
- package/lib/commonjs/reanimated2/commonTypes.js.map +1 -1
- package/lib/commonjs/reanimated2/component/FlatList.js +0 -16
- package/lib/commonjs/reanimated2/component/FlatList.js.map +1 -1
- package/lib/commonjs/reanimated2/component/Image.js +0 -4
- package/lib/commonjs/reanimated2/component/Image.js.map +1 -1
- package/lib/commonjs/reanimated2/component/ScrollView.js +0 -4
- package/lib/commonjs/reanimated2/component/ScrollView.js.map +1 -1
- package/lib/commonjs/reanimated2/component/Text.js +0 -4
- package/lib/commonjs/reanimated2/component/Text.js.map +1 -1
- package/lib/commonjs/reanimated2/component/View.js +0 -4
- package/lib/commonjs/reanimated2/component/View.js.map +1 -1
- package/lib/commonjs/reanimated2/core.js +25 -52
- package/lib/commonjs/reanimated2/core.js.map +1 -1
- package/lib/commonjs/reanimated2/errors.js +3 -14
- package/lib/commonjs/reanimated2/errors.js.map +1 -1
- package/lib/commonjs/reanimated2/fabricUtils.js +3 -5
- package/lib/commonjs/reanimated2/fabricUtils.js.map +1 -1
- package/lib/commonjs/reanimated2/fabricUtils.web.js +1 -3
- package/lib/commonjs/reanimated2/fabricUtils.web.js.map +1 -1
- package/lib/commonjs/reanimated2/frameCallback/FrameCallbackRegistryJS.js +3 -12
- package/lib/commonjs/reanimated2/frameCallback/FrameCallbackRegistryJS.js.map +1 -1
- package/lib/commonjs/reanimated2/frameCallback/FrameCallbackRegistryUI.js +13 -17
- package/lib/commonjs/reanimated2/frameCallback/FrameCallbackRegistryUI.js.map +1 -1
- package/lib/commonjs/reanimated2/globals.d.js.map +1 -1
- package/lib/commonjs/reanimated2/hook/Hooks.js +0 -5
- package/lib/commonjs/reanimated2/hook/Hooks.js.map +1 -1
- package/lib/commonjs/reanimated2/hook/commonTypes.js.map +1 -1
- package/lib/commonjs/reanimated2/hook/index.js +0 -12
- package/lib/commonjs/reanimated2/hook/index.js.map +1 -1
- package/lib/commonjs/reanimated2/hook/useAnimatedGestureHandler.js +4 -17
- package/lib/commonjs/reanimated2/hook/useAnimatedGestureHandler.js.map +1 -1
- package/lib/commonjs/reanimated2/hook/useAnimatedKeyboard.js +2 -9
- package/lib/commonjs/reanimated2/hook/useAnimatedKeyboard.js.map +1 -1
- package/lib/commonjs/reanimated2/hook/useAnimatedReaction.js +1 -11
- package/lib/commonjs/reanimated2/hook/useAnimatedReaction.js.map +1 -1
- package/lib/commonjs/reanimated2/hook/useAnimatedRef.js +1 -13
- package/lib/commonjs/reanimated2/hook/useAnimatedRef.js.map +1 -1
- package/lib/commonjs/reanimated2/hook/useAnimatedScrollHandler.js +2 -9
- package/lib/commonjs/reanimated2/hook/useAnimatedScrollHandler.js.map +1 -1
- package/lib/commonjs/reanimated2/hook/useAnimatedSensor.js +20 -55
- package/lib/commonjs/reanimated2/hook/useAnimatedSensor.js.map +1 -1
- package/lib/commonjs/reanimated2/hook/useAnimatedStyle.js +13 -71
- package/lib/commonjs/reanimated2/hook/useAnimatedStyle.js.map +1 -1
- package/lib/commonjs/reanimated2/hook/useDerivedValue.js +4 -13
- package/lib/commonjs/reanimated2/hook/useDerivedValue.js.map +1 -1
- package/lib/commonjs/reanimated2/hook/useFrameCallback.js +0 -5
- package/lib/commonjs/reanimated2/hook/useFrameCallback.js.map +1 -1
- package/lib/commonjs/reanimated2/hook/useScrollViewOffset.js +0 -7
- package/lib/commonjs/reanimated2/hook/useScrollViewOffset.js.map +1 -1
- package/lib/commonjs/reanimated2/hook/useSharedValue.js +2 -7
- package/lib/commonjs/reanimated2/hook/useSharedValue.js.map +1 -1
- package/lib/commonjs/reanimated2/hook/utils.js +8 -39
- package/lib/commonjs/reanimated2/hook/utils.js.map +1 -1
- package/lib/commonjs/reanimated2/index.js +0 -26
- package/lib/commonjs/reanimated2/index.js.map +1 -1
- package/lib/commonjs/reanimated2/initializers.js +21 -43
- package/lib/commonjs/reanimated2/initializers.js.map +1 -1
- package/lib/commonjs/reanimated2/interpolateColor.js +6 -43
- package/lib/commonjs/reanimated2/interpolateColor.js.map +1 -1
- package/lib/commonjs/reanimated2/interpolation.js +14 -29
- package/lib/commonjs/reanimated2/interpolation.js.map +1 -1
- package/lib/commonjs/reanimated2/jestUtils.js +15 -48
- package/lib/commonjs/reanimated2/jestUtils.js.map +1 -1
- package/lib/commonjs/reanimated2/js-reanimated/JSReanimated.js +15 -39
- package/lib/commonjs/reanimated2/js-reanimated/JSReanimated.js.map +1 -1
- package/lib/commonjs/reanimated2/js-reanimated/Mapper.js +9 -28
- package/lib/commonjs/reanimated2/js-reanimated/Mapper.js.map +1 -1
- package/lib/commonjs/reanimated2/js-reanimated/MapperRegistry.js +7 -37
- package/lib/commonjs/reanimated2/js-reanimated/MapperRegistry.js.map +1 -1
- package/lib/commonjs/reanimated2/js-reanimated/MutableValue.js +5 -18
- package/lib/commonjs/reanimated2/js-reanimated/MutableValue.js.map +1 -1
- package/lib/commonjs/reanimated2/js-reanimated/global.js +2 -9
- package/lib/commonjs/reanimated2/js-reanimated/global.js.map +1 -1
- package/lib/commonjs/reanimated2/js-reanimated/index.js +3 -14
- package/lib/commonjs/reanimated2/js-reanimated/index.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js +7 -26
- package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js +3 -49
- package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/Keyframe.js +7 -43
- package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/Keyframe.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/commonTypes.js +4 -5
- package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/commonTypes.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/index.js +0 -4
- package/lib/commonjs/reanimated2/layoutReanimation/animationBuilder/index.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/animationsManager.js +4 -23
- package/lib/commonjs/reanimated2/layoutReanimation/animationsManager.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Bounce.js +3 -74
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Bounce.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Fade.js +3 -53
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Fade.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Flip.js +3 -63
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Flip.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js +7 -26
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js +3 -13
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Roll.js +3 -23
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Roll.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Rotate.js +3 -43
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Rotate.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Slide.js +3 -43
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Slide.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Stretch.js +3 -23
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Stretch.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Zoom.js +3 -83
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/Zoom.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/index.js +0 -20
- package/lib/commonjs/reanimated2/layoutReanimation/defaultAnimations/index.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js +3 -22
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js +5 -29
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js +3 -9
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js +5 -11
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js +3 -8
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js +3 -12
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/index.js +0 -12
- package/lib/commonjs/reanimated2/layoutReanimation/defaultTransitions/index.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/index.js +0 -9
- package/lib/commonjs/reanimated2/layoutReanimation/index.js.map +1 -1
- package/lib/commonjs/reanimated2/layoutReanimation/sharedTransitions/index.js +3 -17
- package/lib/commonjs/reanimated2/layoutReanimation/sharedTransitions/index.js.map +1 -1
- package/lib/commonjs/reanimated2/mappers.js +29 -32
- package/lib/commonjs/reanimated2/mappers.js.map +1 -1
- package/lib/commonjs/reanimated2/mock.js +5 -15
- package/lib/commonjs/reanimated2/mock.js.map +1 -1
- package/lib/commonjs/reanimated2/mutables.js +2 -28
- package/lib/commonjs/reanimated2/mutables.js.map +1 -1
- package/lib/commonjs/reanimated2/platform-specific/RNRenderer.js +0 -2
- package/lib/commonjs/reanimated2/platform-specific/RNRenderer.js.map +1 -1
- package/lib/commonjs/reanimated2/platform-specific/RNRenderer.web.js.map +1 -1
- package/lib/commonjs/reanimated2/platform-specific/checkCppVersion.js +30 -0
- package/lib/commonjs/reanimated2/platform-specific/checkCppVersion.js.map +1 -0
- package/lib/commonjs/reanimated2/platform-specific/checkVersion.web.js +0 -2
- package/lib/commonjs/reanimated2/platform-specific/checkVersion.web.js.map +1 -1
- package/lib/commonjs/reanimated2/platform-specific/jsVersion.js +14 -0
- package/lib/commonjs/reanimated2/platform-specific/jsVersion.js.map +1 -0
- package/lib/commonjs/reanimated2/pluginUtils.js +0 -1
- package/lib/commonjs/reanimated2/pluginUtils.js.map +1 -1
- package/lib/commonjs/reanimated2/shareables.js +86 -53
- package/lib/commonjs/reanimated2/shareables.js.map +1 -1
- package/lib/commonjs/reanimated2/threads.js +42 -46
- package/lib/commonjs/reanimated2/threads.js.map +1 -1
- package/lib/commonjs/reanimated2/utils.js +0 -5
- package/lib/commonjs/reanimated2/utils.js.map +1 -1
- package/lib/commonjs/reanimated2/valueSetter.js +6 -21
- package/lib/commonjs/reanimated2/valueSetter.js.map +1 -1
- package/lib/commonjs/setAndForwardRef.js +3 -3
- package/lib/commonjs/setAndForwardRef.js.map +1 -1
- package/lib/module/Animated.js.map +1 -1
- package/lib/module/ConfigHelper.js +9 -15
- package/lib/module/ConfigHelper.js.map +1 -1
- package/lib/module/createAnimatedComponent.js +20 -139
- package/lib/module/createAnimatedComponent.js.map +1 -1
- package/lib/module/index.js +0 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/index.web.js.map +1 -1
- package/lib/module/reanimated2/Bezier.js +14 -33
- package/lib/module/reanimated2/Bezier.js.map +1 -1
- package/lib/module/reanimated2/Colors.js +59 -109
- package/lib/module/reanimated2/Colors.js.map +1 -1
- package/lib/module/reanimated2/Easing.js +37 -33
- package/lib/module/reanimated2/Easing.js.map +1 -1
- package/lib/module/reanimated2/NativeMethods.js +8 -15
- package/lib/module/reanimated2/NativeMethods.js.map +1 -1
- package/lib/module/reanimated2/NativeReanimated/NativeReanimated.js +6 -29
- package/lib/module/reanimated2/NativeReanimated/NativeReanimated.js.map +1 -1
- package/lib/module/reanimated2/NativeReanimated/index.js +0 -2
- package/lib/module/reanimated2/NativeReanimated/index.js.map +1 -1
- package/lib/module/reanimated2/PlatformChecker.js.map +1 -1
- package/lib/module/reanimated2/PropAdapters.js +12 -10
- package/lib/module/reanimated2/PropAdapters.js.map +1 -1
- package/lib/module/reanimated2/Sensor.js +61 -0
- package/lib/module/reanimated2/Sensor.js.map +1 -0
- package/lib/module/reanimated2/SensorContainer.js +45 -0
- package/lib/module/reanimated2/SensorContainer.js.map +1 -0
- package/lib/module/reanimated2/UpdateProps.js +3 -5
- package/lib/module/reanimated2/UpdateProps.js.map +1 -1
- package/lib/module/reanimated2/ViewDescriptorsSet.js +0 -6
- package/lib/module/reanimated2/ViewDescriptorsSet.js.map +1 -1
- package/lib/module/reanimated2/WorkletEventHandler.js +5 -18
- package/lib/module/reanimated2/WorkletEventHandler.js.map +1 -1
- package/lib/module/reanimated2/animation/decay.js +7 -15
- package/lib/module/reanimated2/animation/decay.js.map +1 -1
- package/lib/module/reanimated2/animation/delay.js +0 -9
- 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 +6 -20
- package/lib/module/reanimated2/animation/repeat.js.map +1 -1
- package/lib/module/reanimated2/animation/sequence.js +3 -18
- package/lib/module/reanimated2/animation/sequence.js.map +1 -1
- package/lib/module/reanimated2/animation/spring.js +11 -21
- package/lib/module/reanimated2/animation/spring.js.map +1 -1
- package/lib/module/reanimated2/animation/styleAnimation.js +7 -31
- package/lib/module/reanimated2/animation/styleAnimation.js.map +1 -1
- package/lib/module/reanimated2/animation/timing.js +0 -8
- package/lib/module/reanimated2/animation/timing.js.map +1 -1
- package/lib/module/reanimated2/animation/util.js +35 -33
- package/lib/module/reanimated2/animation/util.js.map +1 -1
- package/lib/module/reanimated2/commonTypes.js +12 -19
- package/lib/module/reanimated2/commonTypes.js.map +1 -1
- package/lib/module/reanimated2/component/FlatList.js +0 -4
- package/lib/module/reanimated2/component/FlatList.js.map +1 -1
- package/lib/module/reanimated2/component/Image.js.map +1 -1
- package/lib/module/reanimated2/component/ScrollView.js.map +1 -1
- package/lib/module/reanimated2/component/Text.js.map +1 -1
- package/lib/module/reanimated2/component/View.js.map +1 -1
- package/lib/module/reanimated2/core.js +23 -26
- package/lib/module/reanimated2/core.js.map +1 -1
- package/lib/module/reanimated2/errors.js +3 -13
- package/lib/module/reanimated2/errors.js.map +1 -1
- package/lib/module/reanimated2/fabricUtils.js +3 -3
- package/lib/module/reanimated2/fabricUtils.js.map +1 -1
- package/lib/module/reanimated2/fabricUtils.web.js +1 -1
- package/lib/module/reanimated2/fabricUtils.web.js.map +1 -1
- package/lib/module/reanimated2/frameCallback/FrameCallbackRegistryJS.js +3 -8
- package/lib/module/reanimated2/frameCallback/FrameCallbackRegistryJS.js.map +1 -1
- package/lib/module/reanimated2/frameCallback/FrameCallbackRegistryUI.js +13 -15
- package/lib/module/reanimated2/frameCallback/FrameCallbackRegistryUI.js.map +1 -1
- package/lib/module/reanimated2/globals.d.js.map +1 -1
- package/lib/module/reanimated2/hook/Hooks.js +3 -2
- package/lib/module/reanimated2/hook/Hooks.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 +3 -14
- package/lib/module/reanimated2/hook/useAnimatedGestureHandler.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedKeyboard.js +2 -5
- package/lib/module/reanimated2/hook/useAnimatedKeyboard.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedReaction.js +1 -7
- package/lib/module/reanimated2/hook/useAnimatedReaction.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedRef.js +1 -7
- package/lib/module/reanimated2/hook/useAnimatedRef.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedScrollHandler.js +2 -7
- package/lib/module/reanimated2/hook/useAnimatedScrollHandler.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedSensor.js +22 -52
- package/lib/module/reanimated2/hook/useAnimatedSensor.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedStyle.js +13 -59
- package/lib/module/reanimated2/hook/useAnimatedStyle.js.map +1 -1
- package/lib/module/reanimated2/hook/useDerivedValue.js +4 -8
- package/lib/module/reanimated2/hook/useDerivedValue.js.map +1 -1
- package/lib/module/reanimated2/hook/useFrameCallback.js.map +1 -1
- package/lib/module/reanimated2/hook/useScrollViewOffset.js +0 -1
- package/lib/module/reanimated2/hook/useScrollViewOffset.js.map +1 -1
- package/lib/module/reanimated2/hook/useSharedValue.js +2 -3
- package/lib/module/reanimated2/hook/useSharedValue.js.map +1 -1
- package/lib/module/reanimated2/hook/utils.js +8 -21
- package/lib/module/reanimated2/hook/utils.js.map +1 -1
- package/lib/module/reanimated2/index.js.map +1 -1
- package/lib/module/reanimated2/initializers.js +23 -37
- package/lib/module/reanimated2/initializers.js.map +1 -1
- package/lib/module/reanimated2/interpolateColor.js +5 -34
- package/lib/module/reanimated2/interpolateColor.js.map +1 -1
- package/lib/module/reanimated2/interpolation.js +13 -28
- package/lib/module/reanimated2/interpolation.js.map +1 -1
- package/lib/module/reanimated2/jestUtils.js +15 -39
- package/lib/module/reanimated2/jestUtils.js.map +1 -1
- package/lib/module/reanimated2/js-reanimated/JSReanimated.js +15 -35
- package/lib/module/reanimated2/js-reanimated/JSReanimated.js.map +1 -1
- package/lib/module/reanimated2/js-reanimated/Mapper.js +9 -23
- package/lib/module/reanimated2/js-reanimated/Mapper.js.map +1 -1
- package/lib/module/reanimated2/js-reanimated/MapperRegistry.js +7 -35
- package/lib/module/reanimated2/js-reanimated/MapperRegistry.js.map +1 -1
- package/lib/module/reanimated2/js-reanimated/MutableValue.js +5 -16
- package/lib/module/reanimated2/js-reanimated/MutableValue.js.map +1 -1
- package/lib/module/reanimated2/js-reanimated/global.js +2 -6
- package/lib/module/reanimated2/js-reanimated/global.js.map +1 -1
- package/lib/module/reanimated2/js-reanimated/index.js +3 -9
- package/lib/module/reanimated2/js-reanimated/index.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js +7 -23
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js +3 -45
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/Keyframe.js +7 -39
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/Keyframe.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/commonTypes.js +3 -3
- 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 +4 -19
- package/lib/module/reanimated2/layoutReanimation/animationsManager.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Bounce.js +3 -52
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Bounce.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Fade.js +3 -32
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Fade.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Flip.js +3 -38
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Flip.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js +7 -16
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js +3 -8
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Roll.js +3 -14
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Roll.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Rotate.js +3 -26
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Rotate.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Slide.js +3 -26
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Slide.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Stretch.js +3 -14
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Stretch.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Zoom.js +3 -50
- 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 +3 -17
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js +5 -23
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js +3 -5
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js +5 -6
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js +3 -5
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js +3 -8
- 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/index.js +3 -13
- package/lib/module/reanimated2/layoutReanimation/sharedTransitions/index.js.map +1 -1
- package/lib/module/reanimated2/mappers.js +29 -25
- package/lib/module/reanimated2/mappers.js.map +1 -1
- package/lib/module/reanimated2/mock.js +5 -15
- package/lib/module/reanimated2/mock.js.map +1 -1
- package/lib/module/reanimated2/mutables.js +2 -19
- 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 +23 -0
- package/lib/module/reanimated2/platform-specific/checkCppVersion.js.map +1 -0
- package/lib/module/reanimated2/platform-specific/checkVersion.web.js +0 -1
- package/lib/module/reanimated2/platform-specific/checkVersion.web.js.map +1 -1
- package/lib/module/reanimated2/platform-specific/jsVersion.js +7 -0
- package/lib/module/reanimated2/platform-specific/jsVersion.js.map +1 -0
- package/lib/module/reanimated2/pluginUtils.js.map +1 -1
- package/lib/module/reanimated2/shareables.js +90 -48
- package/lib/module/reanimated2/shareables.js.map +1 -1
- package/lib/module/reanimated2/threads.js +39 -33
- package/lib/module/reanimated2/threads.js.map +1 -1
- package/lib/module/reanimated2/utils.js +0 -3
- package/lib/module/reanimated2/utils.js.map +1 -1
- package/lib/module/reanimated2/valueSetter.js +6 -19
- package/lib/module/reanimated2/valueSetter.js.map +1 -1
- package/lib/module/setAndForwardRef.js +3 -2
- package/lib/module/setAndForwardRef.js.map +1 -1
- package/package.json +51 -43
- package/plugin/build/plugin.js +713 -0
- package/plugin/build/plugin.js.map +7 -0
- package/plugin/index.js +1 -807
- package/react-native-reanimated.d.ts +7 -1
- package/scripts/reanimated_utils.rb +2 -2
- package/src/createAnimatedComponent.tsx +2 -3
- package/src/reanimated2/Easing.ts +19 -0
- package/src/reanimated2/NativeMethods.ts +9 -4
- package/src/reanimated2/NativeReanimated/NativeReanimated.ts +3 -4
- package/src/reanimated2/Sensor.ts +81 -0
- package/src/reanimated2/SensorContainer.ts +71 -0
- package/src/reanimated2/UpdateProps.ts +2 -2
- package/src/reanimated2/animation/decay.ts +7 -1
- package/src/reanimated2/animation/styleAnimation.ts +5 -1
- package/src/reanimated2/animation/util.ts +44 -0
- package/src/reanimated2/commonTypes.ts +18 -1
- package/src/reanimated2/core.ts +31 -12
- package/src/reanimated2/errors.ts +1 -0
- package/src/reanimated2/frameCallback/FrameCallbackRegistryUI.ts +12 -4
- package/src/reanimated2/globals.d.ts +73 -112
- package/src/reanimated2/hook/commonTypes.ts +1 -1
- package/src/reanimated2/hook/useAnimatedReaction.ts +2 -2
- package/src/reanimated2/hook/useAnimatedRef.ts +11 -3
- package/src/reanimated2/hook/useAnimatedSensor.ts +31 -67
- package/src/reanimated2/initializers.ts +11 -8
- package/src/reanimated2/jestUtils.ts +13 -8
- package/src/reanimated2/js-reanimated/JSReanimated.ts +5 -1
- package/src/reanimated2/js-reanimated/index.ts +1 -1
- package/src/reanimated2/mappers.ts +29 -4
- package/src/reanimated2/mock.ts +1 -0
- package/src/reanimated2/platform-specific/checkCppVersion.ts +28 -0
- package/src/reanimated2/platform-specific/jsVersion.ts +6 -0
- package/src/reanimated2/shareables.ts +99 -12
- package/src/reanimated2/threads.ts +36 -17
- package/lib/commonjs/reanimated2/platform-specific/checkVersion.js +0 -42
- package/lib/commonjs/reanimated2/platform-specific/checkVersion.js.map +0 -1
- package/lib/module/reanimated2/platform-specific/checkVersion.js +0 -35
- package/lib/module/reanimated2/platform-specific/checkVersion.js.map +0 -1
- package/src/reanimated2/platform-specific/checkVersion.ts +0 -39
|
@@ -36,7 +36,7 @@ struct UIManagerPublic {
|
|
|
36
36
|
struct BindingPublic : public jni::HybridClass<Binding>,
|
|
37
37
|
public SchedulerDelegate,
|
|
38
38
|
public LayoutAnimationStatusDelegate {
|
|
39
|
-
|
|
39
|
+
std::shared_mutex installMutex_;
|
|
40
40
|
std::shared_ptr<FabricMountingManager> mountingManager_;
|
|
41
41
|
std::shared_ptr<facebook::react::Scheduler> scheduler_;
|
|
42
42
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#include "NativeReanimatedModule.h"
|
|
2
2
|
|
|
3
3
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
4
|
+
#include <react/renderer/core/TraitCast.h>
|
|
4
5
|
#include <react/renderer/uimanager/UIManagerBinding.h>
|
|
5
6
|
#include <react/renderer/uimanager/primitives.h>
|
|
6
7
|
#endif
|
|
@@ -156,7 +157,8 @@ NativeReanimatedModule::NativeReanimatedModule(
|
|
|
156
157
|
platformDepMethodsHolder.getCurrentTime,
|
|
157
158
|
platformDepMethodsHolder.setGestureStateFunction,
|
|
158
159
|
platformDepMethodsHolder.progressLayoutAnimation,
|
|
159
|
-
platformDepMethodsHolder.endLayoutAnimation
|
|
160
|
+
platformDepMethodsHolder.endLayoutAnimation,
|
|
161
|
+
platformDepMethodsHolder.maybeFlushUIUpdatesQueueFunction);
|
|
160
162
|
onRenderCallback = [this](double timestampMs) {
|
|
161
163
|
this->renderRequested = false;
|
|
162
164
|
this->onRender(timestampMs);
|
|
@@ -254,8 +256,14 @@ jsi::Value NativeReanimatedModule::makeShareableClone(
|
|
|
254
256
|
} else if (!object.getProperty(rt, "__init").isUndefined()) {
|
|
255
257
|
shareable = std::make_shared<ShareableHandle>(runtimeHelper, rt, object);
|
|
256
258
|
} else if (object.isFunction(rt)) {
|
|
257
|
-
|
|
258
|
-
|
|
259
|
+
auto function = object.asFunction(rt);
|
|
260
|
+
if (function.isHostFunction(rt)) {
|
|
261
|
+
shareable =
|
|
262
|
+
std::make_shared<ShareableHostFunction>(rt, std::move(function));
|
|
263
|
+
} else {
|
|
264
|
+
shareable = std::make_shared<ShareableRemoteFunction>(
|
|
265
|
+
runtimeHelper, rt, std::move(function));
|
|
266
|
+
}
|
|
259
267
|
} else if (object.isArray(rt)) {
|
|
260
268
|
if (shouldRetainRemote.isBool() && shouldRetainRemote.getBool()) {
|
|
261
269
|
shareable = std::make_shared<RetainingShareable<ShareableArray>>(
|
|
@@ -547,37 +555,40 @@ void NativeReanimatedModule::performOperations() {
|
|
|
547
555
|
shadowTreeRegistry.visit(surfaceId_, [&](ShadowTree const &shadowTree) {
|
|
548
556
|
auto lock = newestShadowNodesRegistry_->createLock();
|
|
549
557
|
|
|
550
|
-
shadowTree.commit(
|
|
551
|
-
|
|
558
|
+
shadowTree.commit(
|
|
559
|
+
[&](RootShadowNode const &oldRootShadowNode) {
|
|
560
|
+
auto rootNode =
|
|
561
|
+
oldRootShadowNode.ShadowNode::clone(ShadowNodeFragment{});
|
|
552
562
|
|
|
553
|
-
|
|
554
|
-
|
|
563
|
+
ShadowTreeCloner shadowTreeCloner{
|
|
564
|
+
newestShadowNodesRegistry_, uiManager_, surfaceId_};
|
|
555
565
|
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
566
|
+
for (const auto &pair : copiedOperationsQueue) {
|
|
567
|
+
const ShadowNodeFamily &family = pair.first->getFamily();
|
|
568
|
+
react_native_assert(family.getSurfaceId() == surfaceId_);
|
|
559
569
|
|
|
560
|
-
|
|
561
|
-
|
|
570
|
+
auto newRootNode = shadowTreeCloner.cloneWithNewProps(
|
|
571
|
+
rootNode, family, RawProps(rt, *pair.second));
|
|
562
572
|
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
573
|
+
if (newRootNode == nullptr) {
|
|
574
|
+
// this happens when React removed the component but Reanimated
|
|
575
|
+
// still tries to animate it, let's skip update for this specific
|
|
576
|
+
// component
|
|
577
|
+
continue;
|
|
578
|
+
}
|
|
579
|
+
rootNode = newRootNode;
|
|
580
|
+
}
|
|
571
581
|
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
582
|
+
// remove ShadowNodes and its ancestors from NewestShadowNodesRegistry
|
|
583
|
+
for (auto tag : copiedTagsToRemove) {
|
|
584
|
+
newestShadowNodesRegistry_->remove(tag);
|
|
585
|
+
}
|
|
576
586
|
|
|
577
|
-
|
|
587
|
+
shadowTreeCloner.updateYogaChildren();
|
|
578
588
|
|
|
579
|
-
|
|
580
|
-
|
|
589
|
+
return std::static_pointer_cast<RootShadowNode>(rootNode);
|
|
590
|
+
},
|
|
591
|
+
{/* default commit options */});
|
|
581
592
|
});
|
|
582
593
|
}
|
|
583
594
|
|
|
@@ -116,6 +116,7 @@ class Shareable {
|
|
|
116
116
|
HandleType,
|
|
117
117
|
SynchronizedDataHolder,
|
|
118
118
|
HostObjectType,
|
|
119
|
+
HostFunctionType,
|
|
119
120
|
};
|
|
120
121
|
|
|
121
122
|
explicit Shareable(ValueType valueType) : valueType_(valueType) {}
|
|
@@ -273,6 +274,27 @@ class ShareableHostObject : public Shareable {
|
|
|
273
274
|
std::shared_ptr<jsi::HostObject> hostObject_;
|
|
274
275
|
};
|
|
275
276
|
|
|
277
|
+
class ShareableHostFunction : public Shareable {
|
|
278
|
+
public:
|
|
279
|
+
ShareableHostFunction(jsi::Runtime &rt, jsi::Function function)
|
|
280
|
+
: Shareable(HostFunctionType),
|
|
281
|
+
hostFunction_(
|
|
282
|
+
(assert(function.isHostFunction(rt)),
|
|
283
|
+
function.getHostFunction(rt))),
|
|
284
|
+
name_(function.getProperty(rt, "name").asString(rt).utf8(rt)),
|
|
285
|
+
paramCount_(function.getProperty(rt, "length").asNumber()) {}
|
|
286
|
+
|
|
287
|
+
jsi::Value toJSValue(jsi::Runtime &rt) override {
|
|
288
|
+
return jsi::Function::createFromHostFunction(
|
|
289
|
+
rt, jsi::PropNameID::forUtf8(rt, name_), paramCount_, hostFunction_);
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
protected:
|
|
293
|
+
jsi::HostFunctionType hostFunction_;
|
|
294
|
+
std::string name_;
|
|
295
|
+
unsigned int paramCount_;
|
|
296
|
+
};
|
|
297
|
+
|
|
276
298
|
class ShareableWorklet : public ShareableObject {
|
|
277
299
|
private:
|
|
278
300
|
std::shared_ptr<JSRuntimeHelper> runtimeHelper_;
|
|
@@ -68,6 +68,7 @@ using ConfigurePropsFunction = std::function<void(
|
|
|
68
68
|
using KeyboardEventSubscribeFunction =
|
|
69
69
|
std::function<int(std::function<void(int, int)>, bool)>;
|
|
70
70
|
using KeyboardEventUnsubscribeFunction = std::function<void(int)>;
|
|
71
|
+
using MaybeFlushUIUpdatesQueueFunction = std::function<void()>;
|
|
71
72
|
|
|
72
73
|
struct PlatformDepMethodsHolder {
|
|
73
74
|
RequestRender requestRender;
|
|
@@ -87,6 +88,7 @@ struct PlatformDepMethodsHolder {
|
|
|
87
88
|
SetGestureStateFunction setGestureStateFunction;
|
|
88
89
|
KeyboardEventSubscribeFunction subscribeForKeyboardEvents;
|
|
89
90
|
KeyboardEventUnsubscribeFunction unsubscribeFromKeyboardEvents;
|
|
91
|
+
MaybeFlushUIUpdatesQueueFunction maybeFlushUIUpdatesQueueFunction;
|
|
90
92
|
};
|
|
91
93
|
|
|
92
94
|
} // namespace reanimated
|
|
@@ -91,7 +91,8 @@ void RuntimeDecorator::decorateUIRuntime(
|
|
|
91
91
|
const TimeProviderFunction getCurrentTime,
|
|
92
92
|
const SetGestureStateFunction setGestureState,
|
|
93
93
|
const ProgressLayoutAnimationFunction progressLayoutAnimationFunction,
|
|
94
|
-
const EndLayoutAnimationFunction endLayoutAnimationFunction
|
|
94
|
+
const EndLayoutAnimationFunction endLayoutAnimationFunction,
|
|
95
|
+
const MaybeFlushUIUpdatesQueueFunction maybeFlushUIUpdatesQueueFunction) {
|
|
95
96
|
RuntimeDecorator::decorateRuntime(rt, "UI");
|
|
96
97
|
rt.global().setProperty(rt, "_UI", jsi::Value(true));
|
|
97
98
|
|
|
@@ -146,6 +147,8 @@ void RuntimeDecorator::decorateUIRuntime(
|
|
|
146
147
|
rt, "_notifyAboutEnd", endLayoutAnimationFunction);
|
|
147
148
|
|
|
148
149
|
jsi_utils::installJsiFunction(rt, "_setGestureState", setGestureState);
|
|
150
|
+
jsi_utils::installJsiFunction(
|
|
151
|
+
rt, "_maybeFlushUIUpdatesQueue", maybeFlushUIUpdatesQueueFunction);
|
|
149
152
|
}
|
|
150
153
|
|
|
151
154
|
} // namespace reanimated
|
|
@@ -52,7 +52,8 @@ class RuntimeDecorator {
|
|
|
52
52
|
const TimeProviderFunction getCurrentTime,
|
|
53
53
|
const SetGestureStateFunction setGestureState,
|
|
54
54
|
const ProgressLayoutAnimationFunction progressLayoutAnimationFunction,
|
|
55
|
-
const EndLayoutAnimationFunction endLayoutAnimationFunction
|
|
55
|
+
const EndLayoutAnimationFunction endLayoutAnimationFunction,
|
|
56
|
+
const MaybeFlushUIUpdatesQueueFunction maybeFlushUIUpdatesQueueFunction);
|
|
56
57
|
|
|
57
58
|
/**
|
|
58
59
|
Returns true if the given Runtime is the Reanimated UI-Thread Runtime.
|
|
@@ -7,6 +7,10 @@
|
|
|
7
7
|
#include <iostream>
|
|
8
8
|
#include <string>
|
|
9
9
|
|
|
10
|
+
#ifdef ANDROID
|
|
11
|
+
#include <android/log.h>
|
|
12
|
+
#endif
|
|
13
|
+
|
|
10
14
|
namespace reanimated {
|
|
11
15
|
|
|
12
16
|
// This is a class that counts how many instances of a different class there
|
|
@@ -22,8 +26,16 @@ class SingleInstanceChecker {
|
|
|
22
26
|
private:
|
|
23
27
|
void assertWithMessage(bool condition, std::string message) {
|
|
24
28
|
if (!condition) {
|
|
25
|
-
|
|
26
|
-
|
|
29
|
+
#ifdef ANDROID
|
|
30
|
+
__android_log_print(
|
|
31
|
+
ANDROID_LOG_WARN, "Reanimated", "%s", message.c_str());
|
|
32
|
+
#else
|
|
33
|
+
std::cerr << "[Reanimated] " << message << std::endl;
|
|
34
|
+
#endif
|
|
35
|
+
|
|
36
|
+
#ifdef IS_REANIMATED_EXAMPLE_APP
|
|
37
|
+
assert(false);
|
|
38
|
+
#endif
|
|
27
39
|
}
|
|
28
40
|
}
|
|
29
41
|
|
package/RNReanimated.podspec
CHANGED
|
@@ -13,6 +13,7 @@ folly_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comm
|
|
|
13
13
|
folly_compiler_flags = folly_flags + ' ' + '-Wno-comma -Wno-shorten-64-to-32'
|
|
14
14
|
boost_compiler_flags = '-Wno-documentation'
|
|
15
15
|
fabric_flags = fabric_enabled ? '-DRCT_NEW_ARCH_ENABLED' : ''
|
|
16
|
+
example_flag = config[:is_reanimated_example_app] ? '-DIS_REANIMATED_EXAMPLE_APP' : ''
|
|
16
17
|
version_flag = '-DREANIMATED_VERSION=' + reanimated_package_json["version"]
|
|
17
18
|
|
|
18
19
|
Pod::Spec.new do |s|
|
|
@@ -48,7 +49,7 @@ Pod::Spec.new do |s|
|
|
|
48
49
|
s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags + ' -DHERMES_ENABLE_DEBUGGER'
|
|
49
50
|
s.xcconfig = {
|
|
50
51
|
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/glog\" \"$(PODS_ROOT)/#{folly_prefix}Folly\" \"$(PODS_ROOT)/Headers/Public/React-hermes\" \"$(PODS_ROOT)/Headers/Public/hermes-engine\" \"$(PODS_ROOT)/#{config[:react_native_common_dir]}\"",
|
|
51
|
-
"OTHER_CFLAGS" => "$(inherited)" + " " + folly_flags + " " + fabric_flags + " " + version_flag
|
|
52
|
+
"OTHER_CFLAGS" => "$(inherited)" + " " + folly_flags + " " + fabric_flags + " " + example_flag + " " + version_flag
|
|
52
53
|
}
|
|
53
54
|
|
|
54
55
|
s.requires_arc = true
|
|
@@ -65,7 +66,9 @@ Pod::Spec.new do |s|
|
|
|
65
66
|
s.dependency "RCTTypeSafety"
|
|
66
67
|
s.dependency "ReactCommon/turbomodule/core"
|
|
67
68
|
s.dependency 'FBLazyVector'
|
|
68
|
-
|
|
69
|
+
if config[:react_native_minor_version] <= 71
|
|
70
|
+
s.dependency 'FBReactNativeSpec'
|
|
71
|
+
end
|
|
69
72
|
s.dependency 'React-Core'
|
|
70
73
|
s.dependency 'React-CoreModules'
|
|
71
74
|
s.dependency 'React-Core/DevSupport'
|
package/android/CMakeLists.txt
CHANGED
|
@@ -22,6 +22,10 @@ if(${IS_NEW_ARCHITECTURE_ENABLED})
|
|
|
22
22
|
string(APPEND CMAKE_CXX_FLAGS " -DRCT_NEW_ARCH_ENABLED")
|
|
23
23
|
endif()
|
|
24
24
|
|
|
25
|
+
if(${IS_REANIMATED_EXAMPLE_APP})
|
|
26
|
+
string(APPEND CMAKE_CXX_FLAGS " -DIS_REANIMATED_EXAMPLE_APP")
|
|
27
|
+
endif()
|
|
28
|
+
|
|
25
29
|
if(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
|
|
26
30
|
string(APPEND CMAKE_CXX_FLAGS " -DDEBUG")
|
|
27
31
|
endif()
|
package/android/build.gradle
CHANGED
|
@@ -2,6 +2,9 @@ import com.android.Version
|
|
|
2
2
|
import org.apache.tools.ant.filters.ReplaceTokens
|
|
3
3
|
import org.apache.tools.ant.taskdefs.condition.Os
|
|
4
4
|
import groovy.json.JsonSlurper
|
|
5
|
+
|
|
6
|
+
import javax.inject.Inject
|
|
7
|
+
import java.nio.file.Files
|
|
5
8
|
import java.nio.file.Paths
|
|
6
9
|
|
|
7
10
|
/**
|
|
@@ -72,9 +75,12 @@ def resolveClientSideBuild() {
|
|
|
72
75
|
return true
|
|
73
76
|
}
|
|
74
77
|
|
|
78
|
+
def isReanimatedExampleApp() {
|
|
79
|
+
return safeAppExtGet("isReanimatedExampleApp", false)
|
|
80
|
+
}
|
|
81
|
+
|
|
75
82
|
def isDeveloperMode() {
|
|
76
|
-
|
|
77
|
-
return safeAppExtGet("isReanimatedExampleApp", false) || System.getenv("REANIMATED_PACKAGE_BUILD") == "1"
|
|
83
|
+
return isReanimatedExampleApp() || System.getenv("REANIMATED_PACKAGE_BUILD") == "1"
|
|
78
84
|
}
|
|
79
85
|
|
|
80
86
|
def isNewArchitectureEnabled() {
|
|
@@ -138,41 +144,6 @@ def shouldAssertNoMultipleInstances() {
|
|
|
138
144
|
}
|
|
139
145
|
}
|
|
140
146
|
|
|
141
|
-
def findReanimatedInstancesForPath(String path) {
|
|
142
|
-
return fileTree(path) {
|
|
143
|
-
include "**/react-native-reanimated/package.json"
|
|
144
|
-
exclude "**/.yarn/**"
|
|
145
|
-
exclude {{ file, attr -> attr.isSymbolicLink() }}
|
|
146
|
-
}.files
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
def checkNoMultipleInstances() {
|
|
150
|
-
// Assert there are no multiple installations of Reanimated
|
|
151
|
-
Set<File> files
|
|
152
|
-
if (projectDir.path.contains(rootDir.parent)) {
|
|
153
|
-
// standard app
|
|
154
|
-
files = findReanimatedInstancesForPath(rootDir.parent + "/node_modules")
|
|
155
|
-
} else {
|
|
156
|
-
// monorepo
|
|
157
|
-
files = findReanimatedInstancesForPath(rootDir.parent + "/node_modules")
|
|
158
|
-
files.addAll(
|
|
159
|
-
findReanimatedInstancesForPath(file(projectDir.parent).parent)
|
|
160
|
-
)
|
|
161
|
-
}
|
|
162
|
-
if (files.size() > 1) {
|
|
163
|
-
String parsedLocation = files.stream().map({
|
|
164
|
-
File file -> "- " + file.toString().replace("/package.json", "")
|
|
165
|
-
}).collect().join("\n")
|
|
166
|
-
String exceptionMessage = "\n[react-native-reanimated] Multiple versions of Reanimated " +
|
|
167
|
-
"were detected. Only one instance of react-native-reanimated can be installed in a " +
|
|
168
|
-
"project. You need to resolve the conflict manually. Check out the documentation: " +
|
|
169
|
-
"https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/" +
|
|
170
|
-
"troubleshooting#multiple-versions-of-reanimated-were-detected \n\nConflict " +
|
|
171
|
-
"between: \n" + parsedLocation + "\n";
|
|
172
|
-
throw new GradleException(exceptionMessage)
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
|
|
176
147
|
def getReanimatedVersion() {
|
|
177
148
|
def inputFile = file(projectDir.path + '/../package.json')
|
|
178
149
|
def json = new JsonSlurper().parseText(inputFile.text)
|
|
@@ -431,6 +402,10 @@ apply plugin: "de.undercouch.download"
|
|
|
431
402
|
|
|
432
403
|
android {
|
|
433
404
|
compileSdkVersion safeExtGet("compileSdkVersion", 30)
|
|
405
|
+
def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION
|
|
406
|
+
if (agpVersion.tokenize('.')[0].toInteger() >= 7) {
|
|
407
|
+
namespace "com.swmansion.reanimated"
|
|
408
|
+
}
|
|
434
409
|
if (REACT_NATIVE_MINOR_VERSION >= 71) {
|
|
435
410
|
buildFeatures {
|
|
436
411
|
prefab true
|
|
@@ -453,6 +428,7 @@ android {
|
|
|
453
428
|
"-DJS_RUNTIME_DIR=${jsRuntimeDir}",
|
|
454
429
|
"-DCLIENT_SIDE_BUILD=${CLIENT_SIDE_BUILD}",
|
|
455
430
|
"-DIS_NEW_ARCHITECTURE_ENABLED=${isNewArchitectureEnabled()}",
|
|
431
|
+
"-DIS_REANIMATED_EXAMPLE_APP=${isReanimatedExampleApp()}",
|
|
456
432
|
"-DPLAYGROUND_APP_NAME=${getPlaygroundAppName()}",
|
|
457
433
|
"-DREANIMATED_PACKAGE_BUILD=${REANIMATED_PACKAGE_BUILD}",
|
|
458
434
|
"-DREANIMATED_VERSION=${REANIMATED_VERSION}"
|
|
@@ -576,15 +552,64 @@ android {
|
|
|
576
552
|
}
|
|
577
553
|
}
|
|
578
554
|
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
555
|
+
abstract class NoMultipleInstancesAssertionTask extends DefaultTask {
|
|
556
|
+
@Inject abstract ObjectFactory getObjectFactory()
|
|
557
|
+
|
|
558
|
+
@Input abstract Property<File> getProjectDirFile()
|
|
559
|
+
@Input abstract Property<File> getRootDirFile()
|
|
560
|
+
@Input abstract Property<Boolean> getShouldCheck()
|
|
561
|
+
|
|
562
|
+
def findReanimatedInstancesForPath(String path) {
|
|
563
|
+
return objectFactory.fileTree().from(path)
|
|
564
|
+
.include("**/react-native-reanimated/package.json")
|
|
565
|
+
.exclude("**/.yarn/**")
|
|
566
|
+
.exclude({ Files.isSymbolicLink(it.getFile().toPath()) })
|
|
567
|
+
.findAll()
|
|
583
568
|
}
|
|
569
|
+
|
|
570
|
+
@TaskAction
|
|
571
|
+
def check() {
|
|
572
|
+
if (shouldCheck.get()) {
|
|
573
|
+
// Assert there are no multiple installations of Reanimated
|
|
574
|
+
Set<File> files
|
|
575
|
+
|
|
576
|
+
if (projectDirFile.get().parent.contains(rootDirFile.get().parent)) {
|
|
577
|
+
// standard app
|
|
578
|
+
files = findReanimatedInstancesForPath(rootDirFile.get().parent + "/node_modules")
|
|
579
|
+
} else {
|
|
580
|
+
// monorepo
|
|
581
|
+
files = findReanimatedInstancesForPath(rootDirFile.get().parent + "/node_modules")
|
|
582
|
+
files.addAll(
|
|
583
|
+
findReanimatedInstancesForPath(projectDirFile.get().parentFile.parent)
|
|
584
|
+
)
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
if (files.size() > 1) {
|
|
588
|
+
String parsedLocation = files.stream().map({
|
|
589
|
+
File file -> "- " + file.toString().replace("/package.json", "")
|
|
590
|
+
}).collect().join("\n")
|
|
591
|
+
String exceptionMessage = "\n[react-native-reanimated] Multiple versions of Reanimated " +
|
|
592
|
+
"were detected. Only one instance of react-native-reanimated can be installed in a " +
|
|
593
|
+
"project. You need to resolve the conflict manually. Check out the documentation: " +
|
|
594
|
+
"https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/" +
|
|
595
|
+
"troubleshooting#multiple-versions-of-reanimated-were-detected \n\nConflict " +
|
|
596
|
+
"between: \n" + parsedLocation + "\n"
|
|
597
|
+
throw new GradleException(exceptionMessage)
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
tasks.register('assertNoMultipleInstances', NoMultipleInstancesAssertionTask) {
|
|
604
|
+
shouldCheck = shouldAssertNoMultipleInstances()
|
|
605
|
+
rootDirFile = rootDir
|
|
606
|
+
projectDirFile = projectDir
|
|
584
607
|
}
|
|
585
608
|
|
|
609
|
+
def NEW_ARCH_ENABLED = isNewArchitectureEnabled()
|
|
610
|
+
|
|
586
611
|
def assertNoReanimated2WithNewArchitecture = task assertNoReanimated2WithNewArchitectureTask {
|
|
587
|
-
onlyIf {
|
|
612
|
+
onlyIf { NEW_ARCH_ENABLED && REANIMATED_MAJOR_VERSION == 2 }
|
|
588
613
|
doFirst {
|
|
589
614
|
throw new GradleException(
|
|
590
615
|
"\n[react-native-reanimated] Reanimated 2.x does not support Fabric. " +
|
|
@@ -595,11 +620,11 @@ def assertNoReanimated2WithNewArchitecture = task assertNoReanimated2WithNewArch
|
|
|
595
620
|
}
|
|
596
621
|
|
|
597
622
|
def assertLatestReactNativeWithNewArchitecture = task assertLatestReactNativeWithNewArchitectureTask {
|
|
598
|
-
onlyIf {
|
|
623
|
+
onlyIf { NEW_ARCH_ENABLED && REANIMATED_MAJOR_VERSION == 3 && REACT_NATIVE_MINOR_VERSION < 72 }
|
|
599
624
|
doFirst {
|
|
600
625
|
throw new GradleException(
|
|
601
626
|
"\n[react-native-reanimated] Reanimated " + REANIMATED_VERSION + " supports the New Architecture " +
|
|
602
|
-
"only on the latest minor release of React Native. Please upgrade to React Native 0.
|
|
627
|
+
"only on the latest minor release of React Native. Please upgrade to React Native 0.72.0+ " +
|
|
603
628
|
"or downgrade to an older version of Reanimated v3."
|
|
604
629
|
)
|
|
605
630
|
}
|
|
@@ -1066,14 +1091,14 @@ afterEvaluate {
|
|
|
1066
1091
|
nativeBuildDependsOn(prepareThirdPartyNdkHeaders)
|
|
1067
1092
|
nativeBuildDependsOn(extractAARHeaders)
|
|
1068
1093
|
nativeBuildDependsOn(extractSOFiles)
|
|
1069
|
-
|
|
1070
|
-
tasks.forEach({ task ->
|
|
1071
|
-
if (task.name.contains("JniLibFolders")) {
|
|
1072
|
-
task.dependsOn(packageNdkLibs)
|
|
1073
|
-
}
|
|
1074
|
-
})
|
|
1075
1094
|
}
|
|
1076
1095
|
|
|
1096
|
+
tasks.forEach({ task ->
|
|
1097
|
+
if (task.name.contains("JniLibFolders")) {
|
|
1098
|
+
task.dependsOn(packageNdkLibs)
|
|
1099
|
+
}
|
|
1100
|
+
})
|
|
1101
|
+
|
|
1077
1102
|
if (JS_RUNTIME == "hermes") {
|
|
1078
1103
|
if (REACT_NATIVE_MINOR_VERSION < 71) {
|
|
1079
1104
|
extractAARHeaders.dependsOn(prepareHermes)
|