Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53778
I've been looking into the next major bump of AGP to 9:
https://developer.android.com/build/releases/agp-preview#android-gradle-plugin-built-in-kotlin
This change adapts our project so that it keeps on buildign with AGP 8
(as the bump to 9 would be a breaking change), but it addresses some of the build
failures we'll be having with AGP 9:
- Set `resValues` build option to true (default was changed true -> false in AGP 9)
- Opts out our project from `android.builtInKotlin` and `android.newDsl` for the time being.
Changelog:
[Android] [Fixed] - Fix build failures with RNGP due to AGP 9.0.0-alpha05
Reviewed By: alanleedev
Differential Revision: D82452555
fbshipit-source-id: 99561f039bf943f5ce99008ce073ca86431cfaed
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53677
## Context
When configuring an app to build with SwiftPM from source, there is a sequence of operations we need to run in order to prepare the project correctly.
## Changed
Add a function that runs `prepareHeaders` that configures the headers for React Native and Codegen targets.
## Changelog:
[Internal] -
Reviewed By: cortinico
Differential Revision: D81778440
fbshipit-source-id: 26b973c07e82f30663e51c4a8e0e72f54765115e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53676
## Context
When configuring an app to build with SwiftPM from source, there is a sequence of operations we need to run in order to prepare the project correctly.
## Changed
Add a function that generates codegen artifacts. Those are required by React Native and by the app to build properly.
## Changelog:
[Internal] -
Reviewed By: cortinico
Differential Revision: D81778439
fbshipit-source-id: 7fe5cc0b612d2d9324d68fe04ec556e986ec14af
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53675
## Context
When configuring an app to build with SwiftPM from source, there is a sequence of operations we need to run in order to prepare the project correctly.
## Changed
Add a function that create hardlinks for React Native so it can build from source
## Changelog:
[Internal] -
Reviewed By: cortinico
Differential Revision: D81778454
fbshipit-source-id: 702a603629e4fad154b5d79dea6d96fcd80235b9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53674
## Context
When configuring an app to build with SwiftPM from source, there is a sequence of operations we need to run in order to prepare the project correctly.
## Changed
Add a function updates the PAckage.swift file to set BUILD_FROM_SOURCE to true
## Changelog:
[Internal] -
Reviewed By: cortinico
Differential Revision: D81778460
fbshipit-source-id: b06ebc546aa8e87acdb15706a0559e9046173784
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53673
## Context
When configuring an app to build with SwiftPM from source, there is a sequence of operations we need to run in order to prepare the project correctly.
## Changed
Add a function that configure React Native to be swift compatible by creating the React-umbrella and modulemap
## Changelog:
[Internal] -
Reviewed By: cortinico
Differential Revision: D81778437
fbshipit-source-id: 8bfd0df3abed813a221e5ef7972f4b7a6e292e76
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53667
This change updates the Package.swift file to enable building RNTester and HelloWorld from source.
The set of changes is the following:
- add a BUILD_FROM_SOURCE flag to toggle between building for creating prebuilds and building an app from source
- configure the proper header search path based on whether we want to build an app from source or not
- split the ReactFabricComponents target in multiple subtargets. This is required because when building from source we can't have targets whose Source folder is overlapping.
## Changelog:
[Internal] -
Reviewed By: cortinico
Differential Revision: D81778452
fbshipit-source-id: 00553a9966e7d96177e70d45179e712536c23124
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53671
## Context
When configuring an app to build with SwiftPM from source, there is a sequence of operations we need to run in order to prepare the project correctly.
## Changed
Add a function that prepares the prebuilds for ios so we can leverage them when building from source
## Changelog:
[Internal] -
Reviewed By: cortinico
Differential Revision: D81778467
fbshipit-source-id: bacfcfd3d646bfa27dcd800417e4787308a51a86
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53706
## Context
When configuring an app to build with SwiftPM from source, there is a sequence of operations we need to run in order to prepare the project correctly.
## Changed
Add a function that runs `pod deintegrate` to remove remainings of cocoapods
## Changelog:
[Internal] -
Reviewed By: cortinico
Differential Revision: D81778468
fbshipit-source-id: 20e1cfefcef8318d63d4a6ff92050ced0f91ef53
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53669
## Context
When configuring an app to build with SwiftPM from source, there is a sequence of operations we need to run in order to prepare the project correctly.
## Changed
Add a function that given the root of the app and the name of the xcodeproject file, can return the path to the Xcode project file
## Changelog:
[Internal] -
Reviewed By: cortinico
Differential Revision: D81778456
fbshipit-source-id: f7050bcb049d75a5b1cabf340a5b98f4736e60b3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54084
Android port of D83754145.
1. Teaches the native networking module on IOS to track a `devToolsRequestId` along with each request, and use it instead of the internal `requestId` to identify the request to `NetworkReporter`.
2. Uses `__NETWORK_REPORTER__.createDevToolsRequestId` (D83238216) to generate a `devToolsRequestId` from JS and pass it into native. This records a JavaScript call stack as the [initiator](https://cdpstatus.reactnative.dev/devtools-protocol/tot/Network#type-Initiator) of the request.
Changelog: [Internal]
Reviewed By: huntie
Differential Revision: D83981793
fbshipit-source-id: b4b8828433881c15e44a0468275a5cf398e7d050
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54114
This setup script will be published in the react-native package.
Other people might not have prettier installed, so it will crash the mock below.
Therefore, we wrap this mock in a try-catch.
Changelog: [General][Fixed] Fixed https://github.com/facebook/react-native/issues/54102
Reviewed By: cortinico
Differential Revision: D84292458
fbshipit-source-id: e884b02eec6abb7a964e01dd01f72f6e2ee31dab
Summary:
Update the copyright header in packages/react-native/ReactCommon/yoga/cmake/yoga-config.cmake.in from
```
# Copyright (c) Facebook, Inc. and its affiliates.
```
to
```
# Copyright (c) Meta Platforms, Inc. and affiliates.
```
for consistency with the rest of the codebase. This change does not affect functionality.
close https://github.com/facebook/react-native/issues/54086
## Changelog:
[GENERAL] [CHANGED] - Updated copyright header in Yoga CMake file from Facebook to Meta.
Pull Request resolved: https://github.com/facebook/react-native/pull/54087
Test Plan: Tests Required: No
Reviewed By: robhogan
Differential Revision: D84101874
Pulled By: cortinico
fbshipit-source-id: 534fb700dcbb14d0e91c8c287e8a9af251cba4f9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54101
Changelog:
[Android][Deprecated] Mark `NetworkingModule.sendRequestInternal` as deprecated
The `NetworkingModule.sendRequestInternal` method is an implementation detail of the `sendRequest` method and does not need to be public. In this diff, we mark it as deprecated ahead of removing it from the public API in a future release of React Native.
Reviewed By: javache
Differential Revision: D84250142
fbshipit-source-id: fad62eeae4f9bf06e00578b3cfb6c2c077c08e5c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54115
Horizontal scroll view extensions should be able to customize the scrolling behavior for state restores. This adds the `restoreScrollTo` function that will be called to restore the scroll position to the location provided by the shadow node state.
Changelog: [Internal]
Reviewed By: rozele
Differential Revision: D84310601
fbshipit-source-id: 007caa3d0922a5430ffc6f970eebb180a112f894
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54113
With `Trait::hidden` unmounting and remounting views for shadow nodes holding scroll state, we have to restore the scroll position from the shadow node state when the scroll view is being remounted
Changelog: [Internal]
Reviewed By: christophpurrer
Differential Revision: D84291899
fbshipit-source-id: 596839f56757dbdf9485e82380af31a71865e1df
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54112
This diff adds the possibility to control the use of `Trait::Hidden` on Android platforms through feature flags. The feature flag is Android specific and only accessed on Android platforms.
Changelog: [Internal]
Reviewed By: christophpurrer
Differential Revision: D84289662
fbshipit-source-id: 0ee1d0702aa36df25c842017673176a9c7984b23
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54091
## Changelog:
[Internal] [Changed] - use processor flag -DRN_USE_ANIMATION_BACKEND to gate animation backend dep
So it's only enabled for catalyst and fantom when building with BUCK while gated from other meta apps, and enabled by default in oss version
Reviewed By: sammy-SC
Differential Revision: D84157729
fbshipit-source-id: e822f11c4b64b77b17a698bf3b60b5c5a4faf4f4
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54096
Exporting this since we have some incoming changes to Animated which okwasniewski wants to make and should be applied to CxxAnimated too.
This is not hooked up to any OSS apps yet.
Changelog: [Internal]
Reviewed By: christophpurrer
Differential Revision: D84200113
fbshipit-source-id: 7a278ebf3f9c2b0779971591804d3fbd89ce4723
Summary:
LayoutDirectionUtil is part of legacy architecutre, in this diff I'm deleting it from fbsource
changelog: [internal] internal
Reviewed By: shwanton, cortinico
Differential Revision: D83984648
fbshipit-source-id: 161e4347ccab160fb1be66cba05f9474c0ad3b72
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54007
## Changelog:
[Android] [Changed] - Defer to responder system to terminate on scroll
when FeatureFlag responderTerminateOnScrollAndroid is turned on
on ios, we don't dispatch TouchCancel at scroll to terminate scrollview's children, instead, responder system handles responder termination when it receives onScroll event
Currently, TouchCancel native event at scroll will stop any ongoing touch events dispatched from native, and will unexpectedly terminate responder even if responder has transferred from child of scrollView to parent view, because of race condition. Fixing this will require revisiting a large part of the native touch system on android.
Reviewed By: sammy-SC
Differential Revision: D83584281
fbshipit-source-id: 10b3c98c30037b50f1705e11aa9ca016a6c3d974
Summary:
In this change, we are allowing users to install cocoapods with the RCT_REMOVE_LEGACY_ARCH flag enabled to compile out the legacy architecture.
For it to work, we had to adjust some part of the framework that we forgot about when working on the internal side of this feature.
bypass-github-export-checks
## Changelog:
[iOS][Added] - Added way to set the RCT_REMOVE_LEGACY_ARCH flag from Cocoapods to compile ou the legacy arch
Pull Request resolved: https://github.com/facebook/react-native/pull/53975
Test Plan:
Tested locally with RNTester and HelloWorld:
```
cd packages/rn-tester
RCT_REMOVE_LEGACY_ARCH=1 bundle exec pod install
open RNTesterPods.xcworkspace
```
Then build and run and verify that the app keeps running.
Same check with Hello World.
Reviewed By: cortinico
Differential Revision: D83471112
Pulled By: cipolleschi
fbshipit-source-id: e5c8fe4eccb3c25510228f20e9e6da3980b0bf0d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54074
Currently, we dispatch view commands eagerly at the beginning of a batch. This behavior originated with https://github.com/facebook/react-native/commit/b54257c628b1a174a2c41960e7fc4d2d719ad731.
However, this can make it difficult to allow developers to control mount item execution order. For example, someone may want to make sure a view command is processed *after* a particular mount item, and not exclusively rely on retryable command exceptions.
This change sets up a feature flag to enable in-order execution of view command mount items.
## Changelog
[Internal]
Reviewed By: mdvacca, sammy-SC
Differential Revision: D84061054
fbshipit-source-id: 7cb68c43823ed67f541f4e8f2d7471629609a905
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54083
Changelog: [Internal]
Fixes a bug in `__DEBUGGER_SESSION_OBSERVER__` where the wrong state could be reported if more than one session existed. Now we reuse the accurate domain status tracking mechanism added in D83847356.
Reviewed By: hoxyq
Differential Revision: D84007326
fbshipit-source-id: e7f2c33286aa69c3bd9d5662d35dad579ca3c770
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54069
Changelog: [Internal]
D83238216 added a `tryExecuteSync` function for use with `EnableExecutorFromThis` objects - concretely, for calling functions on a `weak_ptr<RuntimeTarget>` from the JS thread while ensuring the `RuntimeTarget` is always destroyed on the inspector thread.
`tryExecuteSync` is a generalisation of the lambda-based `delegateExecutorSync` helper from `RuntimeTargetConsole`, so in this diff we refactor the latter to use the more general and better-documented function.
Reviewed By: huntie
Differential Revision: D83838062
fbshipit-source-id: 85fd5a43e204cc634b573e2a3bda47a9ec523fca
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54052
1. Teaches the native networking module on IOS to track a `devToolsRequestId` along with each request, and use it instead of the internal `requestId` to identify the request to `NetworkReporter`.
2. Uses `__NETWORK_REPORTER__.createDevToolsRequestId` (D83238216) to generate a `devToolsRequestId` from JS and pass it into native. This records a JavaScript call stack as the [initiator](https://cdpstatus.reactnative.dev/devtools-protocol/tot/Network#type-Initiator) of the request.
Changelog: [Internal]
Reviewed By: huntie
Differential Revision: D83754145
fbshipit-source-id: ee08f419d2a7013bbc915ee40b1428d7810e6c42
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54082
Changelog: [Internal]
Followup from D83238216.
Adds bookkeeping in `RuntimeTarget` to allow checking from the JS thread whether there is a session with the `Network` CDP enabled. We then use this in the implementation of `__NETWORK_REPORTER__.createDevToolsRequestId` as a more precise alternative to checking the `NetworkHandler` singleton's state.
This is a first step towards breaking up the `NetworkHandler` singleton, subsuming its responsibilities into the Target/Agent architecture of `jsinspector-modern` and fixing a variety of bugs in the process.
NOTE: The additions to `RuntimeTarget` are more general than just tracking the `Network` domain - I'll use them in an upcoming diff to fix a concrete bug related to concurrent session support in `DebuggerSessionObserver`.
Reviewed By: huntie
Differential Revision: D83847356
fbshipit-source-id: 3384e3feb44adbd9ed4d54a20875669d63ae8764
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54051
Adds the private, experimental `__NETWORK_REPORTER__.createDevToolsRequestId()` JavaScript method behind the Fusebox network inspection feature flag.
`createDevToolsRequestId()` returns a unique string ID for a network request, and records the current call stack as the request's [initiator](https://cdpstatus.reactnative.dev/devtools-protocol/tot/Network#type-Initiator). If the native networking layer passes the same request ID into the C++ `NetworkReporter::reportRequestStart` method, the corresponding CDP [`requestWillBeSent`](https://cdpstatus.reactnative.dev/devtools-protocol/tot/Network#event-requestWillBeSent) event will contain the stack trace.
Changelog: [Internal]
Reviewed By: robhogan, huntie
Differential Revision: D83238216
fbshipit-source-id: 5076d887254cd9711f86f72792e791eabc43f297
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54089
Changelog: [Internal]
Adds a minimal standards-compliant UUID v4 generator to `react/utils` for use elsewhere in React Native. We don't need UUID parsing, support for UUID versions other than 4, a UUID value type, or extremely high performance - which makes inlining this simple, portable implementation directly in our codebase acceptable.
Reviewed By: robhogan
Differential Revision: D84149720
fbshipit-source-id: 399d88f4adaff3be4fef5dd1abab3c8552ca1a75
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54092
The `transformOrigin` conversion didn't call into the `toDynamic` conversion for the underlying `ValueUnit` instances for the x and y coordinates. This diff fixes the conversion so that percentages would be correctly converted.
Changelog: [Internal]
Reviewed By: mdvacca
Differential Revision: D84165034
fbshipit-source-id: 40bf32a45770cd43fc67103f4c2e9785abffb033
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54093
Changelog: [Internal]
adding a private! api so we can parse text payloads
Reviewed By: mdvacca
Differential Revision: D83939903
fbshipit-source-id: 8f348648f16d53f2bd86046fb0c3689d7bae3d93
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54058
## Changelog:
[Internal] [Changed] - create UIManagerAnimationBackend to replace forward declare `class AnimationBackend`
for other delegates in UIManager, we usually explicitly create an interface in UIManager package with the public APIs we want to expose, we can follow that pattern here, so we avoid the forward declaration without definition situation, and decoupling UIManager with AnimationBackend
also this way, in the future, animation runtimes that consume AnimationBackend can just include `UIManagerAnimationBackend` (where we expose all of public APIs of AnimationBackend) and remain somewhat decoupled too
Reviewed By: sammy-SC
Differential Revision: D83679693
fbshipit-source-id: e58d180b7d36a3f0e766c2914b16128346abe070
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54050
Changelog: [Internal]
A naive approach to keeping track of request initiators inside the `NetworkHandler` singleton for CDP reporting purposes:
1. Expose a new `recordRequestInitiatorStack` method.
2. Keep the CDP-formatted stack trace (as a `folly::dynamic`) in a map keyed by request ID.
3. Destructively consume the stack trace during `onRequestWillBeSent`.
Reviewed By: huntie
Differential Revision: D83754143
fbshipit-source-id: 4f5a335f2eed66a168f9d39a66c8af6ccee23d6f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54076
Changelog: [Internal]
Add PlatformColor caching so we do not need to make as many JNI calls which helps with perf.
Reviewed By: javache
Differential Revision: D83050864
fbshipit-source-id: 56a53a5facccdbbb3ff18a66df9e07d794bb074c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54048
Changelog: [Internal]
Adds an engine-agnostic mechanism for serialising a previously captured stack trace as a CDP [`Runtime.StackTrace`](https://cdpstatus.reactnative.dev/devtools-protocol/tot/Runtime#type-StackTrace). This complements the existing `RuntimeTargetDelegate::captureStackTrace` method, which returns an opaque, engine-specific representation of a stack trace.
This can be used as a building block for implementing higher-level CDP message types like [`Network.Initiator`](https://cdpstatus.reactnative.dev/devtools-protocol/tot/Network#type-Initiator) within React Native, while keeping the underlying stack trace representation private to each engine.
NOTE: This diff includes an implementation for Hermes that duplicates logic from the Hermes codebase. Further up the stack, I have diffs to replace this with a new API to be provided by Hermes.
Reviewed By: huntie
Differential Revision: D83754142
fbshipit-source-id: 1439ea446665562e5f92c7b1dcb6ab65af1324cd
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54001
This diff adds support for state restore to the horizontal scroll view. The same logic was applied as for the vertical scroll view. The only difference being that the shadow node for the horizontal scroll view needed to be updated to add `ScrollState`.
Changelog: [Internal]
Reviewed By: rshest
Differential Revision: D83247017
fbshipit-source-id: 7c26901df4c43ed70addc7b6d8afb9a6d3e549a8
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54000
Update the scroll view manager to load the fabric state and restore the scroll position and scroll away top padding on mount. Restoring the scroll view happens in the react scroll view state setter, which gets called by the `ReactScrollViewHelper` with the deserialized state provided on mount.
The state loading will happen only until the scroll view itself submits a new state to Fabric (due to scrolling). This guarantees that we only restore the initial state on mount.
This diff also updates the scroll away top padding setter to support setting a new value without triggering a fabric state update.
Changelog: [Internal]
Reviewed By: rshest
Differential Revision: D83247016
fbshipit-source-id: 7ae44b9f69c58da9e5163574073767aea2713b62
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53999
Update the `ScrollViewHelper` class to support reading the scroll state from the provided `stateWrapper` and assigning it to the view implementing the `HasScrollState` interface.
This will be used in a future diff to implement scroll state loading on the scroll view component in the scroll state setter function. This enables having one implementation of the state loading for all variants of the scroll view (vertical and horizontal scroll views).
Changelog: [Internal]
Reviewed By: mdvacca
Differential Revision: D83247018
fbshipit-source-id: 44f10edab2341981b85d6ab8b83c7bea96c1e09d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54077
## Changelog:
[Internal] [Changed] - Extract helper function from AnimatedColor.js to process input color value
Reviewed By: rozele
Differential Revision: D84062952
fbshipit-source-id: 2005dc33d7fd6928ba2638d0d99a2e5faa8448d8
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54057
## Changelog:
[General] [Changed] - Move using declarations into AnimationBackend class
names like `facebook::react::Callback` is a bit too generic and it'll be included in the scope whenever AnimationBackend.h is included in; `StartOnRenderCallback` already exists in c++ native animated (there we also nest the `using`s under class)
Reviewed By: sammy-SC
Differential Revision: D83867098
fbshipit-source-id: a50144bbbd1b441e3ef7b2884a19b091c3190c44