Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53507
We need this to be an unsigned value everywhere but all the API's and interfaces described this a signed number. While this doesn't make a difference in practice, it's better to explicit.
Changelog: [Internal]
Reviewed By: sammy-SC
Differential Revision: D81230050
fbshipit-source-id: 1eb914a79b9b94654cfa54c20a81ce689f79dcb9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53424
Use the namespaced version of these macros to avoid symbol conflicts when multiple instances of `PERFETTO_DEFINE_CATEGORIES` are in the same binary.
The current macro is effectively deprecated: https://github.com/a6f/perfetto_protos/blob/master/CHANGELOG#L691-L696
Changelog: [Internal]
Reviewed By: rshest
Differential Revision: D80697205
fbshipit-source-id: 713fec4d41137ddd2f025c7e7130dc44c5a3a656
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53278
changelog: [internal]
C++ Animated should be in ReactCommon, it is code shared across all platforms.
Reviewed By: christophpurrer, zeyap
Differential Revision: D80261447
fbshipit-source-id: 8ad5d0bb65c9b499b1d9f60fc8babef8d4d90078
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53223
changelog: [internal]
remove dependency on perfetto and use TraceSection like we do elsewhere.
Reviewed By: zeyap, rubennorte
Differential Revision: D80087082
fbshipit-source-id: 08d3434985443db9a83189a4dfabc65d6eda8166
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53215
Changelog: [internal]
This adds a new environment variable to Fantom that allows debugging the JS code in tests.
Usage:
```
FANTOM_DEBUG_JS=1 yarn fantom <test>
```
**Does NOT work in OSS yet**. We need to include a third-party library to send HTTP and WebSocket requests and implement a wrapper on top of it.
Reviewed By: christophpurrer
Differential Revision: D79883372
fbshipit-source-id: d077c373a036033344e61d58274d5cd14028bda4
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53200
Changelog: [internal]
TSIA. This is necessary for Fantom to use real HTTP and WebSocket connections for DevTools, while still providing stubs for the runtime (the networking and websockets native modules provided to clients).
If there are no specific factories for DevTools provided, we fall back to regular ones (keeping backwards compatibility).
Reviewed By: rshest
Differential Revision: D79806934
fbshipit-source-id: 6d16fa44e11f3c8e304c3c3d31fe952d0ba5811a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53201
Changelog: [internal]
This splits the `ReactHost` option `enableDebugging` into more granular options:
- `enableInspector` which enables the connection with the inspector/debugger.
- `enableDevMode` which enables the use of bundles from Metro, reloads, etc.
This allows us to enable the inspector in Fantom without consuming bundles from Metro.
This should be backwards compatible with existing apps.
In the future, we should be able to inject custom `DevSupportManager` instances into the `ReactHost` so we can customize all options with any level of granularity (the same way we do on Android, for example).
Reviewed By: rshest
Differential Revision: D79804006
fbshipit-source-id: c28e788e5006cdbeb1a373d44b4e5aec1acec702
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53203
Changelog: [internal]
This makes ReactHost connect the inspector immediately after creating the instance, aligned with how we do it on Android, instead of doing it as part of loading a bundle.
Reviewed By: rshest
Differential Revision: D79804004
fbshipit-source-id: b165520b0feb089fdfaa323413d697939c7ac794
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52992
changelog: [internal]
do not log on every frame to make logs more readable. The callbacks are only set during construction and there is no value in logging on every commit props.
Reviewed By: rshest
Differential Revision: D79436988
fbshipit-source-id: 26c6cbadd5ae0efa8575c7f85e4c0d90e2ef6215
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52944
changelog: [internal]
this should be in ReactCommon, not in cxx platform as it is not platform specific.
Reviewed By: rubennorte, christophpurrer
Differential Revision: D79184118
fbshipit-source-id: 141f0ce7b993d229c5d832d22c54471d32681173
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52904
changelog: [internal]
There is a race condition in `FabricUIManagerBinding::schedulerDidFinishTransaction`. Until it is addressed properly, let's do synchronisation Fabric commits through JavaScript thread.
It can have pretty serious consequences: a crash in better case and undefined behaviour in worse case.
The race is between acquiring two mutexes:
1. One inside of `MountingCoordinator::pullTransaction`
2. Second one inside of `FabricMountingManager::executeMount`
The logic inside of `FabricUIManagerBinding::schedulerDidFinishTransaction` depends on the fact that whichever thread acquires mutex number 1, will acquire mutex number 2 without interruption. But that is not always the case as threads may be interrupted.
Reviewed By: zeyap
Differential Revision: D79080739
fbshipit-source-id: c86885aba25825030dc44b60144beb3e3ba18306
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52842
## Changelog:
[Internal] [Fixed] - keep track of last direct manipulation props
* so that at next time there's a ShadowTree commit (regardless of which thread), they're merged into the update mutation
* the props will stay until the view is disconnected from props node via Animated API or the view is removed/deleted. This should be expected behavior, because in RN we expect that once Animated changes a prop, subsequent react commits should not change the value.
Reviewed By: sammy-SC
Differential Revision: D78702843
fbshipit-source-id: b5e6e01a7a4f6caeea4cc1eeafaef9c3c7e51691
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52807
changelog: [internal]
Fixes a crash that occurs when event driven animation is attached to a view that is unmounted.
Reviewed By: zeyap
Differential Revision: D78889689
fbshipit-source-id: 6bc534c3d80a7ed2fc5e0ac378e58343fef45430
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52834
changelog: [internal]
we have seen some problems with the fabric commit and believe there is a race condition in the implementation.
Here, we introduce an option to disable it.
Reviewed By: rozele
Differential Revision: D78972655
fbshipit-source-id: 99005c77dbe4dde3816b9e6a692f170cf287f7cd
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52574
Changelog: [Internal]
The main change here is to catch *all* exceptions in:
- loadScriptFromDevServer
- loadScriptFromBundlePath
so that we can make the `loadScript(...` method `noexcept`
Other methods which only call into `noexcept` methods have been marked with `noexcept` as well
Reviewed By: lenaic
Differential Revision: D78222989
fbshipit-source-id: 174ac2420e88c913662f857c875fef996959c564
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52505
changelog: [internal]
there is a race condition where `startRenderCallbackIfNeeded` may be called from JS thread and the main thread at the same time, leading to a crash. To address this, this diff adds uses a boolean to make sure `startOnRenderCallback_` is only called once and `stopOnRenderCallback_` is only called after start was called.
Reviewed By: javache
Differential Revision: D77871230
fbshipit-source-id: 6d7fba596e7146adaff6f8dbe1f436ddd59950c6
Summary:
This follows https://github.com/facebook/react-native/pull/47554
Compared to the initial proposal, I had to remove the `edgeToEdgeEnabled` property from the root `gradle.properties` and put it in the app `gradle.properties` instead (explaining the `AgpConfiguratorUtils.kt` / `GenerateEntryPointTask.kt` / `ProjectUtils.kt` / `PropertyUtils.kt` changes)
This PR:
- Enable edge-to-edge for `MainActivity` (when `edgeToEdgeEnabled` is set to `true`)
- Disable `StatusBar` `backgroundColor` and `translucent` (when `edgeToEdgeEnabled` is set to `true`)
- Enforce `statusBarTranslucent` and `navigationBarTranslucent` on `Modal` when edge-to-edge is enabled
- Add an `isEdgeToEdge` constant to `DeviceInfoModule` for [`react-native-is-edge-to-edge`](https://github.com/zoontek/react-native-edge-to-edge/tree/main/react-native-is-edge-to-edge) detection
## 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
-->
- [Android] [Added] - Add edge-to-edge opt-in support
Pull Request resolved: https://github.com/facebook/react-native/pull/52088
Test Plan:
- Update `enableEdgeToEdge` value in `packages/rn-tester/android/app/gradle.properties`
- Recompile
https://github.com/user-attachments/assets/4c6beb98-fa88-427c-b62d-a42ffe5330f0
Rollback Plan:
Reviewed By: cortinico
Differential Revision: D76834213
Pulled By: alanleedev
fbshipit-source-id: c39b2cff1a5e94e31306e3b35651aa2de83d2fe6
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52296
## Changelog:
[Internal] [Changed] - Fewer calls to direct manipulation callback
`NativeAnimatedNodesManager::onRender` is supposed to run each frame for c++ animation, from the callstack sample trace, the vast majority of time is spent on `updateNodes` (run update on all AnimatedNodes) and `commitProps` (where either Fabric ShadowTree commit or direct manipulation is called). Change in this PR is supposed to reduce time spent in `commitProps`
{F1979788964}
Reviewed By: sammy-SC
Differential Revision: D77380842
fbshipit-source-id: 2f25ca1fba4171a7b3e485298738379d0daff3ad
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52293
# Changelog:
[Internal] -
Adds a helper method to the `IMountingManager` API in order to get the platform specific image loader implementation, if available.
Reviewed By: christophpurrer
Differential Revision: D77379053
fbshipit-source-id: b7595d78c83e9270ec1818daf2d0f1d342661e52
Summary:
Changelog: [Internal]
Fixes a thread safety bug in the C++ platform's `InspectorPackagerConnectionDelegate::WebSocket` implementation. Since D60520747 `IWebSocketDelegate` event calls have been required to be made on the inspector thread, but the C++ platform was making them on the platform's WebSocket thread instead.
Reviewed By: christophpurrer
Differential Revision: D77150289
fbshipit-source-id: f57de05eaccbbe9db674076fc9e60f8d0dd243c5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52263
Changelog: [Internal]
Adds a bare-bones API to set the dev server host and port at the time of creating a `ReactInstance` in the C++ platform.
Reviewed By: rshest
Differential Revision: D77050457
fbshipit-source-id: 642dc96d3cb486a2e7faa177adcbf8a15b8fb668
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52198
# Changelog:
[Internal] -
This provides an implementation of what was the RnCxx ImageLoaderModule stub inside ReactCxxPlatform, allowing the clients use dependency injection to provide the actual platform specific image loading functionality.
Reviewed By: javache
Differential Revision: D77015269
fbshipit-source-id: 7355dd75692c1f564de8c3daffd6c8a79182dc09