Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53411
# Changelog: [Internal]
This regressed after D80263154, when we introduced a local struct for PerforamanceTracerEvent.
We should use id of the thread where event was captured (registered), not where the transform to TraceEvent happened.
This makes sure that events like Event Loop tick or Microtasks phase tick are correctly point to JavaScript thread, not the thread where the transform could've taken place.
Reviewed By: sbuggay
Differential Revision: D80728931
fbshipit-source-id: d3af16e68adece9ebc37368fec2b8a17c1293b4b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53409
This interface is public and is part of Legacy Architecture.
Having this interface as `public` was a mistake, as users can't really do much with it.
There is only one old library that is going to be affected by this change:
https://github.com/spoke-ph/react-native-threads
The library appears unmaintained since RN 0.69 + no NewArch support so I won't consider this a breaking change
given this will land in 0.82.
I'm making it internal so we can remove it more easily later.
Changelog:
[Android] [Changed] - Make OnBatchCompleteListener interface internal
Differential Revision: D80715625
fbshipit-source-id: 94fe80eeba95222deab7ca89c5fcafca8fcee0b7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53404
This interface is part of Legacy Architecture. No one is using it either internally or externally,
so it's safe to remove now. Interface was also `internal` so this is not a breaking change.
Changelog:
[Internal] [Changed] -
Reviewed By: mdvacca
Differential Revision: D80714721
fbshipit-source-id: 82cc6152af7d7980119d2eda704ae50d8e81fd2b
Summary:
Changelog: [GENERAL] [FIXED] - Fixed babel plugin validation error when coverage instrumentation is enabled
Pull Request resolved: https://github.com/facebook/react-native/pull/53381
### Problem
[Workplace post](https://fb.workplace.com/groups/235694244595999/permalink/1278937163605030/)
React Native tests were failing **only when coverage collection was enabled** with the error:
`'Commands' is a reserved export and may only be used to export the result of codegenNativeCommands.`
### Root Cause
The React Native Babel plugin's `codegenNativeCommands` validation logic only handled direct `CallExpression` AST nodes. When coverage instrumentation was enabled, it transformed:
**Normal code:**
`export const Commands = codegenNativeCommands<NativeCommands>({...})`
**With coverage:**
`export const Commands = (cov_xxx().s[0]++, codegenNativeCommands<NativeCommands>({...}))`
The plugin failed to recognize the valid `codegenNativeCommands` call wrapped in a `SequenceExpression` by coverage instrumentation.
### **Solution**
Added `isCodegenNativeCommandsDeclaration` function to handle:
1. **Coverage instrumentation**: `SequenceExpression` nodes containing the function call
2. **Flow type casts**: `TypeCastExpression` and `AsExpression`
3. **TypeScript assertions**: `TSAsExpression`
4. **Direct calls**: Original `CallExpression` (backward compatibility)
Reviewed By: andrewdacenko
Differential Revision: D80572666
fbshipit-source-id: 465f4312a0229d8a92e495c685f46b607ce326e4
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53399
We currently create application template that are still using `ReactNativeHost`.
As this is a legacy arch class, we should remove it from the template ASAP so that
users can organically migrate away from it.
I will also update https://github.com/react-native-community/template with
the same changes I'm applying here.
Changelog:
[Internal] [Changed] -
Reviewed By: mdvacca
Differential Revision: D80708461
fbshipit-source-id: e0d4a1f817e6fdddd93405decf77fd115956ec51
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53398
ReactNativeHost is a legacy architecture class.
This migrates the app away from it and converts it to use DefaultReactHost instead.
Changelog:
[Internal] [Changed] -
Reviewed By: mdvacca
Differential Revision: D80708460
fbshipit-source-id: 7d88c440414c979a2968fc9c910e828f5851195c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53396
This overload for `getDefaultReactHost` is missing the last 2 parameters
and provides the same default as the full method.
In OSS is unused as we used the one with `ReactNativeHost`.
I'm removing it as it's causing an overload resolution failure internally.
This won't be a breaking change for Kotlin users are the signatures are compatibles,
but it will be breaking for Java users. I've verified that there are no OSS users.
Developers should use Kotlin default parameters + the method `getDefaultReactHost()`
with all the params + defaults for ease of use of this API.
Changelog:
[Android] [Removed] - Delete unused `DefaultReactHost.getDefaultReactHost()` overload
Reviewed By: mdvacca
Differential Revision: D80704987
fbshipit-source-id: 0b3a61aad3f18cde77bac78e3ba413d7f9166ede
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53406
The `ReactNativeJNISoLoader` class (previously called BridgeSoLoader)
is actually a Legacy Architecture class.
However is used by `CxxModuleWrapperBase` which is needed by interop, so we need to keep it around.
I'm adding the annotation so we won't forget about it.
Changelog:
[Internal] [Changed] -
Reviewed By: cipolleschi
Differential Revision: D80710951
fbshipit-source-id: ed353e2b14c742b25962f0b81beba6dc90157709
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53408
This class is internal + legacy arch so can safely be removed now.
I've replaced the throw/catch site with the superclass of this exception.
Changelog:
[Internal] [Changed] -
Reviewed By: mdvacca
Differential Revision: D80710950
fbshipit-source-id: 96615835588ce409de40d31ee83b82c88d3a07a0
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53372
We verified that those feature flags are not regressing the experience + we got confirmation from Software Mansion that the fix
is effectively mitigating the regression on Android mounting.
Hence we can ship this to production.
Fixes: https://github.com/facebook/react-native/issues/51869
Changelog:
[Android] [Fixed] - Fix mounting is very slow on Android by shipping native transform optimizations
Reviewed By: javache
Differential Revision: D80624739
fbshipit-source-id: 2e185434f08b5ea0339d59a6ea006017e5abeff2
Summary:
This is a reland of D80622058 + D80623826 + fixes for all the apps.
This method was deprecated in React Native 0.79. We should be able to remove it without impact in 0.82.
I also verified that there are no users of this API in OSS.
There is also a 1:1 replacement for this API which is the other non-deprecated `getDefaultReactHost()` method.
bypass-github-export-checks
Changelog:
[Internal] - Skipping changelog as main already contains a changelog entry
Reviewed By: javache
Differential Revision: D80704320
fbshipit-source-id: c9aa26b83dbd9f4bf97d0a9e9c6dcaa6eb0afdca
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53391
Changelog: [internal]
Some mount items dispatched to Fabric don't have an associated surface ID (they use -1), which causes some log spam when we try to validate that the surface ID exist when we report mount for those surfaces.
This checks if the surface ID has a valid surface ID before adding it to the list of surfaces to report mount.
Reviewed By: rshest
Differential Revision: D80698363
fbshipit-source-id: 63dc13d53b8bbc2742171b1f444c80ce867e2351
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53387
This interface was internal and legacy arch only, so it can safely be removed.
I've also removed the logic inside `ReactInstanceManager` that was using it as no longer necessary.
Changelog:
[Internal] [Changed] -
Reviewed By: mdvacca
Differential Revision: D80626639
fbshipit-source-id: b173e71b92e29cebbfc5ed589e01ac295eda2bf0
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53388
This method is deprecated and should not be invoked in NewArch, therefore I'm deprecating it now.
Changelog:
[Android] [Deprecated] - Deprecate `BridgelessReactContext.getCatalystInstance()` method
Reviewed By: cipolleschi
Differential Revision: D80626638
fbshipit-source-id: d4ed26021c376f54c732154c153bf60fea2bf5e3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53384
Occasionally, the `preparePrefab` task might run before other tasks that
are responsible of populating the 3p headers, such as `prepareNative3pDependencies`.
This was evident in the latest nightly which is missing the fast_float headers in the
Android prefab.
Adding a dependsOn fixes it.
Changelog:
[Internal] [Changed] -
Reviewed By: cipolleschi
Differential Revision: D80695212
fbshipit-source-id: 6e0dd17e5cf8c33d14812e5cb8fdc8b800897816
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53374
This method was deprecated in React Native 0.79. We should be able to remove it without impact in 0.82.
I also verified that there are no users of this API in OSS.
There is also a 1:1 replacement for this API which is the other non-deprecated getDefaultReactHost() method.
Changelog:
[Android] [Removed] - Remove deprecated DefaultReactHost.getDefaultReactHost() overload - part 2
Reviewed By: mdvacca
Differential Revision: D80623826
fbshipit-source-id: f201e99f7cd437a47919c36eced5637481151822
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53371
This method was deprecated in React Native 0.79. We should be able to remove it without impact in 0.82.
I also verified that there are no users of this API in OSS.
There is also a 1:1 replacement for this API which is the other non-deprecated `getDefaultReactHost()` method.
Changelog:
[Android] [Removed] - Remove deprecated DefaultReactHost.getDefaultReactHost() overload - part 1
Reviewed By: mdvacca
Differential Revision: D80622058
fbshipit-source-id: 4667683be151bc7ef1926a21306e088185695369
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53349
Follows feedback on D78904767, refactoring how we pass data to `PerfMonitorOverlayViewManager` to avoid API additions on `DevSupport`.
New interfaces under `com.facebook.react.devsupport.perfmonitor`:
- `PerfMonitorUpdateListener` is implemented by the view class to receive updates from the C++ `HostTargetDelegate`.
- `PerfMonitorInspectorTargetBinding` exposes an API on `ReactHostInspectorTarget` to send CDP actions down to C++ (stub for now).
- `PerfMonitorDevHelper` allows us to use the internal `ReactHostImplDevHelper` to expose the `ReactHostInspectorTarget` instance from the runtime.
Changelog: [Internal]
Reviewed By: cortinico, rshest
Differential Revision: D80464093
fbshipit-source-id: b88e270c0211e4adf52c015ac700df7f44945a5a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53297
Pivots our display metric for the V2 Perf Monitor experiment by switching to Long Tasks.
- Implements a new "__ReactNative__LongTask" metrics event (note: prefixed, since this sits outside the Web Vitals spec).
Changelog: [Internal]
Reviewed By: mdvacca
Differential Revision: D79556595
fbshipit-source-id: 239cf44884f67bf62295b92e2262ae1811d17e4a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53376
When encountering embedded <Text> components, with the parent <Text> component setting event handlers, culling away the child <Text> components will break the assignment of the event handlers to the text spans on Android.
This diff disables view culling on <Text> components so that event handlers would be correctly assigned to the text fragments once rendered.
Changelog: [Internal]
Reviewed By: andrewdacenko
Differential Revision: D80631997
fbshipit-source-id: f835a249fef1b448b884999ccd75ee06041eca70
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53375
We have seen sufficient internal signal to be confident that we can move this to the experimental release channel. Soon I will publish some experimental documentation and let folks in OSS know about this.
Changelog: [Internal]
Reviewed By: christophpurrer
Differential Revision: D80560366
fbshipit-source-id: 6a8cce39f823dfa313c8c51090eb88c31f1f9fd3
Summary:
E2E tests on iOS started failing yesterday because of some permission model that has changed in Github.
When creating a new app from the template, we initialize a git repository. The initialization started failing with the error:
```
debug Could not create an empty Git repository, error: , Error: Command failed with exit code 128: git commit -m Initial commit
Author identity unknown
*** Please tell me who you are.
Run
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
to set your account's default identity.
Omit --global to set the identity only in this repository.
fatal: unable to auto-detect email address (got 'runner@sat12-jr314_3f88162a-0f3d-4d26-80dc-58f431cca4c6-9A2607311B51.(none)')
```
This change fixes it by setting a default identity for git in the CI jobs that requires it.
## Changelog:
[Internal] -
Pull Request resolved: https://github.com/facebook/react-native/pull/53357
Test Plan: GHA
Reviewed By: cortinico
Differential Revision: D80612345
Pulled By: cipolleschi
fbshipit-source-id: 85816057d910ed3619c5f683fdad724c3df8046b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53362
Changelog: [internal]
This just replaces the polyfills for `Event` and `EventTarget` that we're defining inline in Fantom with the implementations that already exist in RN.
Reviewed By: javache
Differential Revision: D80612067
fbshipit-source-id: 047c8f12cbb1f4afea2d05a5a1235d9dff2e25f9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53359
A new version of ktfmt broke the OSS CI build for React Native.
That's due to us running still on the older version of ktfmt, as the newer version hasn't been released yet.
I'm temporarly disabling the `ktfmtCheck` jobs because we primarly check formatting from within fbsource.
Changelog:
[Internal] [Changed] -
Reviewed By: cipolleschi
Differential Revision: D80610450
fbshipit-source-id: 846249780f979788356404205d8b8e37fc54a255
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53150
ReactInstanceManager and ReactInstanceManagerBuilder are legacy architecture classes that will be deleted in the future, in this diff we are deprecating them
changelog: [Android][Changed] Deprecate legacy architecture classes ReactInstanceManager and ReactInstanceManagerBuilder, these classes will be deleted in a future release
Reviewed By: mlord93
Differential Revision: D79677828
fbshipit-source-id: 2d79736d94a55e44dd24056985f358e3650ddf6c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53331
Changelog: [internal]
This change was shipped 3 months ago so we can assume the native method will always have this method and don't need to keep backwards compatibility.
Reviewed By: rshest
Differential Revision: D80449031
fbshipit-source-id: 4ff11b81478701ad712b4e097625e569829f6480
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53330
Changelog: [internal]
These methods have been defined for a month, so it's safe to make then non-nullable already.
Reviewed By: GijsWeterings
Differential Revision: D80453413
fbshipit-source-id: 3fde076622dc9d510bad144300364401f2319507
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53318
Changelog: [internal]
This prepares the codebase for an eventual migration of `HostInstance` to `ReactNativeElement`, so the actual migration doesn't need to adjust so much existing code.
Reviewed By: rshest
Differential Revision: D80399739
fbshipit-source-id: 441d3e92ef6dff253343d1058b2027698e8ecb22