react-native-reanimated 2.12.0 → 2.13.0

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.
@@ -3,6 +3,7 @@
3
3
  #include <memory>
4
4
  #include <thread>
5
5
  #include <unordered_map>
6
+ #include <utility>
6
7
 
7
8
  #include "EventHandlerRegistry.h"
8
9
  #include "FeaturesConfig.h"
@@ -1,2 +1,2 @@
1
- #Thu Oct 27 10:05:12 UTC 2022
1
+ #Fri Nov 11 10:24:13 UTC 2022
2
2
  gradle.version=7.5.1
Binary file
@@ -318,4 +318,4 @@ endif()
318
318
  set (ignoreMe "${CLIENT_SIDE_BUILD}")
319
319
  set (ignoreMe "${JS_RUNTIME_DIR}")
320
320
  set (ignoreMe "${PLAYGROUND_APP_NAME}")
321
- set (ignoreMe "${HERMES_ENABLE_DEBUGGER}")
321
+ set (ignoreMe "${REANIMATED_PACKAGE_BUILD}")
@@ -1,5 +1,6 @@
1
1
  import com.android.Version
2
2
  import org.apache.tools.ant.filters.ReplaceTokens
3
+ import org.apache.tools.ant.taskdefs.condition.Os
3
4
  import groovy.json.JsonSlurper
4
5
  import java.nio.file.Paths
5
6
 
@@ -183,6 +184,13 @@ def getReanimatedVersion() {
183
184
  return major.toInteger()
184
185
  }
185
186
 
187
+ def toPlatformFileString(String path) {
188
+ if (Os.isFamily(Os.FAMILY_WINDOWS)) {
189
+ path = path.replace(File.separatorChar, '/' as char)
190
+ }
191
+ return path
192
+ }
193
+
186
194
  boolean CLIENT_SIDE_BUILD = resolveClientSideBuild()
187
195
  if (CLIENT_SIDE_BUILD) {
188
196
  configurations.maybeCreate("default")
@@ -447,7 +455,7 @@ android {
447
455
  "-DREACT_NATIVE_MINOR_VERSION=${REACT_NATIVE_MINOR_VERSION}",
448
456
  "-DANDROID_TOOLCHAIN=clang",
449
457
  "-DBOOST_VERSION=${BOOST_VERSION}",
450
- "-DREACT_NATIVE_DIR=${reactNativeRootDir.path}",
458
+ "-DREACT_NATIVE_DIR=${toPlatformFileString(reactNativeRootDir.path)}",
451
459
  "-DJS_RUNTIME=${JS_RUNTIME}",
452
460
  "-DJS_RUNTIME_DIR=${jsRuntimeDir}",
453
461
  "-DCLIENT_SIDE_BUILD=${CLIENT_SIDE_BUILD}",
package/ios/REAModule.mm CHANGED
@@ -195,19 +195,21 @@ RCT_EXPORT_METHOD(triggerRender)
195
195
  [_nodesManager dispatchEvent:event];
196
196
  }
197
197
 
198
- - (void)startObserving {
199
- hasListeners = YES;
198
+ - (void)startObserving
199
+ {
200
+ hasListeners = YES;
200
201
  }
201
202
 
202
- - (void)stopObserving {
203
- hasListeners = NO;
203
+ - (void)stopObserving
204
+ {
205
+ hasListeners = NO;
204
206
  }
205
207
 
206
208
  - (void)sendEventWithName:(NSString *)eventName body:(id)body
207
209
  {
208
- if (hasListeners) {
209
- [super sendEventWithName:eventName body:body];
210
- }
210
+ if (hasListeners) {
211
+ [super sendEventWithName:eventName body:body];
212
+ }
211
213
  }
212
214
 
213
215
  @end
@@ -145,14 +145,21 @@ export const advanceAnimationByFrame = (count) => {
145
145
  jest.advanceTimersByTime(frameTime);
146
146
  };
147
147
  export const setUpTests = (userConfig = {}) => {
148
- let expect;
149
- try {
150
- expect = require('expect');
151
- }
152
- catch (_) {
153
- // for Jest in version 28+
154
- const { expect: expectModule } = require('@jest/globals');
148
+ let expect = global.expect;
149
+ if (expect === undefined) {
150
+ const expectModule = require('expect');
155
151
  expect = expectModule;
152
+ // Starting from Jest 28, "expect" package uses named exports instead of default export.
153
+ // So, requiring "expect" package doesn't give direct access to "expect" function anymore.
154
+ // It gives access to the module object instead.
155
+ // We use this info to detect if the project uses Jest 28 or higher.
156
+ if (typeof expect === 'object') {
157
+ const jestGlobals = require('@jest/globals');
158
+ expect = jestGlobals.expect;
159
+ }
160
+ if (expect === undefined || expect.extend === undefined) {
161
+ expect = expectModule.default;
162
+ }
156
163
  }
157
164
  require('setimmediate');
158
165
  frameTime = Math.round(1000 / config.fps);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-reanimated",
3
- "version": "2.12.0",
3
+ "version": "2.13.0",
4
4
  "description": "More powerful alternative to Animated library for React Native.",
5
5
  "scripts": {
6
6
  "test": "yarn run format:js && yarn run lint:js && yarn run test:unit",
@@ -9,11 +9,11 @@
9
9
  "lint:js": "eslint --ext '.js,.ts,.tsx' src/ && yarn prettier --check src/",
10
10
  "lint:java": "./android/gradlew -p android spotlessCheck -q",
11
11
  "lint:cpp": "./scripts/cpplint.sh",
12
- "lint:ios": "./scripts/validate-ios.sh",
12
+ "lint:ios": "./scripts/validate-ios.sh && yarn format:ios --dry-run",
13
13
  "format": "yarn format:js && yarn format:java && yarn format:ios && yarn format:android && yarn format:common",
14
14
  "format:js": "prettier --write --list-different './src/'",
15
15
  "format:java": "node ./scripts/format-java.js",
16
- "format:ios": "find ios/ -iname *.h -o -iname *.m -o -iname *.mm -o -iname *.cpp | xargs clang-format -i",
16
+ "format:ios": "find ios/ -iname *.h -o -iname *.m -o -iname *.mm -o -iname *.cpp | xargs clang-format -i --Werror",
17
17
  "format:android": "find android/src/ -iname *.h -o -iname *.cpp | xargs clang-format -i",
18
18
  "format:common": "find Common/ -iname *.h -o -iname *.cpp | xargs clang-format -i",
19
19
  "release": "npm login && release-it",
@@ -123,7 +123,7 @@
123
123
  "madge": "^5.0.1",
124
124
  "prettier": "^2.5.1",
125
125
  "react": "17.0.2",
126
- "react-native": "0.70.3",
126
+ "react-native": "0.70",
127
127
  "react-native-builder-bob": "^0.18.3",
128
128
  "react-native-codegen": "^0.0.7",
129
129
  "react-native-gesture-handler": "^1.6.1",
@@ -188,13 +188,21 @@ export const advanceAnimationByFrame = (count) => {
188
188
  };
189
189
 
190
190
  export const setUpTests = (userConfig = {}) => {
191
- let expect;
192
- try {
193
- expect = require('expect');
194
- } catch (_) {
195
- // for Jest in version 28+
196
- const { expect: expectModule } = require('@jest/globals');
191
+ let expect = global.expect;
192
+ if (expect === undefined) {
193
+ const expectModule = require('expect');
197
194
  expect = expectModule;
195
+ // Starting from Jest 28, "expect" package uses named exports instead of default export.
196
+ // So, requiring "expect" package doesn't give direct access to "expect" function anymore.
197
+ // It gives access to the module object instead.
198
+ // We use this info to detect if the project uses Jest 28 or higher.
199
+ if (typeof expect === 'object') {
200
+ const jestGlobals = require('@jest/globals');
201
+ expect = jestGlobals.expect;
202
+ }
203
+ if (expect === undefined || expect.extend === undefined) {
204
+ expect = expectModule.default;
205
+ }
198
206
  }
199
207
 
200
208
  require('setimmediate');