Skip to content
This repository was archived by the owner on Mar 7, 2025. It is now read-only.

Update trunk with upstream changes via GitHub#14

Closed
fluiddot wants to merge 313 commits intowordpress-mobile:trunkfrom
software-mansion:main
Closed

Update trunk with upstream changes via GitHub#14
fluiddot wants to merge 313 commits intowordpress-mobile:trunkfrom
software-mansion:main

Conversation

@fluiddot
Copy link
Copy Markdown

No description provided.

tomekzaw and others added 30 commits July 28, 2021 11:12
* Fix `Use of undeclared identifier 'JSIExecutor'`

* Rename `executor` to `installer`
## Description

List of fixes:
- overriding libfbjni.so
- fix some predefined animations
- added `default` to export in 2 new screens in test app
- added missing variable definition in animation
## Description

Added missing optional to the callback in animation builder - this broke building script.
## Description

Fix undefined task for RN 65
## Description

I can't copy the viewDescriptors set because it can be empty during starting of the mapper.
* Update AnimatedLayout.md

* Update AnimatedLayout.md
…id (#2240)

* Fixed layout transitions was started multiple times on android

* Formatted code

* Formatted code
## Description

We want to add support for expo-gl in worklets,

## Changes

- Added pointer to the worklet js runtime as a field in the main js runtime. We need that pointer to inject gl renderer object from expo-gl-cpp
- Added typed array constructors to globals list in plugin.js, It allows creating typed arrays on worklet thread when using hermes, but it still does not work with JSC. WebGL standard requires typed arrays for a lot of stuff, so we can't just change it to regular arrays even if performance would be good enough.

## Test code and steps to reproduce

I prepared 2 examples here wkozyra95@b3618a8
- one that just renders gl in a loop
- one that draws  based on the input from gesture handler

I tested this example yarn linking modified `expo-gl-cpp`, so it does not work in the form with latest version of that package.

## Checklist

- [ ] Included code example that can be used to test this change
- [ ] Updated TS types
- [ ] Added TS types tests
- [ ] Added unit / integration tests
- [ ] Updated documentation
- [ ] Ensured that CI passes
Bumps [tar](https://github.com/npm/node-tar) from 6.1.0 to 6.1.4.
- [Release notes](https://github.com/npm/node-tar/releases)
- [Changelog](https://github.com/npm/node-tar/blob/main/CHANGELOG.md)
- [Commits](isaacs/node-tar@v6.1.0...v6.1.4)

---
updated-dependencies:
- dependency-name: tar
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
## Description

Refactor and transfter of animations module to TypeScript.
## Description

New example animation.
Fixed typos in:

CustomAnimations.md: dimations -> dimentions
EntryAnimations.md: particulr -> particular
Fixed typos in:
* CustomAnimations.md: dimentions -> dimensions
* EntryAnimations.md: ZoomInEadyDown -> ZoomInEasyDown
* ExitAnimations.md: ZoomOutEadyDown -> ZoomOutEasyDown
setNativeProps method was ignoring previously changed style, so before the method call, I merge the current style with the previous one to overcome this issue. Detailed description: necolas/react-native-web#1935
Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.6 to 1.0.7.
- [Release notes](https://github.com/jbgutierrez/path-parse/releases)
- [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7)

---
updated-dependencies:
- dependency-name: path-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.5 to 1.0.7.
- [Release notes](https://github.com/jbgutierrez/path-parse/releases)
- [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7)

---
updated-dependencies:
- dependency-name: path-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.5 to 1.0.7.
- [Release notes](https://github.com/jbgutierrez/path-parse/releases)
- [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7)

---
updated-dependencies:
- dependency-name: path-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Currently on every frame prefix and suffix recognition is performed which is unnecessary. I moved that logic to executes only once on animation start. I'm also changed the regex rule to match scientific notation.
Bumps [url-parse](https://github.com/unshiftio/url-parse) from 1.5.1 to 1.5.3.
- [Release notes](https://github.com/unshiftio/url-parse/releases)
- [Commits](unshiftio/url-parse@1.5.1...1.5.3)

---
updated-dependencies:
- dependency-name: url-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [url-parse](https://github.com/unshiftio/url-parse) from 1.5.1 to 1.5.3.
- [Release notes](https://github.com/unshiftio/url-parse/releases)
- [Commits](unshiftio/url-parse@1.5.1...1.5.3)

---
updated-dependencies:
- dependency-name: url-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
As the next step of the react-native-reanimated smooth transition to TypeScript, this PR updates types for hooks.
As the next step of the react-native-reanimated smooth transition to TypeScript, this PR updates types for the reanimated core.
## Description

We had a problem with the casting event type. Because we used custom type from reanimated instead of event type from gesture-handler.
Currently, users can only animate style properties that are nested one-level deep or transform properties. Animating styles like shadowOffset's width were not supported as there were nested two levels deep. I've changed the useAnimatedStyle hook and LayoutAnimations to support nested objects.
## Description

Fixes #2297 by adding stub implementations of newly-required
methods from react-native 0.65

See e.g. 

- react-native-device-info/react-native-device-info@3917f33
- invertase/react-native-firebase#5616
## Description

Remove dependency to gesture-handler
Bumped react-native version to 0.65.1
## Description

Added support for Gradle flavor. Solution based on https://stackoverflow.com/a/34679933/7276742

Fixes
- #2245
- #2292
dependabot bot and others added 26 commits February 16, 2022 18:03
Bumps [ajv](https://github.com/ajv-validator/ajv) from 6.10.2 to 6.12.6.
- [Release notes](https://github.com/ajv-validator/ajv/releases)
- [Commits](ajv-validator/ajv@v6.10.2...v6.12.6)

---
updated-dependencies:
- dependency-name: ajv
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [ajv](https://github.com/ajv-validator/ajv) from 6.10.2 to 6.12.6.
- [Release notes](https://github.com/ajv-validator/ajv/releases)
- [Commits](ajv-validator/ajv@v6.10.2...v6.12.6)

---
updated-dependencies:
- dependency-name: ajv
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Until now it didn't successfully transpile `performance.now()` (or `_chronoNow`).
## Description

#2979 introduced a typo, [as reported here](#2979 (comment)).

🤦🏼 

## Changes

Fixed the typo

## Test code and steps to reproduce

```js
import Animated, {
    useSharedValue,
    withTiming,
    useAnimatedStyle,
    Easing,
  } from 'react-native-reanimated';
  import { View, Button } from 'react-native';
  import React from 'react';
  
  export function TestScreen() {
    const randomWidth = useSharedValue(10);
  
    const config = {
      duration: 500,
      easing: Easing.bezier(0.5, 0.01, 0, 1),
    };
  
    const style = useAnimatedStyle(() => {
      return {
        width: withTiming(randomWidth.value, config),
      };
    });
  
    return (
      <View
        style={{
          flex: 1,
          alignItems: 'center',
          justifyContent: 'center',
          flexDirection: 'column',
        }}>
        <Animated.View
          style={[{ width: 100, height: 80, backgroundColor: 'black', margin: 30 }, style]}
        />
        <Button
          title="toggle"
          onPress={() => {
            randomWidth.value = Math.random() * 350;
          }}
        />
      </View>
    );
  }
```


## Checklist

- [x] Included code example that can be used to test this change
- [x] Updated TS types
- [ ] Added TS types tests
- [ ] Added unit / integration tests
- [ ] Updated documentation
- [ ] Ensured that CI passes
Bumps [url-parse](https://github.com/unshiftio/url-parse) from 1.5.3 to 1.5.7.
- [Release notes](https://github.com/unshiftio/url-parse/releases)
- [Commits](unshiftio/url-parse@1.5.3...1.5.7)

---
updated-dependencies:
- dependency-name: url-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [url-parse](https://github.com/unshiftio/url-parse) from 1.5.3 to 1.5.7.
- [Release notes](https://github.com/unshiftio/url-parse/releases)
- [Commits](unshiftio/url-parse@1.5.3...1.5.7)

---
updated-dependencies:
- dependency-name: url-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
## Description

The CI failed, so I fixed eslint errors and ran prettier.
## Description

I do it often 😄 So I want to make it faster.
## Description

Part of stack PR:
* #2986
* #2988
* #2990

## Changes

Update jest to latest release version.

## Test code and steps to reproduce

run `yarn jest`


## Checklist

- [ ] Included code example that can be used to test this change
- [ ] Updated TS types
- [ ] Added TS types tests
- [ ] Added unit / integration tests
- [ ] Updated documentation
- [ ] Ensured that CI passes
## Description

This patch removes setup instructions for Android. iOS is in progress (there's some complexity with bridge init lifecycle - Reanimated replaces native RN modules).

## Changes

- Move initialization from `ReanimatedJSIModulePackage` to `ReanimatedModule` by utilizing `@ReactMethod(isBlockingSynchronousMethod = true)` annotation.

## Test code and steps to reproduce

I tested it on the example app but maybe it's worth building the package and checking on the freshly generated app.
## Description

Fixes regression introduced in #2947.
## Description

In `d.ts` was used export from `.ts` file. To make it correct we should use the direct import described here - https://stackoverflow.com/a/51114250/7276742

Thanks for the help for @terrysahaidak 🚀
## Description

Fixes #2345.

In some cases is possible to call `updateProps` on the not yet mounted component. These updates were overridden by React Layout props. I detect this situation and save new props to buffer, and schedule updates of these props after mounting of component.

<details>
<summary>Code to reproduce</summary>

```js
import * as React from 'react';
import { View, StyleSheet, Platform } from 'react-native';
import Animated, {
  useAnimatedStyle,
  useSharedValue,
  useAnimatedScrollHandler,
} from 'react-native-reanimated';

export default function Repro() {
  const translationY = useSharedValue(200);

  const scrollHandler = useAnimatedScrollHandler(({ contentOffset: { y } }) => {
    translationY.value = 200 + y + 20;
  });

  const animatedHeaderStyle = useAnimatedStyle(() => {
    return {
      position: 'absolute',
      backgroundColor: 'red',
      height: 200,
      top: 0,
      left: 0,
      right: 0,
      paddingTop: 100,
      width: translationY.value,
    };
  }, [translationY]);

  console.log("Render", "----------------------------------")
  
  return (
    <View style={styles.container}>
      <Animated.ScrollView
        contentInset={{ top: 200 }}
        contentOffset={{
          y: -200,
          x: 0,
        }}
        contentContainerStyle={styles.contentContainer}
        style={styles.container}
        onScroll={scrollHandler}
        scrollEventThrottle={16}>
      </Animated.ScrollView>
      <Animated.View style={animatedHeaderStyle}>
      </Animated.View>
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
  },
  contentContainer: {
    paddingTop: Platform.OS === 'android' ? 200 : undefined,
  },
  blueSpace: {
    height: 500,
    backgroundColor: 'blue',
  },
  middleLine: {
    height: 10,
    backgroundColor: 'green',
  },
});
```
</details>
Bumps [prismjs](https://github.com/PrismJS/prism) from 1.25.0 to 1.27.0.
- [Release notes](https://github.com/PrismJS/prism/releases)
- [Changelog](https://github.com/PrismJS/prism/blob/master/CHANGELOG.md)
- [Commits](PrismJS/prism@v1.25.0...v1.27.0)

---
updated-dependencies:
- dependency-name: prismjs
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [url-parse](https://github.com/unshiftio/url-parse) from 1.5.7 to 1.5.10.
- [Release notes](https://github.com/unshiftio/url-parse/releases)
- [Commits](unshiftio/url-parse@1.5.7...1.5.10)

---
updated-dependencies:
- dependency-name: url-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
## Description

This PR provides possibility to build reanimated from source in your own project.

## How to build reanimated from source

### app/build.gradle
```
project.ext.reanimated = [
  buildFromSource: true // clean and rebuild if changing
]
```

### or

### package.json

You can install reanimated directly from GitHub:
```
"dependencies": {
  ...
  "react-native-reanimated": "software-mansion/react-native-reanimated#<branch name or commit hash>"
},
```

### Important ⚠️
If you want to build reanimated from a source you need to run Gradle `clean` command before.

### Requirements:
- Java: 8+
- Gradle: 7+
- Gradle Plugin: 4+
- NDK

`react-native@0.63`
You need to upgrade Gradle and Gradle Plugin and apply this patch for `@react-native-community` - https://github.com/react-native-community/cli/pull/1396/files

Authors: @kkafar @piaskowyk
Bumps [url-parse](https://github.com/unshiftio/url-parse) from 1.5.7 to 1.5.10.
- [Release notes](https://github.com/unshiftio/url-parse/releases)
- [Commits](unshiftio/url-parse@1.5.7...1.5.10)

---
updated-dependencies:
- dependency-name: url-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [plist](https://github.com/TooTallNate/node-plist) from 3.0.1 to 3.0.4.
- [Release notes](https://github.com/TooTallNate/node-plist/releases)
- [Changelog](https://github.com/TooTallNate/plist.js/blob/master/History.md)
- [Commits](https://github.com/TooTallNate/node-plist/commits)

---
updated-dependencies:
- dependency-name: plist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [plist](https://github.com/TooTallNate/node-plist) from 3.0.3 to 3.0.4.
- [Release notes](https://github.com/TooTallNate/node-plist/releases)
- [Changelog](https://github.com/TooTallNate/plist.js/blob/master/History.md)
- [Commits](https://github.com/TooTallNate/node-plist/commits)

---
updated-dependencies:
- dependency-name: plist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
## Description

After #1879 was implemented (and also #2792), the mocks weren't updated. This PR fixes that.

The error is the same as in #2766, but only shows up when running tests.

## Changes

The mocks now match the signature of the functions.

## Test code and steps to reproduce

There wasn't anywhere obvious to add a test for this - as far as I can see, we don't have any tests that use the mocks. I'm happy to add one though if you point me in the right direction!

To reproduce, it's as simple as a jest (with mocks set up) test that includes code like:

```typescript
const someEasing = Easing.bezierFn(0, 0, 0.15, 1);
```

## Checklist

- [x] Included code example that can be used to test this change
- [x] Updated TS types
- [ ] Added TS types tests
- [ ] Added unit / integration tests
- [ ] Updated documentation
- [ ] Ensured that CI passes
## Description

This  is an addition to #2447 
Since the [fix](#2515) does not solve the problem entirely. The Problem only occurs with ReactNative < 0.65.

Gradle also accepts lower case flavors but in react-native-reanimated this will break the android build.
This is because the flavor is matched from the gradle invocation via pattern matching. If it is lowercase the path is not found and the build.gradle exits with an exception.

e.g

Running the following in the consuming react-native project.

```
./gradlew assembledevRelease 

```
Will work in Gradle but will run into the error 

`Task with path ':app:mergedevDebugNativeLibs' not found in project ':app'.`

while

```
./gradlew assembleDevRelease 

```
works as expected and does not run into this error.

## Fixes 
This PR solves this problem so that the flavor is dealt with case insensitively in ReactNative < 0.65 as well.
(`assembledevRelease` will just work the same way as `assembleDevRelease`)


## Changes

- Added a method to get the path to the task regardless of the flavor being upper or lower case 
in the gradle invocation.



## Steps to reproduce the error

Import react-native-reanimated in a ReactNative-Project with version < 0.65
Run a gradle task with lowercase flavor (e.g assembledevRelease)

Gradle will run into the error 

`Task with path ':app:mergedevDebugNativeLibs' not found in project ':app'.`
## Description

It is possible to change the gradle build dir so it is not safe to assume it will be under /build.

## Changes

Use the project build dir from gradle in cmake instead of assuming /build.

## Screenshots / GIFs

N/A

## Test code and steps to reproduce

android/build.gradle
```groovy
allprojects {
    buildDir = "${System.getProperty("user.home")}/.gradle/builds/${rootProject.name}/${project.name}"
}
```

## Checklist

- [x] Included code example that can be used to test this change
- [ ] Updated TS types
- [ ] Added TS types tests
- [ ] Added unit / integration tests
- [ ] Updated documentation
- [ ] Ensured that CI passes
## Description

React native support this property to allow building for specific architectures only.

## Changes

Add support for reactNativeArchitectures like in https://github.com/facebook/react-native/blob/main/ReactAndroid/build.gradle#L227.

## Test code and steps to reproduce

Use source build with the latest react-native version and run react-native start-android.

## Checklist

- [ ] Included code example that can be used to test this change
- [ ] Updated TS types
- [ ] Added TS types tests
- [ ] Added unit / integration tests
- [ ] Updated documentation
- [ ] Ensured that CI passes
#3054)

## Description

This will be more reliable in a mono-repo setup. We assume the react-native / other deps are in the same directory as react-native-reanimated instead of assuming it is in rootDir/../node_modules.

## Changes

Use relative path from the react-native-reanimated package instead of project root.

## Test code and steps to reproduce

Use source build in a monorepo.

## Checklist

- [ ] Included code example that can be used to test this change
- [ ] Updated TS types
- [ ] Added TS types tests
- [ ] Added unit / integration tests
- [ ] Updated documentation
- [ ] Ensured that CI passes
@fluiddot fluiddot self-assigned this Mar 14, 2022
@fluiddot
Copy link
Copy Markdown
Author

Closing in favor of #12.

@fluiddot fluiddot closed this Mar 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.