This introduces the first working version of building React Native apps on iOS using prebuilt RNCore and cocoapods.
- Added React-Core-prebuilt.podspec for installing/consuming XCFrameworks
- Added logic in react_native_pods.rb for switching between build from source and using prebuilts
- Added rncore.rb - utilities for the ReactCore prebuilts
- Updated rndependencies with some extra error handling modelled after rncode.rb
- Added support for hard linking headers and modules in each inner framework in the XCFramework in xcframework.js
Swift:
To enable support for the objective-c types from swift, the swift compiler uses a module map to gather exports from the framework (module.modulemap). This file basically points to an umbrella header file that exports the valid objective-c types (non c++) to Swift. In addition these files are read from the DerivedData and not the project source - so it is a bit hard to control everyting.
I was initially not able to use cocoapods own module definitions (module_name, module_file props) to use a custom module map. I finally found that these files are expected in the deriveddata (build folder) where only the active inner framework is copied - so then I had to hard link both module map and header files for each arch.
Summary:
Following up from https://github.com/facebook/react-native/pull/52064#discussion_r2151906096, this PR removes lint-java and its related files.
The codebase is moving entirely to Kotlin and a Kotlin linter is being setup as well, the usage of the Java linter will become unnecessary.
## Changelog:
[INTERNAL] - Remove lint-java
Pull Request resolved: https://github.com/facebook/react-native/pull/52092
Test Plan: Relying on CI here to be green.
Reviewed By: cortinico
Differential Revision: D76880712
Pulled By: sbuggay
fbshipit-source-id: 2736772e7347f435b17d007e0322e1afc2fb2d7b
Summary:
The alpha channel in the `rgba()` color string format should be a value between [0, 1] instead of [0, 255], as stated in the [React Native Documentation](https://reactnative.dev/docs/colors#red-green-blue-rgb).
## Changelog:
[GENERAL] [FIXED] - Fix the serialization of the alpha channel in the `rgba()` color string format.
Pull Request resolved: https://github.com/facebook/react-native/pull/52087
Test Plan: I didn't find any usage of that function in React Native, but it is part of the public API, and I just wanted to use it in Reanimated.
Reviewed By: fabriziocucci
Differential Revision: D76822560
Pulled By: javache
fbshipit-source-id: 370d9729881c1eda794c1b9fe54d258242fde814
Summary:
This PR allows to interactively close the modal using the swipe down gesture.
It fixes 5 year old issue: https://github.com/facebook/react-native/issues/29319
In short it removes `modalInPresentation` which according to the documentation causes: "UIKit ignores events outside the view controller’s bounds and **prevents the interactive dismissal of the view controller while it is onscreen.**".
It also adds another delegate event to call onRequestClose whenever modal is closed by gesture.
https://github.com/user-attachments/assets/8849ecba-f762-47ec-a28b-b41c1991a882
## Changelog:
[IOS] [ADDED] - Allow to interactively swipe down the modal.
Add allowSwipeDismissal prop.
Pull Request resolved: https://github.com/facebook/react-native/pull/51483
Test Plan: Test if swiping down the modal calls onRequestClose
Reviewed By: rshest
Differential Revision: D75125438
Pulled By: javache
fbshipit-source-id: d4f2c8b59447680f405b725d0809573a937f97cf
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52103
## Changelog:
[Internal] -
This got out of sync again, causing the corresponding signal to fail.
Reviewed By: lenaic
Differential Revision: D76893994
fbshipit-source-id: e0e78cd41633972be53aa883c6015588b547b9c2
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52101
Changelog: [internal]
`enableAccessToHostTreeInFabric` is enabled by default in tests, so doesn't need to be explicitly set.
Reviewed By: lenaic
Differential Revision: D76894319
fbshipit-source-id: 437a763bd9c557ecbafa53e31410da1120151b86
Summary:
`SafeAreaView` has been marked for deprecation some time ago. The [following discussion](https://github.com/react-native-community/discussions-and-proposals/discussions/827) summarizes some of the arguments for it, but in a nutshell: it is iOS-only, limited in functionality, and incompatible with Android 15's enforced edge-to-edge rendering.
~~The Android/Kotlin classes have also been deprecated.~~ Not anymore, they are internal and might stay as they are.
## Changelog:
[General] [Deprecated] - Deprecate SafeAreaView due to its iOS-only support and incompatibility with Android 15 edge-to-edge behavior; recommend using react-native-safe-area-context instead.
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
Pull Request resolved: https://github.com/facebook/react-native/pull/51896
Test Plan: Access `SafeAreaView` in your code and check that the deprecation warning logs exactly once in the console.
Reviewed By: rshest
Differential Revision: D76816160
Pulled By: cortinico
fbshipit-source-id: 60f539f9425f8ed8e19578a4530cb1f7d9b54488
Summary:
Due to us moving to central.sonatype.com for publishing, we cannot publish and release the Maven repository in 2 distinct invocations.
This consolidates all the publishing job to happen during build_npm_package
Changelog:
[Internal] [Changed] -
Reviewed By: fabriziocucci
Differential Revision: D76888543
fbshipit-source-id: 3cb0db6176ed2221a12b4f3f1f575232aa006a6c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52081
changelog: [internal]
# The problem in Java and Obj-C Native Animated
--------------------
Event based animations in Native Animated have one big problem: detecting when the gesture is completed. This has led to number of bugs over the years that manifest as Pressable's onPress not triggering. The root cause of the problem is disconnect between where a piece of UI is on the screen and where Fabric thinks it is. Fabric is used for hit testing, and other things like intersection observing, and if Fabric does not have up to date values, weird things start happening.
This diff implements completion detection for event based animations. Unlike previous solutions, it does not depend on sequence of events nor it uses React setState to update shadow tree.
# Completion Detection
--------------------
The key mechanism for marking event animations as completed is in the `onRender` method:
- After processing animations, if `onAnimationFrame` returns false - indicating no UI changes, the system assumes all event-driven animations have completed.
- it then:
* Collects all animated value nodes connected to event drivers.
* Updates all nodes connected to these "finished" animations.
* isEventAnimationInProgress_ to false.
* Commits final property values to the UI.
The benefits over the previous solution:
- It works across all platforms without the need to emit "completion events".
- It uses a UI frame that wouldn't animate anything to do syncing work. Using main thread IDLE time towards bookkeeping.
- No need to call into JavaScript for synchronisation.
Reviewed By: zeyap
Differential Revision: D76743467
fbshipit-source-id: b21ab5ef9c71ff93fd0250e6af6b22ded395be8d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52094
Changelog [Internal]:
- LegacyViewManagerInteropComponentDescriptor was initiaizing Module just to get the `Class` for `componentName`. This can cause deadlock issue when we have module that needs mainQueue to initialize.
Reviewed By: RSNara
Differential Revision: D76757706
fbshipit-source-id: 6fc6127b6ff472fda509364f0c3daa13b6a6df1e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52056
This prop should only be used on Views using it in Text is not very intuitive and also would require some unnecessary edge case handling on Android which we now also remove
Changelog: [Internal]
Reviewed By: joevilches
Differential Revision: D76744972
fbshipit-source-id: 23113789747295ea1a306727f1e29e3ddc078ac4
Summary:
Compile out the legacy c++ core from android.
Changelog: [Internal]
Reviewed By: mdvacca
Differential Revision: D72991984
fbshipit-source-id: 56bb6ca1c4797adb9235e982121712b11e85e109
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52073
X-link: https://github.com/facebook/yoga/pull/1820
Fixes https://github.com/facebook/yoga/issues/1819
Yoga has a fast path when measuring a node, if it thinks it knows its dimensions ahead of time.
This path has some eroneous logic, to set both axis to owner size, if *either* will evaluate to zero, while having an `YGMeasureModeAtMost`/`FitContent` constraint. This means that if a node is given a zero width, and Yoga later measures with with `FitContent`, its height will become the maximum allowable height, even if it shouldn't be that large.
We can fix this, by only allowing if both axis are this fixed case, instead of just one.
This bug has existed for about a decade (going back to at least D3312496).
Changelog:
[General][Fixed] - Fix possible invalid measurements with width or height is zero pixels
Reviewed By: yungsters
Differential Revision: D76793705
fbshipit-source-id: ea4c00e688912a58c08801e4a14ddf1b293a5d86
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52069
Noticed an E2E tests against old emulator version showed aliased Text against Facsimile. This is because non-scratch-paint path does not explicitly enable anti-aliasing (like TextView does), older versions of Android don't enable by default, and `updateTextPaint()` no longer sets, after call to `paint.reset()` was removed.
Changelog: [Internal]
Reviewed By: javache
Differential Revision: D76780749
fbshipit-source-id: 26f0de6d6558649fe08339f1ac91390bbd4cce3c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52078
This Cmake file is not imported anymore and can be removed now.
Changelog:
[Internal] [Changed] -
Reviewed By: cipolleschi
Differential Revision: D76808417
fbshipit-source-id: 81824c7c46080bc16c891b5c11c3a8946f16c1b9
Summary:
The target needs the HERMES_ENABLE_DEBUGGER flag in debug just like .reactHermes does.
This commit fixes this by adding the define to the reactRuntime target.
## Changelog:
[IOS] [FIXED] - Added HERMES_ENABLE_DEBUGGER to debug configuration for the reactRuntime target.
Pull Request resolved: https://github.com/facebook/react-native/pull/52082
Test Plan: Prebuild React Core
Reviewed By: robhogan
Differential Revision: D76813200
Pulled By: cipolleschi
fbshipit-source-id: cb81a40fb9c5a91ca40c3a27ae4ccdf043186bac
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52083
These headers were removed in D55037569 but we may have some targets still depending on them. Add redirection headers with warnings to help users migrate without this being a breaking change.
Changelog: [Internal]
Reviewed By: cipolleschi
Differential Revision: D76810433
fbshipit-source-id: 43cddcc69eefbcff0c0140e165fb893bee493c79
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52077
RNTester is currently crashing on release due to a stripped `mHybridData` field.
Changelog:
[Internal] [Changed] -
Reviewed By: cipolleschi
Differential Revision: D76808165
fbshipit-source-id: 049cca49f683c5dc92aa1f9a37dd7b4371dcbfd6
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52015
Changelog: [Internal]
Add gflags to fantom_tester so we can pass in data like featureFlags
Reviewed By: cortinico
Differential Revision: D76618409
fbshipit-source-id: a18e642a02c405eef972a7418a606a5980253b6a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52079
After the conversion to Kotlin (D74571782), there seems to be a synchronization issue when iterating on `viewManagers` (see T226095884).
There could a shadowing problem kicking in in a few places due to the fact that we are declaring a `viewManagers` local variable when there is already a `viewManagers` instance variable within `ViewManagerRegistry`.
To remove any ambiguity, here we are renaming the instance variable `viewManagers` as `viewManagersMap` (which also makes more sense).
Changelog: [Internal]
Reviewed By: cortinico
Differential Revision: D76807070
fbshipit-source-id: 4f598700e04251409ee19b60515639e90699cc9e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52076
Changelog: [internal]
This refactors the implementation of surface creation in Fantom to make the surface ID handled in native, and treated as an opaque type the same way we do at runtime in RN.
Reviewed By: andrewdacenko
Differential Revision: D76744096
fbshipit-source-id: 1b49a1cbdf0a8d6804de3b87ede727207bc662d9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52051
In {D76368959}, I moved `react-native-fantom` from `packages/` to `private/` and missed this reference.
Changelog:
[Internal]
Reviewed By: rubennorte
Differential Revision: D76743071
fbshipit-source-id: f99d3f2ac5e14fd23f7cf208ca030541844dddc6