Summary:
This PR (https://github.com/facebook/react-native/pull/48182) introduced skipping hidden folders during Codegen generation.
However, when using pnpm, all files are stored in the `.pnpm` folder (see explanation here: https://pnpm.io/symlinked-node-modules-structure).
As a result, some libraries that support the new architecture but lack the `ios.codegenConfig.componentProvider` field - like [FlashList](https://github.com/Shopify/flash-list/blob/main/package.json) - will be skipped during Codegen generation.
This PR explicitly includes `.pnpm` to prevent this issue.
## Changelog:
[iOS][Fixed] - Check .pnpm folder when looking for third-party components.
Pull Request resolved: https://github.com/facebook/react-native/pull/49983
Test Plan:
Tested on:
RN 0.78.0
PNPM: 10
Flashlist: 1.7.3
Reviewed By: cipolleschi
Differential Revision: D71047936
Pulled By: cortinico
fbshipit-source-id: fa9caab23dea8c92ef5f23c997812d348eb19e08
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49981
Changelog: [internal]
(because MutationObserver isn't a public API yet)
## Context
`MutationObserver` is a [JavaScript API](https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver) used to report mutations in the DOM tree. The mutations available on Web are: changing children, changing attributes and changing text. In React Native, only changing children is supported.
Mutation detection needs to happen synchronously when mutations happen (in ShadowTree commits) and the notification is dispatched as a microtask in JS, which means we can only report mutations happening in JavaScript.
There's an assumption that only React (in JS) can change the structure of the tree in Fabric, so we implemented `MutationObserver` considering this assummption.
Unfortunately, while the assumption is correct (we can only mutate children from React) the implementation didn't take into account that commit hooks were triggered from multiple threads, even if the structure doesn't change (e.g.: with Fabric state updates). In this case, we do the checks but we never dispatch the notifications. This can cause crashes (see T217617393) if we try to check for mutations from the main thread while we add new observers in the JS thread (because that logic wasn't thread safe).
This fixes that crash by, in MutationObserver, not only preventing notifications from commits not coming from React, but also preventing the determination altogether.
In order to do this, this modifies the signature of the commit hooks to also pass the commit options, and adds a new field in the commit options with the source of the commit (for now, just "React" or "Unknown").
In `MutationObserver`, before accessing the data structures of the observer, we check if the commit is coming from React, and return early otherwise.
Reviewed By: javache
Differential Revision: D71036705
fbshipit-source-id: 985c8f903375cbf876dce5174e04563f74d7621a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49973
We still depend on the Community CLI directly, supporting local development in `packages/rn-tester`. Bump to latest — contains a number of build improvements, and will align us closer to prod/next.
Changelog: [Internal]
Reviewed By: cortinico, cipolleschi
Differential Revision: D71033085
fbshipit-source-id: ddbf7df5a35951b77c36d111cfd12ad64c3b73f7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49956
This is no longer being used internally so I think we can just remove this for less complexity
Changelog: [Internal]
Reviewed By: philIip
Differential Revision: D70983663
fbshipit-source-id: 61ca5212cb45dd1c8b96aee62964ad62b410d6f1
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49854
Changelog: [GENERAL][ADDED] - Codegen utility functions and types are now exported from the root package
Up to this point, third-party libraries needed to use deep imports to access codegen utilities and types This diff exports them from the main entry point, as we want to move away from supporting deep imports in OSS as a part of JS Stable API project.
Reviewed By: huntie
Differential Revision: D70628408
fbshipit-source-id: 5a6e1cb870465ede0fbc9eb8912d255aa90aa2a8
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49974
Changelog: [internal]
The feature flag system currently logs an error when trying to access common feature flags (flags accessible from everywhere but defined in native) from JS if the native module isn't available.
This forces a pattern in code to check if the module is available before accessing certain feature flags, to avoid showing that error to users in the legacy architecture.
This removes the need for that pattern by adding the check in the feature flag infra itself. If TM infra isn't available, we return default values and don't log the error.
Reviewed By: rozele
Differential Revision: D70975412
fbshipit-source-id: 5544bd96aaaf046ef90ca69bc549bef4e54eb98b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49855
Changelog: [IOS][FIXED] - Fixed touch events not being dispatched to ScrollView's children when they overflow the content container
Closes https://github.com/facebook/react-native/issues/47740.
Changes the ScrollView's container view to be `RCTViewComponentView` instead of `UIView` and sets custom layout metrics to it in a way that it will propagate touch events to all children, even if they overflow its bounds.
Reviewed By: sammy-SC
Differential Revision: D70619894
fbshipit-source-id: 348a1a369489d5208d6037c8d76b223c4ab2d5f7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49582
TSIA, this is a fairly straightforward implementation since iOS likes the shape the data is already in. Note I form a stacking context since I need the native view that has `accessibilityElements` to actually be an ancestor of everything under it
Note I am not exposing anything yet on the JS side, since we need to do Android also
Changelog: [Internal]
Reviewed By: NickGerleman
Differential Revision: D69625269
fbshipit-source-id: 836f1bb631646408a5726f126be61c0ff6afe1d0
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49960
Fixes https://github.com/facebook/react-native/issues/49106
RN legacy arch, and web, will clip inline content which appears after elipsized text. This is the correct behavior, compared to new arch, which will put it in a random place depending on the platform.
`line-clamp`: https://jsfiddle.net/7xgdke1b/
`text-overflow`: https://jsfiddle.net/7xgdke1b/2/
Fabric renderer does not, funnily enough, having an `isClipped` field on `TextMeasurement::Attachment` that is never used.
This change propagates state for whether an attachment is beyond elipsized area to this measurement, then when we see it, we set empty layout results with `DisplayType::None` so that we don't create native views. We don't layout child views either, but this seems to work out okay, even when removing and re-adding `numberOfLines`.
Changelog:
[General][Fixed] - Fix New Arch handling of inline views when text truncated
Reviewed By: mdvacca
Differential Revision: D70922174
fbshipit-source-id: 8c1f4aadbf53ff64ce55b44d6c7953d9b2e40bc5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49543
When using `ReactScrollView` or `ReactHorizontalScrollView` Views with `removeClippedSubviews` keyboard navigation didn't work.
This is because keyboard navigation relies on Android's View hierarchy to find the next focusable element. With `removeClippedSubviews` the next View might've been removed from the hierarchy.
With this change we delegate the job of figuring out the next focusable element to the Shadow Tree, which will always contain layout information of the next element of the ScrollView.
Changelog: [Android][Fixed] - Fix keyboard navigation on lists with `removeClippedSubviews` enabled
Reviewed By: joevilches
Differential Revision: D69618406
fbshipit-source-id: 1df7f90066dfc685e74a89b29222937777714b87
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49961
As preparation for fixing focus on FlatList we need to prevent the currently focused view from getting clipped. This is because in Android, if the currently focused view gets clipped before transferring focus we crash.
Changelog: [Android][Changed] - Prevent currently focused child from getting clipped when `removeClippedSubviews` is enabled
Reviewed By: NickGerleman
Differential Revision: D70994348
fbshipit-source-id: 8c68eeebd7df8e7d8f788e50a3bbe46b0335ace3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49951
We previously fixed Differentiator generating an incorrect parentTag (https://github.com/facebook/react-native/pull/48055), but this can lead to crashes in Android UI due to reordering that happens in the Android mounting layer. While we have an experiment to disable this reordering (https://github.com/facebook/react-native/pull/46702) this currently has a negative performance impact which needs to be addressed.
As a mitigation, we can make the lookup of parentTag's ViewManager state nullable. We only require this to support `needsCustomLayoutForChildren`, which is not commonly used, and seems acceptable to drop in this scenario.
Changelog: [Android][Changed] Do not crash when parent view state can't be found
Reviewed By: NickGerleman
Differential Revision: D70966621
fbshipit-source-id: 33d0b6a90860788a4c9a8c6cea36c2c72c1392e1
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49937
Adding an assert for recycled views still attached to their parent, which would lead to an exception when the view would be added to a new parent.
Changelog: [Internal]
Reviewed By: javache
Differential Revision: D70922503
fbshipit-source-id: 7d4daf427306203d603c31999ab138b3aee08e83
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49954
We have a different version of OkHttp internally and in OSS so we need to suppress these for now.
Changelog: [Internal]
Reviewed By: Abbondanzo
Differential Revision: D70975145
fbshipit-source-id: cd2a3ab5cdc52f25c78cb608e917fa3ca378e4f1
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49817
changelog: [internal]
Remove feature flag excludeYogaFromRawProps. It did not yield any performance wins and the code to support the feature is spread across multiple classes. Removal simplifies complexity.
Reviewed By: javache
Differential Revision: D70389071
fbshipit-source-id: 21751f56aec8de501ff1e1efafda035069d8ef48
Summary:
Migrate com.facebook.react.uimanager.layoutanimation.OpacityAnimation to Kotlin.
I moved out `OpacityAnimationListener` as well in this PR to separate concerns and align more with the codebase.
## Changelog:
[INTERNAL] - Migrate com.facebook.react.uimanager.layoutanimation.OpacityAnimation to Kotlin
Pull Request resolved: https://github.com/facebook/react-native/pull/49822
Test Plan:
```bash
yarn test-android
yarn android
```
Reviewed By: javache
Differential Revision: D70588884
Pulled By: alanleedev
fbshipit-source-id: 1b70f5e5facd5f47b828090e7c63a218229000cb
Summary:
When using the `login-password` prompt type, there is a TypeScript type mismatch issue. The `callbackOrButtons` parameter returns an object with `{login: string, password: string}` structure, but this type variation is not properly included in the **AlertType** type definition. This causes TypeScript to show type errors when using callback functions that expect credentials in the format `(credentials: {login: string, password: string}) => void`.
## Changelog:
- [General] [Fixed] Add missing type variation `{login: string, password: string}` to **AlertType** type definition to properly support `login-password` prompt callbacks
Pull Request resolved: https://github.com/facebook/react-native/pull/49757
Test Plan: This change is purely type-related and doesn't affect runtime behavior.
Reviewed By: NickGerleman
Differential Revision: D70797036
Pulled By: alanleedev
fbshipit-source-id: 8e27a39f0c8f49083730c683b41b69173715bd68
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49927
This change automates updating App's Info.plist with the new `RCTNewArchEnabled` boolean entry. The value depends on how the pod install is set up. In this way, we maintain the previous UX to enable/disable the New Arch.
## Context
The RCT_NEW_ARCH_ENABLE flag is a compile time flag we used for almost two years to configure the iOS apps and to determine whether the app should build with the New Arch or not.
However, given that we are looking into prebuilding React Native, we have to get rid of all the compilation flags, because they would require us to prebuild a combinatorial number of artifacts for react native. For example:
- New Arch / Hermes
- Old Arch / Hermes
- New Arch / JSC
- Old Arch / JSC
- ...
## Backward compatibility
We are going to keep adding the RCT_NEW_ARCH_ENABLED flag in all the dependencies, through the cocoapods inrastructure, so libraries, which are not prebuilt, will be build for the right architecture by the app itself.
## Changelog:
[iOS][Added] -
Reviewed By: cortinico
Differential Revision: D70888212
fbshipit-source-id: 541a818e02ccb96c822de29b0714646d1e69a5a9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49924
This change deprecates the RCT_NEW_ARCH_ENABLEd flag to toggle the New Architecture.
The new approach bring iOS closer to Android: to diasable the New Architecture, user needs to modify the App's Info.plist and add a `RCTNewArchEnabled` boolean entry and set it to `NO`.
The absence of the entry implies that the New Arch is enabled. (Defaults to enabled)
This also deprecates the `RCTSetNewArchEnabled` function because it makes no sense now
## Context
The RCT_NEW_ARCH_ENABLE flag is a compile time flag we used for almost two years to configure the iOS apps and to determine whether the app should build with the New Arch or not.
However, given that we are looking into prebuilding React Native, we have to get rid of all the compilation flags, because they would require us to prebuild a combinatorial number of artifacts for react native. For example:
- New Arch / Hermes
- Old Arch / Hermes
- New Arch / JSC
- Old Arch / JSC
- ...
## Backward compatibility
We are going to keep adding the RCT_NEW_ARCH_ENABLED flag in all the dependencies, through the cocoapods inrastructure, so libraries, which are not prebuilt, will be build for the right architecture by the app itself.
## Changelog:
[iOS][Deprecated] - deprecate the `RCT_NEW_ARCH_ENABLED` and the `RCTSetNewArchEnabled`
Reviewed By: cortinico
Differential Revision: D70885454
fbshipit-source-id: 4b8404ead4900d9787049ebd0b8b3c29b272f913
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49929
X-link: https://github.com/facebook/metro/pull/1459
In the next version of Flow, we will stop bundling many of the builtin libdefs, and they have been moved to flow-typed. This diff checks in them to prepare for the deployment of the next version of Flow.
Changelog: [Internal]
Reviewed By: SamChou19815
Differential Revision: D70896122
fbshipit-source-id: aa6bd0b1e653b983a345b0e202c8dad5058a0001
Summary:
GHA passes the version to the script with a `v` prefix. However, when we receive the version from NPM, the `v` prefix is not here.
We can fix the script by dropping the `v` when it is passed to the function.
bypass-github-export-checks
## Changelog:
[Internal] - Fix verifyPackageOnNPM
Pull Request resolved: https://github.com/facebook/react-native/pull/49944
Test Plan: GHA
Reviewed By: cortinico, fabriziocucci
Differential Revision: D70960414
Pulled By: cipolleschi
fbshipit-source-id: 4234103ebe49cf715aea4a1473a8a60978f07a9f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49936
Ensure LegacyArchitectureLogger.assertWhenLegacyArchitectureMinifyingEnabled is called only once per class loading in kotlin
changelog: [internal] internal
Reviewed By: alanleedev
Differential Revision: D70922132
fbshipit-source-id: ce4d68dc2ab0f61266e4bb5cddfc175c364f568a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49938
Recycling a `ReactViewGroup` will lead to all child views being removed from the view. To avoid having view recycling corrupt the clipping state set for the child views, ahead of base view recycling preparation this diff disables `removeClippedSubviews` so that layout changes don't run over all child views that will end up being removed anyway.
The bug reported earlier should already have been resolved by D70672120 since the view recycling of a child view would remove the view from the parent. Meaning the ReactViewGroup can only have subviews that are not prepared for recycling, any recycled view would have been removed from their parent (the ReactViewGroup)
Changelog: [Internal]
Reviewed By: mdvacca
Differential Revision: D70921641
fbshipit-source-id: a8b311169b268c09400d2b62008184e379f6fe79
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49934
The typing of internal version of jest and the libdef in react-native has diverged a bit. This diff aligns the typing for `describe`
Changelog: [Internal]
Reviewed By: gkz
Differential Revision: D70917375
fbshipit-source-id: 9c2ab98a08394aa187712f4966748a8a60e202b1
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49900
This appears to fix an issue where removing a sibling with zIndex breaks drawing of the next sibling. The theory is that eager return in `onViewRemoved` prevents the view from reverting into a state where it no longer uses custom draw order. However, tracing back history, this eager return was [added](https://github.com/facebook/react-native/pull/43389) to fix a bug in Reanimated. cc bartlomiejbloniarz to confirm if [this Reanimated issue](https://github.com/software-mansion/react-native-reanimated/issues/5715) resurfaces from this change.
Fixes#49838
## Changelog
[Android][Fixed] Fixes issue with z-indexed sibling removal
Reviewed By: NickGerleman, cipolleschi
Differential Revision: D70795631
fbshipit-source-id: 500af92226be29af73f36f911ffff27a0c083ae9
Summary:
Currently, when integrating into a native app using ReactNativeFactory, when we forget to set `dependencyProvider` we get a random crash exception instructing us (depending on native modules in our app) about an unrecognized selector:

After this change we get a proper error informing us that we for got to set dependencyProvider:

## Changelog:
[IOS] [ADDED] - Useful error message about setting dependency provider
Pull Request resolved: https://github.com/facebook/react-native/pull/49843
Test Plan: CI Green
Reviewed By: cortinico
Differential Revision: D70631515
Pulled By: cipolleschi
fbshipit-source-id: d99c8fa12fdb0624a01fe16c50fe0f2d10554f94
Summary:
Migrate com.facebook.react.bridge JavaScriptContextHolder & JavaScriptExecutor to Kotlin.
In this PR I also marked the return of HermesExecutor.initHybridDefaultConfig as non-nullable to keep the conversion without logic changes. I checked that this was changed unintentionally to nullable in 12e321daf0 but I think it was not supposed to be.
## Changelog:
[INTERNAL] - Migrate com.facebook.react.bridge JavaScriptContextHolder & JavaScriptExecutor to Kotlin
Pull Request resolved: https://github.com/facebook/react-native/pull/49909
Test Plan:
```bash
yarn test-android
yarn android
```
Reviewed By: javache
Differential Revision: D70871012
Pulled By: Abbondanzo
fbshipit-source-id: 1c15927056baf166e520e896e92bebf664fa0229
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49931
This change fixes the app startup in the Old Architecture by implementing the loadSourceForBridge:onProgress:onComplete method in the RCTDefaultReactNativeFactoryDelegate object.
The method was missing here, so the Bridge was never trying to load the JS bundle from Metro, resulting in an empty app.
## Changelog:
[iOS][Fixed] - Implement the loadSourceForBridge:onProgress:onComplete in the RCTDefaultReactNativeFactoryDelegate.
Reviewed By: cortinico
Differential Revision: D70898811
fbshipit-source-id: 3e5d519a1965e92ace91ca6d5b316a9069279448
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49906
Task.call is equivalent to a try-catch and wrapping the result in a Task. Inlining this is cheaper than creating a TaskCompletionSource and a Runnable.
Changelog: [Internal]
Reviewed By: cortinico
Differential Revision: D70803554
fbshipit-source-id: 0886176be974eff67c983ce1475ad685a8021b14
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49926
Those files can be fully removed as it's not referenced at all in OSS/Internal
Changelog:
[Internal] [Changed] -
Reviewed By: fabriziocucci
Differential Revision: D70888664
fbshipit-source-id: 4cacc449aa141e0465f771bf8c52d573d4227ef5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49922
Spamming the DB with "heartbeat" events with close to 0 ping didn't give us any useful information. Instead, report high ping situations.
Changelog:
[General][Internal] Remove reporting all device and debugger heartbeat events, only report heartbeats with high round trip latency
Reviewed By: GijsWeterings
Differential Revision: D70707457
fbshipit-source-id: 6bc8a55fd32dfa60fb4f7764ac00a6218417dcb5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49907
These tests have been disabled for a while due to feature flags being introduced, fusebox flags with native dependencies, and the removal of Powermock.
Changelog: [Internal]
Reviewed By: Abbondanzo
Differential Revision: D70803553
fbshipit-source-id: d1ae6e4ca6c0d22e6a8c89bf01b28333929fa8a6