Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49714
Changelog: [internal]
This package was only needed for testing but it's actually not used.
Reviewed By: hoxyq
Differential Revision: D70318040
fbshipit-source-id: b57ec74932029368117520646972bfee83706017
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49693
Allow setting the ReactNativeInternalFeatureFlags from a Fantom test using the `fantom_internal_flags` pragma.
Changelog: [Internal]
Reviewed By: rubennorte
Differential Revision: D70242739
fbshipit-source-id: 17a69edbd58b93f8b8060192b9881e62febf9635
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49697
Changelog: [internal]
These classes cannot be instantiated directly, but having access to them allows users to do `instanceof` checks, e.g.:
```
if (ref.current instanceof Element) {
ref.current.getBoundingClientRect();
}
```
Reviewed By: yungsters
Differential Revision: D70244966
fbshipit-source-id: 3c1e3698b8851ef9ce3c2865e7435b000984c8f0
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49696
Changelog: [internal]
This is just a change for convenience, as Flow is currently typing `textContent` in `Node` as `string` instead of as `string | null` as we were doing.
Our behavior was more correct, as `Document` extends `Node` and it returns `null` in that case, but to ensure a smooth migration we'll adopt the existing definition.
Reviewed By: huntie
Differential Revision: D70244963
fbshipit-source-id: ad8325d6e00c221e858e4e2d45085666ff0a0ce7
Summary:
Solves the iOS part of https://github.com/facebook/react-native/issues/47186.
`onContentSizeChanged` event is sent inside the `updateLayoutMetrics` method every time it's invoked. A change in layout metrics doesn't mean that the content size also changes, like changing the position of the input.
This PR adds a condition that the content size must have changed before sending the event.
|Before this change|After this change|
|-|-|
|<video src="https://github.com/user-attachments/assets/743e1502-e13e-474e-b4a6-ef6873bf9619">|<video src="https://github.com/user-attachments/assets/fe3d3ef5-3951-4ba2-b9a1-c41439ab455c">|
In the reproducer from the issue, `SafeAreaView` is used, which at first renders its content without any insets until its state is updated with the correct insets. Both of these layouts change the layout metrics of the text input, resulting in two events before this change and a single one after.
## Changelog:
[IOS] [FIXED] - Fixed TextInput's `onContentSizeChange` event being dispatched multiple times with the same size
Pull Request resolved: https://github.com/facebook/react-native/pull/49695
Test Plan: Tested on the reproducer from the issue
Reviewed By: NickGerleman
Differential Revision: D70247460
Pulled By: j-piasecki
fbshipit-source-id: 8a1e0d0f55b6b3f8a6d0bb176ed50e47e3b51035
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49699
Changelog: [internal]
Just a minor optimization in `ReactNativeElement`, to stop creating an unnecessary object in the prototype chain for the `super()` removal optimization.
Reviewed By: huntie
Differential Revision: D70250804
fbshipit-source-id: 1f8104f8e17f12264326cd715e07877a371f9dc5
Summary:
This PR implements a C API to switch JS Engines that can be used from Swift.
Here is an example:
```swift
import React
import React_RCTAppDelegate
import ReactAppDependencyProvider
import UIKit
import RCTRuntime
class ReactNativeDelegate: RCTDefaultReactNativeFactoryDelegate {
override func sourceURL(for bridge: RCTBridge) -> URL? {
self.bundleURL()
}
override func bundleURL() -> URL? {
#if DEBUG
RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index")
#else
Bundle.main.url(forResource: "main", withExtension: "jsbundle")
#endif
}
override func createJSRuntimeFactory() -> JSRuntimeFactory {
jsrt_create_jsc_factory() // Easily switch engines here
}
}
```
## Changelog:
[IOS] [ADDED] - js runtime C API for Swift
Pull Request resolved: https://github.com/facebook/react-native/pull/49489
Test Plan: CI Green
Reviewed By: huntie
Differential Revision: D69976988
Pulled By: cipolleschi
fbshipit-source-id: 9333ec62ca99a28c3121f558bbff1ce0457779e3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49702
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: alexmckenley
Differential Revision: D70256694
fbshipit-source-id: 44e0772cc982add44723c252ea547a9cea0641e6
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49666
This change moves the index.js file to the `releases` folder, giving it a meaningful name.
It also rename the prebuild folder to ios-prebuild to be more descriptive.
It finally removes the old scripts that this refactoring supersedes.
bypass-github-export-checks
## Changelog:
[INTERNAL] - Move the infdex.js to the prepare-ios-prebuilds script.
Reviewed By: cortinico
Differential Revision: D70176043
fbshipit-source-id: e0c3f3bd53adf97fa388c37a746d274fd678f690
Summary:
This change refactors the script to prebuild ios dependencies by:
- remove the manually maintained Package.swift
- add script to generate it starting from the configurations that we have
bypass-github-export-checks
## Changelog:
[INTERNAL] - Factor out script to generate Package.swift file
Reviewed By: cortinico
Differential Revision: D70175760
Pulled By: cipolleschi
fbshipit-source-id: a1b0fc6dcdc1860b04ab260697f259c297338f41
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49657
For some use-cases we still want to log using the internal fbsystrace API which allows backdating of events.
This feels a bit weird putting it in `ReactPerfettoLogger`, but maybe we should rename that to something like `TraceLogger` (like we have `TraceSection`).
Changelog: [Internal]
Reviewed By: rshest
Differential Revision: D70109680
fbshipit-source-id: 7757b81ec5032e3800446a88198c7da135afdd0e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49691
Changelog: [internal]
This adds a new getter for `document` in the `Root` class in Fantom tests to easily access the document instance for the root.
This isn't very useful at the moment, but will be very useful when we introduce `document.getElementById`, so we can access arbitrary nodes very easily.
Reviewed By: javache
Differential Revision: D69307130
fbshipit-source-id: 2650bc03e143ee9f0b29d0f284a2f9079ab9f765
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49690
Changelog: [internal]
We're shipping this soon and most tests already using DOM APIs to make assertions, so it's easier if we just "ship" in tests.
Reviewed By: javache, sammy-SC
Differential Revision: D69307129
fbshipit-source-id: 75d0be013703cff7bc2bad5cd16c26bc6471e547
Summary:
Migrate com.facebook.react.modules.network.ProgressRequestBody to Kotlin.
Note: To keep the logic the same as in Java, I had to make the params of RequestBodyUtil.createProgressRequest non-nullable again which were made nullable by mistake in https://github.com/facebook/react-native/pull/49584.
## Changelog:
[INTERNAL]- Migrate com.facebook.react.modules.network.ProgressRequestBody to Kotlin
Pull Request resolved: https://github.com/facebook/react-native/pull/49682
Test Plan:
```bash
yarn test-android
yarn android
```
Reviewed By: rshest
Differential Revision: D70239855
Pulled By: cortinico
fbshipit-source-id: 03c5e0bd5c66a4d5df5e4304d4479ec576d350fd
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49687
Changelog: [internal]
Just a minor type rename to better reflect what this type will become soon.
Reviewed By: cortinico
Differential Revision: D70185597
fbshipit-source-id: d5a67eda44dc88dd32a5290f1d0b292ed7014006
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49633
Changelog: [internal]
This replaces the definition of `HostInstance` to use an interface instead of an object, to better represent the underlying type (an instance of `ReactFabricHostComponent`) and simplify the migration to the new DOM API.
Reviewed By: huntie
Differential Revision: D70023947
fbshipit-source-id: bf312abf02fec48b2b5afb41053593ce542f7324
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49658
This bumps the version of Node that we use to build React Native from 18 to 20.
We'll still be supporting building with 20, but we'll moving our toolchain to Node 20 becuase 18 is at EOL soon.
Changelog:
[General] [Changed] - Bump Node 18 -> 20 to build React Native in OSS
Reviewed By: javache, cipolleschi
Differential Revision: D70168003
fbshipit-source-id: b64ee583b2d2e72d25393119ae9e9029a74d5b13
Summary:
Reland of https://github.com/facebook/react-native/issues/49413 which was reverted due to an internal crash. I've attempted to do a solution to keep backwards compatibility but doesn't seem to work – keeping the original solution for now, perhaps something else can be cleaned up to avoid the breakage.
## Changelog:
[INTERNAL] - Migrate com.facebook.react.uimanager.ReactClippingViewGroup to Kotlin
Pull Request resolved: https://github.com/facebook/react-native/pull/49607
Test Plan:
```bash
yarn test-android
yarn android
```
Verified that the update changes do not cause a crash.
Test flow:
- login to BizApp using Instagram account
- on home screen scroll down to Insights section
- it should show without crashing
Reviewed By: arushikesarwani94
Differential Revision: D70200000
Pulled By: alanleedev
fbshipit-source-id: 89bc948c1b91d9419d4b6e1885d949c4a3c20986
Summary:
## Summary
> [!NOTE]
> This only modifies types, so shouldn't have an impact at runtime.
Some time ago we moved some type definitions from React to React Native
in #26437.
This continues making progress on that so values that are created by
React Native and passed to the React renderer (in this case public
instances) are actually defined in React Native and not in React.
This will allow us to modify the definition of some of these types
without having to make changes in the React repository (in the short
term, we want to refactor PublicInstance from an object to an interface,
and then modify that interface to add all the new DOM methods).
## How did you test this change?
Manually synced `ReactNativeTypes` on top of
https://github.com/facebook/react-native/pull/49602 and verified Flow
passes.
DiffTrain build for [9dd378ff1222335ff133bab2d61001fcc84a1c56](https://github.com/facebook/react/commit/9dd378ff1222335ff133bab2d61001fcc84a1c56)
Reviewed By: poteto
Differential Revision: D70091830
fbshipit-source-id: 2cc49d8ed89e8ee2531dbc4094ef9720fc3040ad
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49678
In this diff I'm undeprecating SynchronousEventReceiver and marking it as UnstableReactNativeAPI, to properly describe the status of this API.
changelog: [internal] internal
Reviewed By: mlord93
Differential Revision: D70193235
fbshipit-source-id: c4818c89eecef135e9e1f82d35e7f1e2d46b1637
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49683
Use of these types will trigger `[internal-type]` error in the next version of Flow. This diff cleans them up ahead of the time.
Changelog: [Internal]
Reviewed By: gkz
Differential Revision: D70202028
fbshipit-source-id: 97b7217040b63514f20888fb20c86596235a82a6
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49632
changelog: [internal]
Add gating to experiment with removal of `_turboModuleManagerDelegateMutex`.
# Why remove _turboModuleManagerDelegateMutex?
- It is not consistently used in the class. Here is a case where access to _delegate is not protected by the mutex: https://fburl.com/code/9tay04fn
- From inspecting individual implementations of RCTTurboModuleManagerDelegates, it is not needed to synchronise access.
- It may lead to deadlocks under following conditions:
- **A)** JavaScript thread gets hold of the `_turboModuleManagerDelegateMutex` and then tries to dispatch a block on the main thread synchronously (calling `RCTUnsafeExecuteOnMainQueueSync`). For example, when a new native module is created lazily because JavaScript used it and the native module requires main thread setup.-
- **B)** The main thread tries to get hold of `_turboModuleManagerDelegateMutex` when it is creating a native module ([[RCTModuleRegistry moduleForName:lazilyLoadIfNecessary:]](https://fburl.com/code/lioi5zei)) from Obj-C.
Reviewed By: javache, cipolleschi
Differential Revision: D70087779
fbshipit-source-id: 1780b2f48537dd578260a96f8f498dbe11529689
Summary:
The class is still in Java and also lacks of some tests so adding them to make it safer to migrate or for future refactors.
## Changelog:
[INTERNAL] - Add `ProgressResponseBodyTest` test cases
Pull Request resolved: https://github.com/facebook/react-native/pull/48675
Test Plan:
```bash
yarn test-android
```
Reviewed By: alanleedev
Differential Revision: D68205423
Pulled By: rshest
fbshipit-source-id: edb1dcf4da34377b7b1dcfc68a6e08861421964b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49635
Changelog:
[General][Internal] - report proxy idle state in heartbeat events
The proxy is considered Idle if it didn't receive any messages for 10 seconds.
Reviewed By: robhogan
Differential Revision: D70078637
fbshipit-source-id: 5b8d9a3a6e3e2568e40b3ada0a41e76b277fe66d