react-native-reanimated 2.3.0 → 2.3.3
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/README.md +1 -1
- package/android/expo/linking.gradle +12 -0
- package/android/react-native-reanimated-63-hermes.aar +0 -0
- package/android/react-native-reanimated-63-jsc.aar +0 -0
- package/android/react-native-reanimated-64-hermes.aar +0 -0
- package/android/react-native-reanimated-64-jsc.aar +0 -0
- package/android/react-native-reanimated-65-hermes.aar +0 -0
- package/android/react-native-reanimated-65-jsc.aar +0 -0
- package/android/react-native-reanimated-66-hermes.aar +0 -0
- package/android/react-native-reanimated-66-jsc.aar +0 -0
- package/android/react-native-reanimated-67-hermes.aar +0 -0
- package/android/react-native-reanimated-67-jsc.aar +0 -0
- package/ios/LayoutReanimation/REAUIManager.mm +8 -7
- package/ios/Nodes/REAPropsNode.m +1 -1
- package/lib/reanimated2/core.js +9 -6
- package/package.json +3 -3
- package/react-native-reanimated.d.ts +3 -3
- package/src/reanimated2/core.ts +9 -6
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@ Check out our dedicated documentation page for info about this library, API refe
|
|
|
19
19
|
|
|
20
20
|
## Examples
|
|
21
21
|
|
|
22
|
-
The source code for the example (showcase) app is under the [`Example/`](https://github.com/software-mansion/react-native-reanimated/blob/
|
|
22
|
+
The source code for the example (showcase) app is under the [`Example/`](https://github.com/software-mansion/react-native-reanimated/blob/main/Example/) directory.
|
|
23
23
|
If you want to play with the API but don't feel like trying it on a real app, you can run the example project. Check Example/ directory README for installation instructions.
|
|
24
24
|
|
|
25
25
|
## License
|
|
@@ -15,12 +15,24 @@ if (isExpoLinked) {
|
|
|
15
15
|
apply plugin: 'com.android.library'
|
|
16
16
|
|
|
17
17
|
android {
|
|
18
|
+
// Disable aar bundling to fix the error when running `gradle assembleRelease` over `gradle :app:assembleRelease`
|
|
19
|
+
// which will throw `Direct local .aar file dependencies are not supported when building an AAR.`
|
|
20
|
+
tasks.whenTaskAdded { task ->
|
|
21
|
+
if (['bundleDebugAar', 'bundleReleaseAar'].contains(task.name)) {
|
|
22
|
+
task.enabled = false
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
18
26
|
compileSdkVersion safeExtGet('compileSdkVersion', 30)
|
|
19
27
|
|
|
20
28
|
sourceSets {
|
|
21
29
|
main.manifest.srcFile 'src/AndroidManifest.xml'
|
|
22
30
|
main.java.srcDirs = [ 'expo/src/main/java' ]
|
|
23
31
|
}
|
|
32
|
+
|
|
33
|
+
libraryVariants.all {
|
|
34
|
+
generateBuildConfigProvider?.get()?.enabled = false
|
|
35
|
+
}
|
|
24
36
|
}
|
|
25
37
|
|
|
26
38
|
dependencies {
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
#import "REAUIManager.h"
|
|
2
2
|
#import <Foundation/Foundation.h>
|
|
3
3
|
#include "FeaturesConfig.h"
|
|
4
|
-
#import "RCTComponentData.h"
|
|
5
|
-
#import "RCTLayoutAnimation.h"
|
|
6
|
-
#import "RCTLayoutAnimationGroup.h"
|
|
7
|
-
#import "RCTModalHostView.h"
|
|
8
|
-
#import "RCTRootShadowView.h"
|
|
9
|
-
#import "RCTRootViewInternal.h"
|
|
10
|
-
#import "RCTUIManagerObserverCoordinator.h"
|
|
11
4
|
#import "REAIOSScheduler.h"
|
|
12
5
|
#include "Scheduler.h"
|
|
13
6
|
|
|
7
|
+
#import <React/RCTComponentData.h>
|
|
8
|
+
#import <React/RCTLayoutAnimation.h>
|
|
9
|
+
#import <React/RCTLayoutAnimationGroup.h>
|
|
10
|
+
#import <React/RCTModalHostView.h>
|
|
11
|
+
#import <React/RCTRootShadowView.h>
|
|
12
|
+
#import <React/RCTRootViewInternal.h>
|
|
13
|
+
#import <React/RCTUIManagerObserverCoordinator.h>
|
|
14
|
+
|
|
14
15
|
#if __has_include(<RNScreens/RNSScreen.h>)
|
|
15
16
|
#import <RNScreens/RNSScreen.h>
|
|
16
17
|
#endif
|
package/ios/Nodes/REAPropsNode.m
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
#import "REANodesManager.h"
|
|
5
5
|
#import "REAStyleNode.h"
|
|
6
6
|
|
|
7
|
+
#import <React/RCTComponentData.h>
|
|
7
8
|
#import <React/RCTLog.h>
|
|
8
9
|
#import <React/RCTUIManager.h>
|
|
9
|
-
#import "React/RCTComponentData.h"
|
|
10
10
|
|
|
11
11
|
@implementation REAPropsNode {
|
|
12
12
|
NSNumber *_connectedViewTag;
|
package/lib/reanimated2/core.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* global _WORKLET _getCurrentTime _frameTimestamp _eventTimestamp, _setGlobalConsole */
|
|
2
2
|
import NativeReanimatedModule from './NativeReanimated';
|
|
3
3
|
import { Platform } from 'react-native';
|
|
4
|
-
import { nativeShouldBeMock, shouldBeUseWeb } from './PlatformChecker';
|
|
4
|
+
import { nativeShouldBeMock, shouldBeUseWeb, isWeb } from './PlatformChecker';
|
|
5
5
|
global.__reanimatedWorkletInit = function (worklet) {
|
|
6
6
|
worklet.__worklet = true;
|
|
7
7
|
};
|
|
@@ -263,8 +263,8 @@ if (!NativeReanimatedModule.useOnlyV1) {
|
|
|
263
263
|
NativeReanimatedModule.installCoreFunctions(NativeReanimatedModule.native
|
|
264
264
|
? workletValueSetter
|
|
265
265
|
: workletValueSetterJS);
|
|
266
|
-
|
|
267
|
-
|
|
266
|
+
if (!isWeb() && isConfigured()) {
|
|
267
|
+
const capturableConsole = console;
|
|
268
268
|
runOnUI(() => {
|
|
269
269
|
'worklet';
|
|
270
270
|
const console = {
|
|
@@ -275,10 +275,13 @@ if (!NativeReanimatedModule.useOnlyV1) {
|
|
|
275
275
|
info: runOnJS(capturableConsole.info),
|
|
276
276
|
};
|
|
277
277
|
_setGlobalConsole(console);
|
|
278
|
-
global.performance
|
|
279
|
-
|
|
280
|
-
|
|
278
|
+
if (global.performance == null) {
|
|
279
|
+
global.performance = {
|
|
280
|
+
now: global._chronoNow,
|
|
281
|
+
};
|
|
282
|
+
}
|
|
281
283
|
})();
|
|
284
|
+
}
|
|
282
285
|
}
|
|
283
286
|
let featuresConfig = {
|
|
284
287
|
enableLayoutAnimations: false,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-reanimated",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.3",
|
|
4
4
|
"description": "More powerful alternative to Animated library for React Native.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"start": "node node_modules/react-native/local-cli/cli.js start",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"type:check": "yarn tsc --noEmit",
|
|
21
21
|
"type:generate": "yarn type:generate:clean && yarn type:generate:cp-js-src && yarn type:generate:tsc && yarn type:generate:remove.ts && yarn type:generate:remove.tsx",
|
|
22
22
|
"type:generate:clean": "rm -rf lib/ && mkdir lib/",
|
|
23
|
-
"type:generate:cp-js-src": "cp -RL src
|
|
23
|
+
"type:generate:cp-js-src": "cp -RL src/* lib/",
|
|
24
24
|
"type:generate:tsc": "yarn tsc",
|
|
25
25
|
"type:generate:remove.ts": "find ./lib -type f -name \"*.ts\" -and -not -name \"*.d.ts\" -delete",
|
|
26
26
|
"type:generate:remove.tsx": "find ./lib -type f -name \"*.tsx\" -and -not -name \"*.d.ts\" -delete",
|
|
@@ -125,7 +125,7 @@
|
|
|
125
125
|
},
|
|
126
126
|
"lint-staged": {
|
|
127
127
|
"*.(js|ts|tsx)": [
|
|
128
|
-
"eslint --ext '.js,.ts,.tsx' src/ --ignore-pattern src/reanimated1 --ignore-pattern react-native-reanimated.d.ts",
|
|
128
|
+
"eslint --ext '.js,.ts,.tsx' src/ --ignore-pattern src/reanimated1 --ignore-pattern react-native-reanimated.d.ts --ignore-pattern docs",
|
|
129
129
|
"prettier --write"
|
|
130
130
|
],
|
|
131
131
|
"**/*.{h,cpp}": "yarn lint:cpp",
|
|
@@ -474,9 +474,9 @@ declare module 'react-native-reanimated' {
|
|
|
474
474
|
currentGlobalOriginY: number;
|
|
475
475
|
}
|
|
476
476
|
|
|
477
|
-
export type EntryExitAnimationFunction =
|
|
478
|
-
targetValues: EntryAnimationsValues
|
|
479
|
-
|
|
477
|
+
export type EntryExitAnimationFunction =
|
|
478
|
+
| ((targetValues: EntryAnimationsValues) => LayoutAnimation)
|
|
479
|
+
| ((targetValues: ExitAnimationsValues) => LayoutAnimation);
|
|
480
480
|
|
|
481
481
|
export type LayoutAnimationsValues = {
|
|
482
482
|
currentOriginX: number;
|
package/src/reanimated2/core.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* global _WORKLET _getCurrentTime _frameTimestamp _eventTimestamp, _setGlobalConsole */
|
|
2
2
|
import NativeReanimatedModule from './NativeReanimated';
|
|
3
3
|
import { Platform } from 'react-native';
|
|
4
|
-
import { nativeShouldBeMock, shouldBeUseWeb } from './PlatformChecker';
|
|
4
|
+
import { nativeShouldBeMock, shouldBeUseWeb, isWeb } from './PlatformChecker';
|
|
5
5
|
import {
|
|
6
6
|
BasicWorkletFunction,
|
|
7
7
|
WorkletFunction,
|
|
@@ -371,8 +371,8 @@ if (!NativeReanimatedModule.useOnlyV1) {
|
|
|
371
371
|
: (workletValueSetterJS as <T>(value: T) => void)
|
|
372
372
|
);
|
|
373
373
|
|
|
374
|
-
|
|
375
|
-
|
|
374
|
+
if (!isWeb() && isConfigured()) {
|
|
375
|
+
const capturableConsole = console;
|
|
376
376
|
runOnUI(() => {
|
|
377
377
|
'worklet';
|
|
378
378
|
const console = {
|
|
@@ -383,10 +383,13 @@ if (!NativeReanimatedModule.useOnlyV1) {
|
|
|
383
383
|
info: runOnJS(capturableConsole.info),
|
|
384
384
|
};
|
|
385
385
|
_setGlobalConsole(console);
|
|
386
|
-
global.performance
|
|
387
|
-
|
|
388
|
-
|
|
386
|
+
if (global.performance == null) {
|
|
387
|
+
global.performance = {
|
|
388
|
+
now: global._chronoNow,
|
|
389
|
+
};
|
|
390
|
+
}
|
|
389
391
|
})();
|
|
392
|
+
}
|
|
390
393
|
}
|
|
391
394
|
|
|
392
395
|
type FeaturesConfig = {
|