Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for React Native 0.71 #3745

Merged
merged 99 commits into from
Jan 3, 2023
Merged

Conversation

tomekzaw
Copy link
Member

@tomekzaw tomekzaw commented Nov 7, 2022

Description

Closes #3871.

TODO

  • Update Example app template to 0.71.0-rc.5
  • Update FabricExample app template to 0.71.0-rc.5
  • Consume shared libraries and headers from prefabs (partially done)
  • Use implementation "com.facebook.react:react-native (without plus) for RN 0.71+
  • Use implementation "com.facebook.react:react-native:+" // From node_modules for older RN versions (leave as it it now)
  • Make it work with Hermes
  • Make it works with JSC
  • Properly detect Hermes on Android
  • Include folly-flags.cmake directly
  • Use headers from path instead of prefabs
  • Depend on jscexecutor and hermes-executor
  • Fix Layout Animations on Paper due after removal of deprecated UIImplementation (facebook/react-native@e7d7563)
  • Use TypeScript types directly from package
  • Add #ifdefs for backward-incompatible code changes (e.g. debugToken_)
  • Use different sourcesets for UIImplementationProvider
  • Add missing SystraceSection in UIManager_cloneNode
  • Confirm that UIManager_cloneNode and UIManagerBinding are identical to those in react-native
  • Remove react-native.config.js
  • Update metro-inspector-proxy patch

Won't do

  • Declare dependency on React-jsi & React-jsc based on ENV['USE_HERMES'] in RNReanimated.podspec - not necessary
  • Fix Jest testEnvironment, use react-native-env.js - still doesn't work
  • Do we still need kotlinVersion in build.gradle? - probably yes
  • Restore MBFingerTip in ReanimatedExample

Checklist

  • Check compatibility with older RN versions
  • Check if debugging worklets with Flipper works
  • Check if debugging in Android Studio works

Copy link
Contributor

@cortinico cortinico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me know if you need further inputs on 0.71 support for Reanimated

android/build.gradle Outdated Show resolved Hide resolved
piaskowyk pushed a commit that referenced this pull request Nov 8, 2022
## Description

This PR aligns Example app with RN 0.70.5 app template in order to simplify the process of adoption of RN 0.71.0 (#3745).

Even though Example never runs with Fabric enabled (it's Paper-only), I decided to leave new-arch Java and C++ files which will be deleted in 0.71.0-rc.0 for the sake of completeness.

Example app has a few dependencies, e.g. SVG, PagerView or MaskedView - as of this PR they are autolinked instead of being linked manually in `settings.gradle`.

I also removed some files specific for tvOS since we already have a separate app called TVOSExample.

### TODO:

- [x] remove `react-native-gradle-plugin` from Example/package.json
- [x] check Android / iOS
- [ ] check debug / release
- [x] check debugging worklets (Flipper needs to be launched before the app)
- [x] check if `MaskedView` component works
piaskowyk added a commit that referenced this pull request Nov 8, 2022
This PR aligns Example app with RN 0.70.5 app template in order to simplify the process of adoption of RN 0.71.0 (#3745).

Even though Example never runs with Fabric enabled (it's Paper-only), I decided to leave new-arch Java and C++ files which will be deleted in 0.71.0-rc.0 for the sake of completeness.

Example app has a few dependencies, e.g. SVG, PagerView or MaskedView - as of this PR they are autolinked instead of being linked manually in `settings.gradle`.

I also removed some files specific for tvOS since we already have a separate app called TVOSExample.

- [x] remove `react-native-gradle-plugin` from Example/package.json
- [x] check Android / iOS
- [ ] check debug / release
- [x] check debugging worklets (Flipper needs to be launched before the app)
- [x] check if `MaskedView` component works
@tomekzaw tomekzaw marked this pull request as ready for review December 30, 2022 12:11
android/src/main/cpp/NativeProxy.cpp Outdated Show resolved Hide resolved
Example/src/App.tsx Outdated Show resolved Hide resolved
FabricExample/android/app/build.gradle Show resolved Hide resolved
FabricExample/App.tsx Outdated Show resolved Hide resolved
Copy link
Member

@piaskowyk piaskowyk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done!

@piaskowyk piaskowyk merged commit d3aea04 into main Jan 3, 2023
@piaskowyk piaskowyk deleted the @tomekzaw/add-0.71-support branch January 3, 2023 16:42
piaskowyk pushed a commit that referenced this pull request Jan 5, 2023
## Summary

This PR fixes a warning that `debugToken_` field is unused in release mode after #3745  which gets escalated to a compile error thanks to `-Werror`.

## Test plan

Check if Example app compiles in release mode.
piaskowyk added a commit that referenced this pull request Jan 10, 2023
@dcangulo
Copy link

Will this be backported to 2.X or do I have to use version 3 for RN 0.71?

@tomekzaw
Copy link
Member Author

tomekzaw commented Jan 11, 2023

@dcangulo Yes, this change was backported to Reanimated2 branch in cb6857f and will be released in 2.14.0 this week.

kkafar added a commit to software-mansion/react-native-screens that referenced this pull request Jan 11, 2023
## Description

It seems that autolinking got complete overhaul in 0.71.0 as
`android/app/src/main/jni` directory was deleted -> thus it works
differently for sure now.

Still need to dive into it.

**FabricTestExample**

* [x] Android
* [x] iOS

**TestsExample**

* #1679

**FabricExample**

* #1680

**TODO**: Consider whether to use `com.facebook.react:react-native:+` or
`com.facebook.react:react-native` (without `+`) in
`android/build.gradle` of the library.

AFAIK the former takes highest available version from defined
repositories (should be `node_modules`?), the latter uses version
injected by React Native Gradle Plugin (but I believe it works since
React Native 0.71.0 or 0.70.0 (need to check) -- so version check might
be necessary).


Decided to leave:

```gradle
implementation 'com.facebook.react:react-native:+'
```

in library's `android/build.gradle` due to following reasons: 

* [Android's readme in RN
repo](https://github.com/facebook/react-native/blob/e108e9ebf1e6c52b6eeffeb6c41f842ad95baa0d/android/README.md)
* [Road to 0.71.0
post](reactwg/react-native-releases#41 (reply in thread))

Blocked by:

* ~facebook/react-native#35306
*
~software-mansion/react-native-reanimated#3745
*
~software-mansion/react-native-gesture-handler#2313
(decided to fix version on commit)
* ~`react-native-safe-area-context` - lacks support for RN71~ (created
patch)
* ~`@react-native-community/cli-platform-android` requires this patch:
kkafar/RNS-tester@9edaaa9.
The patch is already merged, but it is not shipped with `react-native`
yet.~

**NOTE**: Example application will handled in separate PR, as there are
problems with detox (it does not support 0.71 yet) and we run CI on that
app.

## Changes

* Updated examples 
* Updated library's build code

## Test code and steps to reproduce

Run example applications

## Checklist

- [ ] Ensured that CI passes
fluiddot pushed a commit to wordpress-mobile/react-native-reanimated that referenced this pull request Jun 5, 2023
## Description

This PR aligns Example app with RN 0.70.5 app template in order to simplify the process of adoption of RN 0.71.0 (software-mansion#3745).

Even though Example never runs with Fabric enabled (it's Paper-only), I decided to leave new-arch Java and C++ files which will be deleted in 0.71.0-rc.0 for the sake of completeness.

Example app has a few dependencies, e.g. SVG, PagerView or MaskedView - as of this PR they are autolinked instead of being linked manually in `settings.gradle`.

I also removed some files specific for tvOS since we already have a separate app called TVOSExample.

### TODO:

- [x] remove `react-native-gradle-plugin` from Example/package.json
- [x] check Android / iOS
- [ ] check debug / release
- [x] check debugging worklets (Flipper needs to be launched before the app)
- [x] check if `MaskedView` component works
fluiddot pushed a commit to wordpress-mobile/react-native-reanimated that referenced this pull request Jun 5, 2023
## Description

Closes software-mansion#3871.

### TODO

- [x] Update Example app template to 0.71.0-rc.5
- [x] Update FabricExample app template to 0.71.0-rc.5
- [x] Consume shared libraries and headers from prefabs (partially done)
- [x] Use `implementation "com.facebook.react:react-native` (without plus) for RN 0.71+
- [x] Use `implementation "com.facebook.react:react-native:+" // From node_modules` for older RN versions (leave as it it now)
- [x] Make it work with Hermes
- [x] Make it works with JSC
- [x] Properly detect Hermes on Android
- [x] Include `folly-flags.cmake` directly
- [x] Use headers from path instead of prefabs
- [x] Depend on `jscexecutor` and `hermes-executor`
- [x] Fix Layout Animations on Paper due after removal of deprecated `UIImplementation` (facebook/react-native@e7d7563)
- [x] Use TypeScript types directly from package
- [x] Add #ifdefs for backward-incompatible code changes (e.g. `debugToken_`)
- [x] Use different sourcesets for `UIImplementationProvider`
- [x] Add missing `SystraceSection` in `UIManager_cloneNode`
- [x] Confirm that `UIManager_cloneNode` and `UIManagerBinding` are identical to those in react-native
- [x] Remove react-native.config.js
- [x] Update metro-inspector-proxy patch

### Won't do
- [ ] Declare dependency on `React-jsi` & `React-jsc` based on `ENV['USE_HERMES']` in RNReanimated.podspec - not necessary
- [ ] Fix Jest `testEnvironment`, use `react-native-env.js` - still doesn't work
- [ ] Do we still need `kotlinVersion` in build.gradle? - probably yes
- [ ] Restore MBFingerTip in ReanimatedExample

### Checklist

- [ ] Check compatibility with older RN versions
- [ ] Check if debugging worklets with Flipper works
- [ ] Check if debugging in Android Studio works
fluiddot pushed a commit to wordpress-mobile/react-native-reanimated that referenced this pull request Jun 5, 2023
## Summary

This PR fixes a warning that `debugToken_` field is unused in release mode after software-mansion#3745  which gets escalated to a compile error thanks to `-Werror`.

## Test plan

Check if Example app compiles in release mode.
mccoyplayer pushed a commit to mccoyplayer/reactScreen that referenced this pull request Feb 9, 2024
## Description

It seems that autolinking got complete overhaul in 0.71.0 as
`android/app/src/main/jni` directory was deleted -> thus it works
differently for sure now.

Still need to dive into it.

**FabricTestExample**

* [x] Android
* [x] iOS

**TestsExample**

* software-mansion/react-native-screens#1679

**FabricExample**

* software-mansion/react-native-screens#1680

**TODO**: Consider whether to use `com.facebook.react:react-native:+` or
`com.facebook.react:react-native` (without `+`) in
`android/build.gradle` of the library.

AFAIK the former takes highest available version from defined
repositories (should be `node_modules`?), the latter uses version
injected by React Native Gradle Plugin (but I believe it works since
React Native 0.71.0 or 0.70.0 (need to check) -- so version check might
be necessary).


Decided to leave:

```gradle
implementation 'com.facebook.react:react-native:+'
```

in library's `android/build.gradle` due to following reasons: 

* [Android's readme in RN
repo](https://github.com/facebook/react-native/blob/e108e9ebf1e6c52b6eeffeb6c41f842ad95baa0d/android/README.md)
* [Road to 0.71.0
post](reactwg/react-native-releases#41 (reply in thread))

Blocked by:

* ~facebook/react-native#35306
*
~software-mansion/react-native-reanimated#3745
*
~software-mansion/react-native-gesture-handler#2313
(decided to fix version on commit)
* ~`react-native-safe-area-context` - lacks support for RN71~ (created
patch)
* ~`@react-native-community/cli-platform-android` requires this patch:
kkafar/RNS-tester@9edaaa9.
The patch is already merged, but it is not shipped with `react-native`
yet.~

**NOTE**: Example application will handled in separate PR, as there are
problems with detox (it does not support 0.71 yet) and we run CI on that
app.

## Changes

* Updated examples 
* Updated library's build code

## Test code and steps to reproduce

Run example applications

## Checklist

- [ ] Ensured that CI passes
@javier545dev
Copy link

how to implement react native reanimated to nx monorepo project with react webpack? please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error running new RN architecture (0.71.0-rc.4) on IOS
5 participants