Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52838
**Context**
Experimental V2 Performance Monitor prototype, beginning by bringing the [Interaction to Next Paint (INP)](https://web.dev/articles/inp) metric to React Native.
**This diff**
Wires up a client/subscriber for the `"__chromium_devtools_metrics_reporter"` runtime binding (to which we emit live metrics events since D78904748). This will be used to unpack these performance updates to send to the host platform.
- Creates a new `HostRuntimeBinding` helper, which establishes a local/private CDP session.
- Conditionally installs our perf metrics runtime binding in `HostTarget` when `perfMonitorV2Enabled` is set.
- Wires up a new `onPerfMonitorUpdate` event on `HostTargetDelegate` (unimplemented until the next diff).
Changelog: [Internal]
Reviewed By: hoxyq
Differential Revision: D78904766
fbshipit-source-id: 991f17a4cc69f574917750053a5da31bbc6dc0d5
Summary:
The `aria-label` prop was ignored on `TextInput` component. Which resulted in screen reader not able to read it.
This PR forwards `aria-label` to `accessibilityLabel` in a manner similar to e.g. `View` and `Text`
## Changelog:
<!-- 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
-->
[GENERAL] [FIXED] - a11y: fix `aria-label` on `TextInput`
Pull Request resolved: https://github.com/facebook/react-native/pull/53051
Test Plan:
Run RNTester => TextInput => Accessibility section under Accessibility Inspector or screen reader.
iOS fixed:
https://github.com/user-attachments/assets/68c3a2ef-7dfe-479c-97fc-cbe72108c45c
iOS baseline:
https://github.com/user-attachments/assets/2e8372ba-10dc-47d2-b6b1-9f664000de7d
Reviewed By: andrewdacenko
Differential Revision: D79635413
Pulled By: rshest
fbshipit-source-id: dd2f583d67c6c6c6393e02c5fe534308e1e2f921
Summary:
`react-native/codegen` uses `babel/parser` and `babel/core` but does not declare dependency on them. Depending on how packages are hoisted (and especially in pnpm setups), this causes crashes during codegen.
Resolves https://github.com/facebook/react-native/issues/52883
## Changelog:
[GENERAL] [FIXED] - Add missing Babel dependencies
Pull Request resolved: https://github.com/facebook/react-native/pull/52884
Test Plan: See https://github.com/facebook/react-native/issues/52883
Reviewed By: cortinico, christophpurrer
Differential Revision: D79103092
Pulled By: robhogan
fbshipit-source-id: ecaf690f994393a652ea7f0d4f30bbabeb23a434
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53055
Moves the C++ part of `InspectorNetworkReporter.kt` into the `react_devsupportjni` JNI library, and adds missing `SoLoader.loadLibrary` call.
Replaces D79568759 / https://github.com/facebook/react-native/pull/53036.
Changelog: [Internal]
Reviewed By: robhogan
Differential Revision: D79638331
fbshipit-source-id: 5df450ad80e4532d6ada1e4dab51a1de6418a4e0
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53059
# Changelog:
[Internal] -
This is a re-submit of the partially reverted https://github.com/facebook/react-native/pull/52905, which should work fine now on top of the changes stack that support the RN feature flags being safely used on the modules' top level.
Reviewed By: rubennorte
Differential Revision: D79640965
fbshipit-source-id: d8bda0dba662930d1343ea9d5155791a686b653b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53080
# Changelog: [Internal]
We were accidentally resetting this before calculating the timestampf for the TracingStartedInPage event, which is the left boundary for the timeline window.
Reviewed By: sbuggay
Differential Revision: D79670865
fbshipit-source-id: c6b5f869e185d6d3c80cb7153891c72283c82418
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53077
# Changelog: [Internal]
Stores the tracing::Mode on a TraceRecordingState and updates the logic for:
- InstanceTracingAgent to enable PerformanceTracer with a specified window size
- RuntimeTracingAgent to only enable sampling profiler for CDP-initiated sessions
Reviewed By: sbuggay
Differential Revision: D79670864
fbshipit-source-id: 2c4eacb29666b59acbc508848a0a3d859f21a403
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53039
# Changelog: [Internal]
We can now distinguish these 2 different modes.
Reviewed By: sbuggay
Differential Revision: D79565934
fbshipit-source-id: 780678d1f50d4c1d73d55ebc95da0ea328fa2cb3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53035
# Changelog: [Internal]
This adds an ability to distinguish different trace recordings, based on mode
Reviewed By: sbuggay
Differential Revision: D79557790
fbshipit-source-id: cbb216df86fa1a4692e1b82c8a14a6049b5c45ec
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52960
# Changelog: [Internal]
We never call `stopTracing()` on a HostTarget, if the Agent was destroyed.
This could only happen if the session was destroyed. There could me multiple sessions, so we have to keep the source of truth for recording status in a session state.
Reviewed By: sbuggay
Differential Revision: D79435494
fbshipit-source-id: db72ffdf6856974e980afa78d59dec4bf45df289
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52961
# Changelog: [Internal]
Now that we've implemented all required serializers and TraceRecordedState has everything needed, we can migrate TracingAgent to use this new infra.
Reviewed By: sbuggay
Differential Revision: D79433497
fbshipit-source-id: 8c63f0faa50844786b7af8860c22fc006dd38414
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52964
# Changelog: [Internal]
Now TraceRecordingState should capture everything we need in order to display a trace on a timeline.
We just need to serialize it properly into collection of serialized Trace Events that would be sent via `Tracing.dataCollected` CDP events.
This is what this serializer is doing.
Reviewed By: sbuggay
Differential Revision: D79434655
fbshipit-source-id: 6b6858db23077eb7305781b9b0d98af8dedd68ca
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52967
# Changelog: [Internal]
We would need this to correctly serialize Runtime Sampling Profiles.
In case of recording the trace in the background, this might not be the value we would want to use, we would probably add another field or calculate it dynamically, depending on the tracing mode.
This is not the case for now, will be solved separately on top of the stack.
Reviewed By: sbuggay
Differential Revision: D79433502
fbshipit-source-id: 172ff19985d325585590794fb2523a24a6860221
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52963
# Changelog: [Internal]
We are deprecating previous `InstanceTarcingProfile` struct, but not removing yet, since this is still used and we will migrate in one of the diffs at the top of the stack.
The `InstanceTracingProfile` will consist only of Trace Events that were captured by PerformanceTracer, and will not store Runtime Sampling Profiles.
There are multiple reasons for this:
1. As of right now, Runtime Sampling Profiles are completely independant from Instance Profiles and do not require anythings from Instance as a Target to be represented on a timeline.
2. Although PerformanceTracer is a singleton, it should be this way. It captures events for something that can only be dispatched if there is an allocated React Instance, so in the future PerformanceTracer could become a data-member of InstanceTarget.
Reviewed By: sbuggay
Differential Revision: D79433498
fbshipit-source-id: 0fdf09517488bc5c6c8eb604aee66535cdc19ffb
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52968
# Changelog: [Internal]
Now that we've defined all actors and relationship between Agents, we can start recording profiles and store them on a recording state.
Reviewed By: sbuggay
Differential Revision: D79415396
fbshipit-source-id: 9639e59d619268d970b895da2e19dfd92c963a32
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52966
# Changelog: [Internal]
The current design for Tracing is flawed. Right now the logic is mostly scattered around CDP Agents, lifetime of which is tied to CDP session.
This diff introduces a new approach:
- The HostTarget will be the only Target that has public entrypoints to startTracing as part of the jsinspector backend.
- It will create and own TraceRecording that acts as a local session. We won't use wording session here, because it is already reserved for CDP case.
- Every Target will implement TracingAgent, lifetime of which will be limited by lifetime of either Target or TraceRecording.
- All these TracingAgent will have a reference to TraceRecordingState, which they can mutate
This approach unblocks:
- Recording traces without active CDP sessions, for example in a background.
- Recording full instance reloads and multiple profiles for Instances and Runtimes.
{F1980838032}
Reviewed By: sbuggay
Differential Revision: D79371359
fbshipit-source-id: 034e984fd7e977457bd41a980e5feb049db3339d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53072
Changelog: [internal]
This creates a test to make sure there are no changes in React Native dramatically increasing memory usage in simple scenarios.
Reviewed By: rshest
Differential Revision: D79646758
fbshipit-source-id: d7a863468adabb75de7ceb123d96131564bd0959
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53070
As per title, this change adds a warning if you call `pod install` with `RCT_NEW_ARCH_ENABLED` set to 0.
## Changelog:
[iOS][Added] - Add warning if RCT_NEW_ARCH_ENABLED is set to 0
Reviewed By: mdvacca
Differential Revision: D79655716
fbshipit-source-id: 516cc02f9b2dbddaae99c2d74bba249970641d1d
Summary:
Pure cocoapods build with dyn frameworks was broken due to some missing dependencies with the new performance metrics of cdp
## Changelog:
[iOS][Fixed] - Fix pure cocoapods dynamic framework build
Pull Request resolved: https://github.com/facebook/react-native/pull/53075
Test Plan:
Tested locally in RNTester with
```
USE_FRAMEWORKS=dynamic bundle exec pod install
```
and then building from Xcode
Reviewed By: cortinico
Differential Revision: D79676186
Pulled By: cipolleschi
fbshipit-source-id: ae6b81138fcae66c67bedadb1e1ad9cd6c4b6c35
Summary:
Add filter to native animated allowlist.
## Changelog:
[GENERAL] [ADDED] - Allow filter usage with native animated driver.
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
Pull Request resolved: https://github.com/facebook/react-native/pull/52920
Test Plan: Tested on RNTester
Reviewed By: joevilches
Differential Revision: D79473929
Pulled By: lunaleaps
fbshipit-source-id: de6fcc0f18a1d656688dce513d2cf48a3c9d4f09
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53057
Changelog: [internal]
This adds a Fantom test to ensure that `setUpDefaultReactNativeEnvironment` doesn't read any feature flags. This prevents catching this as a runtime issue when the feature flag system complains that feature flags were accessed before being overridden, which always would happen if this module read any flags (as it runs before any product code that sets overrides).
Reviewed By: rshest
Differential Revision: D79639890
fbshipit-source-id: 6997609b7bf84947a6da53b58e68f9edd5654912
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53056
Changelog: [internal]
This exposes a utility method in `ReactNativeFeatureFlagsBase` to reset its internal state for testing purposes.
This is intentionally not exposed through `ReactNativeFeatureFlags` to avoid it being used at runtime.
Reviewed By: rshest
Differential Revision: D79639889
fbshipit-source-id: adfb6125d991994c9706d5952d309915fec8f815
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53026
This change prevents users from opting out of the New Architecure.
The change is non breaking with respect to building an app: all the functions are still there, even if they are unreachable, in case users will still call them explicitly.
We hardcoded all the values to enable the New Architecture, so there is no way to disable it.
This is a behavioral breaking change, though.
## Changelog:
[iOS][Removed] - Removed the opt-out from the New Architecture.
Reviewed By: cortinico
Differential Revision: D79090048
fbshipit-source-id: 9779bfedf50748d7adbef5f7ef038f469e30efc2
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53063
Update `IO.read` CDP method handler to validate the received `size` parameter.
This now accepts a max value of 10MB — adding a layer of safety in front of our current Android implementation, which fails at around ~15MB due to OkHttp limits.
Changelog: [Internal]
Reviewed By: vzaidman
Differential Revision: D79646155
fbshipit-source-id: c777802105dc31cdcc7e9e960c880e689540fddd
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53003
The new `onChildStartedNativeGesture` method accepts a nullable `ReactContext` value for the purpose of flushing active touch events. This change updates all callsites of that method to pass a `ReactContext`
Changelog: [Internal]
Reviewed By: mdvacca
Differential Revision: D79258727
fbshipit-source-id: 7b2950f514295dbe26822442c98079b8121cb3bf
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53053
Changelog: [internal]
This adds a Fantom test to ensure that setting up the RN environment doesn't trigger the initialization for React components like View and Text, which should be lazy loaded when necessary.
Reviewed By: rshest
Differential Revision: D79636160
fbshipit-source-id: ef1fbd6cd531eb7082dce000ba74a5eed451e259
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53054
Changelog: [internal]
We eagerly require `AppRegistry` from environment initialization (`InitializeCore`) because it has some side-effects that are necessary for error reporting (see https://github.com/facebook/react-native/issues/34649 and https://github.com/facebook/react-native/pull/34650), but this change makes a lot of modules to be eagerly initialized.
This reduces that to avoid loading modules that not necessary for environment setup, which allows us to do things like setting up feature flags before modules like `View` and `Text` have been initialized.
Reviewed By: rshest
Differential Revision: D79636159
fbshipit-source-id: a3f1e0db3dd69112ceef3ea339167694e2457454