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

feat: support for RN 0.78.0-rc.5 #2626

Merged
merged 34 commits into from
Feb 19, 2025
Merged

feat: support for RN 0.78.0-rc.5 #2626

merged 34 commits into from
Feb 19, 2025

Conversation

kkafar
Copy link
Member

@kkafar kkafar commented Jan 16, 2025

Description

Add library support for react-native 0.78 & use 0.78 in example apps.

Caution

This PR breaks compatibility with older react native versions on new architecture. In case it is merged new architecture will be supported only from 0.78 onwards. The breaking change in core we need to follow:

There are also breaking changes made in core regarding method / function signatures, see required adjustments here 5a7e440

I believe these Android method signature changes do break backward compatibility also on old architecture!

Changes

Test code and steps to reproduce

Checklist

  • Ensured that CI passes

Sorry, something went wrong.

@mrousavy
Copy link
Contributor

heyo - nice work! are you planning on releasing a beta for RN 78-rc support? Specifically the mutation.parentTag and mutation.parent.componentName thingys are broken because of internal react-native Fabric changes.

@kkafar
Copy link
Member Author

kkafar commented Jan 30, 2025

Hey, I expect support for 0.78 to be released first in beta of 4.8.0 (a month from now?). We still have only-latest-version-support policy for Fabric and I do not want to switch for 0.78 too early.

@mrousavy
Copy link
Contributor

ok, understood. thx

I'm asking because that's the only thing blocking Nitro Views 😅

github-merge-queue bot pushed a commit to software-mansion/react-native-reanimated that referenced this pull request Feb 4, 2025
## Summary

Adds if checks for the RN 0.78 in native code, thanks to which package
builds on both - 0.78 nd 0.77.

## Checklist

- [ ] Upgrade `react-native-screens` when 0.78 support is added
(software-mansion/react-native-screens#2626)
- [ ] Upgrade `react-native-svg` when 0.78 support is added
(software-mansion/react-native-svg#2619)
- [ ] Upgrade `react-native-gesture-handler` when 0.78 support is added
(software-mansion/react-native-gesture-handler#3354)
- [ ] `react-native-pager-view` auto generated schema contains invalid
`StringEnumTypeAnnotation` fields and crashes build on Android

|| Fabric (iOS) | Fabric (Android) | Web | MacOS (not upgraded) | TVOS
(not upgraded) |
|-|-|-|-|-|-|
| Builds | ✅ | ✅ | ✅ | ✅ | ✅ |
| Runs   | ❌ | ❌ | ❌ | ✅ | ✅ |

*Apps where RN was upgraded don't run because of incompatible dependency
versions
@mrousavy
Copy link
Contributor

Hey - sorry hate to be annoying, but did you release a beta for this yet?

@kkafar
Copy link
Member Author

kkafar commented Feb 17, 2025

Nope, I'm releasing stable 4.7.0 today evening & 78 support is next thing in the queue.

kkafar and others added 3 commits February 18, 2025 09:29
## Description

@kkafar:
Fixes #2594 

## Changes

<!--
Please describe things you've changed here, make a **high level**
overview, if change is simple you can omit this section.

For example:

- Updated `about.md` docs

-->

<!--

## Screenshots / GIFs

Here you can add screenshots / GIFs documenting your change.

You can add before / after section if you're changing some behavior.

### Before

### After

-->

## Test code and steps to reproduce

<!--
Please include code that can be used to test this change and short
description how this example should work.
This snippet should be as minimal as possible and ready to be pasted
into editor (don't exclude exports or remove "not important" parts of
reproduction example)
-->

## Checklist

- [ ] Included code example that can be used to test this change
- [ ] Updated TS types
- [ ] Updated documentation: <!-- For adding new props to native-stack
-->
- [ ]
https://github.com/software-mansion/react-native-screens/blob/main/guides/GUIDE_FOR_LIBRARY_AUTHORS.md
- [ ]
https://github.com/software-mansion/react-native-screens/blob/main/native-stack/README.md
- [ ]
https://github.com/software-mansion/react-native-screens/blob/main/src/types.tsx
- [ ]
https://github.com/software-mansion/react-native-screens/blob/main/src/native-stack/types.tsx
- [ ] Ensured that CI passes
The `NativeViewHierarchyManager` argument in `.addUIBlock` is nullable.
(See
[`UIBlock::execute(...)`](https://github.com/facebook/react-native/blob/864c34e9f6c55319417633206e58cefc3c962e7d/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIBlock.kt#L12))

This PR fixes that definition and makes it nullable, and also checks for
null. In our case, we likely want to exit out of that and just do
nothing. (but lmk, I can also change to a throw)

<!--
Description and motivation for this PR.

Include Fixes #<number> if this is fixing some issue.

Fixes # .
-->

- Fixed `NativeViewHierarchyManager` being nullable

<!--
Please describe things you've changed here, make a **high level**
overview, if change is simple you can omit this section.

For example:

- Updated `about.md` docs

-->

<!--

Here you can add screenshots / GIFs documenting your change.

You can add before / after section if you're changing some behavior.

-->

<!--
Please include code that can be used to test this change and short
description how this example should work.
This snippet should be as minimal as possible and ready to be pasted
into editor (don't exclude exports or remove "not important" parts of
reproduction example)
-->

- [ ] Included code example that can be used to test this change
- [ ] Updated TS types
- [ ] Updated documentation: <!-- For adding new props to native-stack
-->
- [ ]
https://github.com/software-mansion/react-native-screens/blob/main/guides/GUIDE_FOR_LIBRARY_AUTHORS.md
- [ ]
https://github.com/software-mansion/react-native-screens/blob/main/native-stack/README.md
- [ ]
https://github.com/software-mansion/react-native-screens/blob/main/src/types.tsx
- [ ]
https://github.com/software-mansion/react-native-screens/blob/main/src/native-stack/types.tsx
- [x] Ensured that CI passes

---------

Co-authored-by: Kacper Kafara <kacper.kafara@swmansion.com>
@kkafar kkafar force-pushed the @kkafar/support-0.78 branch from 12adf96 to 97a3952 Compare February 18, 2025 08:30
@kkafar
Copy link
Member Author

kkafar commented Feb 18, 2025

Currently blocked by issue similar to:

This happens on both platforms.

@kkafar
Copy link
Member Author

kkafar commented Feb 19, 2025

It seems that there is no issue when running fresh application. Most likely the error happens due to some invalid (but not invalidated) caches.

@kkafar kkafar changed the title feat: support for RN 0.78 feat: support for RN 0.78.0-rc.5 Feb 19, 2025
@kkafar kkafar self-assigned this Feb 19, 2025
@kkafar
Copy link
Member Author

kkafar commented Feb 19, 2025

But the issue does happen on clean installation of the react-native-screens repository. Together with previous fact this indicates that this is setup-specific.

@kkafar
Copy link
Member Author

kkafar commented Feb 19, 2025

Tests are failing because I've installed reanimated 4 for the sake of build & it does support only new architecture.

Copy link
Member Author

@kkafar kkafar left a comment

Choose a reason for hiding this comment

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

Tests are failing because I've installed reanimated 4 for the sake of build & it does support only new architecture.

This is something to fixup later, because the 78 stable is out & this PR is good enough for beta.

@kkafar kkafar merged commit 13384c9 into main Feb 19, 2025
6 of 8 checks passed
@kkafar kkafar deleted the @kkafar/support-0.78 branch February 19, 2025 18:03
kligarski added a commit that referenced this pull request Mar 7, 2025
## Description

Adding support for `react-native@0.78.0`.

## Changes

- adjusted example apps (Android, iOS) on both architectures (Paper,
Fabric) with changes from upgrade helper,
- added additional fixes (android, ios, cpp) from 4.x
(#2626),
- updated dependencies, gradle of the library:
- uncommented `syncArchs` task, because updating `react-native` version
of the library fixed the problem with codegen,
- fixed issue connected with Gesture Handler:
  - #2618,
- updated TVOS example app (from 0.74.1) to match example app from 4.x
and Android, iOS apps,
- fixed a bug with `replaceNavigationBarViewsWithSnapshotOfSubview`
method by adding a nil check:
- adapted from
#2485,
- restoring backward compatibility:
  - #2730,
  - #2737.

## Test code and steps to reproduce

CI

## Checklist

- [ ] Ensured that CI passes

---------

Co-authored-by: Kacper Kafara <kacper.kafara@swmansion.com>
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.

None yet

2 participants