react-native-reanimated 2.3.0 → 2.3.1

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 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/master/Example/) directory.
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 {
@@ -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
@@ -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;
@@ -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
- const capturableConsole = console;
267
- isConfigured() &&
266
+ if (!isWeb() && isConfigured()) {
267
+ const capturableConsole = console;
268
268
  runOnUI(() => {
269
269
  'worklet';
270
270
  const console = {
@@ -279,6 +279,7 @@ if (!NativeReanimatedModule.useOnlyV1) {
279
279
  now: global._chronoNow,
280
280
  };
281
281
  })();
282
+ }
282
283
  }
283
284
  let featuresConfig = {
284
285
  enableLayoutAnimations: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-reanimated",
3
- "version": "2.3.0",
3
+ "version": "2.3.1",
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",
@@ -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 | ExitAnimationsValues
479
- ) => LayoutAnimation;
477
+ export type EntryExitAnimationFunction =
478
+ | ((targetValues: EntryAnimationsValues) => LayoutAnimation)
479
+ | ((targetValues: ExitAnimationsValues) => LayoutAnimation);
480
480
 
481
481
  export type LayoutAnimationsValues = {
482
482
  currentOriginX: number;
@@ -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
- const capturableConsole = console;
375
- isConfigured() &&
374
+ if (!isWeb() && isConfigured()) {
375
+ const capturableConsole = console;
376
376
  runOnUI(() => {
377
377
  'worklet';
378
378
  const console = {
@@ -387,6 +387,7 @@ if (!NativeReanimatedModule.useOnlyV1) {
387
387
  now: global._chronoNow,
388
388
  };
389
389
  })();
390
+ }
390
391
  }
391
392
 
392
393
  type FeaturesConfig = {