react-native-reanimated 2.14.2 → 2.14.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.
Files changed (28) hide show
  1. package/android/.gradle/7.5.1/checksums/checksums.lock +0 -0
  2. package/android/.gradle/7.5.1/checksums/md5-checksums.bin +0 -0
  3. package/android/.gradle/7.5.1/checksums/sha1-checksums.bin +0 -0
  4. package/android/.gradle/7.5.1/dependencies-accessors/dependencies-accessors.lock +0 -0
  5. package/android/.gradle/7.5.1/executionHistory/executionHistory.bin +0 -0
  6. package/android/.gradle/7.5.1/executionHistory/executionHistory.lock +0 -0
  7. package/android/.gradle/7.5.1/fileHashes/fileHashes.bin +0 -0
  8. package/android/.gradle/7.5.1/fileHashes/fileHashes.lock +0 -0
  9. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  10. package/android/.gradle/buildOutputCleanup/cache.properties +1 -1
  11. package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
  12. package/android/.gradle/file-system.probe +0 -0
  13. package/android/react-native-reanimated-67-hermes.aar +0 -0
  14. package/android/react-native-reanimated-67-jsc.aar +0 -0
  15. package/android/react-native-reanimated-68-hermes.aar +0 -0
  16. package/android/react-native-reanimated-68-jsc.aar +0 -0
  17. package/android/react-native-reanimated-69-hermes.aar +0 -0
  18. package/android/react-native-reanimated-69-jsc.aar +0 -0
  19. package/android/react-native-reanimated-70-hermes.aar +0 -0
  20. package/android/react-native-reanimated-70-jsc.aar +0 -0
  21. package/android/react-native-reanimated-71-hermes.aar +0 -0
  22. package/android/react-native-reanimated-71-jsc.aar +0 -0
  23. package/ios/native/NativeProxy.mm +5 -1
  24. package/lib/reanimated2/hook/useAnimatedStyle.js +3 -3
  25. package/lib/reanimated2/hook/utils.js +7 -15
  26. package/package.json +1 -1
  27. package/src/reanimated2/hook/useAnimatedStyle.ts +3 -3
  28. package/src/reanimated2/hook/utils.ts +6 -16
@@ -1,2 +1,2 @@
1
- #Tue Jan 17 15:21:03 UTC 2023
1
+ #Thu Jan 19 15:25:25 UTC 2023
2
2
  gradle.version=7.5.1
Binary file
@@ -23,7 +23,11 @@
23
23
  #elif __has_include(<hermes/hermes.h>)
24
24
  #import <hermes/hermes.h>
25
25
  #else
26
- #import <jsi/JSCRuntime.h>
26
+ #if REACT_NATIVE_MINOR_VERSION >= 71
27
+ #include <jsc/JSCRuntime.h>
28
+ #else
29
+ #include <jsi/JSCRuntime.h>
30
+ #endif // REACT_NATIVE_MINOR_VERSION
27
31
  #endif
28
32
 
29
33
  namespace reanimated {
@@ -155,7 +155,7 @@ function styleUpdater(viewDescriptors, updater, state, maybeViewRef, animationsA
155
155
  requestFrame(frame);
156
156
  }
157
157
  }
158
- state.last = Object.assign({}, oldValues, newValues);
158
+ state.last = Object.assign(oldValues, newValues);
159
159
  const style = getStyleWithoutAnimations(state.last);
160
160
  if (style) {
161
161
  updateProps(viewDescriptors, style, maybeViewRef);
@@ -165,7 +165,7 @@ function styleUpdater(viewDescriptors, updater, state, maybeViewRef, animationsA
165
165
  state.isAnimationCancelled = true;
166
166
  state.animations = [];
167
167
  const diff = styleDiff(oldValues, newValues);
168
- state.last = Object.assign({}, oldValues, newValues);
168
+ state.last = Object.assign(oldValues, diff);
169
169
  if (diff) {
170
170
  updateProps(viewDescriptors, newValues, maybeViewRef);
171
171
  }
@@ -240,7 +240,7 @@ function jestStyleUpdater(viewDescriptors, updater, state, maybeViewRef, animati
240
240
  }
241
241
  // calculate diff
242
242
  const diff = styleDiff(oldValues, newValues);
243
- state.last = Object.assign({}, oldValues, newValues);
243
+ state.last = Object.assign(oldValues, diff);
244
244
  if (Object.keys(diff).length !== 0) {
245
245
  updatePropsJestWrapper(viewDescriptors, diff, maybeViewRef, animatedStyle, adapters);
246
246
  }
@@ -108,25 +108,17 @@ export function canApplyOptimalisation(upadterFn) {
108
108
  }
109
109
  export function isAnimated(prop) {
110
110
  'worklet';
111
- const propsToCheck = [prop];
112
- while (propsToCheck.length > 0) {
113
- const currentProp = propsToCheck.pop();
114
- if (Array.isArray(currentProp)) {
115
- for (const item of currentProp) {
116
- propsToCheck.push(item);
117
- }
118
- }
119
- else if ((currentProp === null || currentProp === void 0 ? void 0 : currentProp.onFrame) !== undefined) {
111
+ if (Array.isArray(prop)) {
112
+ return prop.some(isAnimated);
113
+ }
114
+ else if (typeof prop === 'object') {
115
+ if (prop.onFrame !== undefined) {
120
116
  return true;
121
117
  }
122
- else if (typeof currentProp === 'object') {
123
- for (const item of Object.values(currentProp)) {
124
- propsToCheck.push(item);
125
- }
118
+ else {
119
+ return Object.values(prop).some(isAnimated);
126
120
  }
127
- // if none of the above, it's not the animated prop, check next one
128
121
  }
129
- // when none of the props were animated return false
130
122
  return false;
131
123
  }
132
124
  export function styleDiff(oldStyle, newStyle) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-reanimated",
3
- "version": "2.14.2",
3
+ "version": "2.14.3",
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",
@@ -253,7 +253,7 @@ function styleUpdater(
253
253
  requestFrame(frame);
254
254
  }
255
255
  }
256
- state.last = Object.assign({}, oldValues, newValues);
256
+ state.last = Object.assign(oldValues, newValues);
257
257
  const style = getStyleWithoutAnimations(state.last);
258
258
  if (style) {
259
259
  updateProps(viewDescriptors, style, maybeViewRef);
@@ -263,7 +263,7 @@ function styleUpdater(
263
263
  state.animations = [];
264
264
 
265
265
  const diff = styleDiff(oldValues, newValues);
266
- state.last = Object.assign({}, oldValues, newValues);
266
+ state.last = Object.assign(oldValues, diff);
267
267
  if (diff) {
268
268
  updateProps(viewDescriptors, newValues, maybeViewRef);
269
269
  }
@@ -361,7 +361,7 @@ function jestStyleUpdater(
361
361
 
362
362
  // calculate diff
363
363
  const diff = styleDiff(oldValues, newValues);
364
- state.last = Object.assign({}, oldValues, newValues);
364
+ state.last = Object.assign(oldValues, diff);
365
365
 
366
366
  if (Object.keys(diff).length !== 0) {
367
367
  updatePropsJestWrapper(
@@ -179,25 +179,15 @@ export function canApplyOptimalisation(upadterFn: WorkletFunction): number {
179
179
 
180
180
  export function isAnimated(prop: NestedObjectValues<AnimationObject>): boolean {
181
181
  'worklet';
182
- const propsToCheck: NestedObjectValues<AnimationObject>[] = [prop];
183
- while (propsToCheck.length > 0) {
184
- const currentProp: NestedObjectValues<AnimationObject> =
185
- propsToCheck.pop() as NestedObjectValues<AnimationObject>;
186
- if (Array.isArray(currentProp)) {
187
- for (const item of currentProp) {
188
- propsToCheck.push(item);
189
- }
190
- } else if (currentProp?.onFrame !== undefined) {
182
+ if (Array.isArray(prop)) {
183
+ return prop.some(isAnimated);
184
+ } else if (typeof prop === 'object') {
185
+ if (prop.onFrame !== undefined) {
191
186
  return true;
192
- } else if (typeof currentProp === 'object') {
193
- for (const item of Object.values(currentProp)) {
194
- propsToCheck.push(item);
195
- }
187
+ } else {
188
+ return Object.values(prop).some(isAnimated);
196
189
  }
197
- // if none of the above, it's not the animated prop, check next one
198
190
  }
199
-
200
- // when none of the props were animated return false
201
191
  return false;
202
192
  }
203
193