Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49161
Avoid special strings, and default to null to mean undefined or unknown. This save us from bridging an unnecessary string but also makes the fallback name for logging network requests clearer.
Changelog: [Internal]
Reviewed By: bgirard
Differential Revision: D69058211
fbshipit-source-id: d83f424e0c2c23842554a8e4e616cad39719f311
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49125
Changelog: [internal]
This adds support for taking JS memory heap snapshots from Fantom tests via `Fantom.saveJSMemoryHeapSnapshot`. This can be used in one-off tests to do memory analysis and determine the existence of leaks:
```
// Warm up
Fantom.saveJSMemoryHeapSnapshot('/path/to/my/1.heapsnapshot');
// Do work
Fantom.saveJSMemoryHeapSnapshot('/path/to/my/2.heapsnapshot');
// Clean up
Fantom.saveJSMemoryHeapSnapshot('/path/to/my/3.heapsnapshot');
```
Load these snapshots in Chrome and select "Objects allocated between 1 and 2" in the dropdown to see the potentially leaked objects.
In the future we could introduce additional utilities to analyze the snapshots and do the detection automatically, e.g.:
```
// Warm up
const baseline = Fantom.takeJSMemoryHeapSnapshot();
// Do work
const before = Fantom.takeJSMemoryHeapSnapshot();
// Clean up
const after = Fantom.takeJSMemoryHeapSnapshot();
const leaks = findMemoryLeaks(baseline, before, after);
expect(leaks.sizeKB()).toBeLessThan(THRESHOLD);
```
Reviewed By: rshest
Differential Revision: D68953788
fbshipit-source-id: 6b3899297837c582a7b7235909d59b3e1631913d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49140
Similar to the change made in `useAnimatedProps`, except for `useAnimatedPropsMemo`. (This is just split out to make the changes easier to review.)
Changelog:
[Internal]
Reviewed By: javache
Differential Revision: D69058338
fbshipit-source-id: 033853673d8fe1442b37bb0c0adc7cb22557c334
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49143
Within the implementation of Animated, the `allowlist` value passed into `unstable_createAnimatedComponent` and `useAnimatedProps` is stable, meaning that it cannot change from commit to commit. However, this semantic is not codified because `allowlist` is a prop.
This refactors `useAnimatedProps` to be created by a new `createAnimatedPropsHook` function which accepts an `allowlist` argument, codifying that its value is stable for the lifetime of the hook returned.
This permits React to avoid checking whether `allowlist` has changed from commit to commit.
For now, I've left `useAnimatedProps` as a deprecated module that returns a hook with an empty `allowlist`.
Changelog:
[Internal]
Reviewed By: javache
Differential Revision: D69058336
fbshipit-source-id: dbcf4ca4e389f3682864a9794eacbe0af23659db
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49121
This change removes the scripts/circleci folder and the last poll-maven script which was not used.
## Changelog:
[Internal] - Remove the circleci folder script
Reviewed By: cortinico, huntie
Differential Revision: D69047603
fbshipit-source-id: a4f1f100d71d792edf42c8d4cb6a0b8d8e7e5260
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49123
Previously, we used to have CI workflows scripts in a `react-native/scripts/circleci` folder.
Now that we are not using CircleCI anymore, we move those scripts to the `.github/workflow-scripts` folder.
## Changelog:
[Internal] - Move ci scripts to the `.github/workflow-scripts` folder
Reviewed By: cortinico, huntie
Differential Revision: D69047581
fbshipit-source-id: 6a5d8525e526cc7521d42e2be9530deb09914fdc
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49122
This change updates the Release testing and the release scripts by removing any reference to CircleCI
## Changelog:
[Internal] - Remove CircleCI references from Release and Release testing scripts
Reviewed By: cortinico, huntie
Differential Revision: D69047479
fbshipit-source-id: 14a394b879c03cd81a8d043036c43839a38602c7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49119
This change removes the .circleci folder and the workflow that we run on CircleCI
## Changelog:
[Internal] - Remove CircleCI config
Reviewed By: cortinico, huntie
Differential Revision: D69047483
fbshipit-source-id: 0020a4ff69d035e939e01079059ba2743aee55fe
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49118
We finished the migration away from CircleCI, so we are cleaning up the codebase.
This change updates references to CircleCI from gradle.
## Changelog:
[Internal] - Remove references from CircleCI in RNGP
Reviewed By: cortinico
Differential Revision: D69047484
fbshipit-source-id: 4ab40be62e6769eb3a8f65136464eed6628d47a4
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49101
Changelog: [internal]
We can move this out of the deprecated directory. Also added a `.npmignore` entry so this won't be published to npm with the package.
Reviewed By: lenaic
Differential Revision: D68896208
fbshipit-source-id: ec85236aeeabdc9abcd870f0f4c1322eeb3cc659
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49100
Changelog: [internal]
This API isn't part of the DOM standard so can be moved out.
Reviewed By: huntie
Differential Revision: D68896484
fbshipit-source-id: 5d275beb909ce5c5ce0eddb6c6e04cf7491aa1cb
Summary:
Fixes a `ConcurrentModificationException` when iterating over `TextWatcher` `mListeners` array.
If you open Android open source code (`TextView` class), then we can see that Android iterates with `for/n` loop (not `for/:`):
```java
void sendAfterTextChanged(Editable text) {
if (mListeners != null) {
final ArrayList<TextWatcher> list = mListeners;
final int count = list.size();
for (int i = 0; i < count; i++) {
list.get(i).afterTextChanged(text);
}
}
notifyListeningManagersAfterTextChanged();
hideErrorIfUnchanged();
}
```
<hr>
We can catch the `ConcurrentModificationException` with old code, when for example we have 3 listeners:
- 0 is `EmojiTextWatcher` (seems like it's added by OS);
- 1 is `OnlyChangeIfRequiredMaskedTextChangedListener` (added by `react-native-text-input-mask`);
- 2 is a listener that attached by `react-native-keyboard-controller`.
On every afterTextChanged [input-mask-android](https://github.com/RedMadRobot/input-mask-android/tree/df452edc0c52a37e5082adcfc3d05d77b5aa34e8) [removes](https://github.com/RedMadRobot/input-mask-android/blob/df452edc0c52a37e5082adcfc3d05d77b5aa34e8/inputmask/src/main/kotlin/com/redmadrobot/inputmask/MaskedTextChangedListener.kt#L212) the listener and [adds](https://github.com/RedMadRobot/input-mask-android/blob/df452edc0c52a37e5082adcfc3d05d77b5aa34e8/inputmask/src/main/kotlin/com/redmadrobot/inputmask/MaskedTextChangedListener.kt#L231) it back.
The oversimplified version of the code can be next:
```java
public class MyClass {
public static void main(String args[]) {
ArrayList<Integer> mListeners = new ArrayList<>();
mListeners.add(0);
mListeners.add(1);
mListeners.add(2);
Iterator<Integer> iterator = mListeners.iterator();
while (iterator.hasNext()) {
Integer listener = iterator.next();
// Check if the listener is equal to 1
// 1 is OnlyChangeIfRequiredMaskedTextChangedListener and we simulate the behavior of this class
if (listener == 1) {
int i = mListeners.indexOf(listener);
if (i >= 0) {
mListeners.remove(i);
}
// Add the removed element at the end
mListeners.add(listener);
}
}
// Print the modified list
System.out.println(mListeners);
}
}
```
Key points are:
- if we have only [0, 1] listener, then it works well and `ConcurrentModificationException` will not be thrown, because we modify last element;
- if we have `[0, 1, 2]` then exception will be thrown.
So in this PR I decided to re-work code to match what Android has. With `for/n` approach `ConcurrentModificationException` will not be thrown, because we don't check array immutability in this case.
More information also can be found here: https://github.com/kirillzyusko/react-native-keyboard-controller/issues/324
## Changelog:
[ANDROID] [CHANGED] - avoid `ConcurrentModificationException` when iterating over `mListeners` `TextWatcher` array
Pull Request resolved: https://github.com/facebook/react-native/pull/49109
Reviewed By: cortinico
Differential Revision: D69050984
Pulled By: javache
fbshipit-source-id: 9c6a7a428467fa5e546d70549dfcc91d6b2e58d2
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49132
Follows D68780147 and D68953084. We're able to safely remove this API by relocating the implementation into the one dependent internal test call site.
Changelog: [Internal]
Reviewed By: rubennorte
Differential Revision: D69049203
fbshipit-source-id: 82c4b15d7f6736aed21171eeec1c197d2f34b33e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49072
We have instance of apps crashing when enabling the New Architecture because of the TurboModule interop layer.
What's happening is that when the module is loaded, the TM Interop Layer tries to parse the method definition to expose them in JS. However, for some libraries in the Legacy Architecture, it is possible to define a method in Objective-C and to define a different signature in Swift.
For example, the [`RNBluetoothClassic` library](https://github.com/kenjdavidson/react-native-bluetooth-classic) defines a selector in objective-c which [has the signature](https://github.com/kenjdavidson/react-native-bluetooth-classic/blob/main/ios/RNBluetoothClassic.m#L134-L136)
```
RCT_EXTERN_METHOD(available: (NSString *)deviceId
resolver: (RCTPromiseResolveBlock)resolve
rejecter: (RCTPromiseRejectBlock)reject)
```
And the method is inmplemented in Swift with [the signature](https://github.com/kenjdavidson/react-native-bluetooth-classic/blob/main/ios/RNBluetoothClassic.swift#L502-L505):
```
func availableFromDevice(
_ deviceId: String,
resolver resolve: RCTPromiseResolveBlock,
rejecter reject: RCTPromiseRejectBlock
)
```
When the TurboModule interop layer tries to parse the method, it receives the `accept:resolver:rejecter:` signature, but that signature is not actually defined in as a method in the module instance, and it crashes.
This crash was not happening in the Old Architecture, which was handling this case gracefully. Notice that the specific method from the example is not working in the Old Architecture either. However, the app is not crashing in the old architecture.
This change adds the same graceful behaviors plus it adds a warning in development to notify the developer about which methods couldn't be found in the interface.
Fixes:
- https://github.com/facebook/react-native/issues/47587
- https://github.com/facebook/react-native/issues/48065
## Changelog:
[iOS][Fixed] - Avoid crashing the app when the InteropLayer can't find some methods in the native implementation.
Reviewed By: javache
Differential Revision: D68901734
fbshipit-source-id: 844d1bf29423d5c601b583540e86d57dfffd1428
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49041
Prevent the class of issues seen in D68797482 by making `#if FOO` where `FOO` is not defined an error.
Changelog: [Internal]
Reviewed By: NickGerleman, sammy-SC
Differential Revision: D68824244
fbshipit-source-id: 1291c5f2f84ecb023ba76a015716cc7c9ae0f89e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49127
These tests are marked as noexcept, but they can indeed throw exceptions: they trigger synchronous commits, which may cause exceptions in the mounting layer.
Changelog: [Internal]
Reviewed By: lenaic
Differential Revision: D69049587
fbshipit-source-id: 02c6187c8d0e043c9840aad9c9e4d27866898b4a
Summary:
As pointed out by RyanCommits the ReactNativeFactory PR removed `enableFixForViewCommandRace` feature flag by mistake. Reference: https://github.com/facebook/react-native/pull/46298/files
This PR re-adds the feature flag.
## Changelog:
[IOS] [FIXED] - Re-enable enableFixForViewCommandRace feature flag
Pull Request resolved: https://github.com/facebook/react-native/pull/49126
Test Plan: Not needed, the feature flag was there before refactor.
Reviewed By: huntie
Differential Revision: D69049668
Pulled By: cipolleschi
fbshipit-source-id: b7bf382c76878e72619145283fa8cc2c1046b486
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49081
Follows D68780147. We are depending on this API in one internal E2E test. Rename as `__setInterceptor_DO_NOT_USE`.
Changelog: [Internal]
Reviewed By: rubennorte
Differential Revision: D68953084
fbshipit-source-id: 66b685a90b6e7f18646752dc90892963d16f9a83
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49102
Moves this script one level up. In the next diff, will be used to support execution of scripts themselves, as well as `packages/`.
Changelog: [Internal]
Reviewed By: cipolleschi
Differential Revision: D68960279
fbshipit-source-id: 7b62420c269dc1c1366ac9a827db078d34cb86c5
Summary:
Working on migrating some of the com.facebook.react.modules.network classes to Kotlin, I'm creating some test cases here for `CountingOutputStream` before migrating that class.
## Changelog:
[INTERNAL] - Add CountingOutputStream tests
Pull Request resolved: https://github.com/facebook/react-native/pull/49058
Test Plan:
```bash
yarn test-android
```
Reviewed By: cortinico
Differential Revision: D68903427
Pulled By: rshest
fbshipit-source-id: f71926cf526a65b2434aaa762007e0b4ca5dd1a4
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49087
I'm moving the whole module to be in Kotlin and updating the BUCK file.
Those files also have 0 usages in OSS so not a breaking change.
Changelog:
[Internal] [Changed] -
Reviewed By: robhogan
Differential Revision: D68953731
fbshipit-source-id: d8238bf805661cbdd6fb070a60f3e32b44ec9832
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49079
The rule disallows using CommonJS exports in react-native and assets/registry package.
## Changelog:
[Internal] - Created a lint rule that prevents using CommonJS exports
Reviewed By: huntie
Differential Revision: D68951212
fbshipit-source-id: 1c9a1581af951d2a876b348981f0e5a81c99109a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49064
Update `public-api-test` to disregard all object/type members prefixed with an underscore (`_`). These are considered existing internal APIs.
Changelog: [Internal]
Reviewed By: cortinico
Differential Revision: D68895376
fbshipit-source-id: db581df7cc37802fa5f7d3aa4d7c07514223209a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49060
We want to hide private properties from JS public API interface. The stripPrivateProperties transform removes all private nodes of type ObjectTypeProperty, Property, PropertyDefinition and MethodDefinition. There is also a change in transforms reducer that incorporates `print` function from hermes-transform which modifies the code base on the transformed ast (transformed.mutatedCode seems to be a code before the transform operation).
## Changelog:
[Internal] - Added transform that strips private properties in build-types script
Reviewed By: huntie
Differential Revision: D68892853
fbshipit-source-id: 5035fd4339aa6294d972e7aff0eb563f48d4c3d2
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49062
Another round of cleanup for the `public` keyword that I found around.
Those are unnecessary here as those classes are `internal` and we should remove them.
Changelog:
[Internal] [Changed] -
Reviewed By: mdvacca
Differential Revision: D68894182
fbshipit-source-id: 6f7bac6051e17785a1bfb0d544950250429c71cb
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49019
Removes the `JSInspector` class and its dependencies.
- This was related to the legacy `ReactCommon/inspector/` subsystem (D4021490) — which added a compat layer from JavaScriptCore to CDP for an earlier version of Chrome debugging.
- The JS components of this system (`JSInspector.js`, `NetworkAgent.js`) were added in D4021516.
`ReactCommon/inspector/` has since been deleted and these components are no longer load bearing.
- We intend to replace this logic (at least, the archaic `XHRInterceptor` behaviour, which worked at one point) with native debugger `Network` domain support in our C++ layer.
**Changes**
- Remove all modules under `Libraries/JSInspector/`.
- Remove all `XHRInterceptor` call sites.
- Remove the `JSInspector.registerAgent()` mount point in `setUpDeveloperTools.js`.
- Exclude `Libraries/Core/setUp*` from `public-api-test` (these are side-effect setup files with no exported API).
Changelog:
[General][Breaking] - Remove legacy Libraries/JSInspector modules
Reviewed By: christophpurrer
Differential Revision: D68780147
fbshipit-source-id: 3d11cc89886a91055e6b69ac6f0609c288965801
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49074
This used to not be noticeable when we were clipping the background even without a border, after fixing that, we got line when the width/height was 0
This is again not an issue with new Background and Border since they take a slightly different approach
Diff that caused the issue D68279400
ie.
{F1974794589}
Changelog: [Internal]
Reviewed By: javache
Differential Revision: D68843649
fbshipit-source-id: a25ace46b604690e3385c49d6f4bb3a4163bc594
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49020
## Motivation
Modernising the RN codebase to allow for modern Flow tooling to process it.
## This diff
- Migrates the `Libraries/EventEmitter/*.js` and `Libraries/Image/*.js` files to use the `export` syntax.
- Updates deep-imports of these files to use `.default`
- Updates the current iteration of API snapshots (intended).
Changelog:
[General][Breaking] - Deep imports to modules inside `Libraries/EventEmitter` and `Libraries/Image/*.js` with `require` syntax need to be appended with '.default'.
Reviewed By: huntie
Differential Revision: D68780876
fbshipit-source-id: bd8e702aba33878e38df6d9c89bec27e7c8df0ac
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49065
Changelog: [internal]
Cleaning up the flag because it's no longer necessary.
Reviewed By: sammy-SC
Differential Revision: D68892995
fbshipit-source-id: 4e0290bfb11181dc388e6590af1b82581588b9ee
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49063
## Motivation
Modernising the RN codebase to allow for modern Flow tooling to process it.
## This diff
- Updates react-native-codegen to generate ViewConfigs that are compatible with react-native both before and after the export syntax migration.
Changelog: [Internal]
Reviewed By: huntie
Differential Revision: D68894819
fbshipit-source-id: fca46c1b91c15e22f1e1128ce8621c05341e2fe6
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49012
Changelog: [internal]
(This is internal for now, until we rollout the DOM APIs in stable).
This refines the concept of root elements from the merged proposal for [DOM Traversal & Layout APIs](https://github.com/react-native-community/discussions-and-proposals/blob/main/proposals/0607-dom-traversal-and-layout-apis.md).
The original proposal included a reference to have the root node in the tree as `getRootNode()` and no other methods/accessors to access it.
This makes the following changes:
* The root node is a new abstraction in React Native implementing the concept of `Document` from Web. `node.getRootNode()`, as well as `node.ownerDocument` now return instances to this node (except when the node is detached, in which case `getRootNode` returns the node itself, aligning with the spec).
* The existing root node in the shadow tree is exposed as the `documentElement` of the new document instance. It would be the first and only child of the document instance, and the topmost parent of all the host nodes rendered in the tree.
In terms of APIs:
* Implements `getRootNode` correctly, according to the specified semantics.
* Adds `ownerDocument` to the `ReadOnlyNode` interface.
* Adds the `ReactNativeDocument` interface, which extends `ReadOnlyNode` (with no new methods on its own, which will be added in a following PR).
NOTE: This is currently gated under `ReactNativeFeatureFlags.enableDOMDocumentAPI` feature flag, which is disabled by default.
Reviewed By: yungsters
Differential Revision: D67526381
fbshipit-source-id: dff3645469e7ea2b2026dbbaa94d9fd0e00291be
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49011
Changelog: [internal]
This exposes the new `getPublicInstanceFromRoot` method from the React renderer in our RN façades, preparing for the new change to implement the document interface in RN.
Reviewed By: javache
Differential Revision: D68767143
fbshipit-source-id: 9a3403f9bc1612b402305695d084497a46ee4480
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49021
## Motivation
Modernising the RN codebase to allow for modern Flow tooling to process it.
## This diff
- Migrates files in `Libraries/LayoutAnimation/*.js` and `Libraries/Linking/*.js` to use the `export` syntax.
- Updates deep-imports of these files to use `.default`
- Updates jest mocks
- Updates the current iteration of API snapshots (intended).
Changelog:
[General][Breaking] - Deep imports to modules inside `Libraries/LayoutAnimation` and `Libraries/Linking` with `require` syntax need to be appended with '.default'.
Reviewed By: huntie
Differential Revision: D68782429
fbshipit-source-id: c9ea4fadbc44587a165d311b054fcd03444842c8
Summary:
`dev-middleware` uses `invariant` but does not declare it as a dependency. Under certain hoisting scenarios, or when using pnpm, this will cause `dev-middleware` to fail while being loaded.
## Changelog:
[GENERAL] [FIXED] - add missing `invariant` dependency
Pull Request resolved: https://github.com/facebook/react-native/pull/49047
Test Plan: n/a
Reviewed By: cortinico
Differential Revision: D68835789
Pulled By: huntie
fbshipit-source-id: 13718f4970ed55e6e062b7c2bd719be977abdd0c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49049
ReactBridge can be internalize, there are no usages in OSS
changelog: [internal] internal
Reviewed By: NickGerleman
Differential Revision: D68540710
fbshipit-source-id: ce7fe6ca52186414650dcc529c5891dc59cab51a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49050
Changelog: [internal]
We added support for feature flags that don't have a native module definition so we could handle cases where the JS changes progressed faster than native ones, but we recently saw that when native catches up, the API starts logging an error through `console.error` about the native module method not being available.
That's an expected result of this feature and it's when we can clean up the code in JS, so we shouldn't be logging errors in that case.
This removes the error for them specifically.
Reviewed By: elicwhite
Differential Revision: D68843247
fbshipit-source-id: 730f3eba8c26959825cd9c3897f055a02a5f9591
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49018
Changelog: [internal]
Migrates the mounting layer logs from C++ (640 lines of code) to Fantom (248 lines!!!).
This is 1:1 translation of the test.
Reviewed By: javache
Differential Revision: D67549200
fbshipit-source-id: 735fa3203cd04dd5b3b4b5174e0c96fdc2354993
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49017
Changelog: [internal]
The debug string for props doesn't log `nativeID` so we can't access it in Fantom. This fixes that to simply future tests.
Reviewed By: javache
Differential Revision: D68779903
fbshipit-source-id: 9800ef2b6d173e2fc8e21d3d910139a30ae91342
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49016
Changelog: [internal]
This replaces the existing string-based logs with something more structured, and increases the coverage to properly log all operations.
As part of this work I had to refactor how we record mutations so they would be done while applying the mutations, and not before/after where necessary metadata might not be available yet/anymore.
Reviewed By: sammy-SC
Differential Revision: D67549201
fbshipit-source-id: 0bcb1642a6b3d7e704f4ee24a550d4189c406aed
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49015
Changelog: [internal]
This name better reflects the fact that we're emptying the buffer when calling it.
Reviewed By: javache
Differential Revision: D67549202
fbshipit-source-id: 7523a130f26bced122acd4f50b45c2b61a39bba9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48930
Changelog: [internal]
This creates new versions of `XMLHttpRequest`, `FileReader` and `WebSocket` that extend the new built-in `EventTarget` implementation, instead of the implementation from the `event-target-shim` package.
It also sets up a test to choose between the 2 implementations at runtime to verify correctness and performance. This doesn't use the RN feature flags infra because we use this flag very early on startup, before we have a chance to set overrides. We could use a native feature flag instead but it'd slow down the rollout of the test.
Reviewed By: yungsters
Differential Revision: D68625226
fbshipit-source-id: bff715c43a237b65d5a02a3fdb56f3275689ea46
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49045
Changelog: [internal]
Making some objects read-only to reflect usage and allow callers to pass both read-only and writable objects.
Reviewed By: yungsters
Differential Revision: D68831136
fbshipit-source-id: e9a2d96ec0abd13f609d26d376e6da946f802011
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48928
Changelog: [internal]
Just a minor change to reduce the number of Flow errors we will get when we refactor XHR soon.
Reviewed By: javache
Differential Revision: D68625224
fbshipit-source-id: e952f3f52de8081a0773ef3a01e1259c3be67a92
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49022
These modules support the in-app Inspector Overlay.
Breaking change that's unlikely to hit any users. Unreferenced by Expo.
Changelog:
[General][Breaking] Move `Libraries/Inspector/` modules to `src/private/`
Reviewed By: cortinico
Differential Revision: D68781896
fbshipit-source-id: 8fcd72d56684319019f64a375c2e2ef317a47c13
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49010
Changelog: [internal]
This adds a stub method for `ReactNativePrivateInterface.createPublicRootInstance`, which just returns `null` for now, so we can synchronize the React renderer that will try to use it to create root instances.
Initially, this will not do anything and React will just pass the `null` value around. When we implement the document API, we will return a proper instance and React will pass it to `createPublicInstance` so we can link things at runtime.
Reviewed By: javache
Differential Revision: D68561173
fbshipit-source-id: 632a7c3523910059a1f63f35b5f0f52f5660a961
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49009
Changelog: [internal]
Native APIs so far have returned instance handles from React to reference nodes in the rendered UI tree, but now that we're adding support for the document API, this isn't sufficient to represent all types of nodes. Both for the document and for its `documentElement`, we don't have an instance handle from React that links to the node, but we're going to represent that differently.
This is a refactor so the existing methods use a mostly opaque `NativeNodeReference` type so we can implement it as a union of React instance handles and the future types we're going to introduce to support document.
Reviewed By: javache
Differential Revision: D67704855
fbshipit-source-id: 0568143d9ce39be65986e1a4b92fdaebd79e4f66
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49008
Changelog: [internal]
We're modifying some core APIs in the RN render in following diffs, so this adds a simple benchmark as a safety mechanism to verify those don't regress performance significantly.
Reviewed By: yungsters
Differential Revision: D68772175
fbshipit-source-id: 3bc446e68495dc04590b613297baa00589fb5f8d
Summary:
The `maxFontSizeMultiplier` prop for `Text` and `TextInput` was not handled in Fabric / New Architecture as documented in https://github.com/facebook/react-native/issues/47499.
bypass-github-export-checks
## Changelog:
[GENERAL] [FIXED] - Fix `maxFontSizeMultiplier` prop on `Text` and `TextInput` components in Fabric / New Architecture
Pull Request resolved: https://github.com/facebook/react-native/pull/47614
Test Plan:
I have not added any automated tests for this change but try to do so if requested. I have however added examples to RN Tester for both the Text and TextInput components, as well as compared the behaviour with Paper / Old Architecture. Both on version 0.76.
Noticed now I didn't do exactly the same steps in both videos, oops! Be aware that reapplying changes made in the Settings are currently half-broken on the new architecture, thus I'm restarting the app on Android and iOS. But this issue is unrelated to my changes. I've tested on main branch and it has the same issue.
Here are comparison videos between Paper and Fabric on iOS *after* I've made my fix.
### Text
| Paper | Fabric |
| ------------- | ------------- |
| <video src="https://github.com/user-attachments/assets/f4fd009f-aa6d-41ab-92fa-8dcf1e351ba1" /> | <video src="https://github.com/user-attachments/assets/fda42cc6-34c2-42a7-a6e2-028e7c866075" /> |
### TextInput
| Paper | Fabric |
| ------------- | ------------- |
| <video src="https://github.com/user-attachments/assets/59b59f7b-25d2-4b5b-a8e2-d2054cc6390b" /> | <video src="https://github.com/user-attachments/assets/72068566-8f2a-4463-874c-45a6f5b63b0d" /> |
Reviewed By: Abbondanzo
Differential Revision: D65953019
Pulled By: cipolleschi
fbshipit-source-id: 90c3c7e236229e9ad9bd346941fafe4af8a9d9fc
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49032
Add a native API to validate the RuntimeScheduler has no pending tasks, and automatically validate after every test that there's no pending tasks left to execute.
Changelog: [Internal]
Reviewed By: sammy-SC
Differential Revision: D68797481
fbshipit-source-id: dbbef894a57bd29eb5a033ac8aaeedef770dcba2
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49030
Overwriting another RawProps object via `operator=` is rarely what we want, and these objects should be considered immutable once constructed.
This will catch issues such as D68633985
Changelog: [General][Changed] Removed `RawProps::operator=`
Reviewed By: sammy-SC
Differential Revision: D68797484
fbshipit-source-id: 766a65db1dbf4485c78007f8f69cc9426d27a943
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49029
This was never being compiled, because we didn't import the header that set `RN_DEBUG_STRING_CONVERTIBLE`
Will look at enabling `-Wundef` to catch these.
Changelog: [Internal]
Reviewed By: sammy-SC
Differential Revision: D68797482
fbshipit-source-id: 6a01192c799903b6f956f9b0acea94bd93183f3b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49033
Those methods are not used at all in the codebase, let's clean them up.
Changelog:
[Internal] [Changed] -
Reviewed By: cipolleschi
Differential Revision: D68826893
fbshipit-source-id: 36e2f0ae247ed72305c1d9d346c6cf32cef6f8f2
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49034
This class was still in Java. I'm converting it to Kotlin + I'm making it internal.
As this class was inside the `com.facebook.react.internal.turbomodule.core` package,
we don't consider this a breaking change.
Changelog:
[Internal] [Changed] -
Reviewed By: cipolleschi
Differential Revision: D68826892
fbshipit-source-id: b1f7aea984ab333faea66a9e8ccbb1492767333e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49024
## Motivation
Modernising the RN codebase to allow for modern Flow tooling to process it.
## This diff
- Migrates files in `Libraries/Lists/*.js` to use the `export` syntax.
- Updates deep-imports of these files to use `.default`
- Updates the current iteration of API snapshots (intended).
Changelog:
[General][Breaking] - Deep imports to modules inside `Libraries/Lists` with `require` syntax may need to be appended with '.default'.
Reviewed By: huntie
Differential Revision: D68783945
fbshipit-source-id: 7563155254fed40b6fe7d280d9e040ea24a5c870
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49007
# Changelog: [Internal]
Before sending `Tracing.start`, CDT will also send `Debugger.disable`.
You don't want to hit your breakpoints when you are profiling an appplication, this is by design.
We won't just delegate this to Hermes to handle. We will explicitly check that this condition is satisfied on React Native side. This is done to avoid regression in case the implementation details will change on CDT side.
Later in D68414421, we will also check that samples JavaScript stack don't contain debugger frames. This is necessary to distinguish garbage collector frames from debugger frames, which share the same type in Hermes VM - "Suspend".
We need garbage collector frames. If debugger frame was found we would throw an error, because this is unexpected after Debugger domain was disabled.
Right now Hermes is not disabling local VM Debugger on `Debugger.disable` method - this is a known bug, which I am addressing in a stack from D68772900.
Reviewed By: huntie
Differential Revision: D68776863
fbshipit-source-id: 4346ac5eb850578265a179b5fd687539ae7d15bc
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48988
The only unitless `<length>` value allowed is `0`, so most of the examples in the `processBoxShadow` unit tests are parse errors on web 🫠. Lets update the tests, and disallow these invalid values.
Changelog:
[General][Breaking] - Disallow invalid unitless lengths in box shadows
Reviewed By: jorge-cab
Differential Revision: D68740553
fbshipit-source-id: ea935819f773c5d516dd9b3367e5d2c808941c28
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48984
Noticed this in conjunction with another change, that I misinterpreted the ratio spec a bit. Ratios with a part less than zero are parse errors, while degenerate ratios are not (Chrome and Firefox both treat like this).
Removing usage of visitorless `consumeComponentValue()` here in preparation for next diff.
Changelog: [Internal]
Reviewed By: lenaic
Differential Revision: D68733519
fbshipit-source-id: 9afc7b7295b067a3e1469e2f80f5c9a6bea41fae
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49027
Make constants more specific to `METAHash` (avoid potential conflicts) and unify the APIs with a shared attribute definition (will be used to mark these APIs as unavailable from Swift).
## Changelog:
[iOS] [Changed] - Change prime constants to have prefix in order to avoid any potential conflicts
Reviewed By: adamjernst
Differential Revision: D68790450
fbshipit-source-id: 69c8b73063cf57d6a4ec25f6cd52a906c77694f0
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49000
Just found those nits around while looking at the codebase.
This clears things out and should have no runtime impact.
Changelog:
[Internal] [Changed] -
Reviewed By: mdvacca
Differential Revision: D68768384
fbshipit-source-id: bd3a30f1792a6f662d1f5b25855c89b6d43e72bb
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48650
## Motivation
Modernising the RN codebase to allow for modern Flow tooling to process it.
## This diff
- Migrates the `Libraries/ReactNative/*.js` files to use the `export` syntax.
- Updates deep-imports of these files to use `.default`
- Updates the current iteration of API snapshots (intended).
Changelog:
[General][Breaking] - Deep imports to modules inside `Libraries/ReactNative` with `require` syntax need to be appended with '.default'.
Reviewed By: huntie
Differential Revision: D68109193
fbshipit-source-id: 3444bf6b2152f7ed72d2923149a10041d718aaf0
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49001
In {D42973408}, `Debugger.scriptParsed` was tweaked to be intercepted in `inspector-proxy`, which:
1. Rewrote the `sourceMapURL` to be relative to debugger.
2. Attempted to fetch the contents of the source map from `sourceMapURL` after re-writing again to a server-relative URL, and if successful replaced `sourceMapURL` with a base64 data URL.
1 is still needed until we have `Network.loadNetworkResource`, but 2 was only needed for frontends that did not support http fetch, and is not needed with Fusebox.
Changelog: [General][Changed] `Debugger.scriptParsed` now includes the field `sourceMapURL` as a (rewritten) remote url as opposed to base64 data url
Reviewed By: robhogan
Differential Revision: D68708899
fbshipit-source-id: 95242582c79ce4e9a573d4a3e639b0dc3290869e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49004
This just converts yet another class to Kotlin.
Changelog:
[Internal] [Changed] -
Reviewed By: tdn120
Differential Revision: D68772336
fbshipit-source-id: 428cb3a0d54bf7a22f0e4eb07268cdc27ef6f2c3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48905
## Motivation
Modernising the react-native codebase to allow for ingestion by modern Flow tooling.
## This diff
- Updates `Libraries/StyleSheet/processColorArray.js` to use `export` syntax.
- Appends `.default` to requires of the changed files.
- Updates test files.
- Updated View Config codegen (requires an MSDK bump).
- Updates the public API snapshot *(intented breaking change)*
Changelog:
[General][Breaking] - Files inside `Libraries/Text`, `Libraries/Share` and `Libraries/Settings` use `export` syntax, which requires the addition of `.default` when imported with the CJS `require` syntax.
Reviewed By: robhogan
Differential Revision: D68564304
fbshipit-source-id: 2fbd058be1a715cccfce4f2a68146118d8ac66ad
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48807
## Motivation
Modernising the react-native codebase to allow for ingestion by modern Flow tooling.
## This diff
- Updates a handful of components in `Libraries/Components` to use `export` syntax
- `export default` for qualified objects, many `export` statements for collections (determined by how it's imported)
- Appends `.default` to requires of the changed files.
- Updates test files.
- Updates the public API snapshot (intented breaking change)
Changelog:
[General][Breaking] - Files inside `Libraries/Components` use `export` syntax, which requires the addition of `.default` when imported with the CJS `require` syntax.
Reviewed By: huntie
Differential Revision: D68436127
fbshipit-source-id: e3496fe69d66932dd4ed82f41d810f3ef1f850f5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49003
Changelog: [internal]
I was adding a benchmark for rendering thousands of views and it was surprisingly fast, until I realized I wasn't wrapping the call to `root.render` in `runTask`, which means the benchmark wasn't really doing the rendering, only scheduling a microtask that was never executed.
This is a safety mechanism to prevent those mistakes.
Reviewed By: sammy-SC
Differential Revision: D68771170
fbshipit-source-id: 5bd8e6ba9e1168db2320572c99b3a01ebd6aeeed
Summary:
This is another attempt at fixing the Android HMR client for HTTPS proxied Metro instances. The previous one unintentionally [caused the following error](https://github.com/facebook/react-native/pull/48970#issuecomment-2617047184):
```
java.lang.AssertionError: Method overloading is unsupported: com.facebook.react.devsupport.HMRClient#setup
```
This PR removes the overloading, and only adds the `scheme` property as a parameter to the existing `.setup` method. Aligning with the exact behavior we have on iOS.
The alternative fix, which should NOT be backward breaking (if this is) - is to move this "infer the protocol from the bundle URL" to the JS side of the HMR client. Where we don't just always default to `http`, but instead default to `https IF port === 443, otherwise http`. It's a bit more hacky, but shouldn't cause any other issues. _**Ideally**_, we have the same working behavior on both Android and iOS without workarounds.
<details><summary>Alternative workaround</summary>
See [this change](https://github.com/facebook/react-native/compare/main...byCedric:react-native:patch-2).
<img width="1179" alt="image" src="https://github.com/user-attachments/assets/47c365bc-6df8-43e6-ad7d-5a667e350cd4" />
</details>
See full explanation on https://github.com/facebook/react-native/issues/48970
> We've noticed that the HMR on Android doesn't seem to be connecting when using a HTTPS-proxied Metro instance, where the proxy is hosted through Cloudflare. This is only an issue on Android - not iOS - and likely caused by the HMR Client not being set up properly on Android.
>
>- On Android, we run `.setup('android', <bundleEntryPath>, <proxiedMetroHost>, <proxiedMetroPort>, <hmrEnabled>)` in the [**react/devsupport/DevSupportManagerBase.java**](https://github.com/facebook/react-native/blob/53d94c3abe3fcd2168b512652bc0169956bffa39/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerBase.java#L689-L691) file.
>- On iOS, we run `[self.callableJSModules invokeModule:@"HMRClient" method:@"setup" withArgs:@[ RCTPlatformName, path, host, RCTNullIfNil(port), @(isHotLoadingEnabled), scheme ]];` in the [**React/CoreModules
/RCTDevSettings.mm**](https://github.com/facebook/react-native/blob/53d94c3abe3fcd2168b512652bc0169956bffa39/packages/react-native/React/CoreModules/RCTDevSettings.mm#L488-L491) file.
>
>Notice how Android does not pass in the scheme/protocol of the bundle URL, while iOS actually does? Unfortunately, because the default protocol (`http`) mismatches on Android when using HTTPS proxies, we actually try to connect the HMR client over `http` instead of `https` - while still using port 443 - which is rejected by Cloudflare's infrastructure even before we can redirect or mitigate this issue. And the rejection is valid, as we basically try to connect on `http://<host>:443` (the source URL is `https`, so the port is infered as `443`).
>
>This change adds scheme propagation to Android, exactly like we do on iOS for the HMR Client.
## Changelog:
[ANDROID] [FIXED] Pass the bundle URL protocol when setting up HMR client on Android
<!-- 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
Pull Request resolved: https://github.com/facebook/react-native/pull/48998
Test Plan:
See full explanation on https://github.com/facebook/react-native/issues/48970
> It's a little bit hard to test this out yourself, since you'd need a HTTPS-based proxy and reject HTTP connections for HTTPS/WSS Websocket requests.
>
>You can set this up through:
>- `bun create expo@latest ./test-app`
>- `cd ./test-app`
>- `touch .env`
>- Set `EXPO_PACKAGER_PROXY_URL=https://<proxied-metro-hostname>` in **.env**
>- Set `REACT_NATIVE_PACKAGER_HOSTNAME=<proxied-metro-hostname>` in **.env**
>- `bun run start`
>
>Setting both these envvars, the bundle URL in the manifest is set to `https://...` - which triggers this HMR issue on Android. You can validate the **.env** setup through:
>
>```bash
>curl "http://localhost:8081" -H "expo-platform: android" | jq .launchAsset.url
>```
>
>This should point the entry bundle URL towards the `EXPO_PACKAGER_PROXY_URL`.
Reviewed By: cortinico
Differential Revision: D68768351
Pulled By: javache
fbshipit-source-id: 49bf1dc60f11b2af6e57177141270632d62ab564
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48940
The PerformanceObserver (marks and measures) example clears it's output each time a new PerformanceObserver event fires, which makes it not particularly useful.
This change makes it so the output is only updated if a non-empty list of performance events is observed.
## Changelog
[Internal]
Reviewed By: rubennorte
Differential Revision: D68634361
fbshipit-source-id: 71b97e1c66aabd090cae63d55c8fa0a425d0c2f4
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48931
## Motivation
Modernising the react-native codebase to allow for ingestion by modern Flow tooling
## This diff
- Updates files in Libraries/Inspector to use `export` syntax
- Appends `.default` to requires of the changed files.
- Updates the public API snapshot (intented breaking change)
Changelog:
[General][Breaking] - Files inside `Libraries/Inspector` use `export` syntax, which requires the addition of `.default` when imported with the CJS `require` syntax.
Reviewed By: robhogan
Differential Revision: D68629285
fbshipit-source-id: ee0904ea5e8f9389aecfb197d05225c88137fb08
Summary:
Currently, the class OkHttpClientProvider is still in Java. Adding some tests before migrating it to Kotlin
## Changelog:
[INTERNAL] - Add OkHttpClientProvider tests
Pull Request resolved: https://github.com/facebook/react-native/pull/48958
Test Plan:
```bash
./gradlew :packages:react-native:ReactAndroid:test -Dtest.single=com.facebook.react.modules.network
```
Reviewed By: javache
Differential Revision: D68706173
Pulled By: cortinico
fbshipit-source-id: 7b4b1cbe17ff39d3775075682dcb8d253892e062
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48995
This change adds an extra parameter to the codegen script that allow our users to trigger codegen for Apps or for Libraries.
When running codegen for Apps, we have to generate some extra files that are not needed by the Libraries. This is causing issues to our library maintainers and this change will provide more flexibility in the DevX of libraries.
The default value is App, so if the new parameter is not passed, nothing will change in the current behavior.
## Changelog:
[iOS][Added] - Add the `source` parameter to generate-codegen-artifacts to avoid generating files not needed by libraries.
Reviewed By: cortinico
Differential Revision: D68765478
fbshipit-source-id: 8030b4472ad4f5058e58b1c91089de5122a4f60a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48934
This class is publicly exposed but effectively unused at all (neither internally, nor externally).
I'm removing it as this should not affect anyone.
Changelog:
[Android] [Breaking] - Removed `RuntimeConfig` class for Hermes which was unused.
Reviewed By: tdn120
Differential Revision: D68631945
fbshipit-source-id: 6a62ccda9e62f4bae650c11bc17a95efc8c88baf
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48980
Changelog: [internal]
This will be properly removed soon, but disabling for now to avoid showing up in all PRs.
Reviewed By: cortinico
Differential Revision: D68719573
fbshipit-source-id: 6a631ba2556f1399d0ade52f19b79f5a3212e007
Summary:
Fixes https://github.com/facebook/react-native/issues/37801
This PR fixes the system bars visibility not being in sync as with the activity it is displayed on.
Here I am also taking into account the feedback given in [this PR](https://github.com/facebook/react-native/pull/36854) which was also aiming to address this issue. Unfortunately, I tried in multiple ways to get this to work by simply extending the whole system bars behaviour in the dialog with the activity system bars behaviour but found out that that solution won't work as we [currently clear the flag "FLAG_NOT_FOCUSABLE"](https://github.com/facebook/react-native/blob/main/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostView.kt#L314) and unless we remove that line, extending the behaviour won't work. Removing that line is not an option as it would cause other side effects in the dialog itself.
With the above said, I ended up doing this in a more explicit way, by checking whether the status or navigation bars are hidden in the activity and then hiding then as well in the dialog or otherwise, similar as we are currently doing with the status bars appearance.
## Changelog:
[ANDROID] [FIXED] - Sync Modal system bars visibility with current activity
Pull Request resolved: https://github.com/facebook/react-native/pull/48516
Test Plan:
In order to test this, you need to trigger any method that hides or shows the system bars using `window.insetsController`. Here a very small example of it:
```kt
fun toggleSystemBarsVisibility(shouldHide: Boolean) {
val window = currentActivity?.window
val controller = window?.insetsController
if (shouldHide) {
controller?.hide(WindowInsets.Type.systemBars())
} else {
controller?.show(WindowInsets.Type.systemBars())
}
}
```
You can do this optionally from JS to make testing different cases easier. Below is a screen recording of how the solutions looks like:
<details>
<summary>Screen recording showcasing the solution in the test plan</summary>
https://github.com/user-attachments/assets/c497c1cb-5e65-4f31-98cc-aefd2d7b0339
</details>
Reviewed By: mdvacca, Abbondanzo
Differential Revision: D67906071
Pulled By: alanleedev
fbshipit-source-id: cbb2d15520d7729a9e9eafb5f5efb8d20d796c60
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48982
We were missing a conversion to px on the `getOutline()` function of `CompositeBackgroundDrawable` which led to incorrect elevation prop rendering
Changelog: [Android][Fixed] - Elevation prop on android has incorrect border-radius
Reviewed By: NickGerleman
Differential Revision: D68724947
fbshipit-source-id: b3a7a4919bfd7c60fac7c3d6e3ba760e3f74d190
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48054
Web debugging should be fully removed as of recent, so lets remove some of the gunk that was powering it, and checks for that environment.
I did some string searches for the following:
* isAsyncDebugging
* debugRemotely
* isDebuggingRemotely
* isRemoteDebuggingAvailable
* WebSocketExecutor
* JavaJSExecutor
* ProxyJavaScriptExecutor
* RELOAD_APP_EXTRA_JS_PROXY
* getJSBundleURLForRemoteDebugging
* onReloadWithJSDebugger
* setRemoteJSDebugEnabled
* WebsocketJavaScriptExecutor
* createRemoteDebuggerBundleLoader
1. `expo-modules-core` exposes its own `isAsyncDebugging` by checking for `nativeCallSyncHook`, but does not depend on `DebugEnvironment`.
2. `expo-dev-menu` does read `isDebuggingRemotely` from `DevSettings`.
3. Realm does a check in Native using `objc_lookUpClass("RCTWebSocketExecutor")` but will gracefully handle `nil` if it does not exist
4. Some more usages (e.g. `onReloadWithJSDebugger`) in vendored packages of `expo-dev-launcher` for RN 0.74
I created an issue for Expo mentioning both here: https://github.com/expo/expo/issues/33371
Changelog:
[General][Breaking] - Remove some web debugging remnants
Reviewed By: huntie
Differential Revision: D66553934
fbshipit-source-id: deec382b1c8bda393fddb8682aa91b26afd9fbe3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48913
This brings us to parity with normalize-color, and is mostly similar to hsl, with the notable exception there is not a separate alpha variant, and only modern function syntax is supported. Again, I took the math from normalize-color, and sanity tested it against reference function provided by Color Spec.
I'm going to let that cap off color function support for now, and leave the rest as TODO.
Changelog: [Internal]
Reviewed By: lenaic
Differential Revision: D68594471
fbshipit-source-id: 95702d576e068655d34e52a714d38e4fd718bbc9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48912
The implementation of `hwb()` color functions added in https://github.com/facebook/react-native/pull/34600 is pretty flawed.
`hwb()` color functions do not allow comma delimited values. So most of the examples in the unit test here will fail to parse on web. Like `hsl()`, these should also allow numeric non-hue components (instead of just %), and angle values for hue (instead of just numbers), and this is also missing support for alpha values, though these are less dangerous compared to allowing and encouraging incorrect delimiters.
https://www.w3.org/TR/css-color-4/#the-hwb-notation
These were added for web compat, and the examples fail to parse on web, so I'm opting to just remove this incorrect support before implementing this more correctly in the Fabric CSS parser in next diff. I did not attempt to fix the other issues I discovered with the PR implementation in the last couple diffs, around mixing and matching syntax allowed in legacy/modern, along with allowing inconsistent delimiters.
Changelog:
[General][Breaking] - Remove incorrect hwb() syntax support from normalize-color
Reviewed By: lenaic
Differential Revision: D68591172
fbshipit-source-id: 36d670b096ae9fac4bc24938877ad083d4dd336a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48878
Creates a new `scheduleAnimatedCleanupInMicrotask` feature flag to experiment with deferring the `AnimatedProps` cleanup using the microtask queue.
This is different from the previous approach of deferring invocation of the completion callback, which impacted the timing of composite animations such as `Animated.parallel` and `Animated.sequence`, because we are deferring detaching the `AnimatedNode` graph instead. This will only impact the timing of completion callbacks as a result of invalidating `AnimatedProps` (either by passing in new `AnimatedValue` instances or unmounting the component).
This should minimally impact scheduling and have lower risk of user-visible behavior change because React already provides minimal guarantees around when updates are committed (and effects attached/detached).
This also enables us to significantly simplify the current convoluted dance we do to optimized around reference counting in the AnimatedNode graph.
Changelog:
[General][Changed] - When an Animated component is updated or unmounted, `AnimatedNode` instances will now detach in a microtask instead of synchronously in the commit phase of React. This will cause the completion callback of finished animations to execute after the commit phase instead of during it.
Reviewed By: rickhanlonii
Differential Revision: D68527096
fbshipit-source-id: 99346b8ddbf6a01725376c692b0351be679b9e89
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48975
After cutting 0.78-stable, we need to bump the monorepo packages to `0.79.0-main`
## Changelog:
[Internal] - Bump monorepo packages to `0.79.0-main`
Reviewed By: cortinico, huntie
Differential Revision: D68715005
fbshipit-source-id: cb5abbf05e8638683687be8d61d66b3037111572
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48973
changelog: [internal]
This test is broken, let's disable it until it is fixed.
Reviewed By: javache
Differential Revision: D68709385
fbshipit-source-id: f61b287ad7ef921dd26fa290cc7a484d0b550091
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48968
I've noticed we have a lot of `public` and `protected` modifiers for classes that are actually `internal`.
Those are unnecessary as the class itself is `internal` and there is no way to extend the visibility of single fields.
Changelog:
[Internal] [Changed] -
Reviewed By: mdvacca
Differential Revision: D68707255
fbshipit-source-id: 5b93d01dceba1b5031ac608e58ec898c1a1eaf51
Summary:
We've noticed that the HMR on Android doesn't seem to be connecting when using a HTTPS-proxied Metro instance, where the proxy is hosted through Cloudflare. This is only an issue on Android - not iOS - and likely caused by the HMR Client not being set up properly on Android.
- On Android, we run `.setup('android', <bundleEntryPath>, <proxiedMetroHost>, <proxiedMetroPort>, <hmrEnabled>)` in the [**react/devsupport/DevSupportManagerBase.java**](https://github.com/facebook/react-native/blob/53d94c3abe3fcd2168b512652bc0169956bffa39/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerBase.java#L689-L691) file.
- On iOS, we run `[self.callableJSModules invokeModule:@"HMRClient" method:@"setup" withArgs:@[ RCTPlatformName, path, host, RCTNullIfNil(port), @(isHotLoadingEnabled), scheme ]];` in the [**React/CoreModules
/RCTDevSettings.mm**](https://github.com/facebook/react-native/blob/53d94c3abe3fcd2168b512652bc0169956bffa39/packages/react-native/React/CoreModules/RCTDevSettings.mm#L488-L491) file.
Notice how Android does not pass in the scheme/protocol of the bundle URL, while iOS actually does? Unfortunately, because the default protocol (`http`) mismatches on Android when using HTTPS proxies, we actually try to connect the HMR client over `http` instead of `https` - which is rejected by Cloudflare's infrastructure even before we can redirect or mitigate this issue.
This change adds scheme propagation to Android, exactly like we do on iOS for the HMR Client.
## Changelog:
[ANDROID] [FIXED] Pass the bundle URL protocol when setting up HMR client on Android
<!-- 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
Pull Request resolved: https://github.com/facebook/react-native/pull/48970
Test Plan: It's a little bit hard to test this out yourself, since you'd need a HTTPS-based proxy and reject HTTP connections for HTTPS/WSS Websocket requests.
Reviewed By: fabriziocucci
Differential Revision: D68711137
Pulled By: javache
fbshipit-source-id: 230c1c91c8189c0a109d20defe085966ac8f5721
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48922
Changelog: [internal]
This is a basic subclass of Event that allows setting custom values (as opposed to `Event` that is meant to be used as a superclass).
Reviewed By: yungsters
Differential Revision: D67804060
fbshipit-source-id: 9e140cc436f8e230f37275a74df23efd4841071b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48962
Changelog: [internal]
We moved away from private fields for `EventTarget` for performance, in favor of normal fields prefixed with underscore, but this would pollute the global scope when we make it extend `EventTarget`.
This refactors the implementation to use symbols for all properties to avoid that problem, leaving only `addEventListener` and `removeEventListener` as regular properties in the prototype.
Performance-wise this is neutral or a slight improvement according to the existing benchmark.
Reviewed By: javache
Differential Revision: D68672215
fbshipit-source-id: b329548efce6059ae2b9f33afa0719e057d3b8ba
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48918
Changelog: [internal]
Makes the constants read-only and accessible through `Event.prototype` as well.
Reviewed By: yungsters
Differential Revision: D67830012
fbshipit-source-id: 730622a642f08f532cebd4c183d859ccb2ca0641
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48426
Changelog: [internal]
This improves the performance of DOM `Event` interface implementation by migrating away from private fields.
Reviewed By: yungsters
Differential Revision: D67751821
fbshipit-source-id: e58e5a9cbb04e7d91cbc676ec7d1b00fff357e2e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48427
Changelog: [internal]
The `ReactNativeElement` class was refactored for performance reasons, and the current implementation does **NOT** call `super()`, and it inlines the parent constructor instead.
When it eventually extends `EventTarget`, things won't work as expected because the existing `EventTarget` implementation has constructor dependencies.
This refactors the current implementation of `EventTarget` to eliminate those constructor side-effects, and eliminates the constructor altogether.
This breaks encapsulation, but it has some positive side-effects on performance:
1. Creating `EventTarget` instances is faster because it has no constructor logic.
2. Improves memory by not creating maps to hold the event listeners if no event listeners are ever added to the target (which is very common).
3. Improves the overall runtime performance of the methods in the class by migrating away from private methods (which are known to be slow on the babel transpiled version we're currently using).
Extra: it also simplifies making window/the global scope implement the EventTarget interface :)
## Benchmark results
Before:
| Latency average (ns) | Latency median (ns) | Samples | Task name | Throughput average (ops/s) | Throughput median (ops/s) |
| ---|--- |--- |--- |---|---|
| 8234.22 ± 0.27% | 8132.00 | 121445 | dispatchEvent, no bubbling, no listeners | 122323 ± 0.02% | 122971 |
| 9001.22 ± 0.41% | 8883.00 | 111097 | dispatchEvent, no bubbling, single listener | 111981 ± 0.02% | 112575 |
| 51777.94 ± 0.58% | 51247.00 | 19314 | dispatchEvent, no bubbling, multiple listeners | 19393 ± 0.04% | 19513 |
| 8256.65 ± 0.29% | 8152.00 | 121115 | dispatchEvent, bubbling, no listeners | 122031 ± 0.02% | 122669 |
| 9064.32 ± 0.44% | 8933.00 | 110323 | dispatchEvent, bubbling, single listener per target | 111265 ± 0.02% | 111944 |
| 51879.66 ± 0.27% | 51447.00 | 19276 | dispatchEvent, bubbling, multiple listeners per target | 19325 ± 0.04% | 19437 |
After:
| Latency average (ns) | Latency median (ns) | Samples | Task name | Throughput average (ops/s) | Throughput median (ops/s)|
| ---------------------|---------------------|---------|--------------------------------------------------------|----------------------------|--------------------------|
| 5664.62 ± 0.50% | 5588.00 | 176535 | dispatchEvent, no bubbling, no listeners | 178219 ± 0.02% | 178955 |
| 7232.86 ± 0.50% | 7131.00 | 138258 | dispatchEvent, no bubbling, single listener | 139540 ± 0.02% | 140233 |
| 50957.51 ± 0.71% | 50336.00 | 19625 | dispatchEvent, no bubbling, multiple listeners | 19751 ± 0.04% | 19866 |
| 5692.36 ± 0.50% | 5618.00 | 175675 | dispatchEvent, bubbling, no listeners | 177315 ± 0.02% | 177999 |
| 7277.82 ± 0.38% | 7181.00 | 137404 | dispatchEvent, bubbling, single listener per target | 138560 ± 0.02% | 139256 |
| 50493.64 ± 0.28% | 50105.00 | 19805 | dispatchEvent, bubbling, multiple listeners per target | 19855 ± 0.04% | 19958 |
Reviewed By: yungsters
Differential Revision: D67758408
fbshipit-source-id: f8da1788251c9e21377de5ab730875bcc7610361
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48431
Changelog: [internal]
Adds a regression test to make sure we implement the correct spec-compliant behavior for a possible bug in ~~the Web spec~~ __Chrome__: https://github.com/whatwg/dom/issues/1346
Edit: the bug is in the Chrome implementation, not in the spec.
Reviewed By: javache
Differential Revision: D67758702
fbshipit-source-id: ecaeacac3bce286e692880f05d70297ba0c2c736
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48429
Changelog: [internal]
This implements a (mostly) spec-compliant version of the [`Event`](https://dom.spec.whatwg.org/#interface-event) and [`EventTarget`](https://dom.spec.whatwg.org/#interface-eventtarget) Web interfaces.
It does not implement legacy methods in either of the interfaces, and ignores the parts of the spec that are related to Web-specific quirks (shadow roots, re-mapping of animation events with webkit prefixes, etc.).
IMPORTANT: This only creates the interfaces and does not expose them externally yet (no `Event` or `EventTarget` in the global scope).
Reviewed By: yungsters
Differential Revision: D67738145
fbshipit-source-id: c86db29821552cc1a1b6e1023cc3a21ae55febd5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48965
Running codegen should not be a Cocoapods responsibilities, but it should be something that runs before Cocoapods to ensure that the code is already in the right place.
This change moves the invocation of Codegen to the react-native's core-cli-utils so that frameworks can integrate better with it.
It should also make it easier to migrate away from Cocoapods.
## Changelog:
[iOS][Changed] - Invoke Codegen as part of the Core-cli-utils package
Reviewed By: cortinico
Differential Revision: D68706136
fbshipit-source-id: 548c9ffad62bc561fcc948babaf75de5dad82f86
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48966
In our previous fix for concurrent-ruby, we have been a bit too strict. Version 1.3.4 is a valid and working version. The broken version is 1.3.5.
## Changelog:
[iOS][Changed] - Fix Gemfile versions
Reviewed By: cortinico
Differential Revision: D68706060
fbshipit-source-id: 8ab7a4df0eb83a82603729ff8460e64908ddc465
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48961
One of Cocoapods responsibility is to run Codegen while creating the Xcode workspace. Moving away from Cocoapods, this is a step we need to move to a different place.
This change let us to disable running codegen at cocoapods time when we pass the `RCT_SKIP_CODEGEN=1` or when we pass the `RCT_IGNORE_PODS_DEPRECATION=1` flag calling pod install.
When calling `pod install` with `RCT_IGNORE_PODS_DEPRECATION` we are either:
* using one of the Scripts provided by Expo or by the Community CLI
*or*
* we are preparing the project using the legacy mode and, therefore, we want to keep running codegen.
## Changelog
[iOS][Changed] - Stop running codegen when running pod install
Reviewed By: cortinico
Differential Revision: D68704604
fbshipit-source-id: 252e90544886c3dbfd7eff38c344dd4784a0af38
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48960
We are moving away from Cocoapods toward alternative solution.
We are adding this deprecation message to help inform our users that this change is happening.
Part of the Cocoapods tasks will be moved to an alternative script that will be invoked by Expo and by the Community CLI. The warning message tells the users what to do as an alternative to `pod install`.
## Changelog:
[iOS][Deprecated] - deprecate calling `pod install` directly
Reviewed By: cortinico
Differential Revision: D68704127
fbshipit-source-id: df93008afc055254d0c0da09566c84af99248310
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48933
## Motivation
Modernising the react-native codebase to allow for ingestion by modern Flow tooling
## This diff
- Updates files in Libraries/Interaction to use `export` syntax
- Appends `.default` to requires of the changed files.
- Updates the public API snapshot (intented breaking change)
Changelog:
[General][Breaking] - Files inside `Libraries/Interaction` use `export` syntax, which requires the addition of `.default` when imported with the CJS `require` syntax.
Reviewed By: huntie
Differential Revision: D68629953
fbshipit-source-id: 526b18d9b64c4b27b6e3198a9725075fa11e345a
Summary:
Changelog: [General][Fixed] Update tests to support new `didOpen` delegate fn
Add support for the new `didOpen` delegate function in tests.
To follow up separately: the borked tear down sequence when these two tests are ran together (they pass when ran individually)
```
buck2 test @//fbobjc/mode/buck2/ios-tests fbsource//xplat/js/react-native-github/packages/react-native/ReactCommon/jsinspector-modern:testsAppleMac -- ReactInstanceIntegrationTest RuntimeTargetDebuggerSessionObserverTest
```
Reviewed By: hoxyq
Differential Revision: D68632974
fbshipit-source-id: 59da6d9e2d09f2c7e219c1902dd6f9b8ddfee9dc
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48943
changelog: [internal]
A new helper function on Fantom flushAllNativeEvents, which will flush all pending native events.
Reviewed By: javache
Differential Revision: D68566753
fbshipit-source-id: 6cb19416e39807b9b381ff068cea5c2458101174
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48907
changelog: [internal]
Introduce new function `Fantom.scrollTo`, which will fake a scroll to particular position.
Calling the method will call onScroll event using codepath that iOS uses. It will also set C++ state so the new scroll position is observable from JavaScript.
Reviewed By: javache
Differential Revision: D68554703
fbshipit-source-id: 2fc71e96836a03ec343053ceed85764c4bc2f5c7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48917
Cleaning up this flag which has already been rolled out
Changelog: [Internal]
Reviewed By: cortinico
Differential Revision: D68622852
fbshipit-source-id: 5767515d02ce9804976a1363532e1e626aeae0d8
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48916
Cleaning up this feature flag since we no longer require this gating. This was already fulled rulled out as default.
Changelog: [Internal]
Reviewed By: cortinico
Differential Revision: D68621578
fbshipit-source-id: 3fd3ad007b8beb8e2525ffa7b4da372be1dbbd94
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48877
This is a minor refactor to hoist logic that is not actually specific to the `AnimatedProps` lifecycle out of the hook named `useAnimatedPropsLifecycle`.
This will make it easier to iterate on the implementation of `useAnimatedPropsLifecycle` using a feature flag in a subsequent diff.
This has no behavior change.
Changelog:
[Internal]
Reviewed By: javache
Differential Revision: D68516034
fbshipit-source-id: 2cd6d9b0f2a5c0ada10cf01c8c14ed5510fbf25a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48919
I suspect this class is unused and we should not be building it.
The same `AndroidUnicodeUtils.java` is provided by facebook/hermes instead.
Changelog:
[Internal] [Changed] -
Reviewed By: tdn120, mdvacca
Differential Revision: D68623307
fbshipit-source-id: 0a290d31e3b1103947a9dd3c46821958be9223e7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48665
## Motivation
Modernising the react-native codebase to allow for ingestion by modern Flow tooling
## This diff
- Updates files in Libraries/Utilities to use `export` syntax
- `export default` for qualified objects, many `export` statements for collections (determined by how it's imported)
- Appends `.default` to requires of the changed files.
- Updates Jest mocks of the `Platform` module, which happened to touch a lot of test files.
- Updates the public API snapshot (intented breaking change)
Changelog:
[General][Breaking] - Files inside `Libraries/Utilities` use `export` syntax, which requires the addition of `.default` when imported with the CJS `require` syntax.
Reviewed By: huntie
Differential Revision: D68152910
fbshipit-source-id: 07f3a0957f1dbaf44f53974c6f28b273558406eb
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48901
## Motivation
Modernising the react-native codebase to allow for ingestion by modern Flow tooling.
## This diff
- Updates files in `Libraries/Text`, `Libraries/Share` and `Libraries/Settings` to use `export` syntax.
- Appends `.default` to requires of the changed files.
- Updates test files.
- Updates the public API snapshot *(intented breaking change)*
Changelog:
[General][Breaking] - Files inside `Libraries/Text`, `Libraries/Share` and `Libraries/Settings` use `export` syntax, which requires the addition of `.default` when imported with the CJS `require` syntax.
Reviewed By: huntie
Differential Revision: D68562844
fbshipit-source-id: bd71a341e33d3629121aa61549139c4b1cd62c3f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48926
# Changelog: [Internal]
Leverage [`devtools` field](https://developer.chrome.com/docs/devtools/performance/extension#devtools_object) inside [`detail` object](https://developer.mozilla.org/en-US/docs/Web/API/Performance/measure#detail) to make extension tracks work.
Right now we are only specifying track name, later we could use many more fields:
```
interface ExtensionTrackEntryPayload {
dataType?: "track-entry"; // Defaults to "track-entry"
color?: DevToolsColor; // Defaults to "primary"
track: string; // Required: Name of the custom track
trackGroup?: string; // Optional: Group for organizing tracks
properties?: [string, string][]; // Key-value pairs for detailed view
tooltipText?: string; // Short description for tooltip
}
```
In the next few diffs I will extend the spec of the local implementation for `performance.measure` and `performance.mark` to get this propagated correctly.
Reviewed By: huntie
Differential Revision: D68624603
fbshipit-source-id: 99a5d233ee1dbcd690ad8a6802ca993071f63f2c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48923
# Changelog: [Internal]
Starting from this diff, React Native will emit inspector traces, the ones that will have the same UI as if it was recorded in a browser.
We are going to fake it by sending "TracingStartedInPage" event. For a corresponding logic on Chrome DevTools Frontend side, see [this](https://github.com/ChromeDevTools/devtools-frontend/blob/192673131cf3e6e0bcdb4a97bd0bd39c75f1b3c2/front_end/models/trace/handlers/MetaHandler.ts#L68-L80) as a starting point.
Because of this, custom tracks are now grouped under "Timings" track, although with a better color scheme:
- We no longer need the logic for placing tracks under arbitrary thread ids to have them grouped.
- The real support for extension tracks (custom tracks for Performance panel) will be added in the next diff.
Reviewed By: huntie
Differential Revision: D68439734
fbshipit-source-id: 8e5c525a71578375904edc6d473308eb710b5867
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48927
changelog: [internal]
Remove explicit calls to root.destroy() in favour of automated system that will call it and check for memory leaks.
Reviewed By: rubennorte
Differential Revision: D68624917
fbshipit-source-id: 44be1dee9a56ec31bea5a9eefdda086a4cb4248f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48889
## Motivation
Modernising the react-native codebase to allow for ingestion by modern Flow tooling.
## This diff
- Updates files in `Libraries/Core` to use `export` syntax
- `export default` for qualified objects, many `export` statements for collections
- Appends `.default` to requires of the changed files.
- Changed `* as ExceptionsManager` to `ExceptionsManager` in import statements throughout product code.
- Updates test files.
- Updates the public API snapshot (intented breaking change)
Changelog:
[General][Breaking] - Files inside `Libraries/Core` use `export` syntax, which requires the addition of `.default` when imported with the CJS `require` syntax.
[General][Breaking] - `Libraries/Core/ExceptionsManager` now exports a default `ExceptionsManager` object, and `SyntheticError` as a secondary export.
Reviewed By: huntie
Differential Revision: D68553694
fbshipit-source-id: 51c9a404b2762cb1cdb5f56cae3a683ccdfffc7f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48854
Changelog: [internal]
Moves the internals to access instance handle and shadow node from public instances from `ReadOnlyNode` to `NodeInternals` so it's more obvious when people are reaching into internal APIs/state.
Reviewed By: javache
Differential Revision: D67654404
fbshipit-source-id: 1063bc9451eeacb79af34614df3be02466f93fa3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48795
# Changelog: [Internal]
Splitting `PerformanceTracer::stopTracingAndCollectEvents()` into 2 separate methods.
Once we add logic for starting and stopping tracing on `InstanceAgent`:
- We would need to stop tracing everywhere synchronously
- Populate data sources in `PerformanceTracer`, like JavaScript samples
- Collect all events from different data sources in one payload via `PerformanceTracer::collectEvents()`
Reviewed By: huntie
Differential Revision: D68331485
fbshipit-source-id: 0d6b21a522d841f7f734e2fad2e0fc533097fdee
Summary:
On older Android versions clipping doesn't have anti-aliasing by default which means that clipping with no border will always make the background not have anti-aliasing.
This is fixed by default on new Background and Border drawables since rendering logic is separated
Moving the clipping logic so it only runs when we have a border.
https://github.com/facebook/react-native/issues/41226
Changelog: [Android] [Fixed] - Fixed anti-aliasing not showing on older Android versions
Reviewed By: javache
Differential Revision: D68279400
fbshipit-source-id: e2383c71bd1ca89f66f42630b3712bb4cc5cd7ac
Summary:
This was causing links to not ellipsize and be scrollable. Gonna revert while I see if I can workaround
Changelog: [Internal]
Reviewed By: NickGerleman
Differential Revision: D68596950
fbshipit-source-id: 432a059d0b10acbb45d34e0c98763680d280937b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48872
enableDeletionOfUnmountedViews feature flag has been enabled for 4 months with no errors on production, also it's been enabled in OSS since 0.76.
This diff removes the feature flag and fully rollout this fix
bypass-github-export-checks
changelog: [internal] internal
Reviewed By: sammy-SC
Differential Revision: D68511227
fbshipit-source-id: a42481c57aaab2e8c45b952af5e044bf60740df3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48843
Adds support for hsl() and hsla() funtions. This supports more modern syntax options than normalize-color, like number components, optional alpha, and fills in missing support for angle units. The underlying math was lifted pretty much directly from normalize-color though.
An aside, std::remainder for these is not guaranteed to be constexpr, but Clang is still okay with rgb function parsing to be contexpr because we never try to evaluate non-constexpr function?
Changelog: [Internal]
Reviewed By: lenaic
Differential Revision: D68473990
fbshipit-source-id: 2a71d8367b22f9d1ba6a66598d40ef2683847704
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48842
This is a result of inlining isinf previously but we can never be negative infinity because we can never be less than zero.
Changelog: [Internal]
Reviewed By: lenaic
Differential Revision: D68474836
fbshipit-source-id: bfce78c4bd269ff2afac99c03250ede676ee1029
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48841
Right now during parsing we can ask for a next component value, with a delimeter, and even if we don't have a component value to consume, we will consume the delimeter.
This is kind of awkward since e.g. trailing comma can be consumed, then we think syntax is valid. Let's try changing this.
Changelog: [Internal]
Reviewed By: lenaic
Differential Revision: D68474739
fbshipit-source-id: 47a942681bc8472ca28470eba821d4d95306ae5d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48839
In the last diff I mixed and matched `<legacy-rgb-syntax>` and `<modern-rgb-syntax>` a bit to keep compatiblity with `normalze-color`.
Spec noncompliant values have only been allowed since https://github.com/facebook/react-native/pull/34600 with the main issue being that legacy syntax rgb functions are allowed to use the `/` based alpha syntax, and commas can be mixed with whitespace. This seems like an exceedingly rare real-world scenario (there are currently zero usages of slash syntax in RKJSModules validated by `rgb\([^\)]*/`), so I'm going to instead just follow the spec for more sanity.
Another bit that I missed was that modern RGB functions allow individual components to be `<percentage>` or `<number>` compared to legacy functions which only allow the full function to accept one or the other (`normalize-color` doesn't support `<percentage>` at all), so I fixed that as well.
I started sharing a little bit more of the logic here, to make things more readable when adding more functions.
Changelog: [Internal]
Reviewed By: javache
Differential Revision: D68468275
fbshipit-source-id: f1dfab51b91a3f64436c2559daa3d1e8891db889
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48828
1. Rename `CSSComponentValueDelimeter` to `CSSDelimeter` bc the names are getting way too long.
2. Make the distinction between `Whitespace` and `OptionalWhitespace`. Note that for property values, and function blocks, the value parser will already remove trailing/leading whitespace, but it's weird that whitespace unlike others was not required to be present
3. Add `CSSDelimeter::CommaOrWhitespaceOrSolidus` for simpler parsing in the common pattern of alpha values, and move CSSColor function parsing to use that
Changelog: [Internal]
Reviewed By: lenaic
Differential Revision: D68461968
fbshipit-source-id: 388056e47dfe6ca6003b44e82e00fe416706330b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48835
D65907786 ended up regressing a bit of the performance gains from new Background and Border Drawables. changing back to the previous approach.
Changelog: [Internal]
Reviewed By: javache
Differential Revision: D68354292
fbshipit-source-id: f2db6d7ad5c1590d5d4d8261d76281f3592f488a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48891
changelog: [internal]
add two tests covering onScroll: one for the case where onScroll is triggered multiple times during one UI tick and one where it is triggered once per UI tick.
Reviewed By: rubennorte
Differential Revision: D68499566
fbshipit-source-id: ee25227b620569e3a43038575f04b0a325e5e38b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48801
changelog: [internal]
Adds isUnique option to Fantom.dispatchNativeEvent.
isUnique controls whether only the last event of the same type and target is dispatched to JavaScript or all events are queued and dispatched.
Reviewed By: rubennorte
Differential Revision: D68416157
fbshipit-source-id: 415e7db7d258d60a6bc510d929091153bfdccb3f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48888
We have a report from OSS where Images are not displayed properly in case they are saved on disk with no extension.
We previously had a fix attempt iwith [this pr](https://github.com/facebook/react-native/pull/46971), but this was breaking some internal apps.
This second attempt should work for both cases.
## Changelog:
[iOS][Fixed] - Load images even when the extension is implicit
Reviewed By: cortinico
Differential Revision: D68555813
fbshipit-source-id: bc25970aafe3e6e5284163b663d36e00b3df3d82
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48896
This comment is not exact and should be updated.
Changelog:
[Internal] [Changed] -
Reviewed By: yungsters
Differential Revision: D68556425
fbshipit-source-id: 67427ff325809907fdeba1c6a90b84b97713bf5e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48894
## Motivation
In our efforts to migrate the RN codebase to modern Flow (to enable ingestion by modern Flow tooling) I stumbled upon the `AnimatedWeb.js` file, which does not seems to be imported anywhere throughout the monorepo.
Searching on GitHub for imports to this file in OSS projects returned no results.
In case this file has actual uses outside of Meta (e.g. in OSS), I'll abandon the diff 🙌
## This diff
- Removes `Libraries/Animated/AnimatedWeb.js` file
Changelog:
[General][Breaking] Removed `Libraries/Animated/AnimatedWeb.js` file.
Reviewed By: cortinico
Differential Revision: D68558237
fbshipit-source-id: 319b5e59eb83e518cd123b9f74642e90f0003a4a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48648
# Changelog: [Internal]
This is the pre-requisite before adding a formatter for conversion from Hermes format-agnostic API for JavaScript samples to Trace Events.
This struct will probably be used a lot around this module and big enough for a separate header.
Reviewed By: huntie
Differential Revision: D68104202
fbshipit-source-id: 93f2816de5a87471c5f7761468ccc52a34a895d6
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48882
Changelog: [internal]
The current hint for benchmarks is that the test body contains `unstable_benchmark` calls, but some benchmarks that need to use feature flags define their test bodies in a separate file, so the file containing the call to `unstable_benchmark` isn't the `-itest.js` one.
This adds a new hint to opt into optimized builds that uses the name of the test instead of its contents. If it contains `-benchmark` then we consider it a benchmark and do the opt in.
Reviewed By: andrewdacenko
Differential Revision: D68102300
fbshipit-source-id: 4c0909969f76b8a7d563959cccf686aefaef700d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48808
## Motivation
Modernising the react-native codebase to allow for ingestion by modern Flow tooling.
## This diff
- Updates a handful of components in `Libraries/Components` to use `export` syntax
- `export default` for qualified objects, many `export` statements for collections (determined by how it's imported)
- Appends `.default` to requires of the changed files.
- Updates test files.
- Updates the public API snapshot *(intented breaking change)*
- Synchronizes `GoodwillVideoEditorCandidateImage.js` with www, as it was using `require`s that would result in invalid code after this Diff's changes. Added `ReactNativeImage` shim.
Changelog:
[General][Breaking] - Files inside `Libraries/Components` use `export` syntax, which requires the addition of `.default` when imported with the CJS `require` syntax.
Reviewed By: yungsters
Differential Revision: D68436611
fbshipit-source-id: 14f33e375e60429ea2340fb49ddf9dc6eb79594f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48884
## Motivation
Modernising the react-native codebase to allow for ingestion by modern Flow tooling.
## This diff
- Updates files in `Libraries/WebSocket` to use `export` syntax
- Appends `.default` to requires of the changed files.
- Updates mocks.
- Updates the public API snapshot (intented breaking change)
Changelog:
[General][Breaking] - Files inside `Libraries/WebSocket` use `export` syntax, which requires the addition of `.default` when imported with the CJS `require` syntax.
Reviewed By: cortinico
Differential Revision: D68554260
fbshipit-source-id: 90a660fe9e76b255171189101819253521354fda
Summary:
Found this while I was trying to make my own react native info for CI. For android Podfile.lock is being read instead of gradle.properties
## Changelog:
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
[INTERNAL][FIXED] - Fixed React native info where Podfile.lock was being read for android
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
Pull Request resolved: https://github.com/facebook/react-native/pull/48876
Reviewed By: blakef
Differential Revision: D68553964
Pulled By: cortinico
fbshipit-source-id: 7d6391195dab0c2230fe86fb465de6d3f94ccbef
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48815
In an effort to reduce the responsibility of Cocoapods in React Native, we are moving the generation of the Reactcodegen podspec from Cocoapods itself to the codegen infrastructure.
This reduce the responsibility of Cocoapods and allow us to migrate away from it with more ease.
## Changelog:
[iOS][Changed] - Generate the ReactCodegen.podspec as part of codegen instead of as part of pod install.
Reviewed By: cortinico
Differential Revision: D68418268
fbshipit-source-id: 004ac5b6b3563bf96cc38942f2b48b6f269541c3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48855
changelog: [internal]
add event category argument to Fantom.dispatchNativeEvent.
This gives tests option to control whether an event is continuous, discrete etc.
Reviewed By: rubennorte
Differential Revision: D68413879
fbshipit-source-id: f0c365df505a325440693ca7c3408dd612614946
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48871
# Changelog: [Internal]
Forward-fixing D68380665.
Requirements:
- `setUpReactDevTools` should be called before `setUpErrorHandling` to avoid React DevTools mutating `console.error` call arguments.
- `setUpReactDevTools` should be called after `setUpTimers`, because it is using `queueMicrotask`, see https://fb.workplace.com/groups/rn.panelapps/permalink/1120810879540337/.
- `setUpTimers` should be called after `polyfillPromise`, because it uses on `global.Promise`.
I went over bundles, which are not using `InitializeCore` and using either `setUpErrorHandling` or `setUpDeveloperTools` and updated their order of initialization accordingly.
Reviewed By: javache
Differential Revision: D68510100
fbshipit-source-id: 4331dcc7a7cb1dc438ca2ed5ccae49e736c41b2a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48773
This diff contains 2 fixes with regards to clickable text accessibility on Android.
1. It allows nested `Text` links to be accessible via keyboard. The accessibility here is a bit unique. The clickable text is not focused in the classical since that Android provides on `View`s (after all, the part being focused is not even a `TextView`. Its a `Span` in a `TextView`). However, it is [selected](https://developer.android.com/reference/android/widget/TextView#setSelected(boolean)), and pressing enter while it is selected will press the text, so for all intents and purposes it is focused. Some quirks here, though, are that you cannot press tab to cycle through the links in text, you have to use arrow keys. And the arrow keys no longer let you move around to the next item (as they are stuck being used to navigate the links). I *could* override this behavior but I do not see much of a point as long as one can actually get to everything on screen in a semi-logical way. Anyway, the fix here is using [`LinkMovementMethod`](https://developer.android.com/reference/android/text/method/LinkMovementMethod) to navigate between clickable spans, which is exactly what that class exists for. Note that I override this class so that touching the links does not actually highlight them like you see in the videos.
2. In the case we state update and remove the "click-ability" of the text, this diff makes it so that Explore By Touch no longer can focus on the link. The code was in the same area so I decided to just lump that together :P
Changelog: [Android] [Fixed] - Allow text links to be navigable via keyboard by default
Reviewed By: javache
Differential Revision: D68306316
fbshipit-source-id: a72145f6b60caf2a8077e1bd2ca987bdde0b82ab
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48794
changelog: [internal]
Add payload argument to Fantom.dispatchNativeEvent. For example, in `TextInput.onChange` event, new value of input field must be present in the event payload.
Reviewed By: rubennorte
Differential Revision: D68410469
fbshipit-source-id: eb915f9f961efdfe9902f060173072c6259b7eea
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48840
MSVC unicode handling is causing our windows test to fail. To fix,
simply replace the special characters with the their explicit UTF-16
encoding.
Changelog: [Internal]
Reviewed By: neildhar
Differential Revision: D68466808
fbshipit-source-id: 1bfc689972e1e5862fe6525bc48d5ebc508a95da
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45552
In this diff I'm overriding the getDiffProps for ViewProps.
The goal is to verify what's the impact of calculating diffs of props in Android, starting with ViewProps.
Once we verify what are the implication we will automatic implement this diffing.
The full implementation of this method will be implemented in the following diffs
changelog: [internal] internal
Reviewed By: NickGerleman
Differential Revision: D59969328
fbshipit-source-id: ce141528581e46e9ced4175dca040ddf8bed5ddb
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48868
Original commit changeset: ac48be3305eb
Original Phabricator Diff: D68093083
Changelog: [iOS][Removed] - Removed workaround for a iOS build app running on Apple Silicon Mac(in Xcode Destination: "Mac(Designed for iPad)") TextInput crash due to serialization attempt of WeakEventEmitter
Reviewed By: javache
Differential Revision: D68452788
fbshipit-source-id: 9d3466950c43a10f36ca594997ae5a586d1a2a00
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48866
Changelog: [internal]
The current test to create a snapshot of the public API was recently modified to include `src/private` but excluding certain directories from it.
This replaces the opt-out with an opt-in mechanism, where we only use it where necessary (new DOM APIs, etc.).
Reviewed By: huntie
Differential Revision: D68496269
fbshipit-source-id: 6ae056008a6189b493cb27811d21a8619e79009d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48859
Changelog: [internal]
Just to make it easier to distinguish between public and private APIs, until we have proper support to extract that automatically.
Reviewed By: huntie
Differential Revision: D68496270
fbshipit-source-id: 83cdf95f7f33eab8835b0913cc468ccaf5e47730
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48774
[Changelog] [Internal] - Fix data race in TraceSection.h
## Issue
The `instrumentsLogHandle` variable is a static variable that is initialized lazily when the `getOrCreateInstrumentsLogHandle()` function is called. However, this initialization is not thread-safe. Multiple threads may call this function simultaneously, leading to a data race on the `instrumentsLogHandle` variable.
Reviewed By: lyahdav, javache
Differential Revision: D68366837
fbshipit-source-id: d61b85a0299a8d42b9fbcfdbecae78eb410d748f
Summary:
Adds `getConcretePropsShared()` to `ConcreteShadowNode.h`.
I need this in Nitro Views to update state in-place without throwing away the old state object and creating a new one each time.
From reading the code it seems like you use this pattern a lot tho where you create new State objects each time - so let me know if my thing is a bad idea..
## Changelog:
- [INTERNAL] [ADDED] Add `getConcretePropsShared()` to `ConcreteShadowNode.h`
<!-- 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
Pull Request resolved: https://github.com/facebook/react-native/pull/48710
Test Plan: Use in Nitro
Reviewed By: sammy-SC
Differential Revision: D68495697
Pulled By: javache
fbshipit-source-id: e2caa34befcaef2191ec161442c40596cc7de132
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48509
Cleans up the following feature flags from `Animated`:
- `enableAnimatedAllowlist`
- `enableAnimatedPropsMemo`
- `useInsertionEffectsForAnimations`
This will significantly simplify some future planned work here (e.g. T209740497).
Changelog:
[Internal]
Reviewed By: javache
Differential Revision: D67867115
fbshipit-source-id: adf35c70d95f42c240342fda3b4f2e9b4bdfe30a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48851
Changelog: [internal]
Remove the feature flag to disable the event loop on bridgeless, as we no longer have a use case for it. From now on, we can be 100% certain that Bridgeless == Event Loop!
Reviewed By: sammy-SC
Differential Revision: D68270102
fbshipit-source-id: c661bf11f51d4044f9f485b971c43f03197e2983
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48853
## Motivation
Modernising the react-native codebase to allow for ingestion by modern Flow tooling.
## This diff
- Updates the `ReactNativeVersion` template to use `export` syntax.
- Regenerates the `ReactNativeVersion.js` file with the new template.
- Updates jest mock.
- Updates the public API snapshot *(intented breaking change)*
Changelog: [Internal]
Reviewed By: robhogan
Differential Revision: D68492723
fbshipit-source-id: daa55d3d553aca562cf2e091cd24546681a8db2f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48856
Refactor setLayoutAnimationEnabledExperimental in BridgelessUIManager.js to be a no-op in the new architecture
Changelog:
[Android][Fixed] - Make `setLayoutAnimationEnabledExperimental` a no-op in Bridgeless
Reviewed By: javache
Differential Revision: D68313694
fbshipit-source-id: 7a79fad72b1eeda5af3ff629a609d53e4f08f26d
Summary:
changelog: [internal]
Pull Request resolved: https://github.com/facebook/react-native/pull/48793
Adds new method `dispatchNativeEvent` to Fantom give option to dispatch fake native events.
The API is expanded in subsequent diffs. The version introduced in this diff supports only dispatching event without payload and without any options.
Reviewed By: rubennorte
Differential Revision: D68331986
fbshipit-source-id: 075360e1d6874794ba6df966087fbe6a0a820cbc
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48767
## Motivation
Modernising the react-native codebase to allow for ingestion by modern Flow tooling.
## This diff
- Updates a handful of components in `Libraries/Components` to use `export` syntax
- `export default` for qualified objects, many `export` statements for collections (determined by how it's imported)
- Appends `.default` to requires of the changed files.
- Updates test files.
- Updates the public API snapshot (intented breaking change)
Changelog:
[General][Breaking] - Files inside `Libraries/Components` use `export` syntax, which requires the addition of `.default` when imported with the CJS `require` syntax.
Reviewed By: yungsters
Differential Revision: D68335872
fbshipit-source-id: eb0c67039edfe92e9e133726f6b01900dd2c2322
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48837
ViewHierarchyUtil is a class with package visibility and it is not used, let's delete it
changelog: [internal] internal
Reviewed By: shwanton
Differential Revision: D68467507
fbshipit-source-id: d1bd5b279a26fcecb4fed590ad2de75937b54aa6
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48827
This teaches the CSSColor parser how to handle these functions.
There are a surprising amount of edge cases here, including many syntactic options added by the CSS Color Module 4 spec, and some technically invalid examples supported by normalize-color, sometimes working in Chrome.
I used the combination of the spec, and existing functionality and tests for `normalize-color`, with the end result supporting a superset of the functionality of both, while being a bit more permissive than either.
I still need to add support for the other color functions, and will probably want to share code here, but for now, just implemented everything for the rgb values as a start.
Changelog: [Internal]
Reviewed By: javache
Differential Revision: D68362477
fbshipit-source-id: 62973ba2f8361b6a43c7cf9a96029147f84582d2
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48826
This ends up being a not uncommon pattern, so lets make it a bit easier.
Changelog: [Internal]
Reviewed By: lenaic
Differential Revision: D68359563
fbshipit-source-id: 94283c8815cf9dd2f6c0d52762d21232383fb311
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48825
Right now we preserve the state of the CSSSyntaxParser across multiple data type parse attempts, so long that a data type parser consumes an additional component value. This requires data type parsers to be careful to not consume additional forward tokens if it may lead to parse error. We can make this model a lot simpler by instead resetting the parser to original state on data type parse error.
We also introduce `peekComponentValue`, and visitor-less `consumeComponentValue` as a convenience, to allow data type parsers to view future component values without advancing, even if the data type parser does return a value, without needing to manually clone the parser.
Changelog: [Internal]
Reviewed By: lenaic
Differential Revision: D68357624
fbshipit-source-id: 6ff77bab8ac9eabd5dccea52daa85bbd32b5f2b6
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48823
This diff is fixing the execution of Events that are sent early in the rendering of surfaces.
This diff fixes a bug in the queueing of events that are built with not surfaceId (-1), the fixes is to call getSurfaceManagerForView() to retrieve the proper surfaceId (as we do in the execution of events)
calling getSurfaceManagerForView() has a perf hit, we believe this won't be a problem because this method will only be called in edge cases (no surfaceId and early execution of events)
changelog: [Android][Fixed] Fix execution of early InteropEvents
Reviewed By: shwanton, lenaic
Differential Revision: D68454811
fbshipit-source-id: a79be0b392004e645c48d1683bba774b6b597ca0
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48819
Currently, `VirtualizedList-test.js` has a subtle dependency on how asynchronous operations are queued. Specifically, it depends on...
- `Batchinator` to use `setTimeout` for...
- `InteractionManager` to use `setImmediate` for...
- `InteractionManager` to resolve a promise via microtask.
As a consequence, any changes to this queueing logic (e.g. eliminating the unnecessary `setImmediate` and microtask) unnecessarily breaks these unit tests.
This changes the Jest unit tests to instead use `jest. advanceTimersToNextTimer(<step>)` instead of `jest.runOnlyPendingTimers()` so that the unit tests are no longer dependent on these specific queueing logic.
Changelog:
[Internal]
Reviewed By: NickGerleman
Differential Revision: D68449850
fbshipit-source-id: 382b1c0a0d8fade873ccf17a9deb3622a83b8163
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48800
This just converts yet another class from Java to Kotlin
Changelog:
[Internal] [Changed] -
Reviewed By: javache
Differential Revision: D68417564
fbshipit-source-id: 167a27f7f80125cc81a4a0ad57952f1149ef4d7d
Summary:
This collapses all the 0.77 changelog from the various RCs into a single entry.
## Changelog:
[Internal] [Changed] -
Pull Request resolved: https://github.com/facebook/react-native/pull/48811
Test Plan: N/A
Reviewed By: robhogan
Differential Revision: D68438948
Pulled By: cortinico
fbshipit-source-id: 0ef57432901198602863e9769cd2662a0f4e30f6
Summary:
This PR adds missing nonnull annotations to make working with Swift better 👍🏻
## Changelog:
[IOS] [ADDED] - Missing nonnull annotations for RCTArchConfiguratorProtocol, RCTUIConfiguratorProtocol.h
Pull Request resolved: https://github.com/facebook/react-native/pull/48817
Test Plan: CI Green
Reviewed By: cortinico, dmytrorykun
Differential Revision: D68443519
Pulled By: cipolleschi
fbshipit-source-id: 53bf128c65421789034f45f637a08ed996684c6f
Summary:
The `ReactNativeVersion.h` file currently contains a `struct` that holds the React Native version (e.g. `1000.0.0`, as individual ints).
For some libraries, we need to conditionally compile out code when using an older React Native version, and that's where library authors usually set compiler flags that hold the react native version - those are usually resolved using a `node require.resolve` script in the Podspec or build.gradle, adding unnecessary complexity.
With this PR this becomes obsolete as we now create a `#define` that holds the React Native version directly - so e.g.
```cpp
#define REACT_NATIVE_VERSION_MAJOR 0
#define REACT_NATIVE_VERSION_MINOR 67
#define REACT_NATIVE_VERSION_PATCH 1
```
..which we can then use to conditionally compile some code in our libraries:
```cpp
#include <React/ReactNativeVersion.h>
#if REACT_NATIVE_VERSION_MINOR >= 76
// new stuff
#else
// fallback
#endif
```
## Changelog:
[INTERNAL] [ADDED] - Added `REACT_NATIVE_VERSION_*` C++ defines to `ReactNativeVersion.h`
<!-- 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
Pull Request resolved: https://github.com/facebook/react-native/pull/48813
Test Plan: Just import the header in a library and check if the defines exist!
Reviewed By: cortinico
Differential Revision: D68441049
Pulled By: javache
fbshipit-source-id: 55ac8875e1a3f8ad8b9d12795fed4204e9c5bb77
Summary:
As in the title, follow up from https://github.com/facebook/react-native/issues/48075 which added unit tests for this class.
## Changelog:
[INTERNAL] - Convert com.facebook.react.modules.network.ResponseUtil to Kotlin
Pull Request resolved: https://github.com/facebook/react-native/pull/48781
Test Plan:
```bash
./gradlew :packages:react-native:ReactAndroid:test -Dtest.single=com.facebook.react.modules.network
```
Reviewed By: javache
Differential Revision: D68393938
Pulled By: Abbondanzo
fbshipit-source-id: ed214b29ad9248c2da2e2653e75447b0a7e05a26
Summary:
Was looking into improving some of the type definitions for the `ToastAndroid` component and found out also that some of the options don't work anymore from API 30 – I revamped a bit these definitions to reflect that as I saw questions about it online. These updates could also be added to the website later.
## Changelog:
[GENERAL][CHANGED] - Improve ToastAndroid jsdocs
Pull Request resolved: https://github.com/facebook/react-native/pull/48779
Test Plan: Check the jsdocs look good when using the `ToastAndroid` component in the code.
Reviewed By: cortinico
Differential Revision: D68393949
Pulled By: Abbondanzo
fbshipit-source-id: 4be318062483db5be3825b7b21f540030f6c5b10
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48765
## Motivation
Modernising the react-native codebase to allow for ingestion by modern Flow tooling.
## This diff
- Updates a handful of components in `Libraries/Components` to use `export` syntax
- `export default` for qualified objects, many `export` statements for collections (determined by how it's imported)
- Appends `.default` to requires of the changed files.
- Updates test files.
- Updates the public API snapshot (intented breaking change)
Changelog:
[General][Breaking] - Files inside `Libraries/Components` use `export` syntax, which requires the addition of `.default` when imported with the CJS `require` syntax.
Reviewed By: cortinico
Differential Revision: D68330077
fbshipit-source-id: 6bf00c82f72dbcaaa26470d7ea0917639fc3de4a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48763
## Motivation
Modernising the react-native codebase to allow for ingestion by modern Flow tooling.
## This diff
- Updates files in `Libraries/BugReporting`, `Libraries/vendor`, `Libraries/Vibration` and `Libraries/YellowBox` to use `export` syntax
- `export default` for qualified objects, many `export` statements for collections (determined by how it's imported)
- Appends `.default` to requires of the changed files.
- Updates Jest mocks.
- Updates the public API snapshot (intented breaking change)
Changelog:
[General][Breaking] - Files inside `Libraries/BugReporting`, `Libraries/vendor`, `Libraries/Vibration` and `Libraries/YellowBox` use `export` syntax, which requires the addition of `.default` when imported with the CJS `require` syntax.
Reviewed By: cortinico
Differential Revision: D68329075
fbshipit-source-id: 7079a54ce3631171f8d7559bc33cab014df1d16d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48761
## Motivation
Modernising the react-native codebase to allow for ingestion by modern Flow tooling.
## This diff
- Updates files in Libraries/Blob to use `export` syntax
- `export default` for qualified objects, many `export` statements for collections (determined by how it's imported)
- Appends `.default` to requires of the changed files.
- Updates the public API snapshot (intented breaking change)
Changelog:
[General][Breaking] - Files inside `Libraries/Blob` use `export` syntax, which requires the addition of `.default` when imported with the CJS `require` syntax.
Reviewed By: cortinico
Differential Revision: D68326103
fbshipit-source-id: ff0b5e0125987ed44b34c35f39af1eefa9799d8f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48799
This change moves the same scripts we have to prepare the HelloWorld project to RNTester.
This is something we forgot to do when we were decoupling the reacrt-native from the community CLI.
This is also the base to start deprecating cocoapods and add more configuration steps for the project.
## Changelog:
[Internal] - Copy cli.js script from HelloWorld to RNTester
Reviewed By: cortinico
Differential Revision: D68413419
fbshipit-source-id: 7cf19d86bd3c1beb0c1e7f3380331174352a1651
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48787
For reasons that will become clear in the next diff, I'm adding more assertions for things like LogBox being called, and the console being called. I also updated the patterns of things like `toHaveBeenCalledWith` vs `toBeCalledWith` so they're consistent throughout the file.
## Changelog:
[internal] - Add tests to ExceptionManager
Reviewed By: hoxyq
Differential Revision: D68397529
fbshipit-source-id: b05073630969c40a86546a6f5c4244836b636ee1
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48784
React requires React DevTools to be the first patch for console methods, because it assumes it is the _last_ on the stack called before calling the real console.
This is because React DevTools adds additional formatting for things like StrictMode dimming, and component stack formatting for browser specific consoles like Chrome and Firefox, where the DevTool extension runs.
If it's not the first patch, then other patches (like logging, or LogBox) will pick up the DevTools additions and include them, which breaks other tools (like the issue show in the screen below).
This diff ensures React DevTools is patched before the React Native console reporter by moving it to `setupErrorHandling`.
## Changelog:
[General] [Fixed] - Always patch React DevTools first so StrictMode dim chars are excluded from logs/logbox.
## Other places?
I'm not sure how we should handle this for the console polyfill or inside useAlwaysAvailableJSErrorHandling yet.
## Screens
### Before
3 errors, 1 with ANSI dim chars:
{F1974436874}
### After
Just 1:
{F1974436879}
Reviewed By: hoxyq
Differential Revision: D68380665
fbshipit-source-id: 4f5353bb8da0038088c05ef7414bf91e965c73e2
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48785
## Overview
This change adds code frames for component stacks if it differs from the call stack frame.
## Background
After adding native stack based stack frames, which we already symbolicate, we had the capability to show a code frame for component stacks as well as the stack frame (if they differ).
However, this usually wasn't that useful, because the native component stack was unlikely to be more useful than the component stack (see the comparisons below for key errors).
## Owner stacks
With owner stacks the component frame is a lot more useful and in many cases are better at showing the location than the call stack frame.
## Example Screens
Before:
{F1974436645}
After (with owner stacks):
{F1974436723}
Changelog:
[General][Added] - Add owner stack code frames to LogBox
Reviewed By: hoxyq
Differential Revision: D68285627
fbshipit-source-id: 541cecbd4786fffd1970d2e85e659757e3f81604
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48782
React currently has a babel transform to replace all `console.error` calls with a special function for RN and www. The function adds component stacks, which doesn't make sense in an owner stack world because:
- not all console.error calls are replaced, creating inconsistency
- oss web users don't append component stacks to console.log any more
- component stacks can be accessed for DEV modals like logbox with `captureOwnerStack`
- owner stacks are already added to the console with createTask if you use console.error directly
- the redirection is the single greatest source of fragility in the logbox reporting pipeline
So we're removing this as part of the owner stack rollout. This should only be enabled with owner stacks.
## Example Screen
Before:
{F1974436644}
After:
{F1974436645}
## Changelog:
[General] [Added] - Add full owner stack support to React Native
Reviewed By: hoxyq
Differential Revision: D68285628
fbshipit-source-id: 9772593d7ac6e012392d18c6796580c14c852074
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48770
Splits CSSValueParserTest to be file per data type to better match new structure, before we introduce more complexity and tests for CSS colors.
Changelog: [Internal]
Reviewed By: joevilches
Differential Revision: D68351049
fbshipit-source-id: 1a4218e49c8c8adb056fac1dd67f064a4f890775
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48769
Must function notations do not require delimiting commas, with color function "legacy" syntax being an exception.
E.g.
```
rgb() = [ <legacy-rgb-syntax> | <modern-rgb-syntax> ]
rgba() = [ <legacy-rgba-syntax> | <modern-rgba-syntax> ]
<legacy-rgb-syntax> = rgb( <percentage>#{3} , <alpha-value>? ) |
rgb( <number>#{3} , <alpha-value>? )
<legacy-rgba-syntax> = rgba( <percentage>#{3} , <alpha-value>? ) |
rgba( <number>#{3} , <alpha-value>? )
<modern-rgb-syntax> = rgb(
[ <number> | <percentage> | none]{3}
[ / [<alpha-value> | none] ]? )
<modern-rgba-syntax> = rgba(
[ <number> | <percentage> | none]{3}
[ / [<alpha-value> | none] ]? )
```
Theoretically, this should mean an expression like `rgb(1, 2 0)`, which mixes both comma and whitespace delimeters would be malformed, but both Chrome, and RN's existing `normalize-color` package support this, so to make this pattern easier, we add the ability to scan based on using either whitespace or comma as component value delimiter.
Interestingly, the current spec revision also allows `rgb` function with alpha, or `rgba` function without alpha, which Chrome correctly supports, but `normalize-color` does not.
Changelog: [Internal]
Reviewed By: joevilches
Differential Revision: D68349385
fbshipit-source-id: 05cd756ee20227af4d9ec20edc9e7cfc8cc2c071
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48768
Right now, if something like `CSSColor` accepted a function notation block (e.g. for `rgb()` syntax), it is given a syntax parser which may extend beyond the scope of the current function block.
This is confusing, but also problematic for the `CSSSyntaxParser` block visiting logic to validate a correct scope exit.
This change makes it so that the `CSSSyntaxParser` passsed to `CSSDataTypeParser` for function and simple blocks is limited to the syntax within the given block. This prevents extra visiblity beyond the block we are trying to parse, and allows the function/simple block visitor to reliably fail parsing if the block is not correctly terminated, or there are unconsumed component values within the block not handled by the data type parser.
Changelog: [Internal]
Reviewed By: joevilches
Differential Revision: D68340127
fbshipit-source-id: 402f2eabdf6df7bce99223c966f22c2158103be5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48737
## Motivation
Modernising the react-native codebase to allow for ingestion by modern Flow tooling.
## This diff
- Updates files in Libraries/AppState and Libraries/BatchedBridge to use `export` syntax
- `export default` for qualified objects, many `export` statements for collections (determined by how it's imported)
- Appends `.default` to requires of the changed files.
- Updates Jest mocks.
- Updates the public API snapshot (intented breaking change)
Changelog:
[General][Breaking] - Files inside `Libraries/BatchedBridge` and `Libraries/AppState` use `export` syntax, which requires the addition of `.default` when imported with the CJS `require` syntax.
Reviewed By: robhogan
Differential Revision: D68275767
fbshipit-source-id: 97dc84c04a8dd9c9022e53fc4595302efc848338
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48745
This is the first step in a series of diff to make RNGP more Gradle-compliant (specifically for the sake of configuration caching).
Specifically the problem in those 2 tasks is that we're accessing `project.copy()` and other
functions from the `project` field.
The project should never be accessed at execution time. See more on this here:
https://docs.gradle.org/8.12/userguide/configuration_cache.html#config_cache:requirements:use_project_during_execution
This diff fixes it.
Changelog:
[Internal] [Changed] -
Reviewed By: cipolleschi
Differential Revision: D68282777
fbshipit-source-id: 6d474f266b5bc50fba57c8cd478173c995864bbc
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48764
When working on the [commit](https://github.com/facebook/react-native/commit/eced906bedf0c3d2bbc592cc27965c88278abae3) I forgot a bit that makes sure the New Architecture was the default.
This is change set the New Arch as default properly in RCTAppDelegate. Plus it refreshes the GHA caches by updating the Podfile.lock
## Changelog:
[Internal] - Ensure that the New Arch is turned on in RCTAppDelegate
Reviewed By: alanleedev
Differential Revision: D68329797
fbshipit-source-id: 9df5f805f7d3506129909f0adae5ff597f33ce3c
Summary:
In the `displayModeToInt()` function, there is no default case defined which is causing the following warning in React Native Windows when trying to build on the New Architecture:
```
##[error]node_modules\react-native\ReactCommon\react\renderer\uimanager\primitives.h(163,1): Error C2220: the following warning is treated as an error
D:\a\_work\1\s\node_modules\react-native\ReactCommon\react\renderer\uimanager\primitives.h(163,1): error C2220: the following warning is treated as an error [D:\a\_work\1\s\vnext\Microsoft.ReactNative\Microsoft.ReactNative.vcxproj]
##[warning]node_modules\react-native\ReactCommon\react\renderer\uimanager\primitives.h(163,1): Warning C4715: 'facebook::react::displayModeToInt': not all control paths return a value
D:\a\_work\1\s\node_modules\react-native\ReactCommon\react\renderer\uimanager\primitives.h(163,1): warning C4715: 'facebook::react::displayModeToInt': not all control paths return a value [D:\a\_work\1\s\vnext\Microsoft.ReactNative\Microsoft.ReactNative.vcxproj]
```
Adding the default case removes the warning and resolves the issue. Not sure if using the -1 value in this case is appropriate.
## 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] - Add default case to `displayModeToInt()` function
Pull Request resolved: https://github.com/facebook/react-native/pull/48711
Test Plan: Tested on React Native Windows New Arch application and was able to build successfully.
Reviewed By: javache
Differential Revision: D68265335
Pulled By: rshest
fbshipit-source-id: 4724a4c7391b9bf651a122f5de227a0c5e0b6212
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48753
[This commit](https://github.com/facebook/react-native/commit/cc89ddd50bed869013082ad98eb0555a386cf7c9) introduced a dependency between RCTFabric and RCTAnimation because RCTFabric is now using `RCTInterpolateColorInRange` which is defined in `RCTAnimation`.
To unblock the CI, I'm adding the dependency to the RCTFabric.podspec
However, I'm not convinced that this is the proper fix. We should move the function to a common dependency between RCTFabric and RCTAnimation. Probably in `RCTUtils`.
## Changelog:
[Internal] - Fix CI by making RCTFabric depend on RCTAnimation
Reviewed By: GijsWeterings
Differential Revision: D68322935
fbshipit-source-id: 57c8833e348fb69dc1b1703ffeedd3383405b4f8
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48754
The React-FabricComponent was importing some non-existent files when we build for iOS with cocoapods.
This change fixes it.
## Changelog
[Internal] - Only include ReactCommon and ios platform for TextInput
Reviewed By: GijsWeterings
Differential Revision: D68319960
fbshipit-source-id: 45ddd7765f6afc0efef6dc1dadea782871fbd779
Summary:
- Adds support for color transition hint syntax in linear gradients. e.g. `linear-gradient(red, 20%, green)`
- Adds `px` support. Combination of `px` and `%` also works.
- Simplified color stops parsing.
- The `processColorTransitionHint` and `getFixedColorStops` is moved to native code so it can support combination of `px` and `%` units as it requires gradient line length, which is derived from view dimensions and gradient line angle.
- Follows CSS [spec](https://drafts.csswg.org/css-images-4/#coloring-gradient-line) (Refer transition hint section) and implementation is referred from [blink engine source](https://github.com/chromium/chromium/blob/a296b1bad6dc1ed9d751b7528f7ca2134227b828/third_party/blink/renderer/core/css/css_gradient_value.cc#L240).
## Changelog:
[GENERAL] [ADDED] - Linear gradient color transition hint syntax and `px` unit support.
Pull Request resolved: https://github.com/facebook/react-native/pull/48410
Test Plan:
Added testcase in processBackgroundImage-test.ts and example in LinearGradientExample.js
<img width="500" alt="Screenshot 2025-01-05 at 11 38 13 PM" src="https://github.com/user-attachments/assets/62858bb7-1dbf-40cf-8dd4-ec0daf84ac1b" />
## Todo
Add testcases for `getFixedColorStops` and `processColorTransitionHint` in native code for both platforms. That's the only downside of moving it out of JS 🤦
Reviewed By: NickGerleman
Differential Revision: D67870375
Pulled By: joevilches
fbshipit-source-id: b91d741f3108c25df8000d220726bf180c64be60
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48718
This diff looks a bit scary, but it's mostly just structural changes of existing code and some deletion, on a well tested path 😅.
The current parser implementation tries to special case "basic" data types. When I was looking at how to add in support for more complex values, such as lists, function notations, and more compounded types, this distinction ends up not making much sense.
Instead of treating some types as basic, this diff instead moves to a model where a user can declare any structure as a `CSSDataType`, so long as they also supply a parser, which may be visited when iterating through CSS syntax blocks (preserved tokens, function blocks, or simple blocks, which probably won't be used). The user then specifies a list of supported CSS data types to parse, which invokes said parser, calling any defined methods for specific syntax. E.g.
```cpp
struct CSSNumber {
float value{};
};
template <>
struct CSSDataTypeParser<CSSNumber> {
static constexpr auto consumePreservedToken(const CSSPreservedToken& token)
-> std::optional<CSSNumber> {
if (token.type() == CSSTokenType::Number) {
return CSSNumber{token.numericValue()};
}
return {};
}
// Could also accept function block here as well (e.g. for future math
// expressions)
};
static_assert(CSSDataType<CSSNumber>);
```
```cpp
// Can be one of std::monostate (variant null-type), CSSWideKeyword,
// CSSNumber, CSSLength, or CSSPercentage. In this case, a CSSLength.
auto value = parseCSSProperty<CSSNumber, CSSLength, CSSPercentage>("5px");
```
This breaks a whole lot of assumptions I made a year ago, especially around `CSSValueVariant` which must now be able to handle arbitrary values. For now, for the sake of simplicity, I threw this out, and migrated parser code to use plain-old `std::variant`, which has a downside of being a bit less optimized in terms of storage. I also ended up completely throwing out `CSSDeclaredStyle`, since it would majorly need to change, and we're not going to be migrating style storage quite yet. This change also broke the `CSSProperties.h` property definitions and parsing shorthand a bit, which we will need for value processing later. I also opted to delete this for now (a big centralized list is the wrong structure anyways), but will likely copy bits from its source history later.
Another particular hairy bit, that likely won't bite us in practice, is that some strings may be parseable under different data types. This just adds caller requirement to order the types correctly, instead of precedence being implemented as part of the parser.
Changelog: [Internal]
Reviewed By: lenaic
Differential Revision: D68245734
fbshipit-source-id: 132b11053cf41f57483c89176a9a6dceebb69fad
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48716
`transparent` is specced as a special `<named-color>` outside the table the others were derived from. Let's add it, since it is supported today by `normalizeColor`.
https://www.w3.org/TR/css-color-4/#named-colors
Changelog: [Internal]
Reviewed By: rshest
Differential Revision: D68246770
fbshipit-source-id: 3ff7ed68ebb3d6bc59b24a25d35342620670f0c3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48691
We don't intent to use the prealpha logic in the near future so it makes sense to remove it for
to simplify our already complicated release process. We can always revive it if we wish.
Changelog:
[Internal] [Changed] -
Reviewed By: cipolleschi
Differential Revision: D68206014
fbshipit-source-id: f05eeae3997d52df1127852e03437a387a01f5ad
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48739
Follow-up to https://github.com/facebook/react-native/pull/48603
I realized there is one last `tasks.creating` invocation inside `hermes-engine` that needs migration. This fixes it.
Changelog:
[Internal] [Changed] -
Reviewed By: alanleedev
Differential Revision: D68276984
fbshipit-source-id: d58cf64cf41c7943464f15d12c7a04c3cc43ec7d
Summary:
https://github.com/facebook/react-native/issues/48225 fixed the same problem on Mac Catalyst build, but this crash also happen on a iOS build app running on Apple Silicon Mac.
The weak event emitter in AttributedString attributes is causing a serialization error when typing into a TextInput in a iOS build app running on Apple Silicon Mac.
## Changelog
[iOS][Fixed] - Workaround for a iOS build app running on Apple Silicon Mac(in Xcode Destination: "Mac(Designed for iPad)") TextInput crash due to serialization attempt of WeakEventEmitter
## 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
Pull Request resolved: https://github.com/facebook/react-native/pull/48583
Reviewed By: javache
Differential Revision: D68093083
Pulled By: cipolleschi
fbshipit-source-id: ac48be3305eb01ff2b62d63283b929e8ab6b250c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48543
Introduces a shared interface for methods that need to be called by the `ReactScrollViewAccessibilityDelegate`
Changelog: [Internal]
Reviewed By: alanleedev
Differential Revision: D67948151
fbshipit-source-id: 9bafaa0b5f9ad5ba2fd73b7b1929d784fa4951c9
Summary:
Since we updated Gradle, I've noticed several warnings related to configuration avoidance API:
https://docs.gradle.org/current/userguide/task_configuration_avoidance.html
We should be using tasks.registerting rather than tasks.creating as this is going to break in Gradle 9/10.
This PR fixes it.
## Changelog:
[INTERNAL] -
Pull Request resolved: https://github.com/facebook/react-native/pull/48603
Test Plan: CI
Reviewed By: javache
Differential Revision: D68270870
Pulled By: cortinico
fbshipit-source-id: 0ed44d903692c20d102143082fd0939f4dbeaa88
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48712
Currently, all scroll events can be throttled by the `scrollEventThrottle` value when the intention is only to throttle `onScroll` calls. As a result, the scroll view helper unintentionally drops events unrelated to scrolling, like momentum begin/end. It's imperative that these momentum events dispatch so the scroll view does not lock itself in an "animated" state on the JS side; if locked in an animation state, children of the scroll view will not receive touch events. This can happen when the throttle is sufficiently high and momentum scrolling completes before the throttle time has elapsed.
Changelog:
[Android][Fixed] - Scroll view throttle no longer impacts events other than `onScroll`
Reviewed By: javache, rshest
Differential Revision: D68234045
fbshipit-source-id: d5c11412d3f273811a45e6f61af08d3fcf9f61d5
Summary:
Continuing our usual journey, this time migrating MessageQueueThread. Was not expecting to see that many assertions in ReactContext.
One important thing to note on this PR: I had to add an extra Throw RuntimeException to `startNewBackgroundThread`. It already had one from the`dataFuture.getOrThrow()`, but if your thread is not associated with a Looper, calling `myLooper` (Line 203 of MessageQueueThreadImpl) Can return null. Until now, this would have been a `NPE`, i just decided to make it a `RuntimeException` with the message `Looper not found for thread`. Let me know if you want me to make that function return a nullable, or throw another message or exception, or if you want me to treat Looper as Nullable in the whole class.
## Changelog:
[INTERNAL] [FIXED] - Migrate MessageQueueThread and MessageQueueThreadImpl to Kotlin
Pull Request resolved: https://github.com/facebook/react-native/pull/48652
Test Plan: <img width="1318" alt="Screenshot 2025-01-13 at 21 03 00" src="https://github.com/user-attachments/assets/462cc8af-4648-4437-9260-5ffa6c69e763" />
Reviewed By: tdn120
Differential Revision: D68155120
Pulled By: rshest
fbshipit-source-id: 1082a832df5b1d8ee64ca7be26e4b85e79152f88
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48723
## Changelog:
[Internal] -
In certain scenarios `TouchEvent` can be initialized with "unexpected" event actions, such as `ACTION_SCROLL`.
This caused an exception , even though such scenarios may be legitimate.
Reviewed By: javache
Differential Revision: D68265040
fbshipit-source-id: d31881e03d9110bb4f6af38548a4f73a41c54d2b
Summary:
The testing script is making unnecessary call to `input keyevent 82` which causes the Android device to
open the menu.
## Changelog:
[Internal] [Changed] -
Pull Request resolved: https://github.com/facebook/react-native/pull/48707
Test Plan: Tested local with local device
Reviewed By: cipolleschi
Differential Revision: D68215641
Pulled By: cortinico
fbshipit-source-id: 3e2653d8aa0c1e6606d9921f7b3794d0d27ef3f0
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48715
{D68154908} fixed a problem with the `onAnimatedValueUpdate` listener not being correctly attached if `__attach` were called before `__makeNative` (which sets `__isNative` to true).
We're potentially seeing production symptoms of stuttering interactions and user responsiveness, after queuing up many operations. Our hypothesis is that in scenarios where `ensureUpdateSubscriptionExists` is being called during `__makeNative` (instead of during `__attach`), a backup of operations occurs leading to these symptoms.
This diff attempts to validate and mitigate this hypothesis by deferring `ensureUpdateSubscriptionExists` to when an `AnimatedValue` instance has had both `__attach` and `__makeNative` invoked.
Changelog:
[Internal]
Differential Revision: D68236594
fbshipit-source-id: 2089100a773ebfc161fb5b567123eb58a893939f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48708
{D68171721} [facebook/react-native#48678](https://github.com/facebook/react-native/pull/48678) mitigated the bug that necessitated this revert.
Changelog:
[General][Changed] - (Reapply) The `AnimatedNode` graph will not occur during the insertion effect phase, which means animations can now be reliably started during layout effects.
Reviewed By: sammy-SC
Differential Revision: D68217144
fbshipit-source-id: 6796440f2839d897158528642e07869951651327
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48703
## Motivation
Modernising the react-native codebase to allow for ingestion by modern Flow tooling
## This diff
- Updates files in Libraries/Alert and Libraries/ActionSheetIOS to use `export` syntax
- `export default` for qualified objects, many `export` statements for collections (determined by how it's imported)
- Appends `.default` to requires of the changed files.
- Updates Jest mocks of the related modules
- Updates the public API snapshot (intented breaking change)
Changelog:
[General][Breaking] - Files inside `Libraries/Alert` and `Libraries/ActionSheetIOS` use `export` syntax, which requires the addition of `.default` when imported with the CJS `require` syntax.
Differential Revision: D68210738
fbshipit-source-id: a984034b165908f75485f2bad33fcccadd865494
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48678
While diagnosing a recent issue in which `AnimatedValue` instances were not being correctly updated as expected, the insertion effects feature flag was identified as a root cause.
Upon further investigation, it appears that this is because the `onUserDrivenAnimationEnded` listener was not implemented the same way in the two feature flag states:
- When `useInsertionEffectsForAnimations` is disabled, `useAnimatedProps` listens to `onUserDrivenAnimationEnded` in a passive effect, after all nodes have been attached.
- When `useInsertionEffectsForAnimations` is enabled, `useAnimatedProps` listens to `onUserDrivenAnimationEnded` in an insertion effect when attaching nodes.
The bugs occurs because `useAnimatedProps` checks whether native driver is employed to decide whether to listen to `onUserDrivenAnimationEnded`. However, we do not know whether native driver will be employed during the insertion effect. (Actually, we do not necessarily know that in a passive effect, either... but that is a separate matter.)
This fixes the bug when that occurs when `useInsertionEffectsForAnimations` is enabled, by moving the listening logic of `onUserDrivenAnimationEnded` into a passive effect. This is the same way that it is implemented when `useInsertionEffectsForAnimations` is disabled.
Changelog:
[Internal]
Reviewed By: javache, sammy-SC
Differential Revision: D68171721
fbshipit-source-id: 50b23348fd4641580581cacebc920959651f96a7
Summary:
Whenever I run `yarn lint --fix` I noticed that this test is not formatted correctly. This fixes it.
## Changelog:
[Internal] [Changed] -
Pull Request resolved: https://github.com/facebook/react-native/pull/48692
Test Plan: CI
Reviewed By: sammy-SC
Differential Revision: D68207001
Pulled By: cortinico
fbshipit-source-id: 2a6c44ca02249f6662b03c87f0c4d4f3eb5a3054
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48690
We don't intent to use the prealpha logic in the near future so it makes sense to remove it for
to simplify our already complicated release process. We can always revive it if we wish.
Changelog:
[Internal] [Changed] -
Reviewed By: cipolleschi
Differential Revision: D68205691
fbshipit-source-id: 22a3416335052a4bf6a76faa6e6af622254a6e56
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48689
We don't intent to use the prealpha logic in the near future so it makes sense to remove it for
to simplify our already complicated release process. We can always revive it if we wish.
Changelog:
[Internal] [Changed] - RNGP - Cleanup prealpha logic from the Gradle Plugin
Reviewed By: cipolleschi
Differential Revision: D68205665
fbshipit-source-id: 81d5257544df97b566421164944e3b6e71f06635
Summary:
In the old arch, stylistic sets were supported however in the new arch support was not added. It seems that fontVariant support was actually initially missed on iOS fabric however a limited version was added in https://github.com/facebook/react-native/pull/44112 . I referenced that PR and also old arch implementation for these changes.
<img width="480" alt="Screenshot 2025-01-14 at 11 15 18 AM" src="https://github.com/user-attachments/assets/ec32a356-fadd-4281-83b9-15871bbcd18f" />
## Changelog:
<!-- 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
-->
[GENERAL] [ADDED] - Support stylistic sets for fontVariant
Pull Request resolved: https://github.com/facebook/react-native/pull/48674
Test Plan:
- Verified that the "Unsupported FontVariant" native log no longer displays on both platforms
- On iOS was easy to test in the tester app as SF supports stylistic sets by default:
```
<Text>
Stylistic{'\n'}
<Text>Normal: ${'\n'}</Text>
<Text style={{fontVariant: ['stylistic-four']}}>
Stylistic Four: $
</Text>
</Text>
```
<img width="391" alt="Screenshot 2025-01-14 at 11 59 29 AM" src="https://github.com/user-attachments/assets/1ede258e-783f-448f-8300-4c8c710796ef" />
- On Android I could not find any system fonts that support stylistic sets by default so I added Raleway and confirmed with a W character

I did not add font variant example to the tester apps as I felt it could be confusing for people at a glance to understand why there is only a system font example on iOS and why I chose the specific stylistic set.
Reviewed By: cipolleschi
Differential Revision: D68205738
Pulled By: javache
fbshipit-source-id: 03ce572d3c8ecafca71fe00fc0e88eeafc2558bb
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48664
Simplify ViewManager base-class by making `ViewManager`'s delegate non-nullable and using a single path for updating properties.
The ViewManagerDelegate API can map back to the original ViewManagerSetter API transparently, allowing us to remove the codepath from `ViewManagerPropertyUpdater`.
Changelog: [Android][Removed] `ViewManagerPropertyUpdater.updateProps` is deprected, use the related ViewManager APIs instead
Reviewed By: mdvacca, rshest
Differential Revision: D68120420
fbshipit-source-id: cd8b906dc36d4803dbe09ee0283654285eb81fd4
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48658
Migrate to Kotlin before I make further changes to this. Generics are really tricky due to our previous usage of raw generics on the Java side, but were worked around by some combination of unchecked cast and `Nothing`
Changelog: [Internal]
Reviewed By: mdvacca, rshest
Differential Revision: D68102210
fbshipit-source-id: 90013f09db0826f571a4e2a84132ae3b49fa299d
Summary:
This change improves the E2E testing by downloading the iOS RNTesterApp that is built in CI instead of building it locally. This should let us save 10 to 20 minutes when we test a new release.
## Changelog:
[Internal] - Use the RNTester app built in CI for release testing on iOS
Pull Request resolved: https://github.com/facebook/react-native/pull/48637
Test Plan:
- build the app in ci
- run `yarn test-e2e-local -c <my-token>` and `yarn test-e2e-local -h false -c <my-token>` and verify that the iOS app is not built, but run in the simulator
Reviewed By: cortinico
Differential Revision: D68161477
Pulled By: cipolleschi
fbshipit-source-id: 577d110f9ff0197a2d3348a08a60e60a4d0a752b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48547
For some unknown reason, we have been swallowing [`requestFocus`](https://developer.android.com/reference/android/view/View#requestFocus(int) calls since `TextInput` is a controlled component - meaning you can control this components value and focus state from JS. This decision was originally made pre 2015 and I cannot find the reason why
I do not think this makes sense. We can still request focus from JS, while allowing the OS to request focus as well in certain cases and we would still be controlling this text input.
This is breaking keyboard navigation. Pressing tab or arrow keys will no-op if the next destination is a `TextInput`. This is because Android will call `requestFocus` from [here](https://cs.android.com/android/platform/superproject/main/+/main:frameworks/base/core/java/android/view/ViewRootImpl.java;l=7868?q=performFocusNavigation) when handling key events. Notably, Explore By Touch (TalkBack) swiping gestures WOULD focus `TextInputs` since they go through `ExploreByTouchHelper` methods which we override to call the proper `requestFocusInternal()` method.
**In this diff**: I move the logic in `requestFocusInternal()` into `requestFocus`.
Changelog: [Android] [Fixed] - TextInputs can now receive focus via external keyboard
Reviewed By: NickGerleman
Differential Revision: D67953398
fbshipit-source-id: 506006769a7c8a63f0a9b7ce27cfbe8578777790
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48677
E2E tests are flaky again.
Let's bump maestro to see if stability improves.
This will also remove some noise from the logs, make them easier to read.
## Changelog
[Internal] - Bump maestro version
Reviewed By: cortinico
Differential Revision: D68160005
fbshipit-source-id: 40a25f974dfda75785bf08d8d236e771b44d13cf
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48672
## Changelog:
[General] [Fixed] - Buttons becoming unresponsive when transform is animated
# The problem
D67872307 changes when `ensureUpdateSubscriptionExists` is called to in `__attach`. This breaks the functionality because `__attach` is called before flag `__isNative` is set and subscriptions are never setup.
# Fix
The diff sets up subscriptions in `__makeNative` method.
Reviewed By: yungsters
Differential Revision: D68154908
fbshipit-source-id: e2ac108b064a66dda08902653d6bd20286f92458
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48666
The New Architecture sample is getting too big and the two views are not visible anymore.
I'm fixing this but having buttons side by side.
Changelog:
[Internal] [Changed] -
Reviewed By: cipolleschi
Differential Revision: D68153245
fbshipit-source-id: 5557fd40f81078fe3994d8efe0e73784e043ed78
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48670
The `LICENSE-docs` was needed when this repo was also containing the reactnative.dev docs.
As this is not the case anymore, this file is unncessary.
Changelog:
[Internal] [Changed] - Remove unnecessary LICENSE-docs
Reviewed By: cipolleschi
Differential Revision: D68156336
fbshipit-source-id: 489bf2cb95916c20eb61bfb00e34b8e271bc08e3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48656
While working on 0.78, I realize we were not testing the template app with JSC.
This change should fix this.
## Changelog:
[Internal] - Disable Hermes for the JSC E2E tests with Maestro
Reviewed By: cortinico, fabriziocucci
Differential Revision: D68147849
fbshipit-source-id: 4fbe005b5d04d6163a37041d1bd57fd48a9dfda8
Summary:
On bridgeless mode, `reactHost` is kept in memory even after destroying the `DefaultReactNativeHost` in brownfield scenario. Since it keeps references to the modules, they are not deallocated, and their `initialize` methods are not fired again when creating new instance of `react-native` later. It breaks the behavior of e.g. `react-native-screens`, which wants to listen for mutations and should get new `FabricUIManager`: https://github.com/software-mansion/react-native-screens/blob/20b7e83782cd5f79ddd0d61dadc13eeb4db4b258/android/src/main/java/com/swmansion/rnscreens/ScreensModule.kt#L45.
In this commit we change the `DefaultReactNativeHost.clear()` method to also invalidate the instance retained inside `DefaultReactHost`
## Changelog:
[ANDROID] [FIXED] - Make DefaultReactNativeHost.clear() also invalidate DefaultReactHost
Pull Request resolved: https://github.com/facebook/react-native/pull/48338
Test Plan: In brownfield scenario, destroy the instance of RN and see that modules are also destroyed.
Reviewed By: cipolleschi
Differential Revision: D67977140
Pulled By: cortinico
fbshipit-source-id: 1804f093ab1a905bef499078ddec32a13c50cc85
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48659
Changelog:
[Internal] - Replaced ExactReactElement_DEPRECATED with React.Node as a children type in ScrollViewStickyHeader
Reviewed By: fabriziocucci
Differential Revision: D68151420
fbshipit-source-id: d4406de67176ae1fea95b8b2ea85f41dc7f5045e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48660
RN-Tester is currently instacrashing on release due to a migration to Kotlin for HermesExecutor
This fixes it.
Changelog:
[Internal] [Changed] - Fix crash for Hermes Release due to HermesExecutor migration
Reviewed By: javache
Differential Revision: D68151666
fbshipit-source-id: 31f404ec518831cf2151dc670cdf8553427ae8ab
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48609
# Motivation
This is an attempt at modernizing the export syntax in some of the files in `Libraries/StyleSheet/`. It will allow these files to get properly ingested by modern Flow tooling.
# This diff
- Migrates the use of `module.exports` into `export default` for files located in `Libraries/StyleSheet/*.js`. Some files were omitted due to ballooning complexity, but will be addressed in other Diffs.
- Updating internal *require*s to use ".default", no product code seems to be affected.
- Migrating `require`s into `import`s where applicable, taking into account the performance implications (context: https://fb.workplace.com/groups/react.technologies.discussions/permalink/3638114866420225/)
- Updates the current iteration of API snapshots (intended).
- Updates `react-native-codegen`'s require of processColorArray, analogous to D42346452.
Changelog:
[General][Breaking] - Deep imports from some files in `StyleSheet/` can break when using the `require()` syntax, but can be easily fixed by appending `.default`
Reviewed By: javache
Differential Revision: D68017325
fbshipit-source-id: 3c5b94742f101db0b2914c91efab6003dba2b61a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48602
See context in D64532446 / https://github.com/facebook/react-native/pull/47086
These argument types were already consumed as nullable in various OSS libraries, which prevents correct Kotlin migration of this code.
Changelog: [Android][Changed] Deprecated ViewManagerDelegate#setProperty and ViewManagerDelegate#receiveCommand
Reviewed By: mdvacca
Differential Revision: D67277871
fbshipit-source-id: a0743584891c7b2b4b50fff11de15da0078d5a1a
Summary:
Migrating HermesExecutor and it's factory to Kotlin. Not sure if the TAG in HermesExecutorFactory is needed anymore or not, but the rest of the changes are pretty bog standard
## Changelog:
[INTERNAL] [FIXED] - Migrate HermesExecutor and HermesExecutorFactory to Kotlin
Pull Request resolved: https://github.com/facebook/react-native/pull/48617
Test Plan:
`./gradlew test`:
<img width="1266" alt="Screenshot 2025-01-11 at 04 01 12" src="https://github.com/user-attachments/assets/c0f1402c-796b-45fa-9ee3-41c5a5ffc356" />
Reviewed By: tdn120
Differential Revision: D68094681
Pulled By: cortinico
fbshipit-source-id: 16eae5c7c24886421cbd2cbf213295134a9c01cf
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48634
Changelog: [internal]
Just a placeholder to add new tests in the future.
Reviewed By: sammy-SC
Differential Revision: D68093342
fbshipit-source-id: 1e1d7fd71865763ef66b3bb1c76ff8b8ebca9fd9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48631
This step is already carried out by [generate-artifact-executor](https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/codegen/generate-artifacts-executor.js#L385) if needed.
We can remove it from cocoapods and this will make it easier to migrate away from them.
For 3rd party apps that uses a specific version of React Native, codegen is shipped in NPM as already built in the react-native/codegen package.
This change really affects only the React Native monorepo.
## Changelog
[Internal] - Remove build codegen step from cocoapods
Reviewed By: cortinico
Differential Revision: D68019743
fbshipit-source-id: 7aaf9275886ba8b86d38d943d2b26bd8eed11aa8
Summary:
While investigating https://github.com/facebook/react-native/issues/22186, some false positives showed up as some of the examples also have non-strict mode compatible code.
In this PR:
- Converting from class to functional components some TextInput and Image examples that were using `UNSAFE_` lifecycles.
- Unifying the auto-expanding example as it was exactly the same for iOS and Android.
## Changelog:
[INTERNAL] - Fix RNTester strict mode warnings for TextInput and Image examples
Pull Request resolved: https://github.com/facebook/react-native/pull/48619
Test Plan:
- Wrapped the the entry app component in `RNTesterAppShared.js` with `StrictMode` and verified that no warnings are shown anymore for the updated components.
- Checked the examples are still working as they were.
Reviewed By: fabriziocucci
Differential Revision: D68094402
Pulled By: rshest
fbshipit-source-id: e13878cb290735095afaef3d0377fd6dab33c380
Summary:
## Changelog:
[iOS] [Fixed] - Fix app becoming unresponsive when RefreshControl is used inside of <Modal />
Fixes: https://github.com/facebook/react-native/issues/48579
This is a UIKit bug. Switching to `didMoveToSuperview` resolves it.
Reviewed By: cipolleschi
Differential Revision: D68025099
fbshipit-source-id: 5d5e730f002ca93748674655a8393b770dc11611
Co-authored-by: kkafar <kacperkafara@gmail.com>
Summary:
Follow up from https://github.com/facebook/react-native/issues/48619. While investigating https://github.com/facebook/react-native/issues/22186, some false positives showed up as some of the examples also have non-strict mode compatible code.
In this PR: Converting from class to functional components some `AnExApp` examples that were using `UNSAFE_` lifecycles.
## Changelog:
[INTERNAL] - Fix RNTester strict mode warnings for AnExApp examples
Pull Request resolved: https://github.com/facebook/react-native/pull/48620
Test Plan:
- Wrapped the the entry app component in `RNTesterAppShared.js` with `StrictMode` and verified that no warnings are shown anymore for the updated components.
- Checked the examples are still working as they were.
Reviewed By: rshest
Differential Revision: D68092958
Pulled By: cipolleschi
fbshipit-source-id: 0f2cea3c679f8db0f13054e2851a73dc23a4c906
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48556
Changelog: [Internal]
the only place in view module that uses folly is `ViewPropsInterpolation.h` and that is only on Android.
This diff makes that dependency explicit and make it android only.
Reviewed By: javache
Differential Revision: D67942951
fbshipit-source-id: 2a1a41f5a4caba553e81d4bb78ac9c84ba90b60b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48584
[Changelog] [Internal] - Align logic in BaseTextInputShadowNode to calculate placeholder string with AndroidTextInputShadowNode
As a preparation for https://github.com/facebook/react-native/pull/48165 this aligns the implementation of those 2 methods
Reviewed By: NickGerleman
Differential Revision: D68004218
fbshipit-source-id: 722a33bb2665c59347ef1b0cd8ed7b35a05b2113
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48581
Previously the CXX only modules were not being inclued in the schema for these apps, and therefore weren't being caught by the compat check.
Reviewed By: cipolleschi
Differential Revision: D68000360
fbshipit-source-id: 5d56bc840bd220f3b8b814e5d90eb49d9a2beb0b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48548
In this diff I'm introducing the new public API ViewManagerInterface, this will be used in the next diffs of the stack to be implemented by all viewManagerInterfaces that are code-gen when using the new architecture
changelog: [Android][Changed] Introduce new public API ViewManagerInterface
Reviewed By: javache
Differential Revision: D67957886
fbshipit-source-id: 372bf99e4c977c3a4d2252b54371ec9f0dae6e9f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48582
[Changelog] [Internal] - Preparation for sharing common ShadowNode functionality in BaseTextInputShadowNode for Android
As a preparation for https://github.com/facebook/react-native/pull/48165 this change aligns the order of methods between:
- BaseTextInputShadowNode.h
- AndroidTextInputShadowNode.h
to make it easier for future changes to look at the delta between both implementations.
The goal is land https://github.com/facebook/react-native/pull/48582 which aligns the RN iOS and RN Android implementation
Reviewed By: NickGerleman
Differential Revision: D68001423
fbshipit-source-id: 5a5efa6542de676bd175744e7313c2b819e67f11
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48577
This has been enabled by default for about two and a half months. Let's clean up the old path.
Changelog: [Internal]
Reviewed By: javache
Differential Revision: D67985133
fbshipit-source-id: 024c1b3f10d7d23caba04ed4b6eec122de1a7c14
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48607
This feature flag acted as a killswitch but it was effectively never used, so we can clean it up now.
Changelog:
[Internal] [Changed] - Cleanup `enableAlignItemsBaselineOnFabricIOS`
Reviewed By: cipolleschi
Differential Revision: D68018624
fbshipit-source-id: 2340b505021a6632b07a3a872e35b35522b6f361
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48558
Running `yarn test-e2e-local -t "RNTester" -p "Android" -h true -c <TOKEN>`
currently fails if you start from RNTester Android.
That's because codegen is not built. This commit fixes it.
Changelog:
[Internal] [Changed] - Fix test-e2e-local with RNTester due to unbuilt codegen
Reviewed By: cipolleschi
Differential Revision: D67972074
fbshipit-source-id: c5c721a913b655675ed6e03e60efbb5ccdf613b2
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48568
We only need this dependency for internal builds, as we only rely on fbjni, which is its own open-source project.
This code was forked for open-source and not synced in anyway, which is a potential liability.
Changelog: [Internal]
Reviewed By: cortinico
Differential Revision: D67796633
fbshipit-source-id: 8609783ed0921a53a823658b9fd07a57651e91fe
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48567
We don't need the `FBLOG_PRI` macro which does unnecessary additional interpolation, and can instead directly call `__android_log_write`
Changelog: [Internal]
Reviewed By: NickGerleman
Differential Revision: D67461225
fbshipit-source-id: 3f2c881ce996b9638ef62e40ecc05f3e5a3e6ac1
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48606
Fixes https://github.com/facebook/react-native/issues/48009
The app is currently crashing on Android API lvl 26 attempting to invoke the method
`setEventEmitterCallback` which is defined inside BaseJavaModule.
I'm not entirely sure why this is happening only for API lvl 26, but I've verified
that by having the method protected, this doesn't happen anymore.
The visibility is consistent with the field `mEventEmitterCallback` which is also
protected and accessed to codegen. So let's keep them aligned for consistency.
Changelog:
[Android] [Fixed] - Fix crash for setEventEmitterCallback NoSuchMethodError on API lvl 26
Reviewed By: cipolleschi
Differential Revision: D68018506
fbshipit-source-id: 87eda718c9774b584abdf771eaad5833d452a1ea
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48595
Historically React Native used to include the JitPack repository be default in the default repositories.
This sadly exposes React Native projects to supply chain attacks as explained here:
https://blog.oversecured.com/Introducing-MavenGate-a-supply-chain-attack-method-for-Java-and-Android-applications/
Moreover, artifacts on Jitpack are not GPG signed it's complicated to verify the identity of artifact authors.
I'm introducing a Gradle property to control if Jitpack should be included by default or not.
User can control this behavior by changing their `gradle.properties` file as such:
```
includeJitpackRepository=false
```
The default value of this property is currently true, but we're looking into changing it to false in the future.
Changelog:
[Android] [Added] - Make the addition of JitPack repository configurable
Reviewed By: cipolleschi
Differential Revision: D68016028
fbshipit-source-id: 392513fef389a4835b4e00a8184459e00d51fdd0
Summary:
Adding .kotlin to gitignore. This folder starts to get used with K2 (with Kotlin 2.0) so we should be
adding it to the gitignore files
## Changelog:
[INTERNAL] - Add .kotlin to gitignore
Pull Request resolved: https://github.com/facebook/react-native/pull/48598
Test Plan: N/A
Reviewed By: cipolleschi
Differential Revision: D68018000
Pulled By: cortinico
fbshipit-source-id: 78be3597071d07d105145d8ba94cd83cbf4f21bc
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48592
Changelog: [General][Added] Add support for the second parameter of `console.table` to specify a list of columns to print in the table.
Reviewed By: javache
Differential Revision: D67803665
fbshipit-source-id: 354476404bad7cd2d280c8b3d963d5acba41f86b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48591
Changelog: [General][Changed] Improved formatting of values logged via `console.table` (including Markdown format).
This provides several improvements over the format of tables logged via `console.table`:
* Markdown format for easy integration in existing documents.
* Increased alignment with the spec and Chrome/Firefox implementations:
* Added index columns.
* Logged all available columns.
* Format for all types of values (including objects, functions, etc.).
Reviewed By: javache
Differential Revision: D67794858
fbshipit-source-id: 464c938ed51f28a8e071bc46f0f5b0d970005873
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48589
Changelog: [internal]
Added basic tests for the current implementation of the `console.table` polyfill (not the CDP implementation).
Reviewed By: sammy-SC
Differential Revision: D67791579
fbshipit-source-id: 80d64903a92e87e0724ed302ec0521419f45f9a7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48572
Because of this extra step on build-android, we're seeing the version 1000.0.0-<SHA>
on commits on the release branch. This prevents it.
Changelog:
[Internal] [Changed] - Do not reset rn-artifacts-version on release branch
Reviewed By: cipolleschi
Differential Revision: D67975049
fbshipit-source-id: dace7c931ec310538c11c4b9e544fdc2241a1d0c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48588
Changelog: [internal]
This has proved to be very CI and makes it fail a lot, so we're removing this for now.
Reviewed By: javache
Differential Revision: D67985917
fbshipit-source-id: 5ec7c1387ddfb8fb2a4e90450a98cb3caea9399f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48541
Shows how to use tintColor in conjunction with new XML file format, and serves as a good E2E test bench to ensure that drawables don't accidentally reuse the same state (if the underlying implementation isn't careful enough to call `buildCopy`, both icons will render red)
Changelog: [Internal]
Reviewed By: NickGerleman
Differential Revision: D64136753
fbshipit-source-id: 3bd0933e587364425ac14a0635690d4b274a55fe
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48523
Current AndroidTextInputShadowNode logic measures the height of the TextInput by fitting text into the constraints of the TextInput box. This results in the wrong height for single line TextInputs, since a single line TextInput is infinitely horizontally scrollable (whearas the outer TextInput component itself has a fixed width).
After this change, we measure text under single line textinputs with an infinite width constraint, then clamp to the final constraints of the TextInput, to better emulate what is happening under the hood.
iOS ended up solving this in a slightly different way, by measuring paragraph with `maximumNumberOfLines={1}` when not multiline, but think this is a bit more fraught. E.g. up until recently, it would have meant that the width could have been less than max width, depending on where line-breaking happened. I ended up duplicating the new logic to use for both instead (D66914447 will eventually deduplicate).
Changelog:
[Android][Fixed] - Fix incorrect height of single line TextInputs without definite size
Reviewed By: christophpurrer
Differential Revision: D67916827
fbshipit-source-id: b827185c4640835481794cb985c2b62dcf643abe
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48570
Changelog: [internal]
We're still iterating on this feature and making sure it reports stable results, so marking it as `unstable` to set expectations.
Reviewed By: andrewdacenko
Differential Revision: D67975844
fbshipit-source-id: 41e93cb9cb0c887a96178e4a4d5078d1899b2478
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48573
changelog: [internal]
remove main.cpp for cxxreact/tests. It is not needed for tests to work and it breaks build for C++ only tests.
Reviewed By: javache
Differential Revision: D67975182
fbshipit-source-id: b9cbc5b5b6a87aafc69448e99877e664ed2d5af2
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48561
The changelog for 0.77 needs some love as there are some entry that are incorrectly classified.
In this diff I took care of fixing the `Fixed` entries.
We need to go through all the other classes of entries.
## Changelog:
[Internal] - Refine 0.77 changelog
Reviewed By: cortinico
Differential Revision: D67972217
fbshipit-source-id: 343dd5a4e8a6cd6d6806447063594ba466db3b1e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48562
The changelog for 0.77 needs some love as there are some entry that are incorrectly classified.
In this diff I took care of fixing the `Changed` entries.
We need to go through all the other classes of entries.
## Changelog:
[Internal] - Refine 0.77 changelog
Reviewed By: cortinico
Differential Revision: D67941153
fbshipit-source-id: 59bc5a8a37242a1a5dc17baa4d85d0e18df35d46
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48563
The changelog for 0.77 needs some love as there are some entry that are incorrectly classified.
In this diff I took care of fixing the `Changed` entries.
We need to go through all the other classes of entries.
## Changelog:
[Internal] - Refine 0.77 changelog
Reviewed By: cortinico
Differential Revision: D67941107
fbshipit-source-id: 2352c901810587a0d4d5ccbbaa09960f03999378
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48564
The changelog for 0.77 needs some love as there are some entry that are incorrectly classified.
In this diff I took care of fixing the `Added` entries.
We need to go through all the other classes of entries.
## Changelog:
[Internal] - Refine 0.77 changelog
Reviewed By: cortinico
Differential Revision: D67940751
fbshipit-source-id: 345bd0e4e9564a1d8d16418f31ee6a917f27b202
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48565
The changelog for 0.77 needs some love as there are some entry that are incorrectly classified.
In this diff I took care of fixing the entries in the RCs.
We need to go through all the other classes of entries.
## Changelog:
[Internal] - Refine 0.77 changelog
Reviewed By: cortinico
Differential Revision: D67940292
fbshipit-source-id: 3373d2f2879c7137ad93b4b53672a0f8e322776f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48528
The changelog for 0.77 needs some love as there are some entry that are incorrectly classified.
In this diff I took care of fixing the `Breaking Changes` and the `Removed` entries.
We need to go through all the other classes of entries.
## Changelog:
[Internal] - Refine 0.77 changelog
Reviewed By: robhogan, cortinico
Differential Revision: D67937294
fbshipit-source-id: 18278abae4680a9dab3f46e41c1b7f7f8a7ad367
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48560
changelog: [internal]
add tests for width and height and margin style. Covering percentage-based dimensions and invalid inputs.
The test coverage is needed to make removal of folly::tryTo safe.
Reviewed By: rubennorte
Differential Revision: D67942139
fbshipit-source-id: c1e517dfb102eea892c998cf6ff4190fa69cdfa7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48555
Changelog: [internal]
Small move to align with the existing convention.
Add `README.md` file for feature flags in JS directory, to link to canonical docs.
Reviewed By: huntie
Differential Revision: D67897751
fbshipit-source-id: d5091ab4537701ee5cfdf29ebd0fe79e858e3134
Summary:
We currently see this error message on console:

This will silence it by piping stderr to /dev/null
## Changelog:
[INTERNAL] - Silence the `eden info` output from react-native-codegen
Pull Request resolved: https://github.com/facebook/react-native/pull/48540
Test Plan: CI
Reviewed By: robhogan
Differential Revision: D67948411
Pulled By: cortinico
fbshipit-source-id: f805634a65713f4f9bc2dce6d781664e7564bc96
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48428
Changelog: [internal]
Adding a few more tests for `ReactNativeElement` for symmetry with future tests for when it implements `EventTarget`.
Reviewed By: javache
Differential Revision: D67738147
fbshipit-source-id: 04c8f3539fefd15f7c778986eb9e39f2c2386b6a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48545
RootViewManager is meant to be used by the internals of React Native, ther are no external usages. I'm internalizing it
changelog: [internal] internal
Reviewed By: christophpurrer
Differential Revision: D67952865
fbshipit-source-id: 4c7f7de01c4de7ae00f62bd4f5b49e0082ec3f2b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48533
Replaces the custom `XmlFormat` introduced in https://github.com/facebook/react-native/pull/46711 with the built-in support from Fresco. Fresco utilizes a very similar approach to load binary XML files and offers the XML format as part of its built-in `DefaultImageFormats`
Changelog:
[Android][Changed] - Replaced custom XML decoder with Fresco's built-in decoder
Reviewed By: NickGerleman
Differential Revision: D66553842
fbshipit-source-id: 096e60140f893d461be1cdb48e250749e58bbb4c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48542
Updates Fresco from 3.5.0 to 3.6.0. Picks up a few new features and bug fixes for XML drawables, including a required fix that [automatically supplies the XML drawable factory to Fresco's PipelineDraweeControllerBuilder](https://github.com/facebook/fresco/commit/e6b052610aab461601cfabc00f7240758a415878). Without this change, we cannot switch from RN's custom XmlFormat to Fresco's built-in format
Changelog:
[Android][Changed] - Update Fresco to 3.6.0
Reviewed By: NickGerleman, rshest
Differential Revision: D67950225
fbshipit-source-id: 9afd87565a5f069493c9c5ef87977cbd6d7cf3d4
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48525
Fixes https://github.com/facebook/react-native/issues/48249
`TextMeasureCacheKey` hash and equality functions only incorporates the maximum width constraint. I'm guessing this was an attempt at an optimization, but it can lead to incorrect results in pretty trivial cases. E.g. if Yoga knows a definite size of `Text` in one dimension, and measures via `YGMeasureModeExactly`, we can have a minimum size corresponding specific to the style in which the text was laid out.
Changelog:
[General][Fixed] - Fix TextMeasureCacheKey Throwing Out Some LayoutConstraints
Reviewed By: christophpurrer
Differential Revision: D67922414
fbshipit-source-id: 0ee0220059fc4e4645b1684c42a0587fe728bedd
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48524
I've confirmed that we are no longer using `eslint-plugin-prettier` in Metro or React Native. This removes it from the package dependencies.
Changelog:
[Internal]
Reviewed By: huntie
Differential Revision: D67920511
fbshipit-source-id: 9c8036ccfb94d974d344d861942c076dc2b70125
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48511
{D60499583} added a new`onUserDrivenAnimationEnded` listener that requires `AnimatedValue` instances to have up-to-date values reported by `onAnimatedValueUpdate` (if native driver is in use).
Previously, the only way to ensure `onAnimatedValueUpdate` events were always fired to update JavaScript values in `AnimatedValue` instance was to attach a listener — even an empty one. This is exactly what D60499583 did: it traverses `props` for `AnimatedNode` instances and attaches listeners to them.
However, this is really inefficient and makes the code extra convoluted. Instead, this diff changes `AnimatedValue` so that it always subscribes to changes in `__attach`, and then it cleans up the extraneous props traversal and "empty listener" logic.
Changelog:
[Internal]
Reviewed By: javache
Differential Revision: D67872307
fbshipit-source-id: e7d7e486bbfd9ef03e2dd9f201089e2f68b2dbb2
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48529
These classes are identical and we already have a dependency on :uimanager in fabric.
Looking at OSS, I found no usages of `fabric.GuardedFrameCallback`.
Changelog: [Internal]
Reviewed By: rshest
Differential Revision: D67913226
fbshipit-source-id: 97d7a9b45b877b98e9549c71135bd9b21386d78c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48520
Both `ReactScrollViewHelper.parseSnapToAlignment` and `ReactScrollViewHelper.parseOverScrollMode` accept a nullable string. This is a precursor to migrating these files to Kotlin (since they're already marked as nullsafe). The prop itself is a nullable string so this should be reflected in the native types as well
Changelog: [Internal]
Reviewed By: tdn120
Differential Revision: D67911553
fbshipit-source-id: aabe55c2dc65a933b170d76b89f62f25493ab0ee
Summary:
This PR guards code that enables/disables keyboard shortcuts only on iOS (iPadOS included).

## Changelog:
[IOS] [FIXED] - enable/disable keyboard shortcuts only on iOS
Pull Request resolved: https://github.com/facebook/react-native/pull/48518
Test Plan: CI Green
Reviewed By: rshest
Differential Revision: D67900442
Pulled By: javache
fbshipit-source-id: 249a7c3124d02d2c30303d218e2b26e987ae1f0f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48514
Currently, `AnimatedNode` implements logic to start listening to updates on the current native node if a listener is added.
However, the `startListeningToAnimatedNodeValue` native module method only supports native tags for instances of `AnimatedValue`, which is a subclass of `AnimatedNode`. In fact…
* On Android, [`startListeningToAnimatedNodeValue`](https://fburl.com/code/bdsl4sro) throws if the node is not an instance of `ValueAnimatedNode`.
* On iOS, [`startListeningToAnimatedNodeValue`](https://fburl.com/code/hlpk1rzk) does nothing if node is not an instance of `RCTValueAnimatedNode`.
As such, this refactors `AnimatedNode` to never manage this subscription for native nodes. Instead, the logic is moved into the `AnimatedValue` subclass, ensuring that we never accidentally try to `startListeningToAnimatedNodeValue` with non-`AnimatedValue` native tags.
Changelog:
[Internal]
Reviewed By: javache
Differential Revision: D67884973
fbshipit-source-id: 5601efd8c29104a991301eabd97ddb88fd03c4a3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48513
While refactoring `Animated`, I noticed that many subclasses of `AnimatedNode` override `__attach` without invoking the superclass method, even though we do this for `__detach`.
In order to minimize surprise (e.g. if someone were to add logic into `AnimatedNode.prototype.__attach`), this diff updates all method overrides to invoke `super.__attach()`.
Changelog:
[Internal]
Reviewed By: javache
Differential Revision: D67884975
fbshipit-source-id: f3a5456cf944d4d70ba1cfe7c44897c110e5fc7e
Summary:
Some of these parameters were incorrectly marked as nullable during the Kotlin migration
Changelog: [Internal]
Reviewed By: tdn120
Differential Revision: D67091825
fbshipit-source-id: c660164e41ba7d47f1d1d3dc28a01b79b7c8cb03
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48337
`SurfaceRegistryBinding` refers to a forked `SurfaceRegistry` we had for a while in bridgeless but which was merged back into `AppRegistry`. Align the native name as well to make it explicit that all this class does is call into `AppRegistry`.
Changelog: [Internal]
Reviewed By: rshest
Differential Revision: D67342499
fbshipit-source-id: 797d8080611cb2576a2052999c2bf46d2eea9f72
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48336
`RN$AppRegistry` and `RN$stopSurface` are always set on the init path, regardless of bridgeless or not, so we can remove the fallback path and cleanup this code.
Changelog: [Internal]
Reviewed By: rshest
Differential Revision: D67342498
fbshipit-source-id: db47e52fee5075f11258364d82474579d2bb21f4
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48335
This API was never adopted or implemented on iOS, and is not compatible with bridgeless.
Changelog: [Internal]
Reviewed By: rshest
Differential Revision: D67342500
fbshipit-source-id: a6740514d0347c0f497e1aa2f850328cc4607d24
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48470
This introduces:
- `validate_rn_cpp_api`: run a shell script that fails if the user changes the C++ API. Importantly it produces an artifact with details to share with the user: `message`.
- `message` has to be extracted from `stdout`, which **get_user_message** does if the `validate_rn_cpp_api` action is not successful (**warning**).
- The then users `comment_to_signalhub` to share this as a warning to the user (until we're confident this entire stack is very stable, at which time we'll block).
The provides 2 classes of warning:
1. vanilla you've change the API,
2. you've change the API and haven't included the correct changelog.
Changelog: [Internal]
Reviewed By: GijsWeterings
Differential Revision: D67776215
fbshipit-source-id: 4ac7451c8ecef62ba968710ec41804ba42153976
Summary:
Time to migrate some of Hermes's instruments. I see that HermesMemoryDumper(`react/hermes/instrumentation/HermesMemoryDumper.h`) implements the interface on C++, ~but not sure if i need to update the `getId` call to just `id` (same with `getInternalStorage`) or if the interop between Kotlin and Java applies to these things as well. cortinico Any thoughts on your side would be appreciated.
HermesSamplingProfiler just became an object, since it was a singleton and a static anyway.
Here is what HermesMemoryDumper.h looks like:
<img width="1840" alt="Screenshot 2024-12-24 at 10 03 00" src="https://github.com/user-attachments/assets/d18e378a-9b23-47a9-83c9-402d29aeaa5f" />~
*Updated*: I ended up making them match the function signature on Cxx, because even if it does have that implicit behavior, doesn't feel right to tap into it like this.
## Changelog:
[INTERNAL] [FIXED] - Migrate HermesMemoryDumper and HermesSamplingProfiler to Kotlin
Pull Request resolved: https://github.com/facebook/react-native/pull/48378
Test Plan:
`/gradlew test`:
<img width="1840" alt="Screenshot 2024-12-24 at 09 54 29" src="https://github.com/user-attachments/assets/1b23fb6f-9da8-42e4-a348-7da868df77c1" />
Reviewed By: cortinico
Differential Revision: D67657481
Pulled By: philIip
fbshipit-source-id: 4fb5e003789d51d464d0cca5800704ea51324b69
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48487
[Changelog] [Internal] - Add getSurfaceProps helper method to SurfaceManager
When reload a reactHost we need to know which surface properties have been applied when starting the surface. This adds a utility function for that.
Reviewed By: rshest
Differential Revision: D67822459
fbshipit-source-id: 6d1f182514ed6e7ae8e31d3e1ca052c93bac2843
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48476
Command param array types were generating invalid schemas due to untyped parser code. The invalid schemas occurred for any alias type, including custom objects and basics like Int32. This was also inconsistent between Flow and TypeScript.
We already had one component utilizing this issue, so this just codifies that support into the schema so it reflects reality. This is only a partial solution. The more full solution would be to fully encode the custom types in the schemas like we do for Native Modules.
# More Information:
Tl;dr, DebuggingOverlay is abusing a FlowFixMe in codegen commands.
## The problem:
The [CodegenSchema](https://www.internalfb.com/code/fbsource/[d3ab2f79b377]/xplat/js/react-native-github/packages/react-native-codegen/src/CodegenSchema.js?lines=220) should be the source of truth for anything that can be in the schema. If something is in the schema that isn't allowed by the types, that's a bug. We have a bug. I'm adding compat-check support for components and it's blowing up on prod schemas because DebuggingOverlay causes an invalid schema.
## The details:
Support for Arrays as arguments in commands was added to the Codegen in D51866557. [Code Pointer](https://fburl.com/code/8yy1rm0p)
The intention appears to be to support arrays of primitives. There is a TODO for supporting complex types.
```
interface NativeCommands {
+addOverlays: (
viewRef: React.ElementRef<NativeType>,
overlayColorsReadOnly: $ReadOnlyArray<string>,
)
}
```
This support was added to TypeScript in D52046165 where it types the allowed Array arguments to be only
```
{
readonly type: 'ArrayTypeAnnotation';
readonly elementType:
| Int32TypeAnnotation
| DoubleTypeAnnotation
| FloatTypeAnnotation
| BooleanTypeAnnotation
| StringTypeAnnotation
};
```
However, because the Parsers are treating the input type as `any`, it isn't safe to pass through an input value into the schema as Flow won't catch mismatches.
The Flow parser just passes it through:
```
{
type: 'ArrayTypeAnnotation',
elementType: {
// TODO: T172453752 support complex type annotation for array element
type: paramValue.typeParameters.params[0].type,
}
```
Whereas the TypeScript parser has the more correct behavior of validating the inputs and returning specific outputs. Unfortunately, the return type is also typed here as $FlowFixMe, losing most of the benefits.
```
function getPrimitiveTypeAnnotation(type: string): $FlowFixMe {
switch (type) {
case 'Int32':
return {
type: 'Int32TypeAnnotation',
};
case 'Double':
return {
type: 'DoubleTypeAnnotation',
};
case 'Float':
return {
type: 'FloatTypeAnnotation',
};
case 'TSBooleanKeyword':
return {
type: 'BooleanTypeAnnotation',
};
case 'Stringish':
case 'TSStringKeyword':
return {
type: 'StringTypeAnnotation',
};
default:
throw new Error(`Unknown primitive type "${type}"`);
}
}
```
[DebuggingOverlay](https://fburl.com/code/zfe3ipq7) is abusing this gap in the Flow parser by sticking an Array of Objects in.
```
export type ElementRectangle = {
x: number,
y: number,
width: number,
height: number,
};
...
+highlightElements: (
viewRef: React.ElementRef<DebuggingOverlayNativeComponentType>,
elements: $ReadOnlyArray<ElementRectangle>,
) => void;
...
```
This isn't allowed in the schema, but it seems to fall through the holes of the flow parser and generators.
The resulting schema from Flow is this. Note the GenericTypeAnnotation which isn't allowed to be in the schema.
```
{
"name": "highlightElements",
"optional": false,
"typeAnnotation": {
"type": "FunctionTypeAnnotation",
"params": [
{
"name": "elements",
"optional": false,
"typeAnnotation": {
"type": "ArrayTypeAnnotation",
"elementType": {
"type": "GenericTypeAnnotation"
}
}
}
],
"returnTypeAnnotation": {
"type": "VoidTypeAnnotation"
}
},
```
The TypeScript parser fails with `Error: Unsupported type annotation: GenericTypeAnnotation`.
The generators don't seem to check beyond the ArrayTypeAnnotation so they fall through to generating generic arrays.
```
// ios
elements:(const NSArray *)elements
// android
ReadableArray locations
```
## So how do I fix this?
I think there are a couple of different options here. The key problem is that the Schema types need to represent reality of what can be in the schema.
1. We revert DebuggingOverlay to not use features that aren't supported (I assume nobody would be happy with this, but the change shouldn't have been made in the first place)
2. **(This is the approach taken in this diff)** We add MixedTypeAnnotation to the allowed types in Command arrays and have it generate that and add official support for that to the TypeScript parser as well. That is probably the quickest and easiest approach. It leaves the same type unsafety we have today on the native side.
3. NativeModules seem to have a lot more complex type safety here. They persist the alias type in the schema so that the CompatCheck can check them on changes. And then in C++ they generate structs and RCTConvert functions although for Java and ObjC it looks like they just use the same untyped native code. The matching approach here would be to add `aliasMap` and the whole data to the schema for commands, use that for the compat check, and still generate the same unsafe native code.
```
export type ObjectAlias = {|
x: number,
y: number,
|};
export interface Spec extends TurboModule {
+getAlias: (a: ObjectAlias) => string;
}
```
stores the ObjectAlias in the schema
```
{
"aliasMap": {
"ObjectAlias": {
"type": "ObjectTypeAnnotation",
"properties": [
{
"name": "x",
"optional": false,
"typeAnnotation": {
"type": "NumberTypeAnnotation"
}
},
{
"name": "y",
"optional": false,
"typeAnnotation": {
"type": "NumberTypeAnnotation"
}
},
]
}
},
"spec": {
"methods": [
{
"name": "getAlias",
"optional": false,
"typeAnnotation": {
"type": "FunctionTypeAnnotation",
"returnTypeAnnotation": {
"type": "StringTypeAnnotation"
},
"params": [
{
"name": "a",
"optional": false,
"typeAnnotation": {
"type": "TypeAliasTypeAnnotation",
"name": "ObjectAlias"
}
}
]
}
}
]
}
}
```
and then generates the appropriate structs on the native side and generates [this](https://www.internalfb.com/code/fbsource/[d3ab2f79b377]/xplat/js/react-native-github/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleHObjCpp-test.js.snap?lines=818)
```
Reviewed By: hoxyq
Differential Revision: D67806838
fbshipit-source-id: 31f20455c816fdb6b1a86f8f9d0f6f7d0a452754
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48475
This will be needed for the compat-check.
Changelog: [Internal]
Reviewed By: cipolleschi
Differential Revision: D67806831
fbshipit-source-id: b660c9557cafbfa2e713e85a0fd2bdc9edabf537
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48474
The previous definition said that you could put prop types into commands, which definitely isn't allowed.
For example, the schema would have allowed `WithDefault` types.
```
interface NativeCommands {
+methodInt: (viewRef: React.ElementRef<NativeType>, a: WithDefault<string, 'hi'>) => void;
}
```
This change separates out the things that are allowed in commands from what's allowed in props.
Commands should be very similar to what's allowed in native modules, but it isn't exact enough to be able to merge those.
## Changelog:
[General][Breaking] - Codegen: Separate component array types and command array types
Reviewed By: cipolleschi
Differential Revision: D67806818
fbshipit-source-id: 58e504fe2e2e5efa612e836b18af22a167e7ae2f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48473
This is such a simpler approach lol.
I'll need this later for when I want to pass in arrays or objects of these types to the compat check
Changelog: [internal]
Reviewed By: cipolleschi
Differential Revision: D67806812
fbshipit-source-id: 5cc361815fea901098d2931ba78293693ecc0a35
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48477
Over the years of copying and moving and renaming types through CodegenSchema, this type ended up in the Command params, although the Command parser doesn't allow it.
I made this change to a fixture:
{F1974104959}
and got this error
```
FAIL xplat/js/react-native-github/packages/react-native-codegen/src/parsers/flow/components/__tests__/component-parser-test.js
● RN Codegen Flow Parser › can generate fixture COMMANDS_DEFINED_WITH_ALL_TYPES
Unsupported param type for method "scrollTo", param "speed". Found UnionTypeAnnotation
127 | default:
128 | (type: empty);
> 129 | throw new Error(
| ^
130 | `Unsupported param type for method "${name}", param "${paramName}". Found ${type}`,
131 | );
132 | }
```
Also, a default value for enum an argument of a Command doesn't make sense anyways.
Commands should probably have support for enums and string literal unions, but that's out of scope here.
Still need to add to this vec\concat on www: https://www.internalfb.com/code/www/[ebfa58f888a6064e17879934d447f59bcc2b6951]/flib/intern/sandcastle/react_native/ota_steps/SandcastleOTACompatibilityCheckReportingStep.php?lines=62
Changelog: [internal]
Reviewed By: cipolleschi
Differential Revision: D67806808
fbshipit-source-id: f0f31cca30abbf61f569933ea7c49cf6bfd18a3f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48485
[Changelog] [Internal] - Make SurfaceManager const correct
This marks methods which don't modify member props as `const` and others as non `const`.
The current API signature is misleading as `const` methods do alter `mutable` members
Reviewed By: rshest
Differential Revision: D67820439
fbshipit-source-id: 6a991bd7ccbd464c2390e33e0c29b136892d65e0
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48486
[Changelog] [Internal] - Add RuntimeSchedulerKey constant for RuntimeScheduler lookup
Similar to https://github.com/facebook/react-native/pull/48127 this adds a contant to avoid typos when inserting or retrieving the RuntimeScheduler
Reviewed By: rshest
Differential Revision: D67822346
fbshipit-source-id: af982c6d4b875ffde06aae8e953c4892754a074b
Summary:
**iOS** does offer a native property for **UITextField** called `inputAssistantItem`. According to the [documentation](https://developer.apple.com/documentation/uikit/uitextinputassistantitem), we can hide the **"shortcuts"** by setting the `leadingBarButtonGroups` and `trailingBarButtonGroups` properties to empty arrays.
I propose adding a new property for **TextInput** in **React Native**, which would set these native properties to empty arrays. This new property could be called `disableInputAssistant` or `disableKeyboardShortcuts` and would be a `boolean`.
Developers can manage this behavior (the redo & undo buttons and suggestions pop-up hiding) after applying these native props.
https://github.com/react-native-community/discussions-and-proposals/discussions/830
## Changelog:
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
[IOS] [ADDED] - [TextInput] Integrate a new property - `disableKeyboardShortcuts`. It can disable the keyboard shortcuts on iPads.
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[IOS] [ADDED] - [TextInput] Integrate a new property - `disableKeyboardShortcuts`. It can disable the keyboard shortcuts on iPads.
Pull Request resolved: https://github.com/facebook/react-native/pull/47671
Test Plan:
Manual
1. Open TextInput examples.
2. Scroll down and reach the "Keyboard shortcuts" section.
3. Test each case.
Note: **TextInput** behaves the same as now when the new prop is not passed or is `false`.
https://github.com/user-attachments/assets/5e814516-9e6c-4495-9d46-8175425c4456
Reviewed By: javache
Differential Revision: D67451609
Pulled By: cipolleschi
fbshipit-source-id: 59ba3a5cc1644ed176420f82dc98232d88341c6e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48450
Changelog: [internal]
This implements a basic benchmark to compare `ReactFabricHostComponent` and `ReactNativeElement` (legacy and DOM implementations for native component instances).
Reviewed By: rshest
Differential Revision: D66698546
fbshipit-source-id: dd4bde833e5c9eb32c79a52d06f3c360fb012e23
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48451
Changelog: [internal]
Modifies the execution of benchmarks in CI to run benchmarks in test mode when they don't define a `verify` method.
If a benchmark uses `verify`, the test is meant to make sure that the benchmark doesn't regress in CI. If it doesn't, then running the benchmark on CI doesn't provide much value. In that case, we run a single iteration of each test case just to make sure things don't break over time.
Reviewed By: rshest
Differential Revision: D67637754
fbshipit-source-id: 33b78a9c809386cf2e040314b0427de6a53da3e3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48452
Changelog: [internal]
Implements a basic API to run benchmarks with Fantom (using `tinybench` under the hood):
```
import {benchmark} from 'react-native/fantom';
benchmark
.suite('Suite name', {
// options
})
.add(
'Test name',
() => {
// code to benchmark
},
{
beforeAll: () => {},
beforeEach: () => {},
afterEach: () => {},
afterAll: () => {},
},
)
.verify(results => {
// check results and throw an error if the expectations fail
});
```
Features:
* Print benchmark results in the console as a table.
* It opts into optimized builds automatically
* Verifies that optimized build is used (unless manually opting out of the check via `disableOptimizedBuildCheck`).
* Supports verification of results (making expectations and making the test fail if the benchmark doesn't meet some expectations).
Reviewed By: rshest
Differential Revision: D66926183
fbshipit-source-id: 61cfa7689ea7684eb870fbbc815b8d236a1871e6
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48453
Changelog: [internal]
Adds tinybench 3.1.0 (which has support for sync execution) and defined Flow types for the package.
Reviewed By: dmytrorykun
Differential Revision: D66698545
fbshipit-source-id: faf44add74e5711ac0d50794ce3360eedc45f0a5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48454
Changelog: [internal]
This implements a native module for Fantom to provide information about the CPU time used by the current process. This will be used by Fantom as the clock to run benchmarks more accurately.
It provides 2 implementations:
1. One based on `clock_gettime` with `CLOCK_THREAD_CPUTIME_ID` that's available on Linux. This provides the CPU time for the current process with decent precision (tens of nanoseconds).
2. A fallback implementation that uses a monotonic clock (not actually CPU time).
We can add a MacOS equivalent in a following diff.
Reviewed By: rshest
Differential Revision: D67596312
fbshipit-source-id: dd712c0171aa998ddbb6fed9187b3c467cd5417d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48504
Following D67857739, fixes accidental change where the removed `ReactNativeFeatureFlags` flag read was not replaced with `true`. This temporarily disabled Fusebox on `main`, where not configured via other build flags.
{F1974195736}
Changelog: [Internal]
Reviewed By: robhogan
Differential Revision: D67857739
fbshipit-source-id: 2a6fb2e6733035245e7ad959c7d3c650a9fde994
Summary:
Currently the `AppStateModule` doesn't have any unit tests in the Android implementation. This should make it safer for future changes or refactors.
## Changelog:
[INTERNAL] - Add `AppStateModule` Android unit tests
Pull Request resolved: https://github.com/facebook/react-native/pull/48492
Test Plan:
```bash
yarn test-android
```
Reviewed By: cipolleschi
Differential Revision: D67857498
Pulled By: cortinico
fbshipit-source-id: f90ced1cf02ac12a3438495b425ce7931decf19a
Summary:
As a prerequisite of enabling running unit tests on CI again, this PR suggests changes needed to the Ruby unit tests.
I've added comments on the code below, justifying changes where I deem a justification might be needed.
For use internally, I suggest accessing the folly_config and boost_config directly via the `Helpers` class instead of the `get_folly_config` and `get_boost_config` because these global functions are defined in `react_native_pods` which would be result in circular requires. An alternative would be to move these global functions to a separate file.
## Changelog:
[INTERNAL] [FIXED] - Fix Ruby unit tests.
Pull Request resolved: https://github.com/facebook/react-native/pull/48498
Test Plan:
- `cd packages/react-native`
- `./scripts/run_ruby_tests.sh`
Reviewed By: rshest
Differential Revision: D67852809
Pulled By: cipolleschi
fbshipit-source-id: 54d8bd708a9e3fd9aef3569ac89ec6ddcd244437
Summary:
This PR updates podspecs and resolve the following Xcode warnings:
```
Run script build phase '[CP-User] [RN]Check rncore' will be run during every build because it does not specify any outputs. To address this issue, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase.
```
```
Run script build phase '[CP-User] [RN]Check FBReactNativeSpec' will be run during every build because it does not specify any outputs. To address this issue, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase.
```
Enabling the `always_out_of_date` flag will uncheck "Based on dependency analysis" in a script phase.
## Changelog:
[INTERNAL] [FIXED] - Resolve run script build phase warnings
Pull Request resolved: https://github.com/facebook/react-native/pull/48495
Test Plan:
1. Run `bundle exec pod install` in the RNTester folder
2. Open the Xcode workspace
3. Check "Based on dependency analysis" is unchecked in the '[CP-User] [RN]Check rncore' script phase and the '[CP-User] [RN]Check FBReactNativeSpec' script phase
Reviewed By: cipolleschi
Differential Revision: D67835376
Pulled By: rshest
fbshipit-source-id: 11eec80d8172bc0129bfdcf7c79b5edf40427fab
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48490
## Changelog:
[Internal] -
This makes the `RootViewTest` and `JSPointerDispatcher` tests to use mockito-kotlin instead of the Java Mockito, which is the legacy of the conversion of the corresponding tests from Java.
Which:
* is the right thing to do, as we have more Kotlin-idiomatic tests
* helps with some Kotlin conversion with classes under test down the line, as Kotlin Mockito handles things like nullability etc properly
Reviewed By: javache
Differential Revision: D67824679
fbshipit-source-id: 055e9c7c4a33164ce6f4b9a5c47f16051d2a132f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48469
This change downloads the generated artifact and uses it in the E2E tests
## Context
While looking at the recent failures of the E2E tests, I realized that the Hermes, NewArch, Debug variant often fails to build, not to test, for some misconfiguration.
I also realized that we are already building that varaint successfully once, so why not reuse it? To reuse prebuilds, we need a few steps:
1. make sure we build all the variants we need
2. store the .app file as an artifact
3. download the artifact and use it in the E2E tests
## Changelog:
[Internal] - Build release variant for RNTester
Reviewed By: mdvacca
Differential Revision: D67800932
fbshipit-source-id: 6f3c8bbc42ad95cabab85dafff00e233a936d136
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48444
While debugging why the Debug variant was failing, I realised that the code to store video artifacts and the code to record the videos were not working properly.
This diff fixes that
## Context
While looking at the recent failures of the E2E tests, I realized that the Hermes, NewArch, Debug variant often fails to build, not to test, for some misconfiguration.
I also realized that we are already building that varaint successfully once, so why not reuse it? To reuse prebuilds, we need a few steps:
1. make sure we build all the variants we need
2. store the .app file as an artifact
3. download the artifact and use it in the E2E tests
## Changelog:
[Internal] - Build release variant for RNTester
Reviewed By: mdvacca
Differential Revision: D67760436
fbshipit-source-id: ee4b034f7c54cbf0b46c0afc16c31389b11353fe
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48442
This change stores the RNTester `.app` in an artifact so that E2E tests can reuse it.
## Context
While looking at the recent failures of the E2E tests, I realized that the Hermes, NewArch, Debug variant often fails to build, not to test, for some misconfiguration.
I also realized that we are already building that varaint successfully once, so why not reuse it? To reuse prebuilds, we need a few steps:
1. make sure we build all the variants we need
2. store the .app file as an artifact
3. download the artifact and use it in the E2E tests
## Changelog:
[Internal] - Build release variant for RNTester
Reviewed By: mdvacca
Differential Revision: D67760380
fbshipit-source-id: 8be0bbbadf4240dce1bcf5b44dadb41d49ed4c06
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48439
Changelog: [internal]
This is in preparation for implementing `getRootNode` and `ownerDocument` properly in the DOM APIs.
Reviewed By: rshest
Differential Revision: D67137215
fbshipit-source-id: bda6b1f843f219e03df533797fa9e4adbaa54c60
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48438
Changelog: [internal]
Just adding tests to make sure we cover the cases where the root is unmounted.
Reviewed By: rshest
Differential Revision: D67752010
fbshipit-source-id: 3cc17cd25878013a26dc407640be00e8dc251eea
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48434
Changelog: [internal]
We were starting to repeat this logic too much in tests, so extracting so we can reuse it.
Reviewed By: rshest
Differential Revision: D67520443
fbshipit-source-id: 64e4e5b35f83dc45e41bb0efae9685aeaf0cf2e2
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48436
Changelog: [internal]
Changing the defaults to use something that resembles a real device (in this case the iPhone 14 which is a very common device).
Reviewed By: christophpurrer
Differential Revision: D67759914
fbshipit-source-id: 87fe3be19196ece62c412e5076c601be746a4f22
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48468
Clang will add this code by default at the preprocessor phase. I'd observed a difference in output on sandcastle where it didn't include `stdlib` by default.
This stops `stdlib` being included locally. **It isn't important wrt tracking user API changes.**
Changelog: [Internal]
Reviewed By: cipolleschi
Differential Revision: D67793848
fbshipit-source-id: 0c88aee05a78e2410b308fe10c48db2552b8a148
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48460
We can only specify `hg` as a dependency, so have to use it in our shell script.
Changelog: [Internal]
Reviewed By: GijsWeterings
Differential Revision: D67718641
fbshipit-source-id: 557d980a9b6c3dbcd2621481d39a24b47075a3f9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48457
Adding CI support will require executing through buck. Sandboxing means the package has to be well-formed to work, so this cleans up some earlier mess.
- yarn workspace
- check-api.sh to configure the environment correctly when running form sandcastle
- explicity dependencies in our package.json
This is the first step
Changelog: [Internal]
Reviewed By: GijsWeterings
Differential Revision: D67726588
fbshipit-source-id: 7f8605695e323ef332550820b23b85d3af5f4d69
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48456
This is the current output of running the api snapshotting tool. I've also shown some test examples that show how trivial changes affect the API file.
Changelog: [Internal]
Reviewed By: cipolleschi
Differential Revision: D67713415
fbshipit-source-id: f68c7e15b0d1e26878e39f22f49e64cdd7340df2
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48435
Cleans up the runtime `fuseboxEnabledDebug` feature flag. The modern CDP backend has been enabled by default in open source since 0.76.
- Updates `ReactInstanceIntegrationTest` to preserve testing under both backend modes (legacy Hermes debugger vs Fusebox).
- Preserves ability to override `ReactNativeFeatureFlags` in tests via `InspectorFlagOverridesGuard` — we anticipate that future CDP features will continue to read from the `ReactNativeFeatureFlags` system (`fuseboxEnabled` was/is a special case).
Changelog: [Internal]
Reviewed By: robhogan
Differential Revision: D67759600
fbshipit-source-id: 5878dd879bae435e59c48823a9b9faf85561b028
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48440
Changelog: [internal]
Modifies the Fantom runner to read 2 new environment variables to help with debugging:
- `FANTOM_PRINT_OUTPUT`: prints the output of the CLI to the output of the test.
- `FANTOM_LOG_COMMANDS`: logs the buck commands executed by the runner, so they can be re-run outside the runner for debugging, etc.
Reviewed By: rshest
Differential Revision: D67682750
fbshipit-source-id: aff48c4f47078db1be53e0ee105089fbc921768f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48372
Changelog: [internal]
Implements log streaming in Fantom tests. This allows us to see the logs emitted from tests as they're logged, so we don't need to wait until the test completes to flush all of them at the same time.
Reviewed By: rshest
Differential Revision: D67600609
fbshipit-source-id: efb3125e13fd9aec1800a5f1ddaf0d93dcb29218
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48371
Changelog: [internal]
Adds a new favor for `runCommand` and `runBuck2` that works asynchronously and support parsing their output in real time.
Reviewed By: javache
Differential Revision: D67600614
fbshipit-source-id: 99dd2ce9bff11036829f214bf19208b10c9c1b25
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48369
Changelog: [internal]
This improves logs in Fantom by preserving the original log levels. It's also in preparation for adding support for log streaming in tests.
Reviewed By: javache
Differential Revision: D67600616
fbshipit-source-id: 1c4997d5e836a78327f33092527543fe025c90c6
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48367
Changelog: [internal]
We removed the calls to `AppRegistry` in Fantom, so this filter isn't necessary anymore (just a no-op).
Reviewed By: rshest
Differential Revision: D67600610
fbshipit-source-id: d985cc5f0ee1728ac72c567bc091a6c2877f2659
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48391
Changelog: [internal]
When we enabled log streaming in Fantom, we saw a lot of logs that we were previously not forwarding (console.error, console.warn) in existing tests.
This removes all the warnings and errors from those tests.
Reviewed By: rshest
Differential Revision: D67602299
fbshipit-source-id: 111f373eafd8707f2746ff727894f1fa4283b83f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48432
Changelog: [internal]
This moves the native module definition for Fantom to the `react-native` package so we can migrate the module to use the codegen.
Also implements the migration.
Reviewed By: christophpurrer
Differential Revision: D67759729
fbshipit-source-id: d79d078908b05fc4b6f5f26f0144ab7e3485cb83
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48368
Changelog: [internal]
Just a minor rename to align with the existing convention.
Reviewed By: javache
Differential Revision: D67549203
fbshipit-source-id: faa9e34cdce7c59e2c6b3f7e697c90df103699d0
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48465
Removes the `packages/hermes-inspector-msggen` workspace. Since https://github.com/facebook/react-native/pull/39300, this is no longer referenced in React Native, and is now part of the Hermes repo.
Changelog: [Internal]
Reviewed By: cortinico, hoxyq
Differential Revision: D67791612
fbshipit-source-id: 73da135b264d8df632fefe87cc4e3101075ae98c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48430
Changelog: [internal]
This expectation currently prints a very generic message that is hard to parse, so this change improves it a bit to account for more cases. E.g.:
* Before: "Expected <function> to throw"
* After: "Expected <function> to throw with message 'foo', but threw with message 'bar'"
Reviewed By: rshest
Differential Revision: D67738146
fbshipit-source-id: 690f15971cec0e8a7b038eeacc9302c9f3edc323
Summary:
Fixes https://github.com/facebook/react-native/issues/38537
Setting `WindowManager.LayoutParams.FLAG_SECURE` in the window flags is not respected in the Android Modal component, causing security issues with screenshots or screen recordings as the content in the modal is visible. The flag works correctly in the rest of the components, see the videos in the linked issue.
This PR addresses that by checking whether this flag is set in the current activity and then setting it in the dialog when creating a new one in the `ReactModalHostView`.
## Changelog:
[ANDROID][FIXED] - `FLAG_SECURE` not respected in Modal dialog
Pull Request resolved: https://github.com/facebook/react-native/pull/48317
Test Plan:
To test this, you need a physical device as with the emulator the flags don't seem to be respected either.
The easiest way to test this in code is by setting the flags in the main activity. You can do so by adding this code snippet:
<details>
<summary>onCreate in RNTesterApplication.kt</summary>
```kt
override fun onCreate() {
ReactFontManager.getInstance().addCustomFont(this, "Rubik", R.font.rubik)
super.onCreate()
...
registerActivityLifecycleCallbacks(
object : ActivityLifecycleCallbacks {
override fun onActivityCreated(activity: Activity, savedInstanceState: Bundle?) {
activity.window.setFlags(
WindowManager.LayoutParams.FLAG_SECURE,
WindowManager.LayoutParams.FLAG_SECURE
)
}
override fun onActivityStarted(activity: Activity) {}
override fun onActivityResumed(activity: Activity) {}
override fun onActivityPaused(activity: Activity) {}
override fun onActivityStopped(activity: Activity) {}
override fun onActivitySaveInstanceState(activity: Activity, outState: Bundle) {}
override fun onActivityDestroyed(activity: Activity) {}
}
)
}
```
</details>
Then, you can render a simple modal component:
<details>
<summary>RNTesterPlayground.js</summary>
```tsx
function Playground() {
const [modalVisible, setModalVisible] = React.useState(false);
return (
<>
<Modal
visible={modalVisible}
testID="playground-modal">
<Text testID="inner-text-test-id">Hello World!</Text>
<Button title="Close Modal" onPress={() => setModalVisible(false)} />
</Modal>
<Button
title="Open Modal"
onPress={() => {
setModalVisible(true);
}}
/>
</>
);
}
```
</details>
You can then try to record the screen or take screenshots. You will notice that before opening the modal, you won't be able to see anything in the recording, but when opening the modal, the content is visible.
I've tried my best to record the before and after the fix, but as the screen recordings will mostly show a black screen, you have to forward a bit in both videos to see the difference.
<details>
<summary>Before the fix (notice the blank screen and then content visible)</summary>
https://github.com/user-attachments/assets/fc5bbe26-d238-425b-90d3-0e43c89ccaac
</details>
<details>
<summary>After the fix (notice all the screen recording is a black screen)</summary>
https://github.com/user-attachments/assets/0d6991a0-974b-45c5-8f4a-bf4718c284e6
</details>
Reviewed By: cipolleschi
Differential Revision: D67368741
Pulled By: alanleedev
fbshipit-source-id: 9f31063a9208a6df257da424bf3096bf15a5ddcb
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48455
This is a followup to earlier issues in the stack.
Two fixes here:
1. Make the paths more consistent esp. from the config, so everything is working out of react-native-github.
2. Just declare `__cpluscplus`, as we don't seem to care about the value in our code.
Changelog: [Internal]
Reviewed By: cipolleschi
Differential Revision: D67716883
fbshipit-source-id: 359c33210d6b66bb0d75724a177587a7d5f837b2
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48449
This is the simplest possible way to track changes to our public CPP / Objective-C API.
This is going to be really noisy, and there's a good chance it's not complete.
The tooling is also incomplete, as it just runs the preprocessor (then does some funky work to undo noise generated by the preprocessor). If we want more control over this, we're going to have to jump into the guts of each of our build targets (and tooling) OR more clearer layout the repo to separate public and private header files to our users.
Changelog: [Internal]
Reviewed By: cipolleschi
Differential Revision: D67713408
fbshipit-source-id: 9578179bbc4d9be2f07d040b01f8a3ef105d7034
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48414
Was looking into https://github.com/facebook/react-native/issues/48078 which was brought to my attention due to my recent refactorings of iOS Views, especially around how overflow: hidden works. This bug was not brought on by my changes but seems to be a lingering Fabric bug (iirc this bool was not changed when I refactored things)
Anyway, dotted/dashed borders did not work with overflow: hidden. The reason why is we use core animation borders in this case which is incorrect as CA cannot do these types of borders. So I added a check to make sure that the borders are solid as well if we want to use CA to draw them.
Changelog: [iOS] [Fixed] - Dashed & dotted borders now work with overflow: hidden
Reviewed By: mdvacca
Differential Revision: D67720492
fbshipit-source-id: 5aecc15f2d7cbd71952d78d6972f6fc6b7a93ea8
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48343
components store unions as 'StringEnumTypeAnnotation' even though it isn't actually a union, it's a literal.
Native Modules store these as 'StringLiteralTypeAnnotation' so this converges those and reuses the same types.
Changelog: [Internal]
Reviewed By: cipolleschi
Differential Revision: D67427656
fbshipit-source-id: e39028114285588584596012d07db40c117b4b94
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48318
These structures were the same, but the component side didn't use generics and just had duplicates. Making a base one to be shared.
I need to follow up to this and constrain the types that components allow.
Changelog: [Internal]
Reviewed By: javache
Differential Revision: D67371894
fbshipit-source-id: bb1a30fcd0efe6cc567b88bc6f11e7b385bd7c41
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48458
NOTE: This change is made once and is not guaranteed.
**Motivation**: Requiring Flow parsing for `react-native` and its dependencies in user space can involve friction. For the case of `react-native/assets-registry` → `react-native-web`, I believe we should do the pragmatic thing to relax this requirement.
- This is a convenience stopgap until https://github.com/facebook/react-native/pull/39542 can be stabilised.
- This package is tiny and infrequently modified — I believe it's pragmatic/safe to do a one-time conversion, with the above notice and no changelog (i.e. "experimental" for now).
Resolves https://github.com/facebook/react-native/issues/48349.
Changelog: [Internal]
Reviewed By: cortinico
Differential Revision: D67764460
fbshipit-source-id: 7687fd79c6dea73c234a46e475c1cc745225830b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48443
This change makes sure we build the Release variant of RNTester so we can store the generated app as an artifact and forward it to the E2E tests.
## Context
While looking at the recent failures of the E2E tests, I realized that the Hermes, NewArch, Debug variant often fails to build, not to test, for some misconfiguration.
I also realized that we are already building that varaint successfully once, so why not reuse it? To reuse prebuilds, we need a few steps:
1. make sure we build all the variants we need
2. store the .app file as an artifact
3. download the artifact and use it in the E2E tests
## Changelog:
[Internal] - Build release variant for RNTester
Reviewed By: cortinico
Differential Revision: D67760372
fbshipit-source-id: 02cc9ec64d5a7b4fa2ad05bca6aa91a69b2b5907
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48419
This change moves the E2E scripts for iOS to a JS script.
This should make it much easier to modify the code in case we need to change it.
## Changelog
[Internal] - Move e2e script from bash to JS
Reviewed By: cortinico
Differential Revision: D67737950
fbshipit-source-id: d0b0411c8a4d688c10e460e70b11dbfc83aaa135
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48418
RNTester JSC Debug is currently insta-crashing on the 0.77 release branch due to:
```
12-31 10:59:36.388 15165 15204 E ReactNativeJS: React Native version mismatch.
12-31 10:59:36.388 15165 15204 E ReactNativeJS:
12-31 10:59:36.388 15165 15204 E ReactNativeJS: JavaScript version: 0.77.0-rc.5
12-31 10:59:36.388 15165 15204 E ReactNativeJS: Native version: 1000.0.0-bb9d7ad9a
12-31 10:59:36.388 15165 15204 E ReactNativeJS:
12-31 10:59:36.388 15165 15204 E ReactNativeJS: Make sure that you have rebuilt the native code. If the problem persists try clearing the Watchman and packager caches with `watchman watch-del-all && npx react-native start --reset-cache`.
```
This is causing a `console.error` that is resulting in the crash as one of the frame in the stack doesn't have the line/column number information. Calling `.putDouble(string,double)` is forcing a conversion from `null` -> `double` which is result in the crash.
This is happening only on CI because the `set-rn-version` step on GitHub Action is executed with `--dry-run` (as this is not a release run) so the version of React Native is set back to `1000.0.0-<SHA>`. Locally this doesn't happen because the React Native version is read from the local file which is never manipulated by the `set-rn-version`.
Changelog:
[ANDROID] [FIXED] - Fix JSC Debug instacrashing
Reviewed By: cipolleschi
Differential Revision: D67735962
fbshipit-source-id: 363218385277374d33b8313cacd14159b2f17106
Summary:
### Issue
When a real device is oriented into landscape and the user locks the screen during said orientation incase the user rotates back to previous orientation and unlocks the screen `useWindowDimensions` will not get the correctly updated values. This is due to `applicationState` being equal to UIApplicationStateInactive still when `interfaceFrameDidChange` gets called.
### Fix
`didUpdateDimensions` on iOS. Now correctly emits the dimension values after the device has been oriented and device has been locked. By adding `UIDeviceOrientationDidChangeNotification` to `NSNotificationCenter`
## Changelog:
[IOS] [FIXED] - Emit didUpdateDimensions correctly
```
// RCTDeviceInfo.mm
// Adds the interfaceFrameDidChange to UIDeviceOrientationDidChangeNotification
[[NSNotificationCenter defaultCenter] addObserver:self
selector:selector(interfaceFrameDidChange)
name:UIDeviceOrientationDidChangeNotification
object:nil];
```
Pull Request resolved: https://github.com/facebook/react-native/pull/46353
Test Plan:
### ***Note***: This doesn't seem to be replicable on simulators. It only happens on real iOS devices.
### Before change:
Rotate Device > Lock Screen > Rotate back to portrait > Unlock phone

### After change:
Same steps as above, now emits correct values

Reviewed By: cortinico
Differential Revision: D67735523
Pulled By: cipolleschi
fbshipit-source-id: 146e5d62d55eeef0f6b17f962ca84ab418a7b7f0
Summary:
This PR implements ReactNativeFactory to encapsulate further the logic of creating an instance of React Native for iOS.
This will remove the strong coupling on the RCTAppDelegate and allow us to support Scene Delegate in the future.
The goal is to have a following API:
```objc
self.reactNativeFactory = [[RCTReactNativeFactory alloc] initWithDelegate:self];
UIView *rootView = [self.reactNativeFactory.rootViewFactory viewWithModuleName:self.moduleName
initialProperties:self.initialProps
launchOptions:launchOptions];
// Standard iOS stuff here
```
## Changelog:
[IOS] [ADDED] - implement ReactNativeFactory
Pull Request resolved: https://github.com/facebook/react-native/pull/46298
Test Plan: Test out all the methods of AppDelegate
Reviewed By: huntie
Differential Revision: D67451403
Pulled By: cipolleschi
fbshipit-source-id: 9e73cd996ffc27ca1e3e058b45fc899b1637bdba
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48347
Vector drawable support was added behind a feature flag in https://github.com/facebook/react-native/pull/45354 and is ready to release more widely. This change is effectively the same as removing the feature flag but allows our holdout to continue until mid-January.
Changelog: [Internal]
Reviewed By: rshest
Differential Revision: D67482531
fbshipit-source-id: 1733c4748f79fd4df72f531a24efcbd8a7822611
Summary:
X-link: https://github.com/facebook/litho/pull/1036
X-link: https://github.com/facebook/yoga/pull/1775
Pull Request resolved: https://github.com/facebook/react-native/pull/48404
## Changelog:
[Internal] -
This popped up when profiling some heavy UI performance, calling `fmod` operation in Yoga's `roundLayoutResultsToPixelGrid` in `PixelGrid.cpp` can be expensive, furthermore it turns out that some of the calls were redundant.
This replaces the duplicate calls to fmod with an equivalent single round operation, which for e.g. clang compiler on Windows brings the code in question from ~50 instructions (including 4 call instructions to the fmod function) down to ~30 instructions (without any external calls), and the layout operation being **~1% more efficient** for the particular benchmark I was looking into.
Reviewed By: christophpurrer
Differential Revision: D67689065
fbshipit-source-id: 2a074a1cb81bd7f7a3c414050b9ddda2ba90180f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48401
This change adds a flag to JS Error's prototype to specify the jsEngine.
Reviewed By: fkgozali
Differential Revision: D67665484
fbshipit-source-id: 64b7b4bd986bcbd45d58e70c1a16de6752b05ccd
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48400
A couple of days ago, the iOS CI started failing for the E2E tests on main.
This is because We were not using the hermes artifacts we were preconfiguring.
In fact, this is the log of the `test_e2e_ios_rntester`, which is not using the prebuilt.
{F1974129000}
For comparison, this is the `test_ios_rntester`, which is using the prebuilt
{F1974129001}
While investigating why this was happening, I realized that we were not testing the old architecture anymore, because we forget to update the script after the release of the New Architecture.
This change should fix both.
## Changelog:
[Internal] - Fix E2E tests for iOS and test the Old Arch
Reviewed By: robhogan
Differential Revision: D67670976
fbshipit-source-id: 7d1383a89e06c138f437a9c5f876a2e900878fb0
Summary:
### Error message:
we got an error
```
t[n] is not a function. (In 't[n]()', 't[n]' is undefined) \n <unknown> (index.bundle:317:168:317)
```
it related the BackHandle execute handle function.
### Investigation result
our project has screen files`App.tsx`, `Dashboard.tsx`, and `Profile.tsx`.
When launching the app, the screen order is `App.tsx` -> `Dashboard.tsx`, then user can switch to `Profile.tsx`
For `App.tsx` and `Dashboard.tsx`, we just prevent the hardware button action use `usePreventHardwareBackPressEffect()` in the first line of screen code.
```js
export const useHardwareBackPressEffect = (goBack?: () => boolean): void => {
useEffect(() => {
if (goBack) {
BackHandler.addEventListener("hardwareBackPress", goBack);
return () => {
BackHandler.removeEventListener("hardwareBackPress", goBack);
};
}
return undefined;
}, [ goBack ]);
};
export const usePreventHardwareBackPressEffect = (): void => useHardwareBackPressEffect(() => true);
```
currently, `_backPressSubscriptions ` has 2 callback functions.
then user switch to `Profile.tsx` screen, and has the below code for hardwareback button and the second doesn't `return true`:
```js
// first one
usePreventHardwareBackPressEffect();
...
// second one
useEffect(() => {
const backButtonListener = BackHandler.addEventListener(
"hardwareBackPress",
() => navigate(Navigation.Login);
);
return () => backButtonListener.remove();
});
```
currently, `_backPressSubscriptions ` has 4 callback functions, include previous 2 and new 2 of `Profile.tsx`.
When the user press hardwareback button, it will navigate to the login screen, so the issue occurs:
the latest callback will be executed first, then the navigation will let the screen unmount, which will destroy the effect, so the code removing 2 hardwareBackPress callback of `Profile.tsx` by executed
```js
return () => {
BackHandler.removeEventListener("hardwareBackPress", goBack);
};
```
After the navigation ends and the loop is restored, the init `i` is 3, then `i--`, `i` is 2, then `_backPressSubscriptions[2]` is `undefined` now and executes as a function, so the app crashes.
```js
for (let i = _backPressSubscriptions.length - 1; i >= 0; i--) {
if (_backPressSubscriptions[i]()) {
return;
}
}
```
that's the issue I met.
## Changelog:
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
[ANDROID] [FIXED] - Message
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[ANDROID] [FIXED] - Fix BackHandle callback undefined cause crash issue
Pull Request resolved: https://github.com/facebook/react-native/pull/48388
Reviewed By: blakef
Differential Revision: D67648077
Pulled By: rshest
fbshipit-source-id: 5ca685b0c0c474ef11772fd803743968ec2d912e
Summary:
https://github.com/facebook/react-native/issues/48376 removed `applicationDidEnterBackground` from `RCTAppDelegate` but RNTester called it, leads to crash. cc cipolleschi can you please help to review?
## Changelog:
[INTERNAL] [FIXED] - RNTester: Fixes crash when app back to background
Pull Request resolved: https://github.com/facebook/react-native/pull/48385
Test Plan: RNTester iOS back to background not crash.
Reviewed By: cipolleschi
Differential Revision: D67657449
Pulled By: philIip
fbshipit-source-id: e6d806b2677050fa2faa273a7468055d9d21c2a3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48383
## Changelog:
[Internal] -
This changes the name of `SystraceSection` class to `TraceSection`, the purpose being to make it Systrace/FBSystrace agnostic (and that it can be mapped to e.g. Perfetto instead).
It changes all the internal callsites to the RN code code, and also adds a shim include, `<cxxreact/SystraceSection.h`, for backward compatibility with the external callers for now (which will be addressed separately).
Reviewed By: javache
Differential Revision: D67621914
fbshipit-source-id: 337c63c45a7b075c6e00cfca67ecc06c298c94c0
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48381
Right now, the E2E tests for RNTester does not have a timeout.
It can happen that the emulator get stuck and the action times out.
The default timeout is 6 hours, which is definitely too much and wasteful, so let's reduce it to 1 hour.
{F1974112110}
## Changelog:
[Internal] - Set timeout for E2E tests to 1 hour
Reviewed By: robhogan, blakef
Differential Revision: D67620423
fbshipit-source-id: c507d1222fca49287fafe6da4bffe559d8687b99
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48379
## Changelog:
[Internal] -
We have a good portion of RN core code already instrumented with `SystraceSection` blocks, and those do the timing via fbsystrace, which may or may not be enabled in the system and generally is obsolete.
This maps the blocks to the corresponding Perfetto instrumentation, in case the latter is enabled, which will allow to get this information in Perfetto sessions without need to have fbsystrace present.
Reviewed By: javache
Differential Revision: D67619443
fbshipit-source-id: 52e5666472ad118fbec176a0e82d72a5200a358a
Summary:
While investigating the root cause of app hanging on older devices in Instruments, I noticed that the heaviest stack trace was pointing to `RCTRecursiveAccessibilityLabel` in RCTView.m.
<details>
<summary>Heaviest stack trace in Instruments</summary>
<img width="473" alt="Screenshot 2024-05-17 at 4 22 48 PM" src="https://github.com/facebook/react-native/assets/849905/fab8ed01-7a2f-4113-b2ca-04e76f25cd9d">
</details>
The profiling was done on an iPad (5th generation) running iOS 16.7.4. The app is text heavy which makes the issue more visible than in RNTester for instance.
### Before
<img width="854" alt="Screenshot 2024-05-17 at 4 19 46 PM" src="https://github.com/facebook/react-native/assets/849905/5e3cc7ad-299c-4814-ab4a-031c0e677b12">
It turns out that `[NSMutableString stringWithString:@""]` is initialized in every call of the recursion even though most of the time it's only used to check the length at the end and return `nil`.
My change only initialize the mutable string if it's going to be used. I applied the same logic to the equivalent Fabric component. It's a small change that improved the accessibility label generation by 60ms in my case.
## 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
-->
[IOS] [CHANGED] - Reduce memory allocations when computing accessibilityLabel
Pull Request resolved: https://github.com/facebook/react-native/pull/44605
Test Plan:
Running the same measurements after the change, computing the accessibility label is not the heaviest stack trace anymore. And the line by line tracing shows that `[NSMutableString stringWithString:@""]` impact has been significantly reduced.
### After
<img width="769" alt="Screenshot 2024-05-17 at 4 53 04 PM" src="https://github.com/facebook/react-native/assets/849905/1ad638ac-ba7e-4dca-ac77-10df5d2dad49">
I have been using this change in production thanks to a patch-package and it effectively improved the performances when navigating between screens.
I also tested in RNTester with and without Fabric. For both architectures, I made sure the return value of `RCTRecursiveAccessibilityLabel`.
Interestingly, when there is no label, the Fabric implementation returns an empty string while the `RCTView.m` returns `nil`.
I'm open to align both implementations to return `nil` if you believe there is no underlying reason requiring the Fabric implementation to return an empty string.
Reviewed By: cipolleschi
Differential Revision: D67620818
Pulled By: javache
fbshipit-source-id: 1a6937075a5ff5a9ad03fbbf910d64b3884c0fe0
Summary:
I noticed that `AppDelegate` subscribers listening for `applicationDidEnterBackground` events in Expo projects (as documented [here](https://github.com/expo/expo/blob/238b6f57e459dd2c0b13ee158f0af709fe922460/docs/pages/modules/appdelegate-subscribers.mdx?plain=1#L56) aren't working as expected anymore.
While investigating, I discovered that the events aren't reaching the `ExpoAppDelegate` implementation ([source](https://github.com/expo/expo/blob/71f2c55ff3f11e43ab43761bb5cece2e48eae0bf/packages/expo-modules-core/ios/AppDelegates/ExpoAppDelegate.swift#L61)) because the `RCTAppDelegate` implementation of `applicationDidEnterBackground` interrupts the event chain. This appears to be affecting some legitimate use cases.
I believe we could improve this by removing the current implementation, but I'd love to hear your thoughts on this approach. I might be missing some context about why this implementation was originally needed, so any insights would be greatly appreciated!
## Changelog:
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
[IOS] [FIXED] - Fix applicationDidEnterBackground not being called
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[IOS] [FIXED] - Fix applicationDidEnterBackground not being called
Pull Request resolved: https://github.com/facebook/react-native/pull/48376
Test Plan: Ran a local test after change
Reviewed By: javache
Differential Revision: D67621557
Pulled By: cipolleschi
fbshipit-source-id: 2d73711372deba867bd616c79ef4d00c79aa86d5
Summary:
I think parsed isn't a good enough name.
React native also does a lot of processing of the error.
This also opens the door for eventually forwarding the original error in the future.
Changelog: [Internal]
Reviewed By: alanleedev
Differential Revision: D67526700
fbshipit-source-id: 895d64fa1ee4061ecbf0c1a6033c25b6fca95fd6
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48363
jq is already installed on M1 machines on GithubActions. There is no need to install it again and this is outputting a warning in CI:
{F1974100065}
## Changelog:
[Internal] - Do not install jq as it is already installed
Reviewed By: blakef
Differential Revision: D67599961
fbshipit-source-id: 1f621f796b0c67ec877fc35269137537618f47ae
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48364
The configuration to run E2E tests on maestro has a typo that was outputting a warning in CI:
{F1974100056}
## Changelog
[Internal] - Fix typo on E2E test configuration
Reviewed By: robhogan
Differential Revision: D67599849
fbshipit-source-id: 9504f821172782e188ff524176bc4c2ec48dea97
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48365
For a mistake, the local E2E test we use to test a release is still pointing to the release APK instead of using the debug apk.
This change fix that. The change has been manually applied to the release branches, for example [here](https://github.com/facebook/react-native/commit/385318bf6a83b124d9e8eb925932edff02115c85)
## Changelog
[Internal] - use Debug apk instead of release one to test the release
Reviewed By: robhogan
Differential Revision: D67599760
fbshipit-source-id: 224b5b8d8f664bb579b09ee68f1b92c0774a9b5e
Summary:
Sometimes, specific E2E tests can fail. This change tries to run specific E2E tests with retries, to compensate for their flakyness.
## Changelog:
[Internal] - Add single test retry for Android E2E tests
Pull Request resolved: https://github.com/facebook/react-native/pull/48324
Test Plan: GHA
Reviewed By: huntie
Differential Revision: D67396758
Pulled By: cipolleschi
fbshipit-source-id: 7d806fe7354bd9e826c591ea9628c73c3b258fce
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48327
This PR introduces necessary changes to let React Native uses latest version of static Hermes.
## Explanation
### Part 1
```cmake
append("/d2UndefIntOverflow-" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
```
It seems like this flag doesn’t exist anymore in the MSVC 16 compiler.
CI logs - https://github.com/piaskowyk/react-native/actions/runs/11815096269/job/32915591004
```
fatal error C1007: unrecognized flag '-UndefIntOverflow-' in 'p2'
```
### Part 2
```cmake
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC")
# MSVC needs C++20
set(CMAKE_CXX_STANDARD 20)
else()
set(CMAKE_CXX_STANDARD 17)
endif()
```
Some of the new syntax in static Hermes requires the newer C++ standard on MSVC.
### Part 3
```cmake
# Changes in lib/CMakeLists.txt
```
These updates are necessary to successfully build the Hermes Framework for iOS.
### Part 4
```diff
namespace hermes {
namespace hbc {
namespace {
class BytecodeSerializer {
- friend void visitBytecodeSegmentsInOrder<BytecodeSerializer>(
+ friend void hermes::hbc::visitBytecodeSegmentsInOrder<BytecodeSerializer>(
```
Due to additional additional anonymous namespace, the MSVC wasn't able to recognise proper symbol without explicite definition.
X-link: https://github.com/facebook/hermes/pull/1566
Test Plan: Build RNTester app from here - https://github.com/piaskowyk/react-native/tree/%40piaskowyk/build-static-hermes
Reviewed By: tmikov, cipolleschi
Differential Revision: D67316013
Pulled By: neildhar
fbshipit-source-id: cf03850f94a75acd827b68794700a8f143a90e09
Summary:
Follow up from https://github.com/facebook/react-native/issues/48271 and https://github.com/facebook/react-native/issues/48254, I noticed that the Modal component also doesn't map the `resource-id` from the `testID` on Android. This PR addresses that.
## Changelog:
[ANDROID] [FIXED] - Modal: Setting `resource-id` from `testID` prop
Pull Request resolved: https://github.com/facebook/react-native/pull/48313
Test Plan:
Alternatively do:
```
$ adb shell uiautomator dump
UI hierchary dumped to: /sdcard/window_dump.xml
$ adb pull /sdcard/window_dump.xml
/sdcard/window_dump.xml: 1 file pulled, 0 skipped. 1.1 MB/s (3505 bytes in 0.003s)
```
and check in XML: ` resource-id="playground-modal" class="android.view.ViewGroup" `
-------
Using Appium, check that the `testID` prop passed from JS is mapped as `resource-id` in the rendered view group of the Modal.
<details>
<summary>Example of the code implementation in the RNTester Playground:</summary>
```tsx
function Playground() {
const [modalVisible, setModalVisible] = React.useState(false);
return (
<>
<Modal
visible={modalVisible}
testID="playground-modal">
<Text testID="inner-text-test-id">Hello World!</Text>
</Modal>
<Button
title="Open Modal"
onPress={() => {
setModalVisible(true);
}}
/>
</>
);
}
```
</details>
<details>
<summary>Output in Appium Inspector:</summary>
<img width="913" alt="image" src="https://github.com/user-attachments/assets/514ae2b3-35a8-4a1a-8efc-1ca6bd73f189" />
</details>
Reviewed By: javache
Differential Revision: D67369350
Pulled By: alanleedev
fbshipit-source-id: a799ad5b974895a39d9287e3d76d1139a6ef6a83
Summary:
If 3rd party libs are using `inputAccessoryView` - the current code can easily break it. Whenever props gets changed we call `setDefaultInputAccessoryView` which will simply overwrite the current `inputAccessoryView` (which is highly undesirable).
The same fix on paper was made ~7 years ago: https://github.com/facebook/react-native/commit/bf3698323d81508fc77174df2b1ffe5fb03224e7
## Changelog:
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
[IOS] [FIXED] - Fixed problem with accessory view & 3rd party libs
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
Pull Request resolved: https://github.com/facebook/react-native/pull/48339
Test Plan: Make sure `inputAccessoryView` functionality works as before
Reviewed By: javache
Differential Revision: D67451188
Pulled By: cipolleschi
fbshipit-source-id: bc3fa82ae15f8acedfd0b4e17bdea69cbd8c8a8d
Summary:
All newly generated react native apps are still showing warnings to use react in the jsx scope. That is not needed anymore as of react 18 with built-in jsx transform plugin.
Reproduction: https://github.com/matinzd/react-in-jsx-warning-repro
Run `npm run lint` in this repo.
## Changelog:
[GENERAL] [FIXED] - Disable `react-in-jsx-scope` rule in eslint config
Pull Request resolved: https://github.com/facebook/react-native/pull/46587
Test Plan: Initiate a new template with community CLI and you should not see this warning anymore.
Reviewed By: christophpurrer
Differential Revision: D67394923
Pulled By: cipolleschi
fbshipit-source-id: cfe8e44e33e1b3ae9fe17ca56dd3c7258b7bff69
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48250
LLVM-15 has a warning `-Wunused-variable` which we treat as an error because it's so often diagnostic of a code issue. Unused variables can compromise readability or, worse, performance.
This diff either (a) removes an unused variable and, possibly, it's associated code or (b) qualifies the variable with `[[maybe_unused]]`.
- If you approve of this diff, please use the "Accept & Ship" button :-)
Reviewed By: palmje
Differential Revision: D66839601
fbshipit-source-id: dfba4aab6d73a2fd805ad2761a49c23612c28ccd
Summary:
Originally with https://github.com/facebook/react-native/commit/5cf8f43ab182781ea82e88077df425c3efbfc21f , we added a call to a new Apple API `JSGlobalContextSetInspectable` to ensure that our Javascript running with JSC is debuggable. That change was guarded with a `__builtin_available(macOS 13.3, iOS 16.4, tvOS 16.4, *)` check to make sure it only ran on OS'es where to function existed. Later, in https://github.com/facebook/react-native/commit/3eeee11d7ac4075d0917233d3be4a9469f802d35 we did an extra guard in the way of a macro to check we were compiling against a new enough version of Xcode (so that Xcode knows about the symbol).
Between the runtime check and the compile time check, we should be good right? Wrong! As it turns out, this bit of code still caused crashes on iOS 15 devices (See this [Apple Forum Thread](https://forums.developer.apple.com/forums/thread/749534)). To address this, https://github.com/facebook/react-native/pull/44185 was added which added a new compiler guard (`__OSX_AVAILABLE_STARTING(MAC_NA, IPHONE_16_4)` was added. Unfortunately, this guard is incorrect: It is basically checking if our minimum iOS deployment target is 16.4 (It's not, as of writing it is iOS 13.4), which effectively means this code is never compiled and one can never direct debug with JSC on iOS 16.4+ 😨!
So what went wrong, and why were the first two guards not good enough? Three main reasons..
Firstly, this is a device only crash, and not reproducible on simulator. This is probably why the crash was not caught earlier. Secondly, It's because system frameworks (like JavascriptCore) are _dynamically_ linked: the linker doesn't look for the symbol till runtime (and crashes when doing so). Thirdly, It's because we are _strongly_ linking the framework, so every symbol must be present and the macros / guard Apple provides with `AvailabilityMacros.h` don't work.
What we want to do is link JavascriptCore as a `weak_framework`, more info here: https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPFrameworks/Concepts/WeakLinking.html
From that link:
> One challenge faced by developers is that of taking advantage of new features introduced in new versions of OS X while still supporting older versions of the system. Normally, if an application uses a new feature in a framework, it is unable to run on earlier versions of the framework that do not support that feature. Such applications would either fail to launch or crash when an attempt to use the feature was made. Apple has solved this problem by adding support for weakly-linked symbols.
>When a symbol in a framework is defined as weakly linked, the symbol does not have to be present at runtime for a process to continue running. The static linker identifies a weakly linked symbol as such in any code module that references the symbol. The dynamic linker uses this same information at runtime to determine whether a process can continue running. If a weakly linked symbol is not present in the framework, the code module can continue to run as long as it does not reference the symbol. However, if the symbol is present, the code can use it normally.
This seems to be exactly what we want, and the Apple provided method for using new APIs in system frameworks!
Let's update our podspecs so we link JavascriptCore weakly. As a bonus (and admittedly, the original purpose of this PR) let's add macOS support to the `JSC_HAS_INSPECTABLE` macro (This file `JSCRuntime.cpp` used to have more explicit macOS support in it's macros, but I had removed it with https://github.com/facebook/react-native/commit/fb30fcaa2f526cc1f7c2d4189ec9c57f9cf9b3c5).
## Changelog:
[IOS] [FIXED] - Fix Direct Debugging with JSC
Pull Request resolved: https://github.com/facebook/react-native/pull/39549
Test Plan:
Tested that RNTester doesn't crash on boot running on an iPad Air 2 running iOS 15.8., and that an iOS 17.2 simulator is debuggable.
Built RN-Tester and RN-Tester-macOS and verified both show up in Safari Web Inspectors' debug menu:
<img width="1316" alt="Screenshot 2023-09-19 at 10 48 43 PM" src="https://github.com/facebook/react-native/assets/6722175/c642e6e0-36af-4c9f-845a-7e491489f419">
macOS screenshot small bc I got some internal stuff I gotta crop 😅
<img width="347" alt="Screenshot 2023-09-19 at 10 53 46 PM" src="https://github.com/facebook/react-native/assets/6722175/1e802c88-02b8-49e1-8fd2-d91726ca1e93">
Reviewed By: huntie
Differential Revision: D67338150
Pulled By: cipolleschi
fbshipit-source-id: 620c3b3cc1e37e54de7fa4dc9956a02c8f3c09f8
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48312
I figured out how to fix these FlowFixMes
Changelog: [Internal]
Reviewed By: yungsters
Differential Revision: D67313962
fbshipit-source-id: 21b109824411c1537f397aca45b7cdc2495f5e11
Summary:
This is an automatically generated fixup patch to bring fbsource back into sync with
facebook/react on GitHub. Please land this patch as soon as possible, as the difference
reflected on here is already on GitHub and future changes may depend on these
changes!
<< DO NOT EDIT BELOW THIS LINE >>
diff-train-skip-merge
bypass-react-native-oss-changelog
Generated by: https://www.internalfb.com/intern/sandcastle/job/36028798618339642/
GitHub Repo: facebook/react
Reviewed By: kassens
Differential Revision: D67286468
fbshipit-source-id: 66632a2524e80bca065d0a0f94342c4ec2d2a7b9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48307
Changelog:
[General][Fixed] - Fix a bug when fantom tests could not be run in parallel, e.g. in a stress-test.
Reviewed By: rubennorte, danalex97
Differential Revision: D67334828
fbshipit-source-id: 3db18f6a100925480dbf8385f9ea414187406f4a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48306
Extract a constant for SoftAssertions so they can be logged appropriately
Changelog: [Internal]
Reviewed By: makovkastar
Differential Revision: D67296589
fbshipit-source-id: c8823fd5dfa09a771bb8fbf498edb8d9264f053f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48303
## Context
If a component is re-rendered/committed multiple times before mount, Android mounting layer creates and executes mounting instructions for every commit. Component's native representation is updated multiple times, potentially triggering expensive computations (e.g. recreating boxShadows) for a single draw.
A more efficient way would be to create mounting instructions to update the component from the initial state (before the first render) to the final state (after the last render) in one go.
iOS does that.
This diff is an attempt to experiment on achieving such behaviour for Android.
## Implementation Details
1. When cloning a ShadowNode, accumulate all the updates in `Props.rawProps`.
2. For calculating prop update payloads to be sent to the Android mounting layer, diff old and new `rawProps` by calling `newProps->getDiffProps(oldProps)`.
3. Most importantly, move computing of the mounting instructions from `schedulerDidFinishTransaction`, which is called after every commit, to `schedulerShouldRenderTransactions` which happens only once, after the final commit.
Changelog: [Internal]
Reviewed By: javache
Differential Revision: D63457028
fbshipit-source-id: 991727838a4e11628cb696d66d41e1d441a5ef4f
Summary:
Fixes https://github.com/facebook/react-native/issues/45810
Upgrading `typescript-config` module version from `es2015` to `esnext`, in order to support dynamic imports.
## Changelog:
[GENERAL] [CHANGED] - Upgrading `typescript-config` module version to `esnext`
Pull Request resolved: https://github.com/facebook/react-native/pull/48230
Test Plan:
Create a new React Native project:
```bash
npx react-native-community/cli@latest init AwesomeProject
```
Copy the changes in the reproducer from the linked issue and add a lazy import:
```tsx
const LazyAssetExample = React.lazy(() => import('./components/AssetExample'));
```
See the error when running `yarn tsc`:
<img width="739" alt="image" src="https://github.com/user-attachments/assets/99989cd1-e11a-4b23-b178-f221d8cdd8ca" />
---
To fix the error, apply the following patch:
```patch
diff --git a/node_modules/react-native/typescript-config/tsconfig.json b/node_modules/react-native/typescript-config/tsconfig.json
index d5e1bce..51f54c1 100644
--- a/node_modules/react-native/typescript-config/tsconfig.json
+++ b/node_modules/react-native/typescript-config/tsconfig.json
@@ -3,7 +3,7 @@
"display": "React Native",
"compilerOptions": {
"target": "esnext",
- "module": "es2015",
+ "module": "esnext",
"types": ["react-native", "jest"],
"lib": [
"es2019",
```
Verify it is fix by running `yarn tsc` again
Reviewed By: cipolleschi
Differential Revision: D67334277
Pulled By: NickGerleman
fbshipit-source-id: d26525023ff6fcfff651d1e4cee48ab2854b8d83
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48286
This change bumps the specs for the Android E2E tests. This has been reported to improve the stability of the tests.
We need to keep part of the `flatlist.yml` commented as it creates an issue with Maestro as it takes too much memory.
I'll reach out to the people working on Maestro to try and understand what's going on there.
## Changelog:
[Internal] - Improve android Stability and reenable E2E tests on main
Reviewed By: fabriziocucci
Differential Revision: D67276601
fbshipit-source-id: 7cca253547063a0ec39da7de58806286c6632b07
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48279
The text tests has 2 issues:
* on iOS, the Text cell was sometimes rendered below the tabbar, with a small percentage visible. When this happens, the test was actually moving to a different tab rather then navigating to the Text screen
* on Android, sometimes navigation took too long and a scroll command was issued. This moved the screen away from the right screen we wanted to test.
This change fixes both issues by ensuring that the Text cell is 100% visible (not behind the tabbar) and by ensuring that the title "Text" is visible in Android, so the navigatin has actually happened
## Changelog:
[Internal] - Fix Text tests
Reviewed By: fabriziocucci
Differential Revision: D67274009
fbshipit-source-id: ed12f096788e7e6e74ee8d336dba350b35b85e81
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48280
In an attempt to improve times and stability, I bumped the android machine to an ubuntu with 4 cores.
Sometimes the emulator can hang, so i set a timeout for the E2E tests executions of 1 hours to avoid wasting money in CI
## Changelog
[Internal] - Bump Android machine and add timeout
Reviewed By: fabriziocucci
Differential Revision: D67273842
fbshipit-source-id: b7212f52016f8ead1dbb2b4da03cb6f564222893
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48281
While working on Maestro E2E I realized that we were waiting for Metro to start even when metro was not running.
This moves the waiting only when metro is actually started.
I also added another waiting point as it takes several seconds for the app to load the bundle from metro the first time. Subsequent attempts are faster as the metro cache is warm.
## Changelog:
[Internal] - Improve metro waiting times in E2E
Reviewed By: fabriziocucci
Differential Revision: D67273648
fbshipit-source-id: 912be4d14869c8ce87d7c4e4f7ee37b643f5845c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48282
This change bump maestro to the latest version as it present better reporting.
## Changelog:
[Internal] - Bump maestro to 1.39.5
Reviewed By: fabriziocucci
Differential Revision: D67273486
fbshipit-source-id: da41a002528a3b3c0934f86888da2bb53ae131b7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48289
Provide a mechanism to register specific category constants, which can be used by individual `ReactSoftExceptionListener`s to differentiate behavior, if desired.
Changelog: [Android][Added] SoftException categories
Reviewed By: makovkastar
Differential Revision: D66785403
fbshipit-source-id: cb2c8861bb1dce29a6787d328b814cee09f36464
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47749
Migrate ReactPointerEventsView to kotlin
changelog: [Android][Breaking] Mikgrating pointerEvents API breaks compatibility for kotlin usages of this api as a val
Reviewed By: cortinico
Differential Revision: D66217250
fbshipit-source-id: ff192c9f92d1df93c082b563937eb3f37176f144
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48269
# Changelog: [Internal]
I've noticed that our definition of Trace Event is different from the one that is defined in Google's doc / V8 / Chrome. This has some flaws:
* It creates fragmentation, like with custom track ids or with mocked process ids.
* Current implementation is strict the relationship between `performance.mark()`, `performance.measure` APIs and Instant, Complete Trace Events. Basically only something recorded with `performance.mark` can be an instant trace event.
This should unblock recording custom trace events inside `PerformanceTracer`, such as when tracing started and others. Same could be said about events related to CPU profiling from Hermes, which will be based on these APIs.
This is the pre-requisite for next diff that will add emitting `TracingStartedInPage` event. With this event, the trace should look similar to the one recorded in the browser, and Timings / Main tracks no longer should be registered manually.
Reviewed By: huntie
Differential Revision: D67207107
fbshipit-source-id: fd7f55dd82167c14a63c2d93aaa649072c5a2a2c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48292
These dependencies are making the CI on main to fail.
## Changelog:
[General][Fixed] - Fix peer dependencies on React types
Reviewed By: javache, hoxyq
Differential Revision: D67283609
fbshipit-source-id: b325246f5de654a9ccbf7f96eec24434047a38ee
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48160
Shift to mockito-kotlin and fix ReactCookieJarContainerTest so it's not just testing a mock.
Changelog: [Internal]
Reviewed By: javache
Differential Revision: D66898956
fbshipit-source-id: 5ccc652b86e5a80b81d257d3ec645d7bc813301b
Summary:
When building a react native app from Xcode and ccache has been set to be used, the `ccache-clang.sh` and `ccache-clang++.sh` scripts cannot find `ccache`, because Xcode PATH does not include ccache binary.
What I've done is setting a `CCACHE_BINARY` user-defined Xcode setting containing the result of executing `command -v ccache` during pod install execution and directly calling it in ccache scripts, set by ReactNativePodsUtils when ccache is enabled.
Fixes https://github.com/facebook/react-native/issues/46126
## Changelog:
[IOS] [FIXED] - fix ccache not found error exporting ccache binary path as Xcode user-defined setting to be used by ccache scripts
Pull Request resolved: https://github.com/facebook/react-native/pull/48257
Test Plan: Correctly builds helloworld and RNTester apps using ccache by enabling it at pod install time: `USE_CCACHE=1 pod install`.
Reviewed By: christophpurrer
Differential Revision: D67280700
Pulled By: cipolleschi
fbshipit-source-id: 5478a191f9bd77606a56ccd340fea225ab62d4bc
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48291
Changelog: [internal]
`react-native-fantom` was added to `.eslintignore` when we upgraded to React 19 because we wanted to reduce the amount of warnings to ease the migration.
This re-enables ESLint for that directory and removes the warnings.
Reviewed By: cipolleschi
Differential Revision: D67283104
fbshipit-source-id: 4ec2363ceaff3cd7bd6e5d70e9588c3dd22d7d85
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48263
Changelog: [internal]
Customize log level in Fantom based on flag in runner.js.
Reviewed By: javache
Differential Revision: D67199970
fbshipit-source-id: 31cdd2eaeee8e7ab4c8985661b35822d78d0457b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48262
Changelog: [internal]
At the moment, we can't start surfaces in Fabric without calling `AppRegistry.runApplication`.
This is completely unnecessary in cases like Fantom, where the creation of the surface is done manually from JS and we render to it immediately after (so we don't need to call into JS again to run AppRegistry).
Reviewed By: javache
Differential Revision: D67199971
fbshipit-source-id: e6402686b6f544a4a7651f6a21a57891ca6be3d1
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48268
No need to store and compare strings here when a simple boolean will do.
Changelog: [Internal]
Reviewed By: NickGerleman, mdvacca
Differential Revision: D67204387
fbshipit-source-id: c78cc758797980c2bce11875e0f6ea1961058f05
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48267
`parentShadowView.tag` was renamed to `parentTag` in D66656411. This one callsite is hidden behind an `#ifdef`, so it didn't produce a compile error.
Changelog: [Internal]
Reviewed By: christophpurrer
Differential Revision: D67203413
fbshipit-source-id: 8c1b1af616165b9a80bd38ab4d7376cb2f27cce5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48284
Changelog: [internal]
We recently prevented tasks that run via `runTask` to synchronously call `runTask` because the execution is synchronous and we can't nest tasks in the event loop (D67107664 / https://github.com/facebook/react-native/pull/48235).
This adds `scheduleTask` to schedule tasks (also within tasks) with the right expectations (the task will not run synchronously on that call but at the right time).
It also adds `runWorkLoop` so we can run scheduled tasks if they're not scheduled from an already running task.
Reviewed By: javache
Differential Revision: D67275518
fbshipit-source-id: acde0093802fbcb7083334f2c0247b37b759a6b1
Summary:
Fixes https://github.com/facebook/react-native/issues/39092
Right now, the `testID` prop that is passed to the ActivityIndicator component is not being applied as a `resource-id`. In this PR, we overwrite the `onInitializeAccessibilityNodeInfo` in the `ProgressBarContainerView` to set this `resource-id`.
## Changelog:
[ANDROID][ADDED] - ActivityIndicator: setting `resource-id` from the `testID` prop
Pull Request resolved: https://github.com/facebook/react-native/pull/48271
Test Plan:
Render a simple activity indicator and pass a `testID` as follows:
```tsx
import {ActivityIndicator} from 'react-native';
function Playground() {
return (
<ActivityIndicator
color="white"
testID="default_activity_indicator"
accessibilityLabel="Wait for content to load!"
/>
);
}
```
<details>
<summary>Inspect the element using an e2e tool such as Maestro or Appium, the `resource-id` is not present: (see screenshot)</summary>
<img width="736" alt="image" src="https://github.com/user-attachments/assets/3aecce5f-3850-4c62-b1ab-aed4133e12bc" />
</details>
---
Apply the changes and then:
<details>
<summary>Inspect again, the `resource-id` is present now: (see screenshot)</summary>
<img width="731" alt="image" src="https://github.com/user-attachments/assets/5a0e3bfa-924a-4a50-8eef-2f7fff7e1290" />
</details>
Reviewed By: rshest
Differential Revision: D67274852
Pulled By: javache
fbshipit-source-id: 2ac8d2bbebed5d1723eb33e735bbf3b477a42572
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48283
Migrate from custom JSI integration to use TurboModule base-class.
This doesn't use codegen right now for ease of migration, and to avoid needing to setup a js_library buck definition for react-native-fantom. We should also figure out what the right abstraction/division of responsibilities is going forward for TesterAppDelegate and FantomModule.
Changelog: [Internal]
Reviewed By: rubennorte
Differential Revision: D67111850
fbshipit-source-id: e1623d80f1f25ec123315b3620930dd17dd8a8a7
Summary:
Building RNTester fails locally because my node path contains a space " ".
(I'm using [fnm](https://github.com/Schniz/fnm) which installs into `/Users/{username}/Library/Application Support/fnm`).
I haven't verified this, but I suspect this is broken for other apps as well, as the script is called when bundling for any app.
<details>
<summary>Expand to see output from the failed build</summary>
```
Node found at: /Users/kraen.hansen/Library/Application Support/fnm/node-versions/v22.11.0/installation/bin/node
+ DEST=/tmp/RNTesterBuild/Build/Products/Release-iphonesimulator/RNTester.app
+ [[ ! -n '' ]]
+ [[ Release = *Debug* ]]
+ [[ -n '' ]]
+ case "$CONFIGURATION" in
+ DEV=false
+++ dirname ../react-native/scripts/react-native-xcode.sh
++ cd ../react-native/scripts/..
++ pwd
+ REACT_NATIVE_DIR=/Users/kraen.hansen/Repositories/react-native/packages/react-native
+ PROJECT_ROOT=/Users/kraen.hansen/Repositories/react-native/packages/rn-tester
+ cd /Users/kraen.hansen/Repositories/react-native/packages/rn-tester
+ [[ -n /Users/kraen.hansen/Repositories/react-native/packages/rn-tester/js/RNTesterApp.ios.js ]]
+ :
+ source /Users/kraen.hansen/Repositories/react-native/packages/react-native/scripts/node-binary.sh
++ '[' -z '/Users/kraen.hansen/Library/Application Support/fnm/node-versions/v22.11.0/installation/bin/node' ']'
++ type '/Users/kraen.hansen/Library/Application Support/fnm/node-versions/v22.11.0/installation/bin/node'
+ HERMES_ENGINE_PATH=/Users/kraen.hansen/Repositories/react-native/packages/rn-tester/Pods/hermes-engine
+ '[' -z /Users/kraen.hansen/Repositories/react-native/packages/rn-tester/Pods/hermes-engine/build_host_hermesc/bin/hermesc ']'
+ [[ true != false ]]
+ [[ -f /Users/kraen.hansen/Repositories/react-native/packages/rn-tester/Pods/hermes-engine ]]
+ '[' -z '' ']'
+ export NODE_ARGS=
+ NODE_ARGS=
+ '[' -z '' ']'
+ CLI_PATH=/Users/kraen.hansen/Repositories/react-native/packages/react-native/scripts/bundle.js
+ '[' -z '' ']'
+ BUNDLE_COMMAND=bundle
+ '[' -z '' ']'
+ COMPOSE_SOURCEMAP_PATH=/Users/kraen.hansen/Repositories/react-native/packages/react-native/scripts/compose-source-maps.js
+ [[ -z '' ]]
+ CONFIG_ARG=
+ [[ -z '' ]]
+ BUNDLE_NAME=main
+ BUNDLE_FILE=/tmp/RNTesterBuild/Build/Products/Release-iphonesimulator/main.jsbundle
+ EXTRA_ARGS=()
+ case "$PLATFORM_NAME" in
+ BUNDLE_PLATFORM=ios
+ '[' '' = YES ']'
+ EMIT_SOURCEMAP=
+ [[ ! -z ../sourcemap.ios.map ]]
+ EMIT_SOURCEMAP=true
+ PACKAGER_SOURCEMAP_FILE=
+ [[ true == true ]]
+ [[ true != false ]]
++ basename ../sourcemap.ios.map
+ PACKAGER_SOURCEMAP_FILE=/tmp/RNTesterBuild/Build/Products/Release-iphonesimulator/sourcemap.ios.map
+ EXTRA_ARGS+=("--sourcemap-output" "$PACKAGER_SOURCEMAP_FILE")
+ [[ true != false ]]
+ [[ false == false ]]
+ EXTRA_ARGS+=("--minify" "false")
+ [[ -n '' ]]
+ [[ -n '' ]]
+ EXTRA_ARGS+=("--config-cmd" "$NODE_BINARY $NODE_ARGS $REACT_NATIVE_DIR/cli.js config")
+ '/Users/kraen.hansen/Library/Application Support/fnm/node-versions/v22.11.0/installation/bin/node' /Users/kraen.hansen/Repositories/react-native/packages/react-native/scripts/bundle.js bundle --entry-file /Users/kraen.hansen/Repositories/react-native/packages/rn-tester/js/RNTesterApp.ios.js --platform ios --dev false --reset-cache --bundle-output /tmp/RNTesterBuild/Build/Products/Release-iphonesimulator/main.jsbundle --assets-dest /tmp/RNTesterBuild/Build/Products/Release-iphonesimulator/RNTester.app --sourcemap-output /tmp/RNTesterBuild/Build/Products/Release-iphonesimulator/sourcemap.ios.map --minify false --config-cmd '/Users/kraen.hansen/Library/Application Support/fnm/node-versions/v22.11.0/installation/bin/node /Users/kraen.hansen/Repositories/react-native/packages/react-native/cli.js config'
/bin/sh: /Users/kraen.hansen/Library/Application: No such file or directory
node:internal/errors:983
const err = new Error(message);
^
Error: Command failed: /Users/kraen.hansen/Library/Application Support/fnm/node-versions/v22.11.0/installation/bin/node /Users/kraen.hansen/Repositories/react-native/packages/react-native/cli.js config
/bin/sh: /Users/kraen.hansen/Library/Application: No such file or directory
at genericNodeError (node:internal/errors:983:15)
at wrappedFn (node:internal/errors:537:14)
at checkExecSyncError (node:child_process:888:11)
at execSync (node:child_process:960:15)
at Command.handleAction (/Users/kraen.hansen/Repositories/react-native/packages/react-native/scripts/bundle.js:48:9)
at Command.listener [as _actionHandler] (/Users/kraen.hansen/Repositories/react-native/node_modules/commander/lib/command.js:542:17)
at /Users/kraen.hansen/Repositories/react-native/node_modules/commander/lib/command.js:1502:14
at Command._chainOrCall (/Users/kraen.hansen/Repositories/react-native/node_modules/commander/lib/command.js:1386:12)
at Command._parseCommand (/Users/kraen.hansen/Repositories/react-native/node_modules/commander/lib/command.js:1501:27)
at Command.parse (/Users/kraen.hansen/Repositories/react-native/node_modules/commander/lib/command.js:1064:10)
at Object.<anonymous> (/Users/kraen.hansen/Repositories/react-native/packages/react-native/scripts/bundle.js:71:11)
at Module._compile (node:internal/modules/cjs/loader:1546:14)
at Object.<anonymous> (node:internal/modules/cjs/loader:1689:10)
at Module.load (node:internal/modules/cjs/loader:1318:32)
at Function._load (node:internal/modules/cjs/loader:1128:12)
at TracingChannel.traceSync (node:diagnostics_channel:315:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:218:24)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:170:5)
at node:internal/main/run_main_module:36:49 {
status: 127,
signal: null,
output: [
null,
'',
'/bin/sh: /Users/kraen.hansen/Library/Application: No such file or directory\n'
],
pid: 64660,
stdout: '',
stderr: '/bin/sh: /Users/kraen.hansen/Library/Application: No such file or directory\n'
}
Node.js v22.11.0
Command PhaseScriptExecution failed with a nonzero exit code
warning: Run script build phase '[CP-User] [RN]Check FBReactNativeSpec' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'React-RCTFBReactNativeSpec' from project 'Pods')
warning: Run script build phase 'Build JS Bundle' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'RNTester' from project 'RNTesterPods')
warning: Run script build phase '[RN] Copy Hermes Framework' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'RNTester' from project 'RNTesterPods')
** BUILD FAILED **
```
</details>
This PR add single quotes around the `$NODE_BINARY` and `$REACT_NATIVE_DIR` to avoid `--config-cmd` escaping similarly to the way they're escaped when invoked just below: https://github.com/facebook/react-native/blob/00c7174c24fd15db7723633e3e67aa59a7e73a6c/packages/react-native/scripts/react-native-xcode.sh#L155
## Changelog:
[IOS] [FIXED] - Properly escape paths in Xcode build script used when bundling an app.
Pull Request resolved: https://github.com/facebook/react-native/pull/48275
Test Plan:
- Change your node path to contain a space (possibly through a symlink and manually updating the `.xcode.env.local` file in `packages/rn-tester`.
- Build the RNTester app for e2e tests: `yarn e2e-build-ios`
- See the failure mentioned above 💥
- Apply this patch and re-run the build command to success ✅
Reviewed By: NickGerleman
Differential Revision: D67256815
Pulled By: robhogan
fbshipit-source-id: e27a8cd079347fdf982c28b5af347be621c8feba
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48265
For some clang warnings configurations, you may hit `-Winconsistent-missing-destructor-override` without this override modifier.
## Changelog
[Internal]
Reviewed By: cipolleschi
Differential Revision: D67203040
fbshipit-source-id: 51f8f9bc4e45ebdb008dc440b779302b1103668a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48226
Adding logging to onHostPause to help diagnose cases when the activity is incorrectly null.
Reviewed By: fkgozali
Differential Revision: D67123351
fbshipit-source-id: f694a3a89e4584776050f6bca2f33f2805528d4b
Summary:
We're trying to pass `jsi::Value`s directly to our view components (and convert them to java/swift types manually). That way we can pass "complex" objects to our views (such as `jsi::Object`s with `NativeState` attached, without the need to convert them to e.g. `folly::dynamic`).
On android we store our complex prop values on the `StateWrapperImpl` to pass the complex types between c++ and java/kotlin. See an example here:
https://github.com/hannojg/nitro/blob/2378fe7754294c496b2cbcd62f7109529e276427/packages/react-native-nitro-image/nitrogen/generated/android/c%2B%2B/JValueFromStateWrapper.cpp#L21-L23
```
const auto& customStateData = dynamic_cast<const ConcreteState<CustomStateData>&>(state);
CustomStateData data = customStateData.getData();
std::shared_ptr<HybridTestObjectSwiftKotlinSpec> nativeProp = data.nativeProp;
```
> (And then it might be used in java like this:)
https://github.com/hannojg/nitro/blob/2378fe7754294c496b2cbcd62f7109529e276427/packages/react-native-nitro-image/android/src/main/java/com/margelo/nitro/image/NitroExampleViewManager.java#L31-L38
```kotlin
public Object updateState(NonNull View view, ReactStylesDiffMap props, StateWrapper stateWrapper) {
StateWrapperImpl stateWrapperImpl = (StateWrapperImpl) stateWrapper;
HybridTestObjectSwiftKotlinSpec nativeProp = ValueFromStateWrapper.valueFromStateWrapper(stateWrapperImpl);
long value = nativeProp.getBigintValue();
Log.d("NitroExampleViewManager", "Value from state: " + value);
```
For that we need to be able to access the underlying state, which is what we added in this PR.
## 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] - Added `getState` method for `StateWrapperImpl`
Pull Request resolved: https://github.com/facebook/react-native/pull/48255
Test Plan: Internal change, just make sure all tests are passing
Reviewed By: cipolleschi
Differential Revision: D67196130
Pulled By: javache
fbshipit-source-id: 7da74bcddef79abd3122baaad1bfce30330ecc80
Summary:
I was getting build errors when I tried to include `StateWrapperImpl.h` in my library's code on android. The error was:

```
node_modules/react-native/ReactAndroid/build/prefab-headers/reactnative/react/fabric/StateWrapperImpl.h:11:10: fatal error: 'react/common/mapbuffer/JReadableMapBuffer.h' file not found
#include <react/common/mapbuffer/JReadableMapBuffer.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3 warnings and 1 error generated.
```
The problem is that the map buffer files inside the mapbuffer folder are nested, so the prefab outcome looks like this:

Hence it can't resolve the header path.
This change removes the header prefix part as its not needed, since the nested folder structure in mapbuffer already matches what we need, see:
https://github.com/facebook/react-native/tree/main/packages/react-native/ReactAndroid/src/main/jni/react/mapbuffer
## 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] [FIXED] - Fixed build issue when including mapbuffer jni headers in library code
Pull Request resolved: https://github.com/facebook/react-native/pull/48243
Test Plan:
make sure the header path looks correct in the prefab build dir:

Reviewed By: cipolleschi
Differential Revision: D67200010
Pulled By: cortinico
fbshipit-source-id: 127a17392fcca0a3a07643497729979849f0a17a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48222
Changelog: [internal]
Tiny improvement over the current setup so it might help detect some current issues.
Reviewed By: yungsters
Differential Revision: D67021976
fbshipit-source-id: 7829f2ea0d839178f1a50d176b42dc0906c2e585
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48188
Yoga is full of bugs! Some of these bugs cannot be fixed without breaking large swaths of product code. To get around this, we introduced "errata" to Yoga as a mechanism to preserve bug compatibility, and an `experimental_layoutConformance` prop in React Native to create layout conformance contexts. This has allowed us to create more compliant layout behavior for XPR.
This prop was originally designed as a context-like component, so you could set a conformance level at the root of your app, and individual components could change it for compatibility. This was difficult to achieve at the time, without introducing a primitive like `LayoutConformanceView`, which itself participated in the view tree. This prop has not been the desired end-goal, since it does not make clear that it is setting a whole new context, effecting children as well!
Now that we've landed support for `display: contents`, we can achieve this desired API pretty easily.
**Before**
```
import {View} from 'react-native';
// Root of the app
<View {...props} experimental_layoutConformance="strict">
{content}
</View>
```
**After**
```
import {View, experimental_LayoutConformance as LayoutConformance} from 'react-native';
// Root of the app
<LayoutConformance mode="strict">
<View {...props}>
{content}
</View>
</LayoutConformance>
```
Changelog: [Internal]
Reviewed By: javache
Differential Revision: D66910054
fbshipit-source-id: e6a304b5c30ad3c5845a7ce2d1021996a74c2f34
Summary:
This module is no longer functional, the global method `pokeSamplingProfiler` does not exist. There are no implementations in the core of `JSCSamplingProfiler` (removed back in 2019! - https://www.internalfb.com/diff/D10473627)
Changelog: [Internal]
Reviewed By: fabriziocucci
Differential Revision: D67140119
fbshipit-source-id: 9dfe80d63e935004ef4a1956e8a7a544a2f9a8c1
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48073
Small change so we can know what the final value of the feature flag will be
Changelog: [Internal]
Reviewed By: mdvacca
Differential Revision: D64077789
fbshipit-source-id: 2a9e2c7ceeb18813b4556f92db547697bba966a5
Summary:
In this PR we added a change that allows the RawPropsParser to construct its RawValues directly from the `jsi::Value` instead of converting it to `folly::dynamic` first.
We added a global feature flag to turn this on, however, for migrations it might be better to use this functionality as an opt-in on a component basis. With this change `ComponentDescriptors` can now create their RawPropsParser instance with the `useRawPropsJsiValue` flag to opt into it.
(Note: a few more changes are needed to make this accessible to the `ComponentDescriptor`, for which I opened [this follow up PR here](https://github.com/facebook/react-native/pull/48232))
## 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
-->
[INTERNAL] [ADDED] - Added `useRawPropsJsiValue` parameter to `RawPropsParser` to opt into skipping folly::dynamic conversions during prop parsing.
Pull Request resolved: https://github.com/facebook/react-native/pull/48231
Test Plan: Internal change / just make sure all tests are passing.
Reviewed By: NickGerleman
Differential Revision: D67139641
Pulled By: javache
fbshipit-source-id: 5b243edb8149870aad0a5a1b3998ee67997783d7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48242
This std::function is immediately invoked, no need to copy it around.
Changelog: [Internal]
Reviewed By: fabriziocucci
Differential Revision: D67093042
fbshipit-source-id: 2b863fb1857da73568afaf6f3d3c8c7bbef0d61b
Summary:
### Motivation
- We need to exclude certain prop keys from conversion to `folly::dynamic` on android for our custom use case where we pass down `jsi::object`s with NativeState attached down the props
Otherwise we run into crashes such as:

### Changes
- `dynamicFromValue` was marked as `noexcept` although it can throw, I removed the `noexcept` for correctness
- Made it so you can pass down a filter function to exclude certain props from conversion (using the existing mechanism for that)
- I think there is no way to pass a filter function and retain it in `RawProps` as that is constructed very early on in `UIManagerBinding`
## 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
-->
[INTERNAL] [ADDED] - Allow passing a filter function to `BaseViewProps` to exclude certain props on android from being dynamically casted
Pull Request resolved: https://github.com/facebook/react-native/pull/48202
Test Plan:
You can try modifying for example `ScrollViewProps.cpp` and pass a fourth argument to `ViewProps` to confirm that the filtering is working:
```cpp
ScrollViewProps::ScrollViewProps(
const PropsParserContext& context,
const ScrollViewProps& sourceProps,
const RawProps& rawProps)
: ViewProps(context, sourceProps, rawProps, [&](const std::string& keyName){
return true;
}),
```
Reviewed By: NickGerleman
Differential Revision: D67088540
Pulled By: javache
fbshipit-source-id: ed8cf5d773d357dfc54553f5ccf7adf27c781d56
Summary:
Apple introduced system font families
```
font-family: system-ui;
font-family: ui-sans-serif;
font-family: ui-serif;
font-family: ui-monospace;
font-family: ui-rounded;
```
for Safari at 2020 (see https://developer.apple.com/videos/play/wwdc2020/10663/?time=872).
This PR implementation supports above font families on iOS.
bypass-github-export-checks
## Changelog:
[IOS] [ADDED] - Support system font families (system-ui, ui-sans-serif, ui-serif, ui-monospace, and ui-rounded) on iOS
Pull Request resolved: https://github.com/facebook/react-native/pull/47544
Test Plan: Run `RNTester` and view the `Text` component where shows the usage for those font families.
Reviewed By: NickGerleman
Differential Revision: D65761307
Pulled By: cipolleschi
fbshipit-source-id: 18628160b7753b314389e887cddfe9d0ec96ee1d
Summary:
This PR converts the HelloWorld app to Swift. The HelloWorld app is our internal copy of the Template and the template is now using Swift. It's important that this macroscopic changes are synched between the template and HelloWorld, otherwise we risk to ship changes that works in the helloworld app but that break the template, and therefore the next release. That already happened once this month.
## Changelog:
[Internal] - Migrate HelloWorld app to swift
Pull Request resolved: https://github.com/facebook/react-native/pull/48246
Test Plan: GHA
Reviewed By: cortinico
Differential Revision: D67143408
Pulled By: cipolleschi
fbshipit-source-id: f74412116570e44c2a394173f7d4d3b6dd85e2e5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48209
[Changelog] [Internal] - (Almost) align Android TextLayoutManager interface with iOS one
This change aligns the public API surface of `TextLayoutManager` from RN Android closer to the RN iOS one.
Reviewed By: javache
Differential Revision: D67061225
fbshipit-source-id: b06f47c7e322bdac429cefb85bf2f2a80210a64f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48223
[Changelog] [Internal] - Use ShadowNode::Traits instead of directly enable Yoga measurement
The goal of this change is to simple use ShadowNodeTraits to enable measurement of ShadowNode props
Reviewed By: NickGerleman
Differential Revision: D67114097
fbshipit-source-id: dccb0f9b83f339c07ca41678533d97191277b520
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48237
Noticed this when trying to diagnose what seemed like a stale caching issue. It effectively reverts D59917944.
D59917944 added logic to only do yarn caching on main, but it has some correctness issues:
1. We cache `node_modules` instead of the yarn cache, which may contain e.g. build artifacts, or other scratch/cache files written (such as anything that writes to `node_modules/.cache`). We really want to be caching the yarn cache, which has pristine packages before install, which I think it will also need to perform the real install anyways.
2. We key the cache on root `package.json`, which is missing a lot of information (both provided by the other `package.json` in the repo, but mostly, the lockfile resolution).
We only save cache when we're on `refs/heads/main` (so continuous builds against main), and supposedly, builds against base branch should be able to restore against those, but recent PR jobs I have seen, where `package.json` has not changed, all have `Cache not found for input keys: node-modules-068350889e87919c1c6c2c220c8d2d92db13f38820bf2efb315d1274b97bc367`
Because of the potential correctness issues, and that the strategy for limiting to main seemingly is not allowing cache to be used in PR, this diff goes back to previous solution, which may store more artifacts (but working cache should also reduce cost by making jobs run faster).
Changelog: [Internal]
Reviewed By: cipolleschi
Differential Revision: D67140004
fbshipit-source-id: f74074a498af56b1837fa23cf80795f76935b762
Summary:
This pr tests the Old Arch on the Template app using Maestro
## Changelog:
[Internal] - Test old arch in CI with Maestro for template app
Pull Request resolved: https://github.com/facebook/react-native/pull/48244
Test Plan: GHA
Reviewed By: cortinico
Differential Revision: D67141524
Pulled By: cipolleschi
fbshipit-source-id: bef3a9b6fec9d7c91d858d534a2d00e91f1842b5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48238
Use the helper module we have, which has better type-safety and less code duplication.
Changelog: [Internal]
Reviewed By: fabriziocucci
Differential Revision: D67139572
fbshipit-source-id: 39ae9119d97f937b30ad6e7451468cbb3cc37a84
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48235
Recursively calling runTask is not supported, as the inner call will no-op since we're already executing the eventloop.
Currently errors are not correctly propagated, but this at least makes it so that we don't attempt to schedule the task either, which could lead to incorrect assumptions being made.
Changelog: [internal]
Reviewed By: rubennorte
Differential Revision: D67107664
fbshipit-source-id: e665a96671f4812308d87aec3b880ce2009328e2
Summary:
In this PR we introduced a new mechanism for `RawPropsParser` to construct its RawValues directly from `jsi::Value` instead of converting it to `folly::dynamic` first:
- https://github.com/facebook/react-native/pull/48047/
In this PR we added a parameter to `RawPropsParser` to opt-into using the above described mechanism:
- https://github.com/facebook/react-native/pull/48231
Whats missing is that `RawPropsParser` was default constructed in `ComponentProvider` and there is no way to pass a custom instance (where you'd for example set the above described parameter). This PR adds support for that.
## 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
-->
[INTERNAL] [ADDED] - Add `RawPropsParser` as optional parameter to Concrete-/ComponentDescriptor
Pull Request resolved: https://github.com/facebook/react-native/pull/48232
Test Plan: Internal change, just make sure all CI tests are passing.
Reviewed By: cipolleschi
Differential Revision: D67135357
Pulled By: javache
fbshipit-source-id: 45f384d42314976c16cae10d5ea0419d13fd0889
Summary:
`react_native_assert` on iOS uses glog under the hood, and https://github.com/facebook/react-native/pull/47911 added usage to a new podspec, which means new entire binary under some build modes. Need to add missing dependency I think?
Changelog: [Internal]
Pull Request resolved: https://github.com/facebook/react-native/pull/48241
Test Plan: tes_ios_helloworld passes with DynamicLibraries
Reviewed By: cipolleschi
Differential Revision: D67141052
Pulled By: NickGerleman
fbshipit-source-id: 299a499f40e9b54c4aca5d6e1c95c43ce933fb2b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48224
Changelog: [General][Fixed] Removed unnecessary state updates in React to reflect the current state of looping animations.
This enables that feature flag by default and prepares for an incoming cleanup.
Reviewed By: yungsters, dmytrorykun
Differential Revision: D67109980
fbshipit-source-id: 3c98731221b0fb01a8d49d537df859fe23c0ae45
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48229
Changelog: [internal]
The type definitions for these objects (the exported value by the `ReactNativeFeatureFlags` module, and the input value for `ReactNativeFeatureFlags.override()` method) were writable objects, which is incorrect and causes other problems down the line.
This just makes them read-only.
Reviewed By: yungsters
Differential Revision: D67109719
fbshipit-source-id: 8d56e05042587a53cdd05e51b4207ef27ace2d91
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48225
Fixes https://github.com/facebook/react-native/issues/47762
The weak event emitter in AttributedString attributes is causing a serialization error when typing into a TextInput in a Mac Catalyst build. We can resolve this by not putting the event emitters in the attributed string, but this is likely to cause other issues with event handling for nested <Text> components.
## Changelog
[iOS][Fixed] - Workaround for Mac Catalyst TextInput crash due to serialization attempt of WeakEventEmitter
Reviewed By: NickGerleman
Differential Revision: D66664583
fbshipit-source-id: efdfbcb0db4d5e6b9bf7c14f9bbb221faae2d724
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48200
Wires up `Performance.mark()` events, completing support for User Timings in Fusebox.
Other changes:
- Refactors `reportMeasure` to receive a `duration`.
- Fixes conversion for time values (ms -> µs) in emitted trace events.
Changelog: [Internal]
Reviewed By: hoxyq
Differential Revision: D66704283
fbshipit-source-id: 352abbade26eb976e793481dde04463431bf2eb7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48043
Adds a new `PerformanceTracing` API to replace `ReactPerfLogger` and `FuseboxTracer`.
- Mostly a clone of `FuseboxTracer`, with small refactorings.
- Exposes a new `CdpTracing.h` header, intended for shared CDP/Chrome types (that will later propagate through to the runtime impl of `performance.mark,measure()`).
- These live in a new `jsinspector_tracing` library, to avoid a dependency cycle.
**Key change**: With both diffs, `PerformanceTracer` is added to `PerformanceEntryReporter` to initially wire up the `performance.measure` event — replacing the previous routing.
- `FuseboxTracer` remains load-bearing for the out-of-tree call to `stopTracingAndWriteToFile()`.
Changelog: [Internal]
Reviewed By: rubennorte
Differential Revision: D66650181
fbshipit-source-id: 9092257f23cdb8746e69f5ff3eb7dbf4c8142938
Summary:
When running the linter locally, noise is generated from the `packages/react-native/ReactAndroid/build` folder. This folder does not need to be checked, as it is already excluded in the [.gitignore](https://github.com/facebook/react-native/blob/main/.gitignore#L33).
## Changelog:
[INTERNAL] - Exclude `packages/react-native/ReactAndroid/build` from lint checks
Pull Request resolved: https://github.com/facebook/react-native/pull/48217
Test Plan:
```bash
yarn lint
```
Reviewed By: huntie
Differential Revision: D67134035
Pulled By: cortinico
fbshipit-source-id: f314c8601d6a3bf8ac6ebed67bdc392c6a6aeba8
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48227
This option is on by default in Flow v0.256
Reviewed By: gkz
Differential Revision: D67117062
fbshipit-source-id: 1595afe48178529ad43b33a215d84ff225cf9fa9
Summary:
In react-native-windows our static analysis tools report an error for `timeoutForSchedulerPriority` due to cases where it may not always return a value. This is an upstreaming of the patch we have to fix that error.
## Changelog:
[INTERNAL] [FIXED] - Fix no return static analysis error in SchedulerPriorityUtils.h
Pull Request resolved: https://github.com/facebook/react-native/pull/47911
Test Plan: Building should be sufficient.
Reviewed By: christophpurrer
Differential Revision: D66992063
Pulled By: NickGerleman
fbshipit-source-id: 999fea328d0c66ad92314f537e41beff5856c285
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47946
Object creation with custom prototype can currently be done, but it is
unnecessarily convoluted. Users have to call into the global object to
get the `Object.create` function, then call it with the custom
prototype.
This diff adds a JSI API for Object.create(prototype) to make it easy
for users.
Changelog: [Internal]
Reviewed By: avp
Differential Revision: D66485209
fbshipit-source-id: 32018f847190ac16f695f011a78be0c45c4c4659
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47996
Getting and setting an Object's prototype is convoluted. Users have to
call into the global object to get the method, then call it.
This diff adds a JSI API for Object.getPrototype and Object.setPrototype
to make it easy for users.
Changelog: [Internal]
Reviewed By: fbmal7
Differential Revision: D66562549
fbshipit-source-id: 85a2e49deb9d00500544de4cc5ab123c4717398e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48208
[Changelog] [Internal] - Remove unused (Android) TextLayoutManager getter
This getter
```
void* getNativeTextLayoutManager() const;
```
is not used on Android and different in signature to the iOS one:
```
std::shared_ptr<void> getNativeTextLayoutManager() const;
```
Deleting it for now to make future code sharing between various platforms easier.
This change removes further the by now discouraged pattern of:
```
using SharedTextLayoutManager = std::shared_ptr<const TextLayoutManager>;
```
and changes callers to use
```
std::shared_ptr<const TextLayoutManager>;
```
directly.
Reviewed By: javache
Differential Revision: D67059514
fbshipit-source-id: b94dc7f664083c5c62c4ba7defca480549ca9dc1
Summary:
# Summary
I'm working to get the main `react-native` package parsable by modern
Flow tooling (both `flow-bundler`, `flow-api-translator`).
This diff trivially removes some redundant Flow comment syntax in
`ReactNativeTypes.js`, which fixes parsing under these newer tools.
## How did you test this change?
Files were pasted into `react-native-github` under fbsource, where Flow
validates ✅.
DiffTrain build for [92b62f500c3fca44a9dc9ead936ef3bf19481f02](https://github.com/facebook/react/commit/92b62f500c3fca44a9dc9ead936ef3bf19481f02)
Reviewed By: huntie
Differential Revision: D67100354
Pulled By: hoxyq
fbshipit-source-id: 575e4bd8ceefad15576273920a263ae89d027cad
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48216
The `React-graphics` podspec is manually excluding some paths from the source_files but this approach is error prone. For esample changes that added new paths that must be excluded can create failures.
This change the podspec file to explicitly add only the files that iOS requires.
## Changelog:
[iOS][Changed] - Explicitly define the source files for React-graphics
## Facebook:
This change is necessary because we added the macos platform that was not included before and now we can't build RNTester from fbsource using the internal pipeline.
Reviewed By: hoxyq
Differential Revision: D67095677
fbshipit-source-id: 701d5938f6e141a313be62c8f930a089e1d6ee96
Summary:
### Motivation:
We are looking for a way to access the "raw" jsi value in our fabric view components, so that we can pass complex types like `HostObjects` or `jsi::Object` with `NativeState` attached to our components directly.
Currently the props are converted from `jsi::Object` to `folly::dynamic`, which prevents us from accessing these values directly.
### Changes
This PR is a implementation of the proposal discussed here:
- https://github.com/facebook/react-native/pull/44966#issuecomment-2503915245
These changes extend `RawValue` so that it can be directly constructed from `RawValue(Runtime*, jsi::Value&)` (not just from `folly::dynamic`).
`RawValue`s are created by the `RawPropParser.cpp`. By default it will use the `RawValue(folly::dynamic)` constructor, but we added a feature flag called `useRawPropsJsiValue`, which will sue the JSI constructor.
This enables to test this feature at runtime incrementally.
This change might also be tested on a component basis, by setting a flag in the component descriptor to enable JSI prop parsing for the RawPropParser, as outlined in this PR:
- https://github.com/hannojg/react-native/pull/2
## 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] [Added] - Add `useRawPropsJsiValue` feature flag to represent props internally as `jsi::Value`s instead of converting them to `folly::dynamic`
[General] [Added] - Added `RawValue(Runtime*, jsi::Value&)` constructor to make a `RawValue` from a `jsi::Value`.
Pull Request resolved: https://github.com/facebook/react-native/pull/48047
Test Plan: Enable the `useRawPropsJsiValue` feature flag and test the rn-tester app on android and iOS. Make sure you get no new errors / warnings in the native console.
Reviewed By: NickGerleman
Differential Revision: D66877093
Pulled By: javache
fbshipit-source-id: 7342e5f86d2492ad63a9ccf5508f04e7eb252def
Summary:
`JSBigFileString` incorrectly passes the file offset to `mmap`, causing errors when `offset` is non-zero.
## Changelog:
[GENERAL] [FIXED] - `JSBigFileString` fails for non-zero offset arguments
Pull Request resolved: https://github.com/facebook/react-native/pull/48198
Test Plan: - verify the new unit test passes
Reviewed By: cipolleschi
Differential Revision: D67086826
Pulled By: javache
fbshipit-source-id: 0991bb34a710b85ff0263dc553efb85ba62b4cd8
Summary:
While I was [working on fixing the iOS debugger logic](https://github.com/facebook/react-native/pull/48174) based on configuration name regex match, I wanted to know if other logic was also based on configuration names. I think I found and fixed the only other configuration name-based logic in the repo in this PR.
## Changelog:
<!-- 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
-->
[IOS] [CHANGED] - Use configuration type when adding ndebug flag to pods in release
Pull Request resolved: https://github.com/facebook/react-native/pull/48193
Test Plan:
In a fresh react-native project, I added to the Podfile:
```ruby
installer.aggregate_targets.each do |aggregate_target|
aggregate_target.xcconfigs.each do |config_name, config_file|
is_release = aggregate_target.user_build_configurations[config_name] == :release
puts "aggregate_targets #{config_name} is_release: #{is_release}"
end
end
installer.target_installation_results.pod_target_installation_results.each do |pod_name, target_installation_result|
target_installation_result.native_target.build_configurations.each do |config|
is_release = config.type == :release
puts "target_installation_results #{config.name} is_release: #{is_release}"
end
end
```
to confirm my logic. It output the following:
```
aggregate_targets Release is_release: true
aggregate_targets Local is_release: false
...
target_installation_results Local is_release: false
target_installation_results Release is_release: true
...
```
I also updated the applicable tests I could find for this logic.
Reviewed By: cortinico
Differential Revision: D67025325
Pulled By: cipolleschi
fbshipit-source-id: 45d68ee86e3255d843275a72916883c8c4bbc13d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48164
[Changelog] [Internal] - Share common ShadowNode functionality in BaseTextInputShadowNode for iOS
The current Android and iOS implementations have quite some overlapping functionality. Not sharing common logic makes it also harder to reuse this [functionality] for out of tree platforms.
This change moves the current iOS implementation into a shared location.
The next change allows to reuse it for Android.
Reviewed By: NickGerleman
Differential Revision: D66901676
fbshipit-source-id: a870155633875377d881fbd9f41fafb305672949
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48201
For any build for which we enable the perfetto build flag, we should probably enable the `__RCTProfileIsProfiling` so we get systrace markers.
Changelog: [Internal]
Reviewed By: bgirard
Differential Revision: D67031171
fbshipit-source-id: 5e7f56f911acacd3156778bd9151202fc809e291
Summary:
Fixes https://github.com/facebook/react-native/issues/39260
Right now, there is a small issue when you try debugging the Networking library methods as it seems like they are empty in Android. This is not an actual functional issue as everything in code works fine, but rather an inconsistency in how the iOS and Android methods are being exported. In iOS it was exported as an object, in Android it was a class.
## Changelog:
[INTERNAL] - Making `RCTNetworking` js exports consistent
Pull Request resolved: https://github.com/facebook/react-native/pull/48166
Test Plan:
I've checked that `XMLHttpRequest` is still working as expected, as this is used mostly there.
And below there are screenshots of how the module methods are logged after the refactor. Which addresses what was reported in the linked issue.
```js
import {Networking} from 'react-native';
import AndroidNetworking from 'react-native/Libraries/Network/RCTNetworking.android.js';
import IOSNetworking from 'react-native/Libraries/Network/RCTNetworking.ios.js';
console.log({Networking, AndroidNetworking, IOSNetworking});
```
Before | After
-- | --
<img width="1196" alt="image" src="https://github.com/user-attachments/assets/b7ab1dcd-9dd1-4ed9-ade5-d90251a77d5e"> | <img width="1196" alt="image" src="https://github.com/user-attachments/assets/5ae17c6a-b068-462a-b228-576dcf08ef12">
Reviewed By: fabriziocucci
Differential Revision: D67022711
Pulled By: javache
fbshipit-source-id: 81f9988295fb3f559a795077f09ee0f14827dc86
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47247
Changelog: [internal]
Bye bye `ReactNativeConfig` 👋.
All existing usages of the API have been cleaned up or migrated to `ReactNativeFeatureFlags`, so this is no longer needed.
Reviewed By: GijsWeterings
Differential Revision: D65062306
fbshipit-source-id: 76afcd48ad72023b6dc2a90955ae2f03a1164cca
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47246
Changelog: [internal]
Just to use CI to verify there are no more existing usages of the API before cleaning it up.
Reviewed By: GijsWeterings
Differential Revision: D65062302
fbshipit-source-id: e1b71d39ef1fba23cc68e36fe0a0b57cfc2a614e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48199
`animatedShouldUseSingleOp` relies on a queue always being active, or for a call to `flushQueue` later down the line. If these are missing, a call will be queued up but only executed whenever the next animation flush happens.
Changelog: [General][Fixed] Animation.stop() executes when `animatedShouldUseSingleOp` is enabled.
Reviewed By: yungsters
Differential Revision: D67025831
fbshipit-source-id: 66a7f50d833b7bbaf9f16dd04d24b90c7a699fa0
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48182
Maintainers from SVG reached out because of an edge case they inencountered when generating the ComponentProvider. In their setup, they had a `.git` folder in the repo and the algorithm was spending a lot of time crawling the git folder.
In general, we should avoid crawling hidden folders.
This change fix that.
## Changelog:
[General][Fixed] - Skip hidden folders when looking for third party components.
Reviewed By: javache
Differential Revision: D66959345
fbshipit-source-id: 992a79f3cff22cd6a459e0272c8140bc329888da
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48029
Changelog: [Internal]
Adding snapshot support for rendered output only for now.
This will only work if snapshot is created beforehand by hand.
# Next steps
* Create snapshot when no prior snapshot is available
* Pass and update if instructed
Reviewed By: christophpurrer
Differential Revision: D66601387
fbshipit-source-id: fe528cded43c5ba36d314bd9af8e3fb84b98ac3e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47939
Before we were clipping Android background drawable to the padding box. This is not how its done on web.
The background should remain under the border so that if the border is traslucent you can see the background underneath
Reviewed By: NickGerleman
Differential Revision: D66463305
fbshipit-source-id: 427acea760b2748a07cc28bbd362aaaae0811093
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48133
[Changelog] [Internal] - Share common (Base)TextInputState properties
This change allows to share common TextInput State properties between various platforms.
Reviewed By: rshest
Differential Revision: D66855831
fbshipit-source-id: d0f85c419b82445ac84bfcc606f1bf752f5dba73
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47973
Gap can be styled using both `points` and `percentages`, but YGNodeStyleGetGap currently returns a float value.
To maintain alignment with the `padding` and `margin` functionalities and allow it to be handled in bridging code, this function has been updated to return YGValue.
X-link: https://github.com/facebook/yoga/pull/1753
Reviewed By: joevilches
Differential Revision: D66513236
Pulled By: NickGerleman
fbshipit-source-id: b7110855c037f20780f031f22a945bde4446687d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48161
[Changelog] [Internal] - Remove unused defaultThemePaddingStart|End|Top|Bottom from AndroidTextInputState
This data is set, but never read
Reviewed By: javache
Differential Revision: D66904641
fbshipit-source-id: 4db1cd49e9ec63b62f75070b478d2006ea101f8c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48180
Changelog: [Internal]
Releasing runtime shadow node reference updates, enabling it by default now that the fix for RN Windows landed.
Reviewed By: javache
Differential Revision: D66959896
fbshipit-source-id: dcf1c4a7257fe60ae0faffe1952fc2c80effe406
Summary:
Fixes https://github.com/facebook/react-native/issues/47045
On Android `adjustsFontSizeToFit` relies on two metrics:
- Text with line breaks results in more lines than `maximumNumberOfLines`
- The overall height of the text is larger than the available height
None of these two was fulfilled when a single-character string had a higher width than the available one (a single character will not be broken into multiple lines). This PR adds exactly that as a third option to trigger the scaling algorithm - a single-character string that has a higher width than the available one.
On iOS `adjustsFontSizeToFit` relies on `truncatedGlyphRangeInLineFragmentForGlyphAtIndex` which seems to be returning `NSNotFound` when a single-character sting gets truncated. Similarly to Android, this PR adds an additional check to make sure that single-character strings actually fit inside the container.
## Changelog:
[GENERAL] [FIXED] - Fixed `adjustsFontSizeToFit` not working for text with a single character
Pull Request resolved: https://github.com/facebook/react-native/pull/47082
Test Plan:
Tested on the code from the issue:
|Android (old arch)|Android (new arch)|iOS (old arch)|iOS (new arch)|
|-|-|-|-|
|<img width="406" alt="android_old" src="https://github.com/user-attachments/assets/91b1af41-4ef7-46cc-bb04-374f860d93ac">|<img width="406" alt="android_new" src="https://github.com/user-attachments/assets/90e3cde1-e6c0-4b25-8325-c62a37773002">|<img width="546" alt="ios_old" src="https://github.com/user-attachments/assets/902b9c10-84e0-4372-bcc8-07cd1ef006f6">|<img width="546" alt="ios_new" src="https://github.com/user-attachments/assets/f4df4f0e-7649-47f3-9c81-e38f8665d9a2">|
Reviewed By: javache
Differential Revision: D64664351
Pulled By: NickGerleman
fbshipit-source-id: b68f318a0fbd5ebed947a70d1e3fb0515b5fb409
Summary:
Fixes an [issue](https://github.com/facebook/react-native/issues/48168) where only iOS configurations with "Debug" in the name are configured to use the hermes debugger.
## Changelog:
<!-- 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
-->
[IOS] [FIXED] - Enable hermes debugger by configuration type instead of configuration name
Pull Request resolved: https://github.com/facebook/react-native/pull/48174
Test Plan:
Added new test scenarios that all pass:
```
ruby -Itest packages/react-native/scripts/cocoapods/__tests__/utils-test.rb
Loaded suite packages/react-native/scripts/cocoapods/__tests__/utils-test
Started
Finished in 0.336047 seconds.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
56 tests, 149 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
166.64 tests/s, 443.39 assertions/s
```
In a personal project with the following configurations:
```
project 'ReactNativeProject', {
'Local' => :debug,
'Development' => :release,
'Staging' => :release,
'Production' => :release,
}
```
I added the following to my Podfile:
```
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
puts "#{config.name} is debug? #{config.type == :debug}"
end
end
```
To confirm that my logic is correct:
```
Local is debug? true
Development is debug? false
Staging is debug? false
Production is debug? false
```
Reviewed By: robhogan
Differential Revision: D66962860
Pulled By: cipolleschi
fbshipit-source-id: 7bd920e123c9064c8a1b5d45df546ff5d2a7d8be
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48113
Processing cookies can have a non-trivial impact on startup-time. It requires reading OkHttp's `PublicSuffixDatabase` but also allocating various WebKit components. Instead handle the cookiejar being set to non-CookieJarContainer instances gracefully, which allows a custom client builder to set `CookieJar.NO_COOKIES`.
Changelog: [Internal]
Reviewed By: cortinico
Differential Revision: D66787514
fbshipit-source-id: bf790691496f674ec743ba4791552b12e06eda29
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48178
Changelog: [internal]
Adds a new mode for Fantom to run tests with dev-mode bytecode. Right now the modes were only dev (development with source code) or opt (optimized bytecode).
Reviewed By: rshest
Differential Revision: D66888986
fbshipit-source-id: 34b2566a65d138790e16f8fb5787fd9c2bcde536
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48179
Changelog: [internal]
Migrating this type to an enum, which is safer, because it prevents errors like:
```
// when it's actually 'dev'
if (mode === 'development') {
}
```
Reviewed By: rshest
Differential Revision: D66888985
fbshipit-source-id: 4f3f91fad6ca5256baa2123425b2bad11fe036f9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48151
Changelog: [internal]
We have global setup step in Fantom to prewarm caches to properly attribute test running time, but this isn't necessary when running tests locally. Attribution isn't as important there. This disables the prewarming step so we can run individual tests as fast as we can.
Reviewed By: sammy-SC
Differential Revision: D66877990
fbshipit-source-id: 1f33c19a3c537c1c0e499fd7a6c405450cb9f86d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48150
Changelog: [internal]
We're starting to have some Fantom tests that run in optimized mode, but we're not currently prewarming for that case. This adds that capability to do proper attribution of run time for tests.
Reviewed By: javache
Differential Revision: D66877991
fbshipit-source-id: dccb80cd6a4f664de7df0661456bad78d960826d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48123
Changelog: [internal]
This verifies that the modes specified in the pragmas are applied correctly.
Reviewed By: andrewdacenko
Differential Revision: D66822377
fbshipit-source-id: 420f21f171c5d356ab91b49f7a33345386f6f0c0
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48012
Match the OkHttp version we use for NetworkingModule and FrescoModule, to unblock pulling in D66498305
Changelog: [Internal]
Reviewed By: cortinico
Differential Revision: D66595222
fbshipit-source-id: 1c29b061866be5d8bcc87aaa0c8a1de846198e4e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48136
[Changelog] [Internal] - Remove unused code in AndroidTextInputShadowNode.h|cpp
A bit of code clean-up to simplify a planned refactoring of this class
Reviewed By: rshest
Differential Revision: D66862820
fbshipit-source-id: 88114d8711b572f105d804cdddc6c087c94e3f49
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48094
There were a few math inaccuracies in the algorithm for overlapping radii. After fixing there were also minor pixel differences on the unit tests but this is the most correct implementation.
Also, improved the algorithm's verbiage since stuff like "EdgeInset" is not really related and is misleading to what the algorithm is actually doing. (Edge Insets play no part in this)
Changelog: [Internal]
Reviewed By: NickGerleman
Differential Revision: D66728227
fbshipit-source-id: 56a6d59504e784fc245ed6fe306402a15cfd9611
Summary:
X-link: https://github.com/facebook/yoga/pull/1763
Pull Request resolved: https://github.com/facebook/react-native/pull/48080
Small bug that I noticed while doing intrinsic sizing. We have the ownerHeight as the axis size despite bounding the length of the cross axis. This should therefore be the crossAxisOwnerSize, which might be the width in some cases
Changelog: [Internal]
Reviewed By: NickGerleman
Differential Revision: D66736539
fbshipit-source-id: 528fc438b3327cd6f7890ea0ba408e4ce7b0f02c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48129
Continuation of https://github.com/facebook/react-native/pull/48106
* Every AnimatedNode subclasses now have an optional `config` arg as last arg in constructor. `Animation` base constructor already takes in config with debugID, since last PR.
* thread down debugID value to all the native configs
Changelog: [Internal] Allow setting debugID on all types of AnimatedNode and Animation
Reviewed By: yungsters
Differential Revision: D66834935
fbshipit-source-id: 18e5cbc3f701114ef945a237cb5944ef5eb6408e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48127
[Changelog] [Internal] - Allow to provide a custom TextLayoutManager for cxx platform
This change allows target platforms to pass a platform specific or app specific TextLayoutManager implementation
Reviewed By: zeyap
Differential Revision: D66802434
fbshipit-source-id: a64e28d357bf601c7234b43f86538f49e62c8435
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48100
This diff renames `shouldNotify` to `shouldNotifyLoadEvents` as it is named in the spec.
Changelog: [Internal]
Reviewed By: javache
Differential Revision: D66769660
fbshipit-source-id: 64282c08ab82101d51dedb583e0c34476ed90eeb
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48124
Fixes https://github.com/facebook/react-native/issues/47592
The logic in HeadlessJsTaskService is broken. We should not check whether `getReactContext` is null or not.
Instead we should use the `enableBridgelessArchitecture` feature flag to understand if New Architecture was enabled or not.
The problem we were having is that `HeadlessJsTaskService` was attempting to load the New Architecture even if the user would have it turned off. The Service would then die attempting to load `libappmodules.so` which was correctly missing.
Changelog:
[Android] [Fixed] - Fix crash on HeadlessJsTaskService on old architecture
Reviewed By: javache
Differential Revision: D66826271
fbshipit-source-id: 2b8418e0b01b65014cdbfd0ec2f843420a15f9db
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48146
The NoRetryPolicy class is `internal`. Having those `public` modifiers on methods has no effect
and can be safely removed.
Changelog:
[Internal] [Changed] -
Reviewed By: fabriziocucci
Differential Revision: D66875443
fbshipit-source-id: 64c63c7000617cf94c36ce3d25927d3a270ac370
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48132
Backs out D63573322 and D65645981, reverting the change that makes callbacks passed to `animation.start(<callback>)` scheduled for execution in a microtask.
This is being reverted becuase the latency introduced by the current macro and pending micro tasks can introduce visible latency artifacts that diminish the fidelity of animations.
Changelog:
[General][Changed] - Reverts #47503. (~~Callbacks passed to `animation.start(<callback>)` will be scheduled for execution in a microtask. Previously, there were certain scenarios in which the callback could be synchronously executed by `start`.~~)
Reviewed By: javache
Differential Revision: D66852804
fbshipit-source-id: 08434b9876813fe9e8b189b6b467198933843bf0
Summary:
Someone always has to merge in from Meta, so this is just noise.
Refactored some of this older code.
Changelog: [Internal]
Pull Request resolved: https://github.com/facebook/react-native/pull/48148
Test Plan:
This PR, but this doesn't build a lot of confidence:
{F1973526183}
Reviewed By: rubennorte
Differential Revision: D66876722
Pulled By: blakef
fbshipit-source-id: 52e1f15577f8f057ceee9427af65df43f152bffa
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48144
Changelog: [internal]
Adds package.json script to run Fantom tests:
```
yarn fantom
```
NOTE: At the moment, this only works on Meta's infra. We're working on making this available in OSS/Github CI.
Reviewed By: javache
Differential Revision: D66874962
fbshipit-source-id: d9746428b618a31ce0bf96c3233828cdba501dd6
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48143
Changelog: [internal]
Just a small cleanup to move `jest/integration/*` to `packages/react-native-fantom`, so everything related to Fantom (config, runner, runtime, etc.) is in the same directory.
Reviewed By: javache
Differential Revision: D66874763
fbshipit-source-id: 8b87d7320c7704f7ce6cd58761508193784f5ce2
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48142
Changelog: [internal]
This is the default export from the `react-native/fantom` package and it makes sense to be called that way. Also, this is similar to the `jest` global.
Reviewed By: javache
Differential Revision: D66874225
fbshipit-source-id: 8b43a637ebb42b5b1acb9ea5a6dbedd4c1a4f9e0
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48141
Changelog: [internal]
This just aligns the file name with the common convention to name modules with the same name as their default export (if any).
Reviewed By: javache
Differential Revision: D66874227
fbshipit-source-id: 2a619b434c26a29f1774cba1c32ba711b1a7af46
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48140
Changelog: [internal]
These tests test an API that's part of `ReactNativeTester` (will be renamed as `Fantom`) so it makes sense that they're in the same test file as the tests for the rest of the API.
Reviewed By: javache
Differential Revision: D66874226
fbshipit-source-id: f17e14c83cb5ca95ac619c5398c49ad84a27cfa5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48125
Changelog: [internal]
This just moves the runtime modules for Fantom to its own package.
Reviewed By: javache
Differential Revision: D66825478
fbshipit-source-id: ac4dbc23b86895f09abc46345d497c1c53737ae2
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48145
While writing the docs for 0.77, I found an edge case in the generation of the RCTThirdPartyComponentProvider:
* If the app has the `codegenConfig` field set in the `package.json`
* And it does not have the `ios.componentProvider` field is not provided
Codegen was generating the mapping for the react-native core components. That's not expected as, in that case, it should only generate components that are declared in the app or in libraries.
This change fixes this edge case.
## Changelog:
[Internal] - Exclude mapping generation of core component
Reviewed By: blakef
Differential Revision: D66875080
fbshipit-source-id: 65fe10381729ec7808efec70feacf2a55f0056e9
Summary:
This PR adds `pointerEvents` to the `TextProps` type.
### Motivation:
The `pointerEvents` property is already supported in `Text` components internally, but it was missing from the TypeScript definitions. By adding it to `TextProps`, developers can now use this property with full type safety and without TypeScript errors.
This is a type-only change and does not introduce any functional modifications.
## Changelog:
[GENERAL] [ADDED] - Added `pointerEvents` to `TextProps` type.
Pull Request resolved: https://github.com/facebook/react-native/pull/48081
Test Plan:
As this is a type-only update:
- Verified that the `pointerEvents` property is now recognized when used with `Text` components in TypeScript projects.
- Ensured there are no runtime changes or regressions by testing existing `Text` components for expected behavior.
Reviewed By: cipolleschi
Differential Revision: D66753454
Pulled By: javache
fbshipit-source-id: c8f21b11daa6001a309b1d29fd6259101d11f5d2
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48062
We never need the full ShadowView representation of `parent` and this is significantly cheaper to construct and pass around.
Changelog: [Internal]
Reviewed By: rubennorte
Differential Revision: D66656411
fbshipit-source-id: 0b20e04c6beb95c498350085ec06fd57d1c11237
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48106
This could make it easier to locate and debug AnimatedValue and driver from native - so far on the native side of animated, the only way to identify an Animation driver or AnimatedNode is integer IDs and the type, which made it difficult to debug when surface gets complicated
Here I only enabled it for AnimatedValue and TimingAnimation, because
* TimingAnimation is most commonly used
* all the animation drivers (frames, spring, decay) can only drive Value type of AnimatedNode on the native side, so it's the primitive component of AnimatedNode
Changelog: [Internal]
Reviewed By: yungsters
Differential Revision: D66790298
fbshipit-source-id: ddd64a5728120f061aa902f25c93b1701617031b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47530
Adds the default implementation for `getStringData`/`getPropNameIdData`
for VMs that do not provide their own implementation
Changelog: [Internal]
Reviewed By: neildhar
Differential Revision: D65638889
fbshipit-source-id: 0a97569433c09ffafbd08fec5d9c9fbf5639b778
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48109
[Changelog] [Internal] - Allow to provide a custom ImageManager for cxx platform
This change allows target platforms to pass a platform specific or app specific ImageManager implementation
Reviewed By: javache
Differential Revision: D66788794
fbshipit-source-id: d7e99cae5de0a4c60047763dce368271dd191b9c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48097
Changelog: [internal]
As per title, this allows us to specify both common and JS-only feature flags for tests in the docblock as pragmas (in the same pragma separated by spaces, or in different pragmas). E.g.:
```
/**
* fantom_flags commonTestFlag:true
* fantom_flags jsOnlyTestFlag:true
*/
```
The feature flags are overridden automatically for us before the tests start.
Reviewed By: javache
Differential Revision: D66760121
fbshipit-source-id: 7e227e0035a170dab81b1e6ce39600a01a748867
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48093
Changelog: [internal]
We're going to add support for specifying feature flags in Fantom tests in pragmas. E.g.:
```
/**
* fantom_flags commonTestFlag:true
*/
```
Users will be able to specify any feature flags in their tests, so we need a way to pass that information from the test file to the runner, and the runner has to be able to apply this dynamic configuration.
Because the API is statically typed in C++, we need to define a method for every possible feature flag configurable through this API. We could do it in userland, but we'd have to manually add a method every time there was a new feature flag we wanted to support.
Instead of doing that, this introduces a new abstraction in the feature flag system that codegens it for you.
The API is basically:
```
folly::dynamic values = folly::dynamic::object();
values["commonTestFlag"] = true;
ReactNativeFeatureFlags::override(
std::make_unique<ReactNativeFeatureFlagsDynamicProvider>(values));
EXPECT_EQ(ReactNativeFeatureFlags::commonTestFlag(), true);
```
Then we can use this abstraction in Fantom to pass all the configured flags as `folly::dynamic` through this API.
Reviewed By: javache
Differential Revision: D66760118
fbshipit-source-id: c32329e5ca76923c3e0b9c0eb1fe8c3268e1f57b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48089
Planning to make some changes here for perf, but converting to Kotlin first
Changelog: [Android][Removed] Made ReactCookieJarContainer internal.
Reviewed By: tdn120
Differential Revision: D66724567
fbshipit-source-id: bf96f8df8a5c901b47c371c7ed16b7a81de22ee7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48088
Planning to make some changes here for perf, but converting to Kotlin first
Changelog: [Internal]
Reviewed By: cortinico
Differential Revision: D66724321
fbshipit-source-id: dec7f7123abdcd5792b3d589269b40ad42b3d307
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48105
LLVM-15 has a warning `-Wunused-variable` which we treat as an error because it's so often diagnostic of a code issue. Unused variables can compromise readability or, worse, performance.
This diff either (a) removes an unused variable and, possibly, it's associated code or (b) qualifies the variable with `[[maybe_unused]]`.
- If you approve of this diff, please use the "Accept & Ship" button :-)
Changelog: [Internal]
Reviewed By: palmje
Differential Revision: D66777665
fbshipit-source-id: fadf71fd37c2b95f87419acf9d5a7765fe031905
Summary:
GHA to build HermesC for windows are failing because the machines comes with a different CMake version already.
Let's try not to install Cmake and use the one provided by the machine.
## Changelog:
[Internal] -
Pull Request resolved: https://github.com/facebook/react-native/pull/48122
Test Plan: GHA {F1973187648}
Reviewed By: alanleedev
Differential Revision: D66825216
Pulled By: cipolleschi
fbshipit-source-id: 9a9376a5409e192195a6b6cc25b4d58cb47f15da
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48092
Changelog: [internal]
This is just in preparation to expand the scope of that function to include configuration for feature flags.
Reviewed By: javache
Differential Revision: D66760119
fbshipit-source-id: e955e8f596697ac6a0a87013bec3fc3e09caf19d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48087
Changelog: [internal]
Now that we have Fantom tests for these unit tests that use mocks, we can remove the JS tests and the mocks :)
Reviewed By: sammy-SC
Differential Revision: D66599197
fbshipit-source-id: 33822588c2176ffe2f2631da56c671b299f8058d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48086
Changelog: [internal]
Just adding a bit of coverage for the `expect` API adding `toBeLessThan` and `toBeGreaterThan`.
Reviewed By: sammy-SC
Differential Revision: D66753268
fbshipit-source-id: 6a26f558f985ccbb5eb0daacecd93759841149e9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48083
Changelog: [internal]
Just a small refactor to have a better code organization for the testing runtime infra.
Reviewed By: sammy-SC
Differential Revision: D66753269
fbshipit-source-id: e68727fe45fabe0be3528e21d5a60cef3045c252
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48063
Changelog: [internal]
This allows async functions to be passed to `runTask` (just a type change really) and adds tests for ReactNativeTester. Error handling isn't currently set up correctly, so those tests are disabled for now.
Reviewed By: sammy-SC
Differential Revision: D66698547
fbshipit-source-id: 41d1fccc80f90cdf764f6fa3d3d34365eeef8ec6
Summary:
Handling `long` values is not implemented in Writables. I added it on the native side.
## 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] [FIXED] - Support Long values in WritableMap and WritableArray
Pull Request resolved: https://github.com/facebook/react-native/pull/48017
Test Plan: Run https://github.com/WoLewicki/reproducer-react-native/tree/%40wolewicki/long-in-writeable-map and see it doesn't work without those changes.
Reviewed By: javache
Differential Revision: D66754194
Pulled By: cortinico
fbshipit-source-id: 7f8d4eb3c4069f890460525ddffdf9f4324550b0
Summary:
This action is no longer necessary and we can remove it
## Changelog:
[Internal] [Fixed] - Use `refs/pulls` namespace in trigger action
Pull Request resolved: https://github.com/facebook/react-native/pull/47923
Reviewed By: NickGerleman
Differential Revision: D66578573
Pulled By: cortinico
fbshipit-source-id: 87cdbc1544873a2669e82c7763c78d18ff7881fd
Summary:
Related PR in `react-native-screens`:
* https://github.com/software-mansion/react-native-screens/pull/2495
Additional context:
* [my detailed explanation of **one of the issues**](https://github.com/software-mansion/react-native-screens/pull/2495#issuecomment-2478915818)
* [Android Developer: ViewGroup.startViewTransition docs](https://developer.android.com/reference/android/view/ViewGroup#startViewTransition(android.view.View))
### Background
On Android view groups can be marked as "transitioning" with a `ViewGroup.startViewTransition` call. This effectively ensures, that in case a view group is marked with this call and its children are removed, they will be still drawn until `endViewTransition` is not called.
This mechanism is implemented in Android by [keeping track of "transitioning" children in auxiliary `mTransitioningViews` array](https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/view/ViewGroup.java#7178). Then when such "transitioning" child is removed, [it is removed from children array](https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/view/ViewGroup.java#5595) but it's [parent-child relationship is not cleared](https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/view/ViewGroup.java#5397) and it is still retained in the auxiliary array.
Having that established we can proceed with problem description.
### Problem
https://github.com/user-attachments/assets/d0356bf5-2f17-4b06-ba53-bfca659a1071
<details>
<summary>Full code</summary>
```javascript
import { NavigationContainer } from 'react-navigation/native';
import React from 'react';
import { createNativeStackNavigator } from 'react-navigation/native-stack';
import { enableScreens } from 'react-native-screens';
import {
StyleSheet,
Text,
View,
FlatList,
Button,
ViewProps,
Image,
FlatListProps,
findNodeHandle,
} from 'react-native';
enableScreens(true);
function Item({ children, ...props }: ViewProps) {
return (
<View style={styles.item} {...props}>
<Image source={require('../assets/trees.jpg')} style={styles.image} />
<Text style={styles.text}>{children}</Text>
</View>
);
}
function Home({ navigation }: any) {
return (
<View style={styles.container}>
<Button title="Go to List" onPress={() => navigation.navigate('List')} />
</View>
);
}
function ListScreenSimplified({secondVisible}: {secondVisible?: (visible: boolean) => void}) {
const containerRef = React.useRef<View>(null);
const innerViewRef = React.useRef<View>(null);
const childViewRef = React.useRef<View>(null);
React.useEffect(() => {
if (containerRef.current != null) {
const tag = findNodeHandle(containerRef.current);
console.log(`Container has tag [${tag}]`);
}
if (innerViewRef.current != null) {
const tag = findNodeHandle(innerViewRef.current);
console.log(`InnerView has tag [${tag}]`);
}
if (childViewRef.current != null) {
const tag = findNodeHandle(childViewRef.current);
console.log(`ChildView has tag [${tag}]`);
}
}, [containerRef.current, innerViewRef.current, childViewRef.current]);
return (
<View
ref={containerRef}
style={{ flex: 1, backgroundColor: 'slateblue', overflow: 'hidden' }}
removeClippedSubviews={false}>
<View ref={innerViewRef} removeClippedSubviews style={{ height: '100%' }}>
<View ref={childViewRef} style={{ backgroundColor: 'pink', width: '100%', height: 50 }} removeClippedSubviews={false}>
{secondVisible && (<Button title='Hide second' onPress={() => secondVisible(false)} />)}
</View>
</View>
</View>
);
}
function ParentFlatlist(props: Partial<FlatListProps<number>>) {
return (
<FlatList
data={Array.from({ length: 30 }).fill(0) as number[]}
renderItem={({ index }) => {
if (index === 10) {
return <NestedFlatlist key={index} />;
} else if (index === 15) {
return <ExtraNestedFlatlist key={index} />;
} else if (index === 20) {
return <NestedFlatlist key={index} horizontal />;
} else if (index === 25) {
return <ExtraNestedFlatlist key={index} horizontal />;
} else {
return <Item key={index}>List item {index + 1}</Item>;
}
}}
{...props}
/>
);
}
function NestedFlatlist(props: Partial<FlatListProps<number>>) {
return (
<FlatList
style={[styles.nestedList, props.style]}
data={Array.from({ length: 10 }).fill(0) as number[]}
renderItem={({ index }) => (
<Item key={'nested' + index}>Nested list item {index + 1}</Item>
)}
{...props}
/>
);
}
function ExtraNestedFlatlist(props: Partial<FlatListProps<number>>) {
return (
<FlatList
style={styles.nestedList}
data={Array.from({ length: 10 }).fill(0) as number[]}
renderItem={({ index }) =>
index === 4 ? (
<NestedFlatlist key={index} style={{ backgroundColor: '#d24729' }} />
) : (
<Item key={'nested' + index}>Nested list item {index + 1}</Item>
)
}
{...props}
/>
);
}
const Stack = createNativeStackNavigator();
export default function App(): React.JSX.Element {
return (
<NavigationContainer>
<Stack.Navigator screenOptions={{ animation: 'slide_from_right' }}>
<Stack.Screen name="Home" component={Home} />
<Stack.Screen name="List" component={ListScreenSimplified}/>
</Stack.Navigator>
</NavigationContainer>
);
}
export function AppSimple(): React.JSX.Element {
const [secondVisible, setSecondVisible] = React.useState(false);
return (
<View style={{ flex: 1, backgroundColor: 'lightsalmon' }}>
{!secondVisible && (
<View style={{ flex: 1, backgroundColor: 'lightblue' }} >
<Button title='Show second' onPress={() => setSecondVisible(true)} />
</View>
)}
{secondVisible && (
<ListScreenSimplified secondVisible={setSecondVisible} />
)}
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
},
nestedList: {
backgroundColor: '#FFA07A',
},
item: {
flexDirection: 'row',
alignItems: 'center',
padding: 10,
gap: 10,
},
text: {
fontSize: 24,
fontWeight: 'bold',
color: 'black',
},
image: {
width: 50,
height: 50,
},
});
```
</details>
Explanation (copied from [here](https://github.com/software-mansion/react-native-screens/pull/2495#issuecomment-2478915818)):
I've debugged this for a while now & I have good understanding of what's going on. This bug is caused by our usage of `startViewTransition` and its implications. We use it well, however React does not account for case that some view might be in transition. Error mechanism is as follows:
1. Let's have initially simple stack with two screens: "A, B". This is component rendered under "B":
```javascript
<View //<-- ContainerView (CV)
removeClippedSubviews={false}
style={{ flex: 1, backgroundColor: 'slateblue', overflow: 'hidden' }}>
<View removeClippedSubviews style={{ height: '100%' }}> // <--- IntermediateView (IV)
<View removeClippedSubviews={false} style={{ backgroundColor: 'pink', width: '100%', height: 50 }} /> // <--- ChildView (ChV)
</View>
</View>
```
2. We press the back button.
3. We're on Fabric, therefore subtree of B gets destroyed before B itself is unmounted -> in our commit hook we detect that the screen B will be unmounted & we mark every node under B as transitioning by calling `startViewTransition`.
4. React Mounting stage starts, view hierarchy is disassembled in bottom-up fashion (leafs first).
5. ReactViewGroupManager receives MountItem to detach ChV from IV.
6. A call to [`IV.removeView(ChV)` is made](https://github.com/facebook/react-native/blob/9c11d7ca68c5c62ab7bab9919161d8417e96b28b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactClippingViewManager.kt#L58-L73), which effectively removes ChV from `IV.children`, ***HOWEVER*** it does not clear `ChV.parent`, meaning that after the call, `ChV.parent == IV`. This happens, due to view being marked as in-transition by our call to `startViewTransition`. If the view is not marked as in-transition this parent-child relationship is removed.
7. IV has `removeClippedSubviews` enabled, therefore a [call to `IV.removeViewWithSubviewsClippingEnabled(ChV)` is made](https://github.com/facebook/react-native/blob/9c11d7ca68c5c62ab7bab9919161d8417e96b28b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactClippingViewManager.kt#L68). [This function](https://github.com/facebook/react-native/blob/9c11d7ca68c5c62ab7bab9919161d8417e96b28b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.java#L726-L744) does effectively two things:
1. if the ChV has parent (interpretation: it has not yet been detached from parent), we compute it's index in `IV.children` (Android.ViewGroup's state) and remove it from the array,
2. remove the ChV from `mAllChildren` array (this is state maintained by ReactViewGroup for purposes of implementing the "subview clipping" mechanism".
The crash happens in 7.1, because ChV has been removed from `IV.children` in step 6, but the parent-child relationship has not been broken up there. Under usual circumstances (this is my hypothesis now, yet unconfirmed) 7.1 does not execute, because `ChV.parent` is nulled in step no. 6.
### Rationale for `startViewTransition` usage
Transitions. On Fabric, when some subtree is unmounted, views in the subtree are unmounted in bottom-up order. This leads to uncomfortable situation, where our components (react-native-screens), who want to drive & manage transitions are notified that their children will be removed after the subtrees mounted in screen subviews are already disassembled. **If we start animation in this very moment we will have staggering effect of white flash** [(issue)](https://github.com/software-mansion/react-native-screens/issues/1685) (we animate just the screen with white background without it's children). This was not a problem on Paper, because the order of subtree disassembling was opposite - top-down. While we've managed to workaround this issue on Fabric using `MountingTransactionObserving` protocol on iOS and a commit hook on Android (we can inspect mutations in incoming transaction before it starts being applied) we still need to prevent view hierarchy from being disassembled in the middle of transition (on Paper this has also been less of an issue) - and this is where `startViewTransition` comes in. It allows us to draw views throughout transition after React Native removes them from HostTree model. On iOS we exchange subtree for its snapshot for transition time, however this approach isn't feasible on Android, because [snapshots do not capture shadows](https://stackoverflow.com/questions/42212600/android-screenshot-of-view-with-shadow).
### Possible solutions
[Android does not expose a method to verify whether a view is in transition](https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/view/ViewGroup.java#7162) (it has `package` visibility), therefore we need to retrieve this information with some workaround. I see two posibilities:
* first approach would be to override `startViewTransition` & `endViewTransition` in ReactViewGroup and keep the state on whether the view is transitioning there,
* second possible approach would be as follows: we can check for "transitioning" view by checking whether a view has parent but is not it's parent child (this **should** be reliable),
Having information on whether the view is in transition or not, we can prevent multiple removals of the same view in every call site (currently only in `removeViewAt` if `parent.removeClippingSubviews == true`).
Another option would be to do just as this PR does: having in mind this "transitioning" state we can pass a flag to `removeViewWithSubviewClippingEnabled` and prevent duplicated removal from parent if we already know that this has been requested.
I can also add override of this method:
```java
/*package*/ void removeViewWithSubviewClippingEnabled(View view) {
this.removeViewWithSubviewClippingEnabled(view, false);
}
```
to make this parameter optional.
## Changelog:
[ANDROID] [FIXED] - Handle removal of in-transition views.
Pull Request resolved: https://github.com/facebook/react-native/pull/47634
Test Plan: WIP WIP
Reviewed By: javache
Differential Revision: D66539065
Pulled By: tdn120
fbshipit-source-id: cf1add67000ebd1b5dfdb2048461a55deac10b16
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48090
This alleviates a breaking change on `ReactModuleInfo` constructor.
While the ctor was deprecated, we realized that there are more than 250 usages in OSS.
We'll need to properly communicate this removal before we do it.
Changelog:
[Android] [Fixed] - Re-introduce the deprecated constructor on ReactModuleInfo
Reviewed By: cipolleschi
Differential Revision: D66755541
fbshipit-source-id: 3673d8f2af278d55491cea89f1594d368513e3d8
Summary:
Currently the class `ResponseUtil` is still in Java, I'm adding some unit tests so it is safer to migrate it to Kotlin.
## Changelog:
[INTERNAL] - `ResponseUtil` unit tests
Pull Request resolved: https://github.com/facebook/react-native/pull/48075
Test Plan:
```bash
yarn test-android
```
Reviewed By: cortinico
Differential Revision: D66727736
Pulled By: lunaleaps
fbshipit-source-id: 9c89c75905b4e0c9c4820a556245a07e135e0f17
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48076
JSC for Android does not implement `String.prototype.replaceAll`:
{F1971791988}
https://github.com/facebook/react-native/pull/47466 introduced a use of it into runtime code, breaking JSC compatibility.
This.. replaces it.. with `replace`. Since the argument is already a regex with a `g` modifier, `replaceAll` wasn't necessary anyway.
Changelog:
[ANDROID][FIXED] Fix JSC by avoiding use of unavailable `str.replaceAll()`
Reviewed By: javache
Differential Revision: D66712312
fbshipit-source-id: 534b6db6834a2fda46ae8457437de3caa24f4eb0
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48053
Changelog: [Internal]
`getModuleInstanceFromClass:` is a delegate method intended to be implemented by the product layer to provide modules. if it is not implemented to return a module for a given key, `RCTTurboModuleManager` will simply call `new` on the TM class.
however, these two paths differentiate - for `getModuleInstanceFromClass:`, we will call `_attachBridgelessAPIsToModule:` which provides objects like surfacePresenter to the native module.
if we fallback to calling `new`, then this attachment does not happen, even if the app has already been migrated to bridgeless modules.
thus, the fix in the case is to lift the fallback into RCTInstance as well, and decorate the APIs onto the new fallback.
Reviewed By: cipolleschi
Differential Revision: D66675034
fbshipit-source-id: 1ab89a4006d05f744f5d42b5de786ccea4d4a55d
Summary:
X-link: https://github.com/facebook/yoga/pull/1762
Pull Request resolved: https://github.com/facebook/react-native/pull/48077
OCD strikes again. Grepped this time to make sure we didn't miss any cases for this specific param name
Changelog: [Internal]
Reviewed By: NickGerleman
Differential Revision: D66715777
fbshipit-source-id: 3e881a15b3b2836a4a55b11d7ec621541b92a05d
Summary:
why: running `yarn test-e2e-local -t "RNTestProject" -p "Android" -h false -c $GITHUB_TOKEN` would actually build the app with Hermes even though it's specified as disabled.
This is because of the `if (argv.hermes == null)` condition whose body would not execute.
The condition was changed [recently](https://github.com/facebook/react-native/commit/f322dc7a84eb72370910f6933d0a4fa7780f49bc#diff-56f57bf0eac99b0fda1b2938aceb8d9b663db82c07cb405bd53a01c8689710ffR258).
Reason for `await` being used:
```
Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ scripts/release-testing/test-e2e-local.js:303:32
Cannot get argv.hermes because property hermes is missing in Promise [1]. [prop-missing]
scripts/release-testing/test-e2e-local.js
300│ 'reactNativeArchitectures=arm64-v8a',
301│ 'android/gradle.properties',
302│ );
303│ const hermesEnabled = (argv).hermes === true;
304│
305│ // Update gradle properties to set Hermes as false
306│ if (!hermesEnabled) {
flow-typed/npm/yargs_v17.x.x.js
[1] 80│ argv: Argv | Promise<Argv>;
```
## Changelog:
[INTERNAL] [FIXED] - fix `hermes` param handling in `test-e2e-local.js`
Pull Request resolved: https://github.com/facebook/react-native/pull/48068
Test Plan: tested locally
Reviewed By: cipolleschi
Differential Revision: D66704263
Pulled By: robhogan
fbshipit-source-id: f05f23b95e67bd20025e0b3448df0d284fcb62da
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48071
Changelog: [Internal]
- Write fantom test for rn_rootThreshold given current implementation of IntersectionObserver
- Rename `rn_rootThreshold` to `rnRootThreshold`
- Rename `rn_intersectionRootRatio` to `rnRootIntersectionRatio`
- Rename `rootThresholds` on observer to `rnRootThresholds`
Reviewed By: rubennorte
Differential Revision: D66464509
fbshipit-source-id: 8ed66afa54bab99a28625ebe6f227d59d0bd7389
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48055
Address the test-case identified in D66557919, where Differentiator could emit updates for views referencing an incorrect parentTag.
The longer-term fix here is to avoid emitting any updates for nodes which are being reparented, but that requires bigger changes, including to the LayoutAnimation system. As a short-term patch, we're passing through an explicit `parentShadowViewForUpdate` which will be used as the current parent for update purposes.
{F1971278019}
Changelog: [Android][Fixed] Fix Fabric mutations sometimes triggering a `getViewState` crash when referencing an invalid parentTag.
Reviewed By: rubennorte
Differential Revision: D66654293
fbshipit-source-id: cd5b3e577ad1eede1b6dea834582ac6d750cbb81
Summary:
Make it clearer to the release crew to avoid using an outdated artifact
for testing a release.
{F1971030533}
Changelog: [Internal]
Pull Request resolved: https://github.com/facebook/react-native/pull/48046
Test Plan:
```
yarn test-e2e-local -t "RNTester" -p "Android" -h true -c $GITHUB_TOKEN
```
Reviewed By: robhogan
Differential Revision: D66657082
Pulled By: blakef
fbshipit-source-id: 225128690c180bee7a3d28fdcc7f8c9885a37f0d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48066
Minor edits to this build spec to align with other packages in `ReactCommon/`.
Changelog: [Internal]
Reviewed By: rubennorte
Differential Revision: D66700351
fbshipit-source-id: 47942c27d6154b78c165508447a3056f1354f5c3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47930
This diff adds a list of props that will be used by the Android `ImagePrefetcher` to create an `ImageRequest`. This list is derived from all the props that `ReactImageView` uses to create its `ImageOptions` and `ImageRequest` objects.
Changelog: [Internal]
Reviewed By: javache
Differential Revision: D66453306
fbshipit-source-id: ca4f59784c81f2b94ed4b052f6fbe5e8c6b97a2a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48052
LLVM-15 has a warning `-Wunused-variable` which we treat as an error because it's so often diagnostic of a code issue. Unused variables can compromise readability or, worse, performance.
This diff either (a) removes an unused variable and, possibly, it's associated code or (b) qualifies the variable with `[[maybe_unused]]`.
#buildsonlynotests - Builds are sufficient
- If you approve of this diff, please use the "Accept & Ship" button :-)
Reviewed By: javache, wuyuoss
Differential Revision: D66143498
fbshipit-source-id: a461f115610258777bd1173f91cf4d4472e2fc5e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48057
FabricViewStateManager has been deprecated for a long time and it's unused, let's delete it
changelog: [Android][Breaking] Delete deprecated class FabricViewStateManager
Reviewed By: javache, cortinico
Differential Revision: D66403219
fbshipit-source-id: e8f893b6a240ca09c0e86821c0a15fa345ffd221
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48056
ComponentNameResolver is meant to be used only internaly, we reduce its visbility to internal
changelog: [Android][Breaking] Removed ComponentNameResolver from public API
Reviewed By: javache
Differential Revision: D66403218
fbshipit-source-id: bf08284400a6dc6446b771c894488ed3fb371e25
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47349
This is needed to be able to recurse into the literals and compare them.
I'm primarily unsure if there is a problem representing doubles/floats as numbers instead of strings though.
Changelog: [Internal]
Reviewed By: makovkastar
Differential Revision: D65284058
fbshipit-source-id: b2de9ed5fb7f079a432c94aaea69027863879909
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47987
Store a tag value for whether the view is added or removed, to better track the state instead of checking view.getParent().
Changelog: [Internal]
Reviewed By: javache
Differential Revision: D66383241
fbshipit-source-id: 16521eb4052e9473be058a00cfe29d7f198b7861
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47915
## Purpose of this noop-ing
If an fatal js error happens during js runtime init, the js thread continues executing and raises **yet another** fatal error.
This noop-ing was an **attempt** to prevent that second inactionable fatal from happening: That fatal is usually inactionable.
## Problems with this noop-ing
I don't think this is the right approach: There could be legitimate reasons to continue executing native -> js calls post first js fatal.
I don't think it does *much*: it doesn't noop native -> js calls executed on the runtime scheduler, which should be most of them.
## Changes
Instead of trying to prevent that fatal, just let it happen. Then, don't report the second fatal: D66193194 and D66392706.
## Safetly
The production impact is negligible: This codepath is executed only after early js errors. There shouldn't be any in production right now.
We've spent a lot of time making our javascript error handling pipeline's coverage compresive. So, after an early js fatal error happens, subsequent js fatals should get handled properly.
Changelog: [Internal]
Reviewed By: javache
Differential Revision: D66394278
fbshipit-source-id: ef342fc2eba9ae9f27b15a0f412fb69bd92aed43
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48020
Progress towards Performance panel display parity for User Timing events in Chrome DevTools.
- Support nullable `track` name in `ReactPerfLogger`, passing track name directly to `FuseboxTracer`.
- Update `FuseboxTracer` to register "Main" process and send V8-aligned `blink.user_timing`-categorised tracing events.
The previous track naming strategy continues to be used under Perfetto.
Changelog: [Internal]
**Better, but not perfect yet**
For now, this is probably the upper limit of how aligned we can be with Chrome on web, since our forked DevTools frontend is 6mo+ behind `main`. Notably, it does not include equivalent custom track handling today: https://github.com/ChromeDevTools/devtools-frontend/commit/4b4435feef14c5c0ac71d932940c6ea7613f8afe
{F1969750671}
> Importing an exact trace from Chrome into RNDT is unable to sub-group the "Timings" track.
Reviewed By: rubennorte
Differential Revision: D66579308
fbshipit-source-id: fa57151d2be477eaa15f62e5c19ee09b1a0ef43a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48048
Changelog: [Internal]
Some messages may contains multi line content, ie snapshot comparison, multiline strings comparison.
Fixing this by checking first code pointer in the stack and slicing from there.
Reviewed By: christophpurrer, rubennorte
Differential Revision: D66660107
fbshipit-source-id: 57cea02cf6aae3c24f351504c2e077b5a2de0761
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48004
Follows https://github.com/facebook/react-native/pull/47962 and depends on https://github.com/facebookexperimental/rn-chrome-devtools-frontend/pull/139.
Updates the modern debugger server to no longer respond to `FuseboxClient` messages — namely `FuseboxClient.setClientMetadata`. This method is replaced by `ReactNativeApplication.enable` for identifying the React Native DevTools frontend.
Changelog:
[General][Breaking] - The `FuseboxClient.setClientMetadata` CDP method is removed. Instead, use `ReactNativeApplication.enable`.
Reviewed By: rubennorte
Differential Revision: D66575324
fbshipit-source-id: f2b4cbacd857931832d89305510f5aaf51df483a
Summary:
Updates Fresco from 3.4.0 to 3.5.0. Picks up a few new features, including experimental support for XML-based drawable resource types
Changelog:
[Android][Changed] - Update Fresco to 3.5.0
Reviewed By: cortinico
Differential Revision: D66553841
fbshipit-source-id: d0e630c73ba73ea9bbf96f7d630471c5383145f0
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48039
This class was removed in D66127067 but was marked as DeprecatedInNewArchitecture and not Deprecated, which limited the signal we gave to developers to move away from this.
Restore for now to e
Changelog: [Android][Fixed] Reverted removal of TurboReactPackage
Reviewed By: rshest
Differential Revision: D66648209
fbshipit-source-id: 165f9390b4874e69353612b929d87b0c495588af
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48022
Changelog: [internal]
This adds support for Fantom options in tests to configure different aspects of the test execution.
For now, it only supports specifying the mode (dev or opt) so we can try things without having to change the runner (watch mode still works if you change mode :D).
Fantom options are specified as pragmas in the docblock of the test. E.g.:
```
/**
* flow strict-local
* format
* fantom_mode opt
*/
```
We expect this is mostly going to be used for one-time tests and that regular tests won't specify the mode (they'll just run in dev mode).
Maybe we can evolve this in the future to specify that you want a test to be executed in both modes, to ensure the behavior is consistent in dev/prod.
Reviewed By: rshest
Differential Revision: D66597626
fbshipit-source-id: b12325fc2235740cc2a3e0283d6a556091c1794c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48015
Changelog: [internal]
Right now, when we run individual Fantom tests, we compile Hermes and the RN Tester CLI as part of the test, which causes the first test to run to be very slow and the remaining tests in the same run to be very fast.
This is misleading because it makes it look like the test itself is slow, when it's actually paying a price for everyone.
Fortunately, Jest has an option to do a global setup before any tests in the project run (and it doesn't run if none of the tests in the project run, in multi-project setups), so we can use it to do the necessary warmup so it doesn't end up being attributed to individual tests.
Reviewed By: javache
Differential Revision: D66595406
fbshipit-source-id: 496aa2b248da661f7504c8445fed1edad0301803
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48014
Changelog: [internal]
Just a small refactor in preparation for a following change that will add more usages for these utilities. It also cleans up the runner file which is good too.
Reviewed By: javache
Differential Revision: D66595405
fbshipit-source-id: e734d76006ce937fadd1cb673035db85a3e838dd
Summary:
building RN tester with 0.77 rc-0 doesn't work now because of `java.io.IOException: No such file or directory` on line 48.
`buildDirectory` is a Gradle property representing a file
https://github.com/facebook/react-native/pull/47552 removes this file altogether so feel free to close if that one is the "right one"
## Changelog:
[ANDROID] [FIXED] - fix IOException in `BuildCodegenCLITask`
Pull Request resolved: https://github.com/facebook/react-native/pull/48008
Test Plan: After this change, building RN tester works.
Reviewed By: cortinico
Differential Revision: D66650038
Pulled By: robhogan
fbshipit-source-id: 11cd83493fa118c6b79d11c9113228dd3971a803
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48041
Changelog: [internal]
This adds a Fantom test for the LongTask API, testing it using public APIs :D
Reviewed By: javache
Differential Revision: D66601861
fbshipit-source-id: f3531e8b58ffa044dcb5cec2f462ae6a31c27790
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48040
Changelog: [internal]
We need more expectations for a new test we're writing. This just adds:
* `expect(received).toBeLessThanOrEqual(expected)`
* `expect(received).toBeGreaterThanOrEqual(expected)`
Reviewed By: sammy-SC
Differential Revision: D66601921
fbshipit-source-id: 0a73f7757117ed790b95796b259244c8259136b7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48025
Changelog: [internal]
This migrates the existing tests we have for the current public API for host component refs to Fantom.
After this, the only remaining test to migrate before we can clean up the legacy mocks for Fabric, etc. is the one for IntersectionObserer.
Reviewed By: sammy-SC
Differential Revision: D66599070
fbshipit-source-id: 67da1cd3b360ac79aed6fe6ad2a8bd5273754174
Summary:
There are currently 2 warnings firing for every PR (e.g. look here https://github.com/facebook/react-native/pull/48013/files).
Those are annoying so I'm fixing them here.
## Changelog:
[INTERNAL] - Fix eslint warnings in react-native
Pull Request resolved: https://github.com/facebook/react-native/pull/48016
Test Plan: CI
Reviewed By: NickGerleman
Differential Revision: D66595842
Pulled By: cortinico
fbshipit-source-id: 0fd39629a97dbbe5d75a78c8eaa50241faf6bf1e
Summary:
A NPE can occur when a user touches the screen before the `SurfaceMountingManager` is initialized. Below is an example of the error log from our production service. This issue can also be reproduced using RNTester. To prevent invalid touch events during init time of rn app from causing an NPE, add a null check for SurfaceMountingManager before calling mark/sweepActiveTouchForTag.
```
Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.facebook.react.fabric.mounting.SurfaceMountingManager.markActiveTouchForTag(int)' on a null object reference
at com.facebook.react.fabric.FabricUIManager.markActiveTouchForTag(FabricUIManager.java)
at com.facebook.react.uimanager.JSTouchDispatcher.markActiveTouchForTag(JSTouchDispatcher.java)
at com.facebook.react.uimanager.JSTouchDispatcher.handleTouchEvent(JSTouchDispatcher.java)
at com.facebook.react.runtime.ReactSurfaceView.dispatchJSTouchEvent(ReactSurfaceView.java)
at com.facebook.react.ReactRootView.onInterceptTouchEvent(ReactRootView.java)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2870)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3352)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2963)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3352)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2963)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3352)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2963)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3352)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2963)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3352)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2963)
at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:794)
at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1967)
at android.app.Activity.dispatchTouchEvent(Activity.java:4571)
at com.rainist.banksalad2.feature.common.BaseActivity.dispatchTouchEvent(BaseActivity.java)
at androidx.appcompat.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:70)
at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:752)
at android.view.View.dispatchPointerEvent(View.java:16498)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:8676)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:8423)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:7752)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:7809)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:7775)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:7978)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:7783)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:8035)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:7756)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:7809)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:7775)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:7783)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:7756)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:11343)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:11212)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:11168)
at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:11477)
at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:337)
at android.os.MessageQueue.nativePollOnce(MessageQueue.java)
at android.os.MessageQueue.next(MessageQueue.java:335)
at android.os.Looper.loopOnce(Looper.java:187)
at android.os.Looper.loop(Looper.java:319)
at android.app.ActivityThread.main(ActivityThread.java:9063)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:588)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)
```
https://github.com/user-attachments/assets/e9c6ff84-c94d-4392-9042-8e635197202e
## Changelog:
[Android] [Fixed] - Avoid NPE when touch event is triggered before SurfaceManager is initiated
Pull Request resolved: https://github.com/facebook/react-native/pull/48007
Test Plan:
I checked the crashed being fixed on RNTester.
https://github.com/user-attachments/assets/71f7e359-707a-494c-ae34-fef8d432e612
Reviewed By: cortinico
Differential Revision: D66594576
Pulled By: javache
fbshipit-source-id: b1559d94866bdb021e0374f1953684849603033c
Summary:
fix typo in `inherithed`
## Changelog:
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
[IOS] [CHANGED] - fix typo in utils.rb
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[IOS] [CHANGED] - fix typo in utils.rb
Pull Request resolved: https://github.com/facebook/react-native/pull/48013
Test Plan: I did not spot any changes when switching it but in some specific build settings it could destroy some behaviors probably.
Reviewed By: cipolleschi
Differential Revision: D66595786
Pulled By: cortinico
fbshipit-source-id: d1607fd1127352533fb2977bdfcafec1edd1aef7
Summary:
https://github.com/facebook/react-native/pull/46385 introduced use of `Object.hasOwn` as an incidental detail of some `Animated` performance improvements.
Unfortunately, `Object.hasOwn` is not present in the version of JSC shipped with Android, nor the built in iOS JSC until iOS 15.4, which is greater than React Native's minimum version (13.4).
Instead:
- Use `obj.hasOwnProperty(prop)` for known objects that have the `Object` prototype.
- Otherwise, use `Object.hasOwn` where it is defined.
- Lastly, fall back to `Object.prototype.hasOwnProperty.call(obj, prop)`, which is compatible with passed `null`-prototype objects.
Fixes https://github.com/facebook/react-native/issues/47963
Intend to pick for RN 0.77.
## Changelog:
[GENERAL][FIXED] Replace Object.hasOwn usages to fix Animated on JSC
Pull Request resolved: https://github.com/facebook/react-native/pull/48035
Test Plan:
- Run `rn-tester` on Android with Hermes disabled.
- Verify the FlatList->Basic example redboxes before this change, and works after it.
Reviewed By: yungsters
Differential Revision: D66638379
Pulled By: robhogan
fbshipit-source-id: 51ac525851b41adea3bf3cc41349225138e1f2fe
Summary:
This Pull Request fixes a regression introduced in https://github.com/facebook/react-native/commit/7c7e9e6571c1f702213e9ffbb40921cd5a1a786b, which adds a `filename*` attribute to the `content-disposition` of a FormData part. However, as the [MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition#directives) states, there is no `filename*` attribute for the `content-disposition` header in case of a form data.
The `filename*` attribute would break the parsing of form data in the request, such as in frameworks like `Next.js` which uses the web implementation of [`Request`](https://developer.mozilla.org/en-US/docs/Web/API/Request).
Fixes https://github.com/facebook/react-native/issues/44737
## 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] - Remove non compliant `filename*` attribute in a FormData `content-disposition` header
Pull Request resolved: https://github.com/facebook/react-native/pull/46543
Test Plan:
- Clone the `react-native` repo
- Create a simple JS file that will act as a node server and execute it
```javascript
const http = require('http');
const server = http.createServer(async function (r, res) {
const req = new Request(new URL(r.url, 'http://localhost:3000'), {
headers: r.headers,
method: r.method,
body: r,
duplex: 'half',
});
const fileData = await req.formData();
console.log(fileData);
res.writeHead(200);
res.end();
});
server.listen(3000);
```
- Go to `packages/rn-tester`
- Add a `useEffect` in `js/RNTesterAppShared.js`
```javascript
React.useEffect(() => {
const formData = new FormData();
formData.append('file', {
uri: 'https://www.gravatar.com/avatar',
name: '测试photo/1.jpg',
type: 'image/jpeg',
});
fetch('http://localhost:3000', {
method: 'POST',
body: formData,
}).then(res => console.log(res.ok));
});
```
- Run the app on iOS or Android
- The node server should output the file added to the FormData with an encoded name
Reviewed By: robhogan
Differential Revision: D66643317
Pulled By: yungsters
fbshipit-source-id: 0d531528005025bff303505363671e854c0a2b63
Summary:
This PR migrates `ReactSwitchManager` to Kotlin
Also it moves it's shadow node to a separate file (`ReactSwitchShadowNode.kt`)
## Changelog:
[ANDROID] [CHANGED] - Migrate `ReactSwitchManager` to Kotlin
Pull Request resolved: https://github.com/facebook/react-native/pull/48003
Test Plan: Make sure that `Switch` example in `RNTester` works correctly
Reviewed By: cortinico
Differential Revision: D66594606
Pulled By: javache
fbshipit-source-id: 774641c4cf57d6d5f770df1fed4fcafef2af7ceb
Summary:
solve the exception on android when `Appearance.setColorScheme` and activity recreate()
Fixes https://github.com/facebook/react-native/issues/47954
## Changelog:
[Android][Fixed] setColorScheme should be called on the UI thread
Pull Request resolved: https://github.com/facebook/react-native/pull/47955
Reviewed By: cortinico
Differential Revision: D66573373
Pulled By: javache
fbshipit-source-id: 97808e163e1c53bb94f4be7269d9cb9e212f2e95
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47962
Updates `HostAgent` to respond equivalently if either `FuseboxClient.setClientMetadata` (outgoing) or `ReactNativeApplication.enable` (incoming) are sent by the CDP frontend.
This is a partial migration, to be followed by removing the `FuseboxClient.setClientMetadata` method later.
Changelog: [Internal]
Reviewed By: robhogan
Differential Revision: D66501027
fbshipit-source-id: 1ff669c24667f51d240311e75f95747efe577e2d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48006
Changelog: [internal]
This implements symbolication of error stack traces in Fantom tests. We just needed to ask Metro to generate source maps and use the `source-map` package to process the stack traces that we get back from the runtime.
Reviewed By: sammy-SC
Differential Revision: D66577818
fbshipit-source-id: 672c66c246ad8646646d5ed31cabca39eb4f7aca
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48002
Demonstrates the issue identified in https://github.com/facebook/react-native/issues/47960 and a crash we've been seeing internally around `getViewState` referencing a view that does not exist.
When reparenting unflattened nodes, Differentiator may emit an `update` with a `parentShadowView` that does not exist on the native side yet, thereby crashing Android.
Landing the test-case first (with some test cleanup), so the diff for the actual fix is clearer.
Changelog: [Internal]
Reviewed By: lenaic
Differential Revision: D66557919
fbshipit-source-id: 5428c32e5f0200a8e98568cabeedb0c61aafbe23
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47994
Changelog: [internal]
This adds a few hacks to improve errors messages in Fantom tests. Before, we were only logging the error message. After this, we log the message and the full (unsymbolicated for now) stack, including a pretty print of the exact location of the error.
For errors thrown from `expect` functions, the stack trace is modified to remove the "infra" lines from the stack.
The next step is symbolicating the errors using source maps generated by metro.
Reviewed By: javache
Differential Revision: D66555063
fbshipit-source-id: 17bd23cb30429a17e99f13f934c45e001120bbb3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47968
Updates the Inspector Proxy to report + log when a profiling build target (experimental) is registered. This notifies the developer that debugging is available for these app(s), which will not otherwise fetch development bundles from Metro.
Changelog: [Internal]
Reviewed By: rubennorte
Differential Revision: D66501771
fbshipit-source-id: e06dee279158094ad5c70bf8e6a90e7c983de48a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47983
Changelog: [internal]
This mitigates some performance regressions caused by the migration from `ReactFabricHostComponent` to `ReactNativeElement` (enabling the DOM APIs).
Those regressions were caused by 2 main things:
1. By the use of a class hierarchy and having to call `super()`, which we transpile to a very complex code to ensure it's spec compliant.
2. By the use of private fields (`#viewConfig`) which are significantly slower than a regular field with the `_` naming convention (`_viewConfig`) processed by our custom transform.
This mitigates those problems by using the `_` convention and refactoring the class hierarchy to avoid the use of `super()` while preserving the Flow typing and most of the existing implementation.
Reviewed By: javache, andrewdacenko
Differential Revision: D66540756
fbshipit-source-id: db6aa18c12194b18e3a69e9979621d0feae6186a
Summary:
Removed `node-fetch` in favour of node builtin fetch to get rid of the deprecated `punycode` warning when using Node 22.
`react-native/community-cli-plugin` already requires Node >= 18 where it was made available by default (without `--experimental-fetch` flag).
This change is similar to the one made in https://github.com/facebook/react-native/pull/45227
## Changelog:
[GENERAL] [CHANGED] - Drop node-fetch in favor of Node's built-in fetch from undici in `react-native/community-cli-plugin`
Pull Request resolved: https://github.com/facebook/react-native/pull/47397
Test Plan: tests pass
Reviewed By: blakef
Differential Revision: D66512595
Pulled By: NickGerleman
fbshipit-source-id: c4e01baf388f9fae8cea7b4bfe25034bff28b461
Summary:
X-link: https://github.com/facebook/yoga/pull/1755
Pull Request resolved: https://github.com/facebook/react-native/pull/47975
I've been working with callsites here and its annoying if you switch these that you need to move these params around too. Let's just make them the same order
Changelog: [Internal]
Reviewed By: NickGerleman
Differential Revision: D66519836
fbshipit-source-id: 2e98e671270a053c6e62372e2003f1ca67774ec9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47965
Changelog: [General] [Changed] - fix item disappearing with scroll in VirtualizedList
It was caused because the function `computeWindowedRenderLimits` collapsed the current window size to just 1 element. So, users start scroll current window increase from {left:0, right:5 } -> {left:0, right:6 } and after some edge cases the window collapsed to `{left:6, right:6 }` which cause to remove all elements and recreate them later. As a result users have a lot of lags and blank pages.
The diff fixes the collapsing window size to 1 element. Also fix other decreasing `left` position even if windowSize more than current amount of elements.
Reviewed By: NickGerleman
Differential Revision: D66334188
fbshipit-source-id: 2162d00d03d64ab6325c0492d87449051e68a4e9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47723
Identity of `ImageRequest` is based on `ImageSource` and a subset of `ImageProps`. If any of those change, the request must be recreated and resubmitted.
Currently, the relevant subset of ImageProps is represented by a single `blurRadius` prop. This list will grow in the future. In order to simplify adding new props to the image request, we introduce the `ImageRequestParams` type that will wrap all the relevant props.
The alternative approach to pass `ImageProps` directly to `ImageManager` is worse because it would introduce dependency cycle between `ImageManager` and the `Image` component, and also it would require to store the props in State, which is bad.
Changelog: [Internal]
Reviewed By: javache
Differential Revision: D66172570
fbshipit-source-id: d6853bf8dcecd6e76ac90ccb2079d102a3015988
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47721
This diff splits Cxx ImageManger into Cxx and Android variants. They both are currently no-op, but the Android one will be used for image prefetching, just as `RCTImageManager.mm` for iOS.
Changelog: [Internal]
Reviewed By: javache
Differential Revision: D65753319
fbshipit-source-id: 774ff09b6b397facee7f645706dd97ba6d1177d7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47950
`addInArray` may reallocate `mAllChildren` so it's not correct to store this reference.
Changelog: [Internal]
Reviewed By: tdn120
Differential Revision: D66474532
fbshipit-source-id: 90ce2fcbf8ff236501ed47b2acc413e54ef8b82a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47913
CompositeBackgroundDrawable has some logic for inserting the layers that are not set through the constructor. This unit test makes sure they are being properly ordered.
Changelog: [Internal]
Reviewed By: NickGerleman
Differential Revision: D66381515
fbshipit-source-id: 514979a4a97fa159c1d1c3c923afe969eafc21c3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47934
This property needs to be made public for later diffs in this stack.
Changelog: [Internal]
Reviewed By: javache
Differential Revision: D66338915
fbshipit-source-id: f4896f8404e3d7eed7255e0f923ab5eec9a1291e
Summary:
The React Native `<ScrollView>` has a peculiar `centerContent` prop. It solves a common need — keeping the image "centered" while it's not fully zoomed in (but then allowing full panning after it's sufficiently zoomed in).
This prop sort of works but it has a few wonky behaviors:
- If you start tapping immediately after pinch (and don't stop), the taps will not be recognized until a second after you stop tapping. I suspect this is because the existing `centerContent` implementation hijacks the `contentOffset` setter, but the calling UIKit code _does not know_ it's being hijacked, and so the calling UIKit code _thinks_ it needs to do a momentum animation. This (invisible) momentum animation causes the scroll view to keep eating the tap touches.
- While you're zooming in, once you cross the threshold where `contentOffset` hijacking stops adjusting values, there will be a sudden visual jump during the pinch. This is because the "real" `contentOffset` tracks the accumulated translation from the pinch gesture, and once it gets taken into account with no "correction", the new offset snaps into place.
- While not sufficiently pinched in, the vertical axis is completely rigid. It does not have the natural rubber banding.
The solution to all of these issues is described [here](https://petersteinberger.com/blog/2013/how-to-center-uiscrollview/). Instead of hijacking `contentOffset`, it is more reliable to track zooming, child view, and frame changes, and adjust `contentInsets` instead. This solves all three issues:
- UIKit isn't confused by the content offset changing from under it so it doesn't mistrigger a faux momentum animation.
- There is no sudden jump because it's the insets that are being adjusted.
- Rubber banding just works.
## 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
-->
[IOS] [FIXED] - Fixed centerContent losing taps and causing jitter
Pull Request resolved: https://github.com/facebook/react-native/pull/47591
Test Plan:
I'm extracting this from [a patch we're applying to Bluesky](https://github.com/bluesky-social/social-app/blob/2ef697fe3d7dec198544ed6834553f33b95790b3/patches/react-native%2B0.74.1.patch). I'll be honest — I have not tested this in isolation, and it likely requires some testing to get merged in. I do not, unfortuntately, have the capacity to do it myself so this is more of a "throw over the wall" kind of patch. Maybe it will be helpful to somebody else.
I've tested these in our real open source app (https://github.com/bluesky-social/social-app/pull/6298). You can reproduce it in any of the lightboxes in the feed or the profile.
### Before the fix
Observe the failing tap gestures, sudden jump while pinching, lack of rubber banding.
https://github.com/user-attachments/assets/c9883201-c9f0-4782-9b80-8e0a9f77c47c
### After the fix
Observe the natural iOS behavior.
https://github.com/user-attachments/assets/c025e1df-6963-40ba-9e28-d48bfa5e631d
Unfortunately I do not have the capacity to verify this fix in other scenarios outside of our app.
Reviewed By: sammy-SC
Differential Revision: D66093472
Pulled By: javache
fbshipit-source-id: 064f0415b8093ff55cb51bdebab2a46ee97f8fa9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47292
If we don't add the prop to the iterator style parser then since fabric is not parsing the prop we are not properly creating the stacking context for when a prop has a mix-blend-mode set
Changelog: [Internal]
Reviewed By: javache
Differential Revision: D65166886
fbshipit-source-id: 7b5bce82e81bf0c566ccd4620852ae877ccbf376
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47293
We missed fabric check for the mix-blend-mode conditional on `drawChildren` adding it now
Changelog: [Internal]
Reviewed By: NickGerleman
Differential Revision: D65167244
fbshipit-source-id: 1af5dc1979fb79c453ba0f27c0385a94dc539a55
Summary:
While trying to write some test cases for `ReactOkHttpNetworkFetcher`, I found that the cache control headers are not being sent over the network request correctly. These cache control headers are always being overwritten by the rest of the headers hence all the logic to set this custom cache control doesn't seem to be working as expected.
As per the [Request headers](https://github.com/square/okhttp/blob/2832a9e532ecbc6f1f84b3a07e8e64b75372789c/okhttp/src/main/kotlin/okhttp3/Request.kt#L256) docs, this seems to be the explanation:
> /** Removes all headers on this builder and adds [headers]. */
open fun headers(headers: Headers) = commonHeaders(headers)
With the new approach by setting the headers first, we ensure that the cache control headers don't get overwritten but they would get added on top of the passed headers.
Notice that currently it seems to be overwriting these headers even if there are not headers passed from the Image component (AKA null/empty).
See my reproduction example in the test plan.
## Changelog:
[ANDROID] [FIXED] - ReactOkHttpNetworkFetcher – cache control headers getting overwritten by the rest of the headers
Pull Request resolved: https://github.com/facebook/react-native/pull/47922
Test Plan:
By creating the following component, we log the request headers using `FLog` with the previous and the new approach. See the difference on the outputs below:
Component:
```tsx
<Image
source={{
uri: 'https://www.facebook.com/assets/fb_lite_messaging/E2EE-settings@3x.png?cacheBust=reload',
cache: 'reload',
headers: {
'some-header': 'some-header-value',
},
}}
/>
```
Setting the `headers` last (current approach):
```kt
val request =
Request.Builder()
.cacheControl(cacheControlBuilder.build())
.url(uri.toString())
.headers(headers)
.get()
.build()
FLog.w("RequestHeaders", request.headers.toString())
```
Output (notice that the Cache-Control header is not present):
```bash
RequestHeaders com.facebook.react.uiapp W some-header: some-header-value
```
<img width="561" alt="image" src="https://github.com/user-attachments/assets/797cd90a-2064-4772-99cc-5f9d39d73361">
---
New approach by setting the `headers` first:
```kt
val request =
Request.Builder()
.headers(headers)
.cacheControl(cacheControlBuilder.build())
.url(uri.toString())
.get()
.build()
FLog.w("RequestHeaders", request.headers.toString())
```
Output (Cache-Control is present now along with the passed headers):
```bash
RequestHeaders com.facebook.react.uiapp W some-header: some-header-value
Cache-Control: no-cache, no-store
```
<img width="556" alt="image" src="https://github.com/user-attachments/assets/1b9f7865-926e-496b-ad3a-36e19ae92188">
Reviewed By: rshest
Differential Revision: D66446820
Pulled By: javache
fbshipit-source-id: 2640ea4b0e678a7aa919b919b0b44bedc0da0af4
2024-11-25 07:34:51 -08:00
2019 changed files with 149439 additions and 111523 deletions
This directory was home to the Circle CI configuration files.
In July 2024 we moved to GitHub Actions, and week this folder for backward compatibility, as we want to keep on using Circle CI for the release of React Native <= 0.74.
- Add the `source` parameter to generate-codegen-artifacts to avoid generating files not needed by libraries. ([98b8f17811](https://github.com/facebook/react-native/commit/98b8f178110472e5fed97de80766c03b0b5e988c) by [@cipolleschi](https://github.com/cipolleschi))
### Fixed
- Add missing `invariant` dependency ([ee8088b615](https://github.com/facebook/react-native/commit/ee8088b6157837c239db47ac5bd3a8603ceefc3c) by [@tido64](https://github.com/tido64))
- Fix `maxFontSizeMultiplier` prop on `Text` and `TextInput` components in Fabric / New Architecture ([ea49d4d1b01107a5ecbbbd4904f1d935e51d6b32](https://github.com/facebook/react-native/commit/ea49d4d1b01107a5ecbbbd4904f1d935e51d6b32) by [@RickardZrinski](https://github.com/RickardZrinski))
#### Android specific
- Pass the bundle URL protocol when setting up HMR client on Android ([32fe244744](https://github.com/facebook/react-native/commit/32fe24474495f09f985a2c92e11103dd386f5fe3) by [@byCedric](https://github.com/byCedric))
## v0.78.0-rc.2
### Fixed
#### iOS specific
- Load images even when the extension is implicit ([b9f418e9bc](https://github.com/facebook/react-native/commit/b9f418e9bc35372438a34934254db985b7ad1840) by [@cipolleschi](https://github.com/cipolleschi))
## v0.78.0-rc.1
### Changed
#### iOS specific
- Pin 'concurrent-ruby' to a working version ([198adb47af](https://github.com/facebook/react-native/commit/198adb47af3676c85b35adb308c110c1d87120c8) by [@cipolleschi](https://github.com/cipolleschi))
### Fixed
- Buttons becoming unresponsive when transform is animated ([2204ec94d4](https://github.com/facebook/react-native/commit/2204ec94d4b67a9ba559db3f54a5a1ef91e0f233) by [@sammy-SC](https://github.com/sammy-SC))
## v0.78.0-rc.0
### Breaking
- Codegen: Separate component array types and command array types ([825492b199](https://github.com/facebook/react-native/commit/825492b1999b62de708e6f40d5d5de8d3d7cb8a9) by [@elicwhite](https://github.com/elicwhite))
- The `FuseboxClient.setClientMetadata` CDP method is removed. Instead, use `ReactNativeApplication.enable`. ([1a9780f0e3](https://github.com/facebook/react-native/commit/1a9780f0e3714ac18ffae34cb67376c711b0e031) by [@huntie](https://github.com/huntie))
#### Android specific
- Changed visibility of FrescoBasedReactTextInlineImageViewManager to internal ([d5f33c19cb](https://github.com/facebook/react-native/commit/d5f33c19cb33e2f2c7d2470cc90872c1f065f20d) by [@alanleedev](https://github.com/alanleedev))
- Mikgrating pointerEvents API breaks compatibility for kotlin usages of this api as a val ([45e4a3afce](https://github.com/facebook/react-native/commit/45e4a3afceb4be3047cd01a60ec2c9f806ed30fe) by [@mdvacca](https://github.com/mdvacca))
- Convert RootView to Kotlin ([21c9491926](https://github.com/facebook/react-native/commit/21c94919260a68409f82081740169d0409e78933) by [@fabriziocucci](https://github.com/fabriziocucci))
- Delete unused abstract class GuardedResultAsyncTask ([67bff8734f](https://github.com/facebook/react-native/commit/67bff8734f4b92fe399910eecad5b67511a749c1) by [@mdvacca](https://github.com/mdvacca))
- Delete deprecated class FabricViewStateManager ([b25b65ba19](https://github.com/facebook/react-native/commit/b25b65ba19f3c674fd2efe5c01123ccc0ae55cbf) by [@mdvacca](https://github.com/mdvacca))
- Removed ComponentNameResolver from public API ([a4849cb3d6](https://github.com/facebook/react-native/commit/a4849cb3d6f4245d15eb3812e417a9f4248bb3a1) by [@mdvacca](https://github.com/mdvacca))
#### iOS specific
- Change Image load event size info from logical size to pixel ([09995fc874](https://github.com/facebook/react-native/commit/09995fc8741cfdc6095d09627262b4f6fbbaafc2) by [@zhongwuzw](https://github.com/zhongwuzw))
### Added
- Add support for the second parameter of `console.table` to specify a list of columns to print in the table. ([fd0894b1c7](https://github.com/facebook/react-native/commit/fd0894b1c7fcb20dd213ec1e93aafef25935d709) by [@rubennorte](https://github.com/rubennorte))
- Added `RawValue(Runtime*, jsi::Value&)` constructor to make a `RawValue` from a `jsi::Value`. ([03d2186ace](https://github.com/facebook/react-native/commit/03d2186ace2cb17c676b7763d5a545759a658b77) by [@hannojg](https://github.com/hannojg))
- Added `pointerEvents` to `TextProps` type. ([3efbe33ce0](https://github.com/facebook/react-native/commit/3efbe33ce03f846932406742528652eb695b957d) by [@hyochan](https://github.com/hyochan))
- Add `jest-diff v29.7.0` to devDependencies ([b27bd00a38](https://github.com/facebook/react-native/commit/b27bd00a389295250ec003357df713ebf306374b) by [@andrewdacenko](https://github.com/andrewdacenko))
- Add useColorScheme mock test ([24fee29f7a](https://github.com/facebook/react-native/commit/24fee29f7a8ab328bb35e66d145d6b9c2d018c1d) by [@Kudo](https://github.com/Kudo))
#### Android specific
- Make the addition of JitPack repository configurable ([a98528e609](https://github.com/facebook/react-native/commit/a98528e609ff0ace4b7bc82f3aa273b7e3fa6443) by [@cortinico](https://github.com/cortinico))
- Fixing schema types for component command params of Arrays ([25c673e357](https://github.com/facebook/react-native/commit/25c673e35784d8d8c49555af104b9b4d8d37973d) by [@elicwhite](https://github.com/elicwhite))
- SoftException categories ([c832f94cf7](https://github.com/facebook/react-native/commit/c832f94cf713d0cb7616ef095f38583979e1cf43) by Thomas Nardone)
- Add mockito-kotlin for Kotlin unit testing ([e393711ef8](https://github.com/facebook/react-native/commit/e393711ef88629a661b34d4aebe785855c5c5969) by Thomas Nardone)
- ActivityIndicator: setting `resource-id` from the `testID` prop ([87b1bad45e](https://github.com/facebook/react-native/commit/87b1bad45e4eb730ea07686a2b2558253c60d3b7) by [@mateoguzmana](https://github.com/mateoguzmana))
- Added `getState` method for `StateWrapperImpl` ([ed36e896ac](https://github.com/facebook/react-native/commit/ed36e896ac34fcbefece87456dbdfdff30d22ad5) by [@hannojg](https://github.com/hannojg))
#### iOS specific
- [TextInput] Integrate a new property - `disableKeyboardShortcuts`. It can disable the keyboard shortcuts on iPads. ([0154372b93](https://github.com/facebook/react-native/commit/0154372b93eb1b02f0c62f2a75c95f4fc6a9f3e8) by [@rezkiy37](https://github.com/rezkiy37))
- Implement ReactNativeFactory ([081be01a5d](https://github.com/facebook/react-native/commit/081be01a5dd24d0a398c6aa8297575502a17d5ec) by [@okwasniewski](https://github.com/okwasniewski))
- Support system font families (system-ui, ui-sans-serif, ui-serif, ui-monospace, and ui-rounded) on iOS ([1763321c89](https://github.com/facebook/react-native/commit/1763321c8960d30ddc4d3464a0fffdecdd44617a) by [@cxa](https://github.com/cxa))
### Changed
- Improved types in BoxInspector and refactored a code ([f832c450a5](https://github.com/facebook/react-native/commit/f832c450a52c4c9d61c1d6b609fcad1332613556) by [@coado](https://github.com/coado))
- Improved types in StyleInspector and refactored a code ([49e5c58c59](https://github.com/facebook/react-native/commit/49e5c58c595265c9fffc84741aab6363d291f1f5) by [@coado](https://github.com/coado))
- Improved types in ElementBox and refactored a code ([2959d49e8d](https://github.com/facebook/react-native/commit/2959d49e8d09663f9ac437ffcb66d1c99162c6d0) by [@coado](https://github.com/coado))
- Improve types on BorderBox ([48a7840919](https://github.com/facebook/react-native/commit/48a784091989c695e3432cb8ba657139eb9f5e99) by [@coado](https://github.com/coado))
- Improved formatting of values logged via `console.table` (including Markdown format). ([7154c62afb](https://github.com/facebook/react-native/commit/7154c62afb5371f3f861663826792e41229c344a) by [@rubennorte](https://github.com/rubennorte))
- Improve types on DrawerLayoutAndroid ([b5155fba89](https://github.com/facebook/react-native/commit/b5155fba895411e290faeeea06180fce24079f78) by [@huntie](https://github.com/huntie))
- Mark `intersectionRect` required in `NativeIntersectionObserverEntry` to reflect native logic. ([8681fc2ab2](https://github.com/facebook/react-native/commit/8681fc2ab20aa1e5937a0bf3fc58ed03c3e0ee23) by [@lunaleaps](https://github.com/lunaleaps))
- Upgrading `typescript-config` module version to `esnext` ([5370347f54](https://github.com/facebook/react-native/commit/5370347f54719f318a4e032aba6cbf2269e7c3d7) by [@mateoguzmana](https://github.com/mateoguzmana))
- Reverts #47503. (~~Callbacks passed to `animation.start(<callback>)` will be scheduled for execution in a microtask. Previously, there were certain scenarios in which the callback could be synchronously executed by `start`.~~) ([8793b7d89b](https://github.com/facebook/react-native/commit/8793b7d89bcafdfcca7ecb953e60882b67ffc807) by [@yungsters](https://github.com/yungsters))
- ([9aa21b5e87](https://github.com/facebook/react-native/commit/9aa21b5e8765f14a9806eac435636b87f62178cc) by [@lunaleaps](https://github.com/lunaleaps))
- Fix item disappearing with scroll in VirtualizedList ([df7b6ae092](https://github.com/facebook/react-native/commit/df7b6ae092d03385ebd05efd0f068c59e727f723) by [@Tom910](https://github.com/Tom910))
#### Android specific
- Introduce new public API ViewManagerInterface ([40a0cdbc99](https://github.com/facebook/react-native/commit/40a0cdbc99746f18ca15c48f3d8f03cdad1635af) by [@mdvacca](https://github.com/mdvacca))
- Bumped Android Gradle Plugin (AGP) to 8.8.0 ([4c7c836ebf](https://github.com/facebook/react-native/commit/4c7c836ebf956c13fa327170adaec43a076226e7) by [@cortinico](https://github.com/cortinico))
- Bump Gradle to 8.12 ([5e6478954c](https://github.com/facebook/react-native/commit/5e6478954c77f64a9086757ed4a879e83a1ab404) by [@cortinico](https://github.com/cortinico))
- Replaced custom XML decoder with Fresco's built-in decoder ([6feb90bb29](https://github.com/facebook/react-native/commit/6feb90bb290ab460df8df2f6f01531a77aac9008) by [@Abbondanzo](https://github.com/Abbondanzo))
- Update Fresco to 3.6.0 ([819b5c2c8d](https://github.com/facebook/react-native/commit/819b5c2c8dfad620152b159838575b6c03e18ffe) by [@Abbondanzo](https://github.com/Abbondanzo))
- Migrate jsc-android to mavenCentral ([e42a3a6b84](https://github.com/facebook/react-native/commit/e42a3a6b842d71fc25419c02f6015863fa019f05) by [@Kudo](https://github.com/Kudo))
- Migrate ComponentNameResolver to kotlin ([385b9f4265](https://github.com/facebook/react-native/commit/385b9f4265316a1e1cf8627ea7ed3bed790cc8c5) by [@mdvacca](https://github.com/mdvacca))
- Update Fresco to 3.5.0 ([72bb2f4089](https://github.com/facebook/react-native/commit/72bb2f4089d5e49b9e8a09f416d63db6c7d2b798) by [@Abbondanzo](https://github.com/Abbondanzo))
- Migrate `ReactSwitchManager` to Kotlin ([b886bc4db9](https://github.com/facebook/react-native/commit/b886bc4db970d8c70de1596dc3f88bdc398de482) by [@krozniata](https://github.com/krozniata))
#### iOS specific
- Reduce memory allocations when computing accessibilityLabel ([74bdab8bd8](https://github.com/facebook/react-native/commit/74bdab8bd8be2413734004145507c0688232053e) by [@sparga](https://github.com/sparga))
- Explicitly define the source files for React-graphics ([3ff9212ce4](https://github.com/facebook/react-native/commit/3ff9212ce46314a749e65dd246e49965288d8f57) by [@cipolleschi](https://github.com/cipolleschi))
- Use configuration type when adding ndebug flag to pods in release ([462fae4a29](https://github.com/facebook/react-native/commit/462fae4a29ba1a5249d05862d2593dca4d6758c1) by [@benhandanyan](https://github.com/benhandanyan))
- Fix typo in utils.rb ([fa03840e68](https://github.com/facebook/react-native/commit/fa03840e688067bf16a7fb60c00efdc9a1813f92) by [@WoLewicki](https://github.com/WoLewicki))
### Removed
#### Android specific
- Removed JSCHeapCapture module, deprecated PackagerCommandListener#onCaptureHeapCommand ([e06fa5d102](https://github.com/facebook/react-native/commit/e06fa5d1026843ec4a2ba3dd209652dc5290c0ba) by [@javache](https://github.com/javache))
- Made ReactCookieJarContainer internal. ([18ebea533d](https://github.com/facebook/react-native/commit/18ebea533d348329926bd7782bb55469aa228a4a) by [@javache](https://github.com/javache))
### Fixed
- Modified `console.table` to avoid mutating the received argument. ([caa77fbe2b](https://github.com/facebook/react-native/commit/caa77fbe2b03e6969ae9b542d011f926a0ede3c7) by [@rubennorte](https://github.com/rubennorte))
- Disable `react-in-jsx-scope` rule in eslint config ([ea56c432b7](https://github.com/facebook/react-native/commit/ea56c432b7a577d3805d1a7b4b46596799dd892e) by [@matinzd](https://github.com/matinzd))
- Fix a bug when fantom tests could not be run in parallel, e.g. in a stress-test. ([8696b79f73](https://github.com/facebook/react-native/commit/8696b79f73fec18a9e3785b9a2c150afc9965d76) by [@mijay](https://github.com/mijay))
- Fix peer dependencies on React types ([4368368ef5](https://github.com/facebook/react-native/commit/4368368ef5c3f3d08a66ee6c13222f6d81a2d2df) by [@cipolleschi](https://github.com/cipolleschi))
- Removed unnecessary state updates in React to reflect the current state of looping animations. ([6059660c60](https://github.com/facebook/react-native/commit/6059660c607f5b6edba08a12906f0f9d6cb15d34) by [@rubennorte](https://github.com/rubennorte))
- `JSBigFileString` fails for non-zero offset arguments ([7d0338cb0b](https://github.com/facebook/react-native/commit/7d0338cb0b24926aff648a4c8ba5d77b052010cc) by [@jwajgelt](https://github.com/jwajgelt))
- Animation.stop() executes when `animatedShouldUseSingleOp` is enabled. ([746d584a23](https://github.com/facebook/react-native/commit/746d584a23f303493faa4f9d857ec542257a92ae) by [@javache](https://github.com/javache))
- Fixed `adjustsFontSizeToFit` not working for text with a single character ([47822e9048](https://github.com/facebook/react-native/commit/47822e90480d61e197a3f223e088ee88a0f38ad7) by [@j-piasecki](https://github.com/j-piasecki))
#### Android specific
- Fix crash for setEventEmitterCallback NoSuchMethodError on API lvl 26 ([7dcbc799eb](https://github.com/facebook/react-native/commit/7dcbc799eb2fb5792512b71320eafed08deec9ea) by [@cortinico](https://github.com/cortinico))
- Fix incorrect height of single line TextInputs without definite size ([9b646c8b7b](https://github.com/facebook/react-native/commit/9b646c8b7b9a23645b1563883768a9274897a1cd) by [@NickGerleman](https://github.com/NickGerleman))
- `FLAG_SECURE` not respected in Modal dialog ([7e029b0dcf](https://github.com/facebook/react-native/commit/7e029b0dcf6d1a6455a8a6343457b70e353d0ff6) by [@mateoguzmana](https://github.com/mateoguzmana))
- Fix JSC Debug instacrashing ([b10491a3c4](https://github.com/facebook/react-native/commit/b10491a3c457c802608758ca1fe659a72c18576b) by [@cortinico](https://github.com/cortinico))
- Fix BackHandle callback undefined cause crash issue ([44705fe11b](https://github.com/facebook/react-native/commit/44705fe11bd9bb12c8f71d1e50a7b48e0af6a38d) by [@BleemIs42](https://github.com/BleemIs42))
- Modal: Setting `resource-id` from `testID` prop ([52b6592559](https://github.com/facebook/react-native/commit/52b65925595882d9b6c7f354a5ce3bfe3823738e) by [@mateoguzmana](https://github.com/mateoguzmana))
- Handling `testID` correctly for horizontal scroll view ([81c74cd35f](https://github.com/facebook/react-native/commit/81c74cd35f9e40c8ad4663fc932d0dddeaa4bc19) by [@mateoguzmana](https://github.com/mateoguzmana))
- Fixed build issue when including mapbuffer jni headers in library code ([ecf17666ad](https://github.com/facebook/react-native/commit/ecf17666ad84e15d31944962e2d0e846a5670977) by [@hannojg](https://github.com/hannojg))
- Support Long values in WritableMap and WritableArray ([e7f943de2f](https://github.com/facebook/react-native/commit/e7f943de2fd71d2259ab53e7817d2dcf96559f7e) by [@WoLewicki](https://github.com/WoLewicki))
- Re-introduce the deprecated constructor on ReactModuleInfo ([734730df75](https://github.com/facebook/react-native/commit/734730df75b3bdddeb5dbe65f4151cc92b988303) by [@cortinico](https://github.com/cortinico))
- Fix JSC by avoiding use of unavailable `str.replaceAll()` ([b5b9e032c2](https://github.com/facebook/react-native/commit/b5b9e032c2b57aa44afb7141a879d83c8b889feb) by [@robhogan](https://github.com/robhogan))
- Reverted removal of TurboReactPackage ([70a957452c](https://github.com/facebook/react-native/commit/70a957452c438a74787f4f752b2c274360cb2edd) by [@javache](https://github.com/javache))
- SetColorScheme should be called on the UI thread ([2aa79979d3](https://github.com/facebook/react-native/commit/2aa79979d3e4a54008f24c81b6c04553c98ff6b6) by lihaitao)
#### iOS specific
- Fix app becoming unresponsive when RefreshControl is used inside of <Modal /> ([6cb2684b43](https://github.com/facebook/react-native/commit/6cb2684b4343bd8698b9770c0f6ef8812683c783) by [@sammy-SC](https://github.com/sammy-SC))
- Resolve "Your project does not explicitly specify the CocoaPods master specs repo" `pod install` warning ([2f2281718a](https://github.com/facebook/react-native/commit/2f2281718a2ef905ffd15adf3b47a1b6b6fb8d95) by [@noway](https://github.com/noway))
- Enable/disable keyboard shortcuts only on iOS ([8b0af4542e](https://github.com/facebook/react-native/commit/8b0af4542e6fd5628fefdc8e1699326c2225c3f0) by [@okwasniewski](https://github.com/okwasniewski))
- Dashed & dotted borders now work with overflow: hidden ([1b88c5b429](https://github.com/facebook/react-native/commit/1b88c5b429888e109b7acae4808b4b6f8b3f920f) by [@joevilches](https://github.com/joevilches))
- Emit didUpdateDimensions correctly ([920867d949](https://github.com/facebook/react-native/commit/920867d9494cbfcc9cb0e23607cb339ec1b89ca9) by TobiasH)
- Fix applicationDidEnterBackground not being called ([adaceba546](https://github.com/facebook/react-native/commit/adaceba5462b4ad8676745f34e0be2bf5bb25166) by [@alextoudic](https://github.com/alextoudic))
- Fixed problem with accessory view & 3rd party libs ([5fc582783d](https://github.com/facebook/react-native/commit/5fc582783d7f70ca9521e317c93624a8845bfff2) by [@kirillzyusko](https://github.com/kirillzyusko))
- Fix Direct Debugging with JSC ([b04d17afca](https://github.com/facebook/react-native/commit/b04d17afcac82af1a47fd462a04fe4088d19b468) by [@Saadnajmi](https://github.com/Saadnajmi))
- Fix ccache not found error exporting ccache binary path as Xcode user-defined setting to be used by ccache scripts ([d31ac832c5](https://github.com/facebook/react-native/commit/d31ac832c5b866653f7179fd517427f7be11ad45) by [@ste7en](https://github.com/ste7en))
- Properly escape paths in Xcode build script used when bundling an app. ([2fee13094b](https://github.com/facebook/react-native/commit/2fee13094b3d384c071978776fd8b7cff0b6530f) by [@kraenhansen](https://github.com/kraenhansen))
- Exclude Android HorizontalScrollContentView cxx component code ([4adaacb4f7](https://github.com/facebook/react-native/commit/4adaacb4f7cd136d5534c81fb9b8f5f2a0312d7f) by [@zhongwuzw](https://github.com/zhongwuzw))
- Fixed centerContent losing taps and causing jitter ([fe7e97a2fd](https://github.com/facebook/react-native/commit/fe7e97a2fd272db0d9d9aa7d0561337a7c8e2c30) by [@gaearon](https://github.com/gaearon))
### Unknown
- Release 0.78.0-rc.0 ([b713f273b6](https://github.com/facebook/react-native/commit/b713f273b6df654e4274ae00a849c39d2efccedc) by [@react-native-bot](https://github.com/react-native-bot))
- Bump Hermes ([0c8e15e8bb](https://github.com/facebook/react-native/commit/0c8e15e8bb16ec279290d2390caf75e83d52f518) by [@cipolleschi](https://github.com/cipolleschi))
- Include cxx modules in codegen schema ([cf5ab03d43](https://github.com/facebook/react-native/commit/cf5ab03d4324b7e3fce38f9eacc96da82b11b68a) by [@elicwhite](https://github.com/elicwhite))
- Add "jsEngine: hermes" to JS runtime Error prototype ([85bdd75828](https://github.com/facebook/react-native/commit/85bdd75828f85230aaa90ed510666457c46f996c) by Maddie Lord)
- Translation auto-update for Apps/Wilde/scripts/intl-config.json on master ([5b6e35afda](https://github.com/facebook/react-native/commit/5b6e35afda5f0ef8cc8810ed8c6bd918777292b4) by Intl Scheduler)
- Add logging in ReactInstanceManager.onHostPause when activity is incorrectly null ([c2fd35a442](https://github.com/facebook/react-native/commit/c2fd35a4429c752dc2d10a789e4c5f48d22b1eeb) by Maddie Lord)
- Remove as_const option (on by default) in fbsource ([e5a526ff44](https://github.com/facebook/react-native/commit/e5a526ff44c25afd935d117d6d4d342f210553a6) by [@panagosg7](https://github.com/panagosg7))
- Remove comment syntax from ReactNativeTypes ([a80baac58e](https://github.com/facebook/react-native/commit/a80baac58e9f2fc62829ab76b929f5c8b21c05a5) by [@hoxyq](https://github.com/hoxyq))
- Update YGNodeStyleGetGap to return YGValue ([331d99a941](https://github.com/facebook/react-native/commit/331d99a94154678848628122e8fe3373ee67fb9b) by [@heoblitz](https://github.com/heoblitz))
- Remove unused-variable in ../xplat/compphoto/gpuEngine/tools/ToolHelpers.cpp +3 ([071d223ee0](https://github.com/facebook/react-native/commit/071d223ee02c6f826d06c033e6c949642bd24b9a) by [@r-barnes](https://github.com/r-barnes))
#### Android Unknown
- Fix background getting clipped when border-radius is set ([6d235853fb](https://github.com/facebook/react-native/commit/6d235853fb9e9ad4050ba5611d74921fa1b9c72d) by [@jorge-cab](https://github.com/jorge-cab))
#### iOS Unknown
- Static Hermes for React Native ([23eb06f662](https://github.com/facebook/react-native/commit/23eb06f6623f6831ff5f6a2f12e22884de4c1326) by [@piaskowyk](https://github.com/piaskowyk))
- Remove unused-variable in xplat/js/react-native-github/packages/react-native/React/Base/RCTModuleData.mm +3 ([72007a14af](https://github.com/facebook/react-native/commit/72007a14af3afe0e161c1144af39759807807f25) by [@r-barnes](https://github.com/r-barnes))
#### Failed to parse
- Apply fixup patch to fbsource ([7948044179](https://github.com/facebook/react-native/commit/794804417990848d0fc9bb8939b9c340ced3477f) by generatedunixname499836121)
- Test(image): [android] react okhttp network fetcher cache control tests ([37c532a063](https://github.com/facebook/react-native/commit/37c532a063c6054ea974612a40551f7c1399c147) by [@mateoguzmana](https://github.com/mateoguzmana))
- Test(network): [android] `ResponseUtil` unit tests ([50d0157f0c](https://github.com/facebook/react-native/commit/50d0157f0c6a4e3224d8064a8b55c523bcd33269) by [@mateoguzmana](https://github.com/mateoguzmana))
- ReactOkHttpNetworkFetcher – cache control headers getting overwritten by the rest of the headers ([81cb166d10](https://github.com/facebook/react-native/commit/81cb166d103f7caaa5135b5a1c66d4e978f3619f) by [@mateoguzmana](https://github.com/mateoguzmana))
## v0.77.0
### Breaking
- **Animation:** Native looping animation will not send React state update every time it finishes. ([4b035d820d](https://github.com/facebook/react-native/commit/4b035d820d3f1c3c9a98ce4f55bcc95a7ab064bf) by [@dmytrorykun](https://github.com/dmytrorykun))
- **Dev-Middleware:** Frameworks should specify `serverBaseUrl` relative to the middleware host. ([acf384a72e](https://github.com/facebook/react-native/commit/acf384a72e599691e4c9d53043f1801da01c58fd) by [@robhogan](https://github.com/robhogan))
- **JS:** Remove ReactFabricInternals module ([0c21db360c](https://github.com/facebook/react-native/commit/0c21db360cecc6a3265eea50d628106c58b67af8) by [@huntie](https://github.com/huntie))
- **layout:**`position` of sticky headers on `ScrollView` will now be taken into account ([cbab004eb9](https://github.com/facebook/react-native/commit/cbab004eb94f8312e9b10dae1502d3ca8632a006) by [@joevilches](https://github.com/joevilches))
- **layout:** More spec compliant absolute positioning ([0a2dec175e](https://github.com/facebook/react-native/commit/0a2dec175e92185943907f3e1f6073bae6cd663d) by [@NickGerleman](https://github.com/NickGerleman))
- **Native Modules:** Bridgeless: Make NativeModules.foo load turbomodules (unset turboModuleProxy in bridgeless). ([cc5f17d5a2](https://github.com/facebook/react-native/commit/cc5f17d5a2b185de1e7dec2a56a97b088e4c7a81) by [@RSNara](https://github.com/RSNara))
#### Android specific
- **APIs:** Removed ReactViewGroup.getBackgroundColor() ([6a472c5cf2](https://github.com/facebook/react-native/commit/6a472c5cf25d72f72ec7e261282d611a5ab0a662) by Thomas Nardone)
- **APIs:** ReadableArray non-primitive getters are now correctly typed as optional ([145c72f816](https://github.com/facebook/react-native/commit/145c72f8163048f0eee30d5ce850911f5dad865c) by [@javache](https://github.com/javache))
- **APIs:** Remove jsBundleLoader from DefaultReactHost.getDefaultReactHost() ([fbe4c0ed34](https://github.com/facebook/react-native/commit/fbe4c0ed347156a7ea24da29e09083a499c80cf5) by [@mdvacca](https://github.com/mdvacca))
- **APIs:** Reduce visibility of TaskCompletionSource class ([4f55161132](https://github.com/facebook/react-native/commit/4f551611326d63b6fb5cd53e63d536c2c6f04647) by [@mdvacca](https://github.com/mdvacca))
- **APIs:** Stable API - Make ImageStoreManager internal ([846c4b1ea2](https://github.com/facebook/react-native/commit/846c4b1ea2d139e3f3cbafa2f8ddbf159e3322e4) by [@arushikesarwani94](https://github.com/arushikesarwani94))
- **APIs:** Stable API - Make SwipeRefreshLayoutManager internal ([d02da992a4](https://github.com/facebook/react-native/commit/d02da992a4c0893313b9f059a8be228f43fffa7a) by Thomas Nardone)
- **APIs:** Stable API - Make classes inside `com.facebook.react.views.progressbar` internal ([46526fc2fe](https://github.com/facebook/react-native/commit/46526fc2fe1dd0ce937fad35469b64b9fb05eaa2) by [@cortinico](https://github.com/cortinico))
- **APIs:** Stable API - Make OkHttpCallUtil internal ([abd118a719](https://github.com/facebook/react-native/commit/abd118a719fe0aeb13f980729ff9ce5fb8358b83) by [@arushikesarwani94](https://github.com/arushikesarwani94))
- **APIs:** Stable API - Make SimpleSettableFuture internal ([3dec672398](https://github.com/facebook/react-native/commit/3dec672398729cd668aff92249f1fdde231fb928) by [@arushikesarwani94](https://github.com/arushikesarwani94))
- **APIs:** Stable API - Make `ClipboardModule` internal ([10f6d5adb5](https://github.com/facebook/react-native/commit/10f6d5adb538a9b20043312fc09b192759100d63) by [@cortinico](https://github.com/cortinico))
- **APIs:** Reduce visibility of ReactVirtualTextShadowNode to internal ([496b0a8729](https://github.com/facebook/react-native/commit/496b0a8729b41266683fdd84de5618b23d06ce3d) by [@mdvacca](https://github.com/mdvacca))
- **APIs:** Reduce visibility of ReactVirtualTextViewManager to internal ([4a119c4c3a](https://github.com/facebook/react-native/commit/4a119c4c3ac9bf4b234e2942a27a6efd68a801cc) by [@mdvacca](https://github.com/mdvacca))
- **APIs:** Stable API - Make classes in `com.facebook.react.views.safeareaview` internal ([39dfbadd5d](https://github.com/facebook/react-native/commit/39dfbadd5d3468d079bf3b039401237c6e7f363c) by [@cortinico](https://github.com/cortinico))
- **APIs:** Stable API - Make ClipboardModule internal ([a72c35f98c](https://github.com/facebook/react-native/commit/a72c35f98ccd1a49d367678b46a29c814ad5de43) by [@cortinico](https://github.com/cortinico))
- **APIs:** Stable API - Make NativeModulePerfLogger internal ([d7d5de9f96](https://github.com/facebook/react-native/commit/d7d5de9f9630e7dcd0194830d7ccb32f167b619c) by [@cortinico](https://github.com/cortinico))
- **APIs:** Make ReactDebugOverlayTags, DebugOverlayTags, Printer, PrinterHolder, NoopPrinter internal ([623d481991](https://github.com/facebook/react-native/commit/623d4819915e7e6fafb8006c8e3b3b796e394974) by [@cortinico](https://github.com/cortinico))
- **APIs:** Make `DevLoadingModule` internal ([8c50bf0beb](https://github.com/facebook/react-native/commit/8c50bf0beb17ced7fdafeae7a734edfc03e6e0b2) by [@cortinico](https://github.com/cortinico))
- **APIs:** Stable API - Convert to Kotlin and make internal `NotThreadSafeViewHierarchyUpdateDebugListener` ([287e200332](https://github.com/facebook/react-native/commit/287e20033207df5e59d199a347b7ae2b4cd7a59e) by [@cortinico](https://github.com/cortinico))
- **APIs:** Rename DevSupportManagerBase.getCurrentContext() -> getCurrentReactContext() ([0e7ba9094e](https://github.com/facebook/react-native/commit/0e7ba9094ea573d1512b2dc71e46f55b24201b7a) by [@RSNara](https://github.com/RSNara))
- **APIs:** Make DevSupportManagerBase.getCurrentReactContext() public ([5a6a42c7d0](https://github.com/facebook/react-native/commit/5a6a42c7d029d44799cb907c0ca3c8aa38fa1770) by [@RSNara](https://github.com/RSNara))
- **APIs:** Reduce visibility of ReactUnimplementedViewManager to internal ([fe656be26e](https://github.com/facebook/react-native/commit/fe656be26e0d71bf2505032578dbea54af36b2c5) by [@mdvacca](https://github.com/mdvacca))
- **APIs:** Stable API - Make InteropModuleRegistry internal ([cba1d4bae7](https://github.com/facebook/react-native/commit/cba1d4bae7285ba160b05f31ca18cfa0b91e9ef5) by [@cortinico](https://github.com/cortinico))
- **APIs:** Stable API - Make ReactDevToolsSettingsManagerModule and ReactDevToolsRuntimeSettingsModule internal ([d7550293a2](https://github.com/facebook/react-native/commit/d7550293a2530f02f75b4249b7e6003edaf28ac9) by [@cortinico](https://github.com/cortinico))
- **APIs:** Added JSBundleLoader as parameter of DefaultReactHost ([143b9d172c](https://github.com/facebook/react-native/commit/143b9d172ca755e2457e8dfc6009eeef2475a4a1) by [@mdvacca](https://github.com/mdvacca))
- **APIs:** Deleting deprecated CompositeReactPackage ([2cb5198f1b](https://github.com/facebook/react-native/commit/2cb5198f1b589a57a4cfd3cc40a9ed6224fc5d75) by [@mdvacca](https://github.com/mdvacca))
- **APIs:** Make ReactHost.createSurface() method non nullable ([70c7616535](https://github.com/facebook/react-native/commit/70c761653564653bdfcb77a8c5ef3608dafcf5d7) by [@mdvacca](https://github.com/mdvacca))
- **APIs:** Stable API - Make AppStateModule internal ([dbf09fbe58](https://github.com/facebook/react-native/commit/dbf09fbe5823d77556b451317c14f833735067d9) by [@cortinico](https://github.com/cortinico))
- **APIs:** Make `AccessibilityInfoModule` internal ([7168a9d1a2](https://github.com/facebook/react-native/commit/7168a9d1a2ed7459ebb056ebe45d86de791013e3) by [@cortinico](https://github.com/cortinico))
- **APIs:** Add 3 methods to ReactInstanceDevHelper ([c867aba2f3](https://github.com/facebook/react-native/commit/c867aba2f3dd7773be9d2ee0827bcd69481a394e) by [@cortinico](https://github.com/cortinico))
- **APIs:** Remove Deprecated DefaultDevSupportManagerFactory.create() ([f25abe51ce](https://github.com/facebook/react-native/commit/f25abe51ce93b97ef1fe97af5fc76f13a5a6ff03) by [@cortinico](https://github.com/cortinico))
- **APIs:** Remove BaseViewManagerInterface ([7fb3d830be](https://github.com/facebook/react-native/commit/7fb3d830beae3daf431ac90e9326b744ff8300a1) by [@NickGerleman](https://github.com/NickGerleman))
- **APIs:** Remove ReactNativeFlipper object, deprecated in 0.75 ([d1a256f51a](https://github.com/facebook/react-native/commit/d1a256f51a43f465823bdfb8a70fae5f92473d7c) by [@cortinico](https://github.com/cortinico))
- **APIs:** Use BackgroundStyleApplicator when setting background color in BaseViewManager ([309cdea337](https://github.com/facebook/react-native/commit/309cdea337101cfe2212cfb6abebf1e783e43282) by [@NickGerleman](https://github.com/NickGerleman))
- **APIs:** Delete useTurboModules, enableFabricRenderer and enableBridgelessArchitecture fields from ReactFeatureFlags class ([10a33e0479](https://github.com/facebook/react-native/commit/10a33e04793befbeab6ae82d4068b1ebd7fdffd0) by [@mdvacca](https://github.com/mdvacca))
- **APIs:** Remove ReactViewBackgroundManager and ReactViewBackgroundDrawable ([51673e41ae](https://github.com/facebook/react-native/commit/51673e41ae12f06b2b378e048094ad39ca30c317) by [@NickGerleman](https://github.com/NickGerleman))
#### iOS specific
- **APIs:** Use the RCTDependencyProvider in the RCTAppDelegate, breaking the dependency with Codegen ([b91626af26](https://github.com/facebook/react-native/commit/b91626af2626bf611958b1e7d0dd0b7338ccc29e) by [@cipolleschi](https://github.com/cipolleschi))
- **APIs:** Delete experimental API RCTConstants.RCTGetMemoryPressureUnloadLevel ([d79dc48abd](https://github.com/facebook/react-native/commit/d79dc48abd2e65e4d203e488f99eb554c473a1fc) by [@mdvacca](https://github.com/mdvacca))
- **APIs:** Move `UseNativeViewConfigsInBridgelessMode` to a proper feature flag ([6fc500ee99](https://github.com/facebook/react-native/commit/6fc500ee9942e51519545c1ba1026bacad03dc61) by [@philIip](https://github.com/philIip))
- **APIs:** Delete partialBatchDidFlush ([a777a8937e](https://github.com/facebook/react-native/commit/a777a8937ee165993d7d9b35c7c981fe6698f9dc) by [@philIip](https://github.com/philIip))
- **APIs:** Remove the deprecated RCTRuntimeExecutor. ([cf8d09b279](https://github.com/facebook/react-native/commit/cf8d09b279c4bd667d96f9445c1c0b9acb0a0dfc) by [@philIip](https://github.com/philIip))
- **colors:** Replace uses of `CGColorRef` with UIColor to avoid manual memory management ([b70709dbc2](https://github.com/facebook/react-native/commit/b70709dbc27c75c69e9fd2b082ffa27e7e8db7fd) by [@Saadnajmi](https://github.com/Saadnajmi))
- **infra:** Cocoapods decide the C++ version for iOS pods ([bd50c4a460](https://github.com/facebook/react-native/commit/bd50c4a460a01dad3cd7cade8191273563675d24) by [@cipolleschi](https://github.com/cipolleschi))
- **Interop Layer:** Remove opt-out mechanism for Native Modules interop layer ([538bff710f](https://github.com/facebook/react-native/commit/538bff710f7afb4afa7ce91f20074668ad5c739d) by [@philIip](https://github.com/philIip))
### Added
- **Codegen:** Support negative values in enums ([177bf4d043](https://github.com/facebook/react-native/commit/177bf4d043ce862911e477e0f0039214d8541cfd) by [@okwasniewski](https://github.com/okwasniewski))
- **Codegen:** Add NumberLiteralTypeAnnotation support ([dd472101b7](https://github.com/facebook/react-native/commit/dd472101b76a964b7a64f0bb84d967f702500cad) by [@elicwhite](https://github.com/elicwhite))
- **Codegen:** Add cli --help details to combine-js-toschema-cli.js ([e4814b0d6d](https://github.com/facebook/react-native/commit/e4814b0d6d981cf96eef2803e8f20548263ea0e4) by [@blakef](https://github.com/blakef))
- **Codegen:** Codegen for Native Modules now supports string literals ([d2f3f06826](https://github.com/facebook/react-native/commit/d2f3f06826e2287ad5f5dc4e27201fc5dc9fcd5c) by [@elicwhite](https://github.com/elicwhite))
- **Codegen:** Codegen now supports Union Types in NativeModules ([3af126b562](https://github.com/facebook/react-native/commit/3af126b562cf7e0828906a4fe0ac79a886b557e6) by [@elicwhite](https://github.com/elicwhite))
- **DevMenu:** Export `DevMenu` from `react-native` ([e12c0d9551](https://github.com/facebook/react-native/commit/e12c0d95516924b5e6ca4f0d5ebcadb42bb19f30) by [@frankcalise](https://github.com/frankcalise))
- **FlatList:** Updated FlatList setNativeProps type ([b0ac99b477](https://github.com/facebook/react-native/commit/b0ac99b47781e3b68bee2ff737b109f58eeeba78) by [@JDMathew](https://github.com/JDMathew))
- **Flow:** Upgrade Flow to 0.245.2 ([1f65bf9545](https://github.com/facebook/react-native/commit/1f65bf9545cd84bbf1be7a7a91cb0b4f8b4b47ba) by [@SamChou19815](https://github.com/SamChou19815))
- **Image:** Image `resizeMode` and `objectFit` support for `'none'`. ([d8cfd98070](https://github.com/facebook/react-native/commit/d8cfd98070cbccc5e8a49446d76bdc2cb0c6939f) by [@mateoguzmana](https://github.com/mateoguzmana))
- **JS:** Eliminate usage of more than 1-arg `React.AbstractComponent` in React codebase ([6205aad81e](https://github.com/facebook/react-native/commit/6205aad81ef8154a106fa253a1f4b00aee568650) by [@SamChou19815](https://github.com/SamChou19815))
- **layout:** Added support for `display: contents` ([e7a3f479fe](https://github.com/facebook/react-native/commit/e7a3f479fe37a5d503770bafc03c80b1c2dcb8f7) by [@j-piasecki](https://github.com/j-piasecki))
- **Modal:** Added overlayColor prop to modal component for customisable background overlay ([4e1d7015c1](https://github.com/facebook/react-native/commit/4e1d7015c1d4e2703133b1347ed97a0cc93b1318) by [@shubhamguptadream11](https://github.com/shubhamguptadream11))
- **Perfetto:** Add FuseboxPerfettoDataSource to emit Fusebox traces using Perfetto ([ef0ea4d834](https://github.com/facebook/react-native/commit/ef0ea4d834ec61c5deede487b46a787a363f6a64) by Benoit Girard)
- **ReactNativeDevTools:** Add support for reload-to-profile in Fusebox (Part 2 of 2: JS) ([4df224ca6d](https://github.com/facebook/react-native/commit/4df224ca6df9dc593ab7090520578f27c520f361) by [@EdmondChuiHW](https://github.com/EdmondChuiHW))
- **ReactNativeDevTools:** Add support for reload-to-profile in Fusebox. (Part 1 of 2: native) ([91a40a28de](https://github.com/facebook/react-native/commit/91a40a28de3f74a389c6e6ad05fb917d58fc072d) by [@EdmondChuiHW](https://github.com/EdmondChuiHW))
- **runtime:** Add support for `rn_rootThreshold` in Intersection Observer ([a77d8d9d50](https://github.com/facebook/react-native/commit/a77d8d9d50e69a6a4563737c2ce68d26204eda7f) by [@lunaleaps](https://github.com/lunaleaps))
- **runtime:** Added `HostInstance` type to represent the instance of a `HostComponent<T>`. ([e24f9917c2](https://github.com/facebook/react-native/commit/e24f9917c25ed8c32c6e01d50a5fa49fe66a6ee1) by [@yungsters](https://github.com/yungsters))
- **style:** Removed `experimental` prefix and fully released `mixBlendMode` prop ([d2c48f3b1a](https://github.com/facebook/react-native/commit/d2c48f3b1a2a15e9832ea3240c19aea5186ceb24) by [@jorge-cab](https://github.com/jorge-cab))
- **Text:** Add JS layer for new text content type cellular EID and cellular IMEI ([118c1f7035](https://github.com/facebook/react-native/commit/118c1f7035cfcadb567b1ccd40d85c751dd65162) by [@cipolleschi](https://github.com/cipolleschi))
- **Text:** Expose missing text content type to JS ([d3d48cb357](https://github.com/facebook/react-native/commit/d3d48cb357e55b1f2ae0042a5960451fbe5ff5c7) by [@cipolleschi](https://github.com/cipolleschi))
- **TypeScript** Use the TypeScript key in syntax to restrict permissions and types of results ([0244710c4b](https://github.com/facebook/react-native/commit/0244710c4b1e5016069ec9f7b8e7116ff51f59f1) by [@qnnp-me](https://github.com/qnnp-me))
#### Android specific
- **Accessibility:** Added `isHighTextContrastEnabled()` to `AccessibilityInfo` to read `ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED` setting value ([d4ea147b41](https://github.com/facebook/react-native/commit/d4ea147b41e4d22253f80be8b74731dcf0439302) by Ariel Lin)
- **APIs:** Marked ReactPackage#getModule as stable. ([8fba7ebb5e](https://github.com/facebook/react-native/commit/8fba7ebb5e874d001dc5c16eb4229054a2ef4812) by [@javache](https://github.com/javache))
- **C++:** Add cmake arguments to support 16KB page size for native libraries ([65cdd5b82c](https://github.com/facebook/react-native/commit/65cdd5b82ce7652630b1920fa3a48c8f256c7983) by [@alanleedev](https://github.com/alanleedev))
- **Error Hadling:** Add exceptionHandler as a parameter of DefaultReactHost.getDefaultReactHost() method ([7a5a10c95c](https://github.com/facebook/react-native/commit/7a5a10c95ce6af1964ce5bd273c0c6513fb78a1e) by [@mdvacca](https://github.com/mdvacca))
- **graphics** Added PixelUtil extensions for Int and Long ([9406a09f87](https://github.com/facebook/react-native/commit/9406a09f871d3efa66e3d10237a6d1fd08ddee0b) by Thomas Nardone)
- **Image:** Image `force-cache` caching control option ([a0be88fd72](https://github.com/facebook/react-native/commit/a0be88fd727898d4626ca51876d0bfb4e50dcb77) by [@mateoguzmana](https://github.com/mateoguzmana))
- **Image:** Enabling basic `Image` cache control for Android ([e5dd7d68bf](https://github.com/facebook/react-native/commit/e5dd7d68bf264669fc5c4ce5e69b24249d28558b) by [@mateoguzmana](https://github.com/mateoguzmana))
- **Image:** Adds a new `resizeMethod`, `none`, which disables downsampling for an image ([6202319ed5](https://github.com/facebook/react-native/commit/6202319ed544e4d23f1f327ff5334c480af3819d) by [@Abbondanzo](https://github.com/Abbondanzo))
- **Image:** Adds support for importing XML assets as images ([2e80f5acf1](https://github.com/facebook/react-native/commit/2e80f5acf11cd9726921a00a58700cab9e0bb0a7) by [@Abbondanzo](https://github.com/Abbondanzo))
- **Modal:** Add navigationBarTranslucent prop to Modal component ([7a6c7a462a](https://github.com/facebook/react-native/commit/7a6c7a462a7898e13327438a6603d83a39147abb) by [@zoontek](https://github.com/zoontek))
- **resources:** Add a new Fresco decoder for XML resource types ([118b7c18a6](https://github.com/facebook/react-native/commit/118b7c18a6f827dabb00522bbd6a2416e1bf99da) by [@Abbondanzo](https://github.com/Abbondanzo))
- **runtime:** ReactDelegate and ReactActivityDelegate#getCurrentReactContext can be used to access the current context ([fe8cc62824](https://github.com/facebook/react-native/commit/fe8cc62824372229d90445b2769fed9c08604a7e) by [@javache](https://github.com/javache))
- **runtime:** Trigger Java GC on app reload ([de3c1ee097](https://github.com/facebook/react-native/commit/de3c1ee097f7041d6f9754a55a45cea80fd25813) by [@mrousavy](https://github.com/mrousavy))
- **runtime:** React Activity exposes ReactHost ([d78cb78b15](https://github.com/facebook/react-native/commit/d78cb78b15a520f3bebcdf00b82b26bf120f4180) by [@shwanton](https://github.com/shwanton))
- **runtime:** ReactDelegate `unloadApp` methods for unmounting surfaces without destroying ReactHost ([38593c440e](https://github.com/facebook/react-native/commit/38593c440e949a9b52df0a6821b80ac47b19a693) by [@rozele](https://github.com/rozele))
- **ScrollView:** Add OnLayoutChange API for scroll views ([d825a4d712](https://github.com/facebook/react-native/commit/d825a4d712a1ba53c0f4209c9da5d51578209a6d) by Thomas Nardone)
- **style:** Logic to check for grayscale mode on android ([e70202e606](https://github.com/facebook/react-native/commit/e70202e606be3101da33d28f5403443c3e84749e) by [@oddlyspaced](https://github.com/oddlyspaced))
- **style:** Add boxShadow support to BaseViewManager ([b69a92e2c9](https://github.com/facebook/react-native/commit/b69a92e2c95990fcfa95a6ab7b7260ac492f942c) by [@NickGerleman](https://github.com/NickGerleman))
- **Text:** TextTransform ktx ([7794d7af43](https://github.com/facebook/react-native/commit/7794d7af43b90b581574361af102f67ad7961a5e) by Thomas Nardone)
#### iOS specific
- **Accessibility** Added `isDarkerSystemColorsEnabled()` to `AccessibilityInfo` to read "Increase Contrast" setting value ([af3bee6511](https://github.com/facebook/react-native/commit/af3bee6511fe72fda7415bf974f937012b3eefec) by Ariel Lin)
- **ActionSheetIOS:** Added `disabledButtonTintColor` prop to ActionSheetIOS ([089c87e22e](https://github.com/facebook/react-native/commit/089c87e22e9f431d0e7f35292dce2e36fa86d09a) by [@henninghall](https://github.com/henninghall))
- **Cocoapods:** Extract RCTAppDependencyProvider in the ReactAppDependencyProvider pod ([102062fbc7](https://github.com/facebook/react-native/commit/102062fbc7d6a5c81192562c3ccb87bc4222a0cf) by [@cipolleschi](https://github.com/cipolleschi))
- **Codegen:** Add RCTDependencyProvider protocol ([f2b3716426](https://github.com/facebook/react-native/commit/f2b371642684682916522dc82adee93464ba31fe) by [@cipolleschi](https://github.com/cipolleschi))
- **graphics:** Add `systemCyan` and `systemMint` colors on iOS ([4caf548a9f](https://github.com/facebook/react-native/commit/4caf548a9f2e485aef9cbaeeb0a666cf9b9d3e59) by [@EvanBacon](https://github.com/EvanBacon))
- **Hermes:** TvOS support for Hermes artifacts ([f673759c83](https://github.com/facebook/react-native/commit/f673759c83fed130964ea7dfe677c04608b8e64d) by [@douglowder](https://github.com/douglowder))
- **Image:** Image `only-if-cached` cache control option ([dc9db01665](https://github.com/facebook/react-native/commit/dc9db01665308ac931967326abfc86deb9ae7e2a) by [@mateoguzmana](https://github.com/mateoguzmana))
- **infra:** Declare supportedInterfaceOrientations only on iOS ([40c5e6b64a](https://github.com/facebook/react-native/commit/40c5e6b64a1d82b5b481717b9086340eca2aaef9) by [@okwasniewski](https://github.com/okwasniewski))
- **infra:** User-configurable BUNDLE_NAME when building bundles ([f8287e25e1](https://github.com/facebook/react-native/commit/f8287e25e11d56beb66ace414ca5f8a6a32405a9) by [@fivecar](https://github.com/fivecar))
- **infra:** User-configurable BUNDLE_NAME when building bundles ([f8287e25e1](https://github.com/facebook/react-native/commit/f8287e25e11d56beb66ace414ca5f8a6a32405a9) by [@fivecar](https://github.com/fivecar))
- **Layout:** Fix: Correct Layout Behavior for Combined align-content and align-items ([73a2be1243](https://github.com/facebook/react-native/commit/73a2be12437c93bbd138e0d63cd45d834529a3c4) by [@phuccvx12](https://github.com/phuccvx12))
- **runtime:** Pass the `RCTAppDependencyProvider` to the `RCTAppDelegate` ([95fc906930](https://github.com/facebook/react-native/commit/95fc906930ece9b30482eb1f0924d7e8614af7c6) by [@cipolleschi](https://github.com/cipolleschi))
- **runtime:** Introduce the RCTAppDependencyProvider to minimize the changes required y the users ([41c2502b36](https://github.com/facebook/react-native/commit/41c2502b3650e238b0a5d86b5044abcb538b76e3) by [@cipolleschi](https://github.com/cipolleschi))
- **runtime:** Introduce RCTArchConfiguratorProtocol ([ec0dbb729d](https://github.com/facebook/react-native/commit/ec0dbb729d3774184dee83efbff5f9beebce72ce) by [@okwasniewski](https://github.com/okwasniewski))
- **runtime:** Introduce RCTUIConfiguratorProtocol ([8850736188](https://github.com/facebook/react-native/commit/8850736188321f13c7bdeadedeed15c759ad72c1) by [@okwasniewski](https://github.com/okwasniewski))
- **runtime:** Add `CallInvoker` to `BindingsInstaller` ([87bae7f734](https://github.com/facebook/react-native/commit/87bae7f7349976cfc269b25584330c4d3d897d79) by [@mrousavy](https://github.com/mrousavy))
- **ScrollView:** Scroll the cursor into view when text input is focused ([e021e50d53](https://github.com/facebook/react-native/commit/e021e50d537884a55a9f5bea931adb19e9069dd6) by [@dominictb](https://github.com/dominictb))
- **Swift:** Expose RCT_NEW_ARCH_ENABLED to Swift ([d24507611d](https://github.com/facebook/react-native/commit/d24507611de7fefc71286fd54b2c909d98a4bf27) by [@okwasniewski](https://github.com/okwasniewski))
- **Text:** New text content type cellular EID and cellular IMEI ([14e0d0dffb](https://github.com/facebook/react-native/commit/14e0d0dffb9ee8b1d41d60ccbcfd63d53bfe4d48) by [@pasc0al](https://github.com/pasc0al))
- **TextInput:** TextInput `inputAccessoryViewButtonLabel` prop ([32931466ed](https://github.com/facebook/react-native/commit/32931466ed7e3d8d9eeeb65f12ce146e123870ba) by [@mateoguzmana](https://github.com/mateoguzmana))
- **TextInput:** Line break mode for TextInput components. **This includes JS APIs for the new mode.** ([ce2d34f194](https://github.com/facebook/react-native/commit/ce2d34f19451c91a90f0bd820064208912c86092) by [@shubhamguptadream11](https://github.com/shubhamguptadream11))
### Changed
- **Animated:** The `AnimatedNode` graph will not occur during the insertion effect phase, which means animations can now be reliably started during layout effects. ([316170ce8d](https://github.com/facebook/react-native/commit/
- **Animated:** Optimized the performance of updating `Animated` components. ([f0ffcd4f5d](https://github.com/facebook/react-native/commit/f0ffcd4f5dfeab794fbfa3257bb9a8fd793ff2bc) by [@yungsters](https://github.com/yungsters))
- **Animated:** Animations started with incompatible `useNativeDriver` and `AnimatedValue` configurations will now synchronously fail. Previously, spring and timing animations with non-zero delays would throw the error asynchronously. ([fd8cf19625](https://github.com/facebook/react-native/commit/fd8cf1962585aa49e8921475d89c1a5c2423c51c) by [@yungsters](https://github.com/yungsters))
- **Animated:** The `Animation` superclass no longer exposes `__onEnd` as a property. Subclasses must instead invoke `super.start(…)` in their `start()` implementation. ([b3fe06b268](https://github.com/facebook/react-native/commit/b3fe06b2685e526fe2bc420a902a3ccd4e1381df) by [@yungsters](https://github.com/yungsters))
- **Animated:** Bring back shouldSkipStateUpdatesForLoopingAnimations feature flag ([6e0e712c2a](https://github.com/facebook/react-native/commit/6e0e712c2a680cf4b4de1ee5fb25cc5282b242c5) by [@dmytrorykun](https://github.com/dmytrorykun))
- **Animated:** AnimatedNode (and its subclasses) once again implement `toJSON()`. ([7bd4a54968](https://github.com/facebook/react-native/commit/7bd4a5496815943b031b68ca46792560d8d798d8) by [@yungsters](https://github.com/yungsters))
- **Animated:** Improved the performance of unmounting (and updating, when an enclosing Activity becomes hidden) Animated components ([46abda55b9](https://github.com/facebook/react-native/commit/46abda55b9749dc171e0fec551ba83c027818eb7) by Royi Hagigi)
- **Animated:** AnimatedNode (and its subclasses) no longer implement `toJSON()`. ([fe6228512e](https://github.com/facebook/react-native/commit/fe6228512e076820c9c11869cfe24b19d1abfb58) by [@yungsters](https://github.com/yungsters))
- **Animated:** Animated now resolves `style` to the original prop value if it contains no `AnimatedNode` instances. Previously, it would resolve to a flattened style object. ([ca234ba10e](https://github.com/facebook/react-native/commit/ca234ba10e8d06630da7ea00aac515b222137645) by [@yungsters](https://github.com/yungsters))
- **AttributedString:** AttributedString `appendFragment` and `prependFragment` take an rval instead of a const ref; append/prependAttributedString have been removed ([2c31fe99e1](https://github.com/facebook/react-native/commit/2c31fe99e1cc5bfdb393d4f5c70231a042ea67ef) by [@javache](https://github.com/javache))
- **AttributedString:** Improved AttributedText generation for raw text nodes. ([2f7957f2fd](https://github.com/facebook/react-native/commit/2f7957f2fd424fdaa980d99a4ff05eb3237d662e) by [@javache](https://github.com/javache))
- **Flow:** Simplified Flow types to use `HostInstance` (which changing nominal types). ([177697f539](https://github.com/facebook/react-native/commit/177697f539ec68a47cbb8f57260cebe701589ef1) by [@yungsters](https://github.com/yungsters))
- **JS:**`useMergeRefs` and components using it (e.g. `Pressable`) now support ref cleanup functions. ([01e210fd28](https://github.com/facebook/react-native/commit/01e210fd28bc961e8c1b5fa454b3c947adda296c) by [@yungsters](https://github.com/yungsters))
- **JS:** Fix: use public instance in Fiber renderer and expose it from getInspectorDataForViewAtPoint (#31068) ([633ad4933e](https://github.com/facebook/react-native/commit/633ad4933e9514d4168d6dcdb7e56c9a1859482a) by [@hoxyq](https://github.com/hoxyq))
- **deps:** Bump serve-static to 1.16.2 to fix CVE-2024-43800 ([50e38cc9f1](https://github.com/facebook/react-native/commit/50e38cc9f1e6713228a91ad50f426c4f65e65e1a) by [@cortinico](https://github.com/cortinico))
- **deps:** Bump Folly to 2024.10.14.00 ([37375d8aba](https://github.com/facebook/react-native/commit/37375d8aba0869531567426466478b0de9a1aea3) by [@alanleedev](https://github.com/alanleedev))
- **deps:** Update Metro to 0.81.0 ([0902b0af75](https://github.com/facebook/react-native/commit/0902b0af75ba30ec9d4abeda71769d0685637afa) by [@robhogan](https://github.com/robhogan))
- **deps:** Upgrade React DevTools to 6.0.0. ([ed4f6d6891](https://github.com/facebook/react-native/commit/ed4f6d68910677ab050e3fef5aaa87e42d582fe0) by [@hoxyq](https://github.com/hoxyq))
- **infra:** Do not print Bridgeless Mode is enabled on console anymore ([f3a969f38d](https://github.com/facebook/react-native/commit/f3a969f38d7a2c74bf63ee05c4c819c0873059a9) by [@cortinico](https://github.com/cortinico))
- **VirtualizedList:** Fix unnececary rerenders of VirtualizedListCells with strictMode={true} ([aafe696453](https://github.com/facebook/react-native/commit/aafe696453186d0e87ae96d0bca4c6650234d222) by [@Tom910](https://github.com/Tom910))
316170ce8d0aac1df3261c792b9f768665d134c5) by [@yungsters](https://github.com/yungsters))
#### Android specific
- **deps:** Updating targetSdk to 35 (apps can still choose their own targetSdk regardless of RN version) ([48ea6867a9](https://github.com/facebook/react-native/commit/48ea6867a96bd16dc7aed9af5a8e9ce12a487c22) by [@alanleedev](https://github.com/alanleedev))
9fa4845136969ec95ce5615b7ea78feaf0f7f109) by [@javache](https://github.com/javache))
- **deps:** AGP to 8.7.2 ([e1a1cead43](https://github.com/facebook/react-native/commit/e1a1cead434a6856b2b018274876b9ba8eab706a) by [@cortinico](https://github.com/cortinico))
- **deps:** Android NDK to 27.1 ([ba061a5d18](https://github.com/facebook/react-native/commit/ba061a5d18176fd455c3aa6350127506dac05211) by [@alanleedev](https://github.com/alanleedev))
- **deps:** Bump fbjni to 0.7.0 ([1c002c7b4e](https://github.com/facebook/react-native/commit/1c002c7b4ea4f22729920e54a9032402247ea350) by [@alanleedev](https://github.com/alanleedev))
- **deps:** Fresco to 3.4.0 ([091025e18b](https://github.com/facebook/react-native/commit/091025e18b1dc5212031e3ed06bfb6c450e788e2) by [@cortinico](https://github.com/cortinico))
- **deps:** Bump Kotlin 1.9.x to 2.0.x ([972c2c864c](https://github.com/facebook/react-native/commit/972c2c864c0b563163a36080a13908d1c0a3fb87) by [@cortinico](https://github.com/cortinico))
- **deps:** Bump Android Gradle Plugin (AGP) to 8.7.0 ([cbc0978bb6](https://github.com/facebook/react-native/commit/cbc0978bb65dcfd2a18a54201c845785a626b1b3) by [@cortinico](https://github.com/cortinico))
- **deps:** Gradle to 8.10.1 ([90f89a830a](https://github.com/facebook/react-native/commit/90f89a830acced9e6b8e80ef58aefd7e2c9666a8) by [@cortinico](https://github.com/cortinico))
- **deps:** Gradle to 8.11.1 ([490db92562](https://github.com/facebook/react-native/commit/490db92562df3baf6dc38737778179065f378715) by [@cortinico](https://github.com/cortinico))
- **Kotlin:** Migrated systeminfo module code from Java to Kotlin ([8dc2c90ce5](https://github.com/facebook/react-native/commit/8dc2c90ce5f4b30f4729560aed2412e6d29f39fa) by [@oddlyspaced](https://github.com/oddlyspaced))
- **Kotlin:** Migrate ReactFeatureFlags to Kotlin ([4076dbfc86](https://github.com/facebook/react-native/commit/4076dbfc8651fcd193b886bf63b23728fad466d7) by [@mdvacca](https://github.com/mdvacca))
- **Kotlin:** Migrate MainReactPackage to Kotlin (and make it final) ([7bbac8ee27](https://github.com/facebook/react-native/commit/7bbac8ee27daf092b580b57c2c7ee46d2723cd09) by [@cortinico](https://github.com/cortinico))
- **Native Modules:** TurboModules marked as requiring eager init will now be constructed on the mqt_native thread to increase concurrency in React Native init. ([663b5f9d19](https://github.com/facebook/react-native/commit/663b5f9d19a905520bd0aef62cda890f76ef9b6e) by [@javache](https://github.com/javache))
- **ReactViewGroup:** Consolidated ReactViewGroup add/remove overrides ([0b22b955f1](https://github.com/facebook/react-native/commit/0b22b955f1494f0e7441a01dd19b3fdf5e20c3dc) by Thomas Nardone)
- **runtime:** Invocations to JS will now invoke their callbacks immediately if the instance is ready. Surface starts will not wait for the main thread to become available to dispatch the work in JS. ([9fa4845136](https://github.com/facebook/react-native/commit/
- **runtime:** Update documentation for ReactHost.destroy() APIs ([443bc32dc4](https://github.com/facebook/react-native/commit/443bc32dc49a86534fce1d6ec0e31c97b8f33053) by [@mdvacca](https://github.com/mdvacca))
- **style:** Disabling `outline` props on Android to stay consistent with iOS ([7ab0002799](https://github.com/facebook/react-native/commit/7ab0002799d52a876a8cdd32f25ebef6d431650e) by [@jorge-cab](https://github.com/jorge-cab))
- **tracing:** Improve FpsDebugFrameCallback.getTotalTimeMS() accuracy ([d54c25fdae](https://github.com/facebook/react-native/commit/d54c25fdaee4d2642cdbca812b61c6973d3f203d) by [@aamagda](https://github.com/aamagda))
#### iOS specific
- **Codegen:** Change how components automatically register ([8becc2514d](https://github.com/facebook/react-native/commit/8becc2514d484c99b51ea76f479f06a8fcdd8265) by [@cipolleschi](https://github.com/cipolleschi))
- **Codegen:** Stop generating the RCTThirdPartyLibraryComponentProvider ([60b9d3d89e](https://github.com/facebook/react-native/commit/60b9d3d89eba90a945070646c6220b3c03b3aeba) by [@cipolleschi](https://github.com/cipolleschi))
- **runtime:**`RCTSurfaceHostingProxyRootView` no longer has different behavior (whether it calls `start` on the provided *surface*) depending on which initializer is used. Call `start` yourself on the *surface* instead. ([13b93cfdda](https://github.com/facebook/react-native/commit/13b93cfddaa559697968ac1c19e55f7aaa053070) by Nolan O'Brien)
- **runtime:** Use `newArchEnabled` flag in RCTAppDelegate and RCTRootViewFactory ([7e1674fc59](https://github.com/facebook/react-native/commit/7e1674fc59abeeb70d946ee082a829fae4c671b7) by [@okwasniewski](https://github.com/okwasniewski))
- **runtime:** Do not move to the main queue synchronously when starting a new surface ([ab2c47be28](https://github.com/facebook/react-native/commit/ab2c47be285fde99a77d189fd04220ef8ad0933a) by [@cipolleschi](https://github.com/cipolleschi))
- **APIs**: Rename `RCTUIGraphicsImageRenderer` to `RCTMakeUIGraphicsImageRenderer` ([6a09fc09af](https://github.com/facebook/react-native/commit/6a09fc09af8eedbf409ab870d5714e44892b2a16) by [@Saadnajmi](https://github.com/Saadnajmi))
### Deprecated
#### Android specific
- **Codegen:** Deprecated shadows for ReadableNative[Map|Array].[Readable|Writable] ([d424bb9d7c](https://github.com/facebook/react-native/commit/d424bb9d7cf101dc5609e8f787ba8af2a33d0262) by [@javache](https://github.com/javache))
- **Fabric:** ReactContext.getFabricUIManager() method ([fb737ca7d3](https://github.com/facebook/react-native/commit/fb737ca7d34b636a3aa337a0935bf9a5a10c641d) by [@mdvacca](https://github.com/mdvacca))
- **runtime:** Deprecate CatalystInstance in old architecture ([3e27ef1f6e](https://github.com/facebook/react-native/commit/3e27ef1f6e024bba8725a3bd64e2648ffd6af496) by [@mdvacca](https://github.com/mdvacca))
- **runtime:** Deprecate BridgelessCatalystInstance class ([72bd840dd3](https://github.com/facebook/react-native/commit/72bd840dd3dc7b6e3e88a74ac9ddb000a0cb3a60) by [@mdvacca](https://github.com/mdvacca))
#### iOS specific
- **runtime:** Deprecating RCTBridgeModule batchDidComplete and adding configuration to disable it ([731bd95c43](https://github.com/facebook/react-native/commit/731bd95c430c752126aaaa34e4911ba2b87b382f) by [@philIip](https://github.com/philIip))
### Removed
- **DevX:** Remove "run on iOS" and "run on Android" from the dev server key commands ([19b971ff94](https://github.com/facebook/react-native/commit/19b971ff94a0fe353f82363e788c13f86815663b) by [@huntie](https://github.com/huntie))
- **JS:** Removed type for useConcurrentRoot from AppRegistry, as it was already ignored ([2ec547ad28](https://github.com/facebook/react-native/commit/2ec547ad28ca914c17e276abb91174dfa0dc87b2) by [@javache](https://github.com/javache))
- **TypeScript:** Removed `refs` property from `NativeMethods` TypeScript definition. ([223e98cc4b](https://github.com/facebook/react-native/commit/223e98cc4b656b94b48c88940114bfdc025f8ddf) by [@yungsters](https://github.com/yungsters))
#### Android specific
- **APIs:** Remove `BackHandler.removeEventListener` ([44d619414c](https://github.com/facebook/react-native/commit/44d619414c1de3dbf17a421afa8dbcec7cdab025) by [@retyui](https://github.com/retyui))
- **APIs:** DevToolsReactPerfLogger stats gathering now uses an internal API ([f503fe3f10](https://github.com/facebook/react-native/commit/f503fe3f100d96a31fc56451d7846d80ce5c342f) by [@javache](https://github.com/javache))
- **APIs:** BindingImpl is no longer part of the public interface ([18faf68b48](https://github.com/facebook/react-native/commit/18faf68b4825118253cf247572084c4da8f6366e) by [@javache](https://github.com/javache))
- **APIs:** FabricComponents is removed from public API ([300db67b27](https://github.com/facebook/react-native/commit/300db67b270a5d6fc85d27188d0d1089675f89c0) by [@javache](https://github.com/javache))
### Fixed
- **Animated:** Correctly pass down isLooping in parallel animation ([4014aa4528](https://github.com/facebook/react-native/commit/4014aa4528d43e905246850c83007a635938d7cb) by [@zeyap](https://github.com/zeyap))
- **Animated:** Improved types for AnimatedProps ([390925ea39](https://github.com/facebook/react-native/commit/390925ea39eb469768f21cf7069b8f75ccdec09d) by [@javache](https://github.com/javache))
- **Animated:** Order of operations related to platformConfig propagation in NativeAnimated ([a64183b0c6](https://github.com/facebook/react-native/commit/a64183b0c6a56e9d482c7b8b0f80965493ed87af) by [@rozele](https://github.com/rozele))
- **Animated:** Replace Object.hasOwn usages to fix Animated on JSC ([e996b3f346](https://github.com/facebook/react-native/commit/e996b3f346462a394012a722ce19990cdf9c3d9a) by [@robhogan](https://github.com/robhogan))
- **Animated:** Fix buttons becoming unresponsive when transform is animated (Revert #48669) ([c799aa07e2](https://github.com/facebook/react-native/commit/c799aa07e2148a2ca38939cb72468c949ed0c95f) by [@sammy-SC](https://github.com/sammy-SC))
- **Appearance:** Fixed jest error from Appearance.js ([ce838a4bcf](https://github.com/facebook/react-native/commit/ce838a4bcfb1c08728b637a9addd24cc6e3477e0) by [@Kudo](https://github.com/Kudo))
- **Appearance:** Fix `Appearance.setColorScheme(null)` not resetting color scheme value ([7d63235086](https://github.com/facebook/react-native/commit/7d63235086352d8c424d634c7039551f0a5025dc) by [@sangonz193](https://github.com/sangonz193))
- **C++:** Fix C++ bridging template compatibility with MSVC ([e6848ba5ba](https://github.com/facebook/react-native/commit/e6848ba5ba997d102cbaf6181c7c8c73e25a0827) by [@acoates-ms](https://github.com/acoates-ms))
- **C++** Fix cast and control paths errors on windows ([0794fa909b](https://github.com/facebook/react-native/commit/0794fa909b2e06fad5c40dce402c5f14a24bb946) by [@TatianaKapos](https://github.com/TatianaKapos))
- **C++** Fix type conversion error in react native windows build. ([13db1cb88b](https://github.com/facebook/react-native/commit/13db1cb88bdd454cf19be358d6f0cd62f5a6d0cc) by [@marlenecota](https://github.com/marlenecota))
- **Codegen:** Support nested objects in arrays ([13780126d3](https://github.com/facebook/react-native/commit/13780126d3cb17ad00c2954f9830a3623812dc3e) by [@tvanlaerhoven](https://github.com/tvanlaerhoven))
- **Codegen:** Make Codegen work with local modules ([7b6e8e7765](https://github.com/facebook/react-native/commit/7b6e8e776574e683821133f0c814969d74c4de61) by [@cipolleschi](https://github.com/cipolleschi))
- **Codegen:** Upgrade Codegen dependency `jscodeshift@17.0.0` to resolve outdated dependencies ([39c98fb8f8](https://github.com/facebook/react-native/commit/39c98fb8f8af98aa40dc89a1580d6c1901fa86cf) by [@byCedric](https://github.com/byCedric))
- **Codegen:** Fix source mapping for codegenNativeCommands ([8fba154b66](https://github.com/facebook/react-native/commit/8fba154b6655b5d87609d7c9f136997141ea5e99) by [@vzaidman](https://github.com/vzaidman))
- **Codegen:** Skip hidden folders when looking for third party components. ([8ab524312a](https://github.com/facebook/react-native/commit/8ab524312ab3bf1192b94ae6e30d296a85baa944) by [@cipolleschi](https://github.com/cipolleschi))
- **Dev-Middleware:** Rewrite URLs in the inspector proxy to cover all configurations, not just Android emulators. ([74995bc90a](https://github.com/facebook/react-native/commit/74995bc90aa039b880e4875ad356d3bce324d902) by [@robhogan](https://github.com/robhogan))
- **Dev-Middleware:** Fix URL rewriting where device and debugger reach the server on different ports/protocols. ([5da7ebf99a](https://github.com/facebook/react-native/commit/5da7ebf99ae317c104d8e4bfbf36d3d89f66b5c9) by [@robhogan](https://github.com/robhogan))
- **Dev-Middleware:** Regex-escape IP addresses in urlRegex replacements ([aae3e03e57](https://github.com/facebook/react-native/commit/aae3e03e57096c3dc51589a3de240d49a8b9fadf) by [@robhogan](https://github.com/robhogan))
- **Dev-middleware:** Remove URL.canParse, restore compat with Node < 18.17 ([99767d43b0](https://github.com/facebook/react-native/commit/99767d43b04e41c83e3bcbfebe267d6fdc284549) by [@robhogan](https://github.com/robhogan))
- **Error Handling:** Improved error message when no view config is found. ([bca232ad90](https://github.com/facebook/react-native/commit/bca232ad90692da7a87be5e37ee2680380f94bef) by [@javache](https://github.com/javache))
- **FlatList:** Fixed accuracy of FlatList estimations to determine what elements are visible in the rendering window. ([40aaeb7181](https://github.com/facebook/react-native/commit/40aaeb71814a1987482d97fd3170af0add55bc6a) by [@rubennorte](https://github.com/rubennorte))
- **FormData:** Remove non compliant `filename*` attribute in a FormData `content-disposition` header ([f791fb9e66](https://github.com/facebook/react-native/commit/f791fb9e660fe15bccf55029045c48f4bbcbc5cb) by [@foyarash](https://github.com/foyarash))
- **graphics:** Linear gradient start and end point algorithm. ([221d1eceda](https://github.com/facebook/react-native/commit/221d1eceda0e5ab870e96dcdd26e22ab17a3870c) by [@intergalacticspacehighway](https://github.com/intergalacticspacehighway))
- **Hermes:** Hermes: revert Intl removal ([4cffff35e0](https://github.com/facebook/react-native/commit/4cffff35e030f256c32bf69c5971dfee4e60723f) by [@robhogan](https://github.com/robhogan))
- **Image:** Passed height and width as native props to support cases where source is an array. ([45b177f50d](https://github.com/facebook/react-native/commit/45b177f50de624eefcb66bb2d8bc1ffb00855863) by [@shubhamguptadream11](https://github.com/shubhamguptadream11))
- **infra:** When using Babel with plain JavaScript files, support for additional user syntax plugins should be fixed (now uses Babel's parser instead of hermes-parser). There is no change for JS files annotated with `flow`, where extended JS syntax remains - unsupported. ([3de9892353](https://github.com/facebook/react-native/commit/3de989235365504468d2b6c0bb194e944bf1ce8e) by [@huntie](https://github.com/huntie))
- **infra:** Fix npm react-native start when cli-server-api isn't installed ([e0be2efe4e](https://github.com/facebook/react-native/commit/e0be2efe4e80edf99f96a2ae6a25856f6df5e0ca) by [@blakef](https://github.com/blakef))
- **infra:** Fix "punycode is deprecated" warning by replacing `node-fetch` with native `fetch` ([881d8a720f](https://github.com/facebook/react-native/commit/881d8a720fb24241d7b2127273ca6116833bf176) by [@jbroma](https://github.com/jbroma))
- **JS:** Do not discard props in the patch when they are not null while using `useNativeProps` ([4c3112c8d8](https://github.com/facebook/react-native/commit/4c3112c8d8685d6c34be9acf07b18871b3cee5b2) by [@cipolleschi](https://github.com/cipolleschi))
- **KeyboardAvoidingView:** Accessing KeyboardAvoidingEvent event in onLayout handler ([68db74205a](https://github.com/facebook/react-native/commit/68db74205afdd190304eb73ef71710781fa580b9) by [@mhoran](https://github.com/mhoran))
- **KeyboardAvoidingview:** Fix KeyboardAvoidingView not aware of the keyboard closing it is unmounted ([08bd8ac47d](https://github.com/facebook/react-native/commit/08bd8ac47da60121225e7b281bbf566e2c5a291e) by [@QichenZhu](https://github.com/QichenZhu))
- **layout:** Plumbing to get boxSizing prop to Yoga round 2 ([3ca796edc3](https://github.com/facebook/react-native/commit/3ca796edc327c5287533dcc8f4394033d5398c2d) by [@joevilches](https://github.com/joevilches))
- **layout:** Fix TextMeasureCacheKey Throwing Out Some LayoutConstraints ([e7db7a7266](https://github.com/facebook/react-native/commit/e7db7a72661bd49948c13eb46d0f72fbe9e00bf3) by [@NickGerleman
](https://github.com/NickGerleman))
- **Modal:** Rename overlayColor prop in Modal to backdropColor ([7aeff18970](https://github.com/facebook/react-native/commit/7aeff18970a2b47cbb3fffc1408e4bb21eec6fed) by [@alanleedev](https://github.com/alanleedev))
- **Native Modules:** TurboModule::get is now a final method, override `create` to customize property lookup ([5b5e150eaf](https://github.com/facebook/react-native/commit/5b5e150eaff015540720225b9e61acb306e1d107) by [@javache](https://github.com/javache))
- **PointerEvents:** Fixed issues with W3C PointerEvents testsx ([1dcaf823f5](https://github.com/facebook/react-native/commit/1dcaf823f5e7d9b114dd803ce3181aa0b8f827ad) by [@rozele](https://github.com/rozele))
- **PointerEvents:** Fixed issue with W3C PointerEvents tests ([68a6b69b27](https://github.com/facebook/react-native/commit/68a6b69b27275998b4083797942f3e26a92d3adb) by [@rozele](https://github.com/rozele))
- **ReactNativeDevTools:** Don't assume 10.0.2.2 is an alias for localhost unless it's used to establish a connection to the server ([69400be4fc](https://github.com/facebook/react-native/commit/69400be4fc0abd38072f6586f3e7d5b6c33e54be) by [@robhogan](https://
- **ReactNativeDevTools:** Fix fetching sources and source maps when the dev-server is remote and not tunnelled via the same port+protocol. ([d1b0e9a30b](https://github.com/facebook/react-native/commit/d1b0e9a30b3afc56b9355453cf7f6e690bdd8aff) by [@robhogan](https://github.com/robhogan))
- **runtime:** Fixes typo in ReactHostImpl ([e3f03269c5](https://github.com/facebook/react-native/commit/e3f03269c5cea28977e44ddf5c5125968336b0e6) by [@rozele](https://github.com/rozele))
- **runtime:** Microtasks are now correctly executed after the code evaluation in Console panel of DevTools. ([3dfe22bd27](https://github.com/facebook/react-native/commit/3dfe22bd27429a43b4648c597b71f7965f31ca65) by [@hoxyq](https://github.com/hoxyq))
- **runtime:** Fix setImmediate/clearTimeout mismatch in NativeAnimatedHelper that could clear an unrelated setTimeout. ([a5dd1be889](https://github.com/facebook/react-native/commit/a5dd1be889be21f8daefbc609702989ec7c156cf) by Benoit Girard)
- **style:** Fix the nodes' owners not being updated when `display: contents` is used ([aa53bde21b](https://github.com/facebook/react-native/commit/aa53bde21b8952533cf17ffee234b273766f2133) by [@j-piasecki](https://github.com/j-piasecki))
- **style:** Fix for nodes with `display: contents` not being cleaned in some cases ([a88ddcecc9](https://github.com/facebook/react-native/commit/a88ddcecc93a9fa2d231907439d02b11bac8a944) by [@j-piasecki](https://github.com/j-piasecki))
- **Text:** Fix text not taking full width ([550b0c0ed1](https://github.com/facebook/react-native/commit/550b0c0ed16a64ce58102f15d4657abe92aac71c) by [@s77rt](https://github.com/s77rt))
github.com/robhogan))
- **Text:** AnsiHighlight style in RTL layout ([9a3958a619](https://github.com/facebook/react-native/commit/9a3958a619fddb75ed3c6eddebd94f11c0d00e9f) by [@hexboy](https://github.com/hexboy))
- **Text:** TextTransform: capitalize better reflects the web behaviour ([dc2000c875](https://github.com/facebook/react-native/commit/dc2000c8750f42b2f01bdad75455750814d567c6) by [@javache](https://github.com/javache))
- **tracing:**`PerformanceEntryReporter::reportMark` and `PerformanceEntryReporter::reportMeasaure` now return created performance entries. ([32f7b3b4e0](https://github.com/facebook/react-native/commit/32f7b3b4e0b8be1d1138f43c46b3c86d9a64c29a) by [@robik](https://github.com/robik))
- **TypeScript** The definition of ts of resizeMethod attribute is none. ([758892a7d8](https://github.com/facebook/react-native/commit/758892a7d89cc1e316984f8f522738021410f530) by [@nianxiongdi](https://github.com/nianxiongdi))
- **VirtualizedList:** Fix onEndReached not being called when getItemLayout is present and we scroll past render window ([3485e9ed87](https://github.com/facebook/react-native/commit/3485e9ed871886b3e7408f90d623da5c018da493) by YunPeng Chong)
- **VirtualizedList** Fix onEndReached not being called when getItemLayout is present and we scroll past render window ([62b7396bf4](https://github.com/facebook/react-native/commit/62b7396bf45c04bd47e74fe4c1e5b5e59918244d) by [@NickGerleman](https://github.com/NickGerleman))
#### Android specific
- **C++:** Fixes C++ TurboModules: Prioritise OnLoad.cpp, falling back to default-app-setup ([5a64bde701](https://github.com/facebook/react-native/commit/5a64bde701e28615a79ad52d0631de62ce6cab92) by [@timbocole](https://github.com/timbocole))
- **Codegen:** Fix IOException in `BuildCodegenCLITask` ([9147b0753a](https://github.com/facebook/react-native/commit/9147b0753a6c3afb2480b079f91614cd7189a28a) by [@vonovak](https://github.com/vonovak))
- **Dialog:** Fixed styling on alert dialog titles to wrap two lines and retain bold appearance ([c54b23ff9e](https://github.com/facebook/react-native/commit/c54b23ff9ed7a6bfbb52c081c5afe4b3911d0dd2) by [@Abbondanzo](https://github.com/Abbondanzo))
- **graphics:** Missing isInvertColorsEnabled implementation for Android ([cc1d2853fb](https://github.com/facebook/react-native/commit/cc1d2853fb2b64adfb884cb30c8d22ce0260be15) by [@oddlyspaced](https://github.com/oddlyspaced))
- **Headless Tasks:** Fix crash on HeadlessJsTaskService on old architecture ([4560fc0497](https://github.com/facebook/react-native/commit/4560fc049748a345d5945bc08d43f4b61ca51ff3) by [@cortinico](https://github.com/cortinico))
- **Image:** Apps will no longer fatally crash when trying to draw large images ([483b928224](https://github.com/facebook/react-native/commit/483b92822496fa2e6339f75049a33be1e9567f52) by [@Abbondanzo](https://github.com/Abbondanzo))
- **Image:** Avoid blocking the main thread when decompressing drawable resources ([420229d669](https://github.com/facebook/react-native/commit/420229d66946320f06485c5a3d3c167eae1a407e) by [@Abbondanzo](https://github.com/Abbondanzo))
- **JSC:** Fixes RNTester JSC Debug instacrashing ([17a5d2be5a](https://github.com/facebook/react-native/commit/17a5d2be5a96703ed1c76d89990a8f1e37abd4d4) by [@cortinico](https://github.com/cortinico))
- **layout:** Reenable `setAndroidLayoutDirection` by default ([6cf0cfb5a4](https://github.com/facebook/react-native/commit/6cf0cfb5a47a437b8a17b50b4c70460be15ee1cd) by [@NickGerleman](https://github.com/NickGerleman))
- **Layout:** Restore layout/invalidate during ReactViewClippingManager.removeViewAt() ([e3970a4bb3](https://github.com/facebook/react-native/commit/e3970a4bb3f39ec5652277d78d8c58c89e87dc30) by [@tdn20](https://github.com/tdn20))
- **Layoutanimations:** LayoutAnimations work on full new architecture ([43af902693](https://github.com/facebook/react-native/commit/43af902693f0befde802a7f684e26b19ec7126c8) by [@javache](https://github.com/javache))
- **Modal:** Fix issues with Modals and lifecycle events in multi-surface apps ([1ffef5669c](https://github.com/facebook/react-native/commit/1ffef5669c21f4b2c5fec6bc58a85f95518cf10e) by [@rozele](https://github.com/rozele))
- **Modal:** Fix crash for Modal not attached to window manager ([eaa780de1c](https://github.com/facebook/react-native/commit/eaa780de1c799bf35fded2914d27b1953b093340) by [@cipolleschi](https://github.com/cipolleschi))
- **Permissions:** Prevent ArrayIndexOutOfBoundsException in permission check ([6aeca53b3e](https://github.com/facebook/react-native/commit/6aeca53b3ed4530e57a31d7a5593ae16b550b985) by [@antFrancon](https://github.com/antFrancon))
- **ReactNativeDevTools:** Fix source loading when using an Android emulator connecting to a dev server on the host. ([ca9c56329f](https://github.com/facebook/react-native/commit/ca9c56329fe548b6631934afee0c9be63e1752a1) by [@robhogan](https://github.com/robhogan))
- **RNGP** Do not attempt to substring to 1024 while logging ([e64513bf4e](https://github.com/facebook/react-native/commit/e64513bf4ecce60aff5c04e3bed91b203429d12f) by [@cortinico](https://github.com/cortinico))
- **runtime:** Fixes some deadlocks when doing commits and state updates synchronously from the UI thread (e.g.: from reanimated). ([3986eefed1](https://github.com/facebook/react-native/commit/3986eefed1733f305db5410737a96b635f0159e7) by [@rubennorte](https://github.com/rubennorte))
- **runtime:** Addressed race condition in surface start. ([6ba7cb3102](https://github.com/facebook/react-native/commit/6ba7cb310273a0ecce6a168bf3aae45fb85bf955) by [@javache](https://github.com/javache))
- **runtime:** Avoid null reference exception in bridgeless ReactDelegate ([0d664100bb](https://github.com/facebook/react-native/commit/0d664100bbf608550a5c42a4e9b02c6c5bd0f5b8) by [@rozele](https://github.com/rozele))
- **runtime:** Fix Frame Callback not being called after Host Resume ([e8f8ee3c0f](https://github.com/facebook/react-native/commit/e8f8ee3c0f28b8c5751ffaef495adea0b8daf1eb) by [@s77rt](https://github.com/s77rt))
- **runtime:** Merge Android ViewNativeComponent ViewConfig into BaseViewConfig ([0ba00fc998](https://github.com/facebook/react-native/commit/0ba00fc99891a333d3625db15d9dd832ca7eac88) by [@NickGerleman](https://github.com/NickGerleman))
- **runtime:** Add missing BaseViewManager props to BaseViewManagerDelegate ([6741fd94ad](https://github.com/facebook/react-native/commit/6741fd94ad26012938caa65a5129f0eca6f2246e) by [@NickGerleman](https://github.com/NickGerleman))
- **runtime:** Fix issue where `onDropViewInstance` cleanup was not being handled after `ReactRootView.unmountReactApplication` ([0449630612](https://github.com/facebook/react-native/commit/04496306123c46730b46accb2cd6239531e51fef) by [@rozele](https://github.com/rozele))
- **runtime:** Fix some cases where we override setBackgroundColor on View-level instead of VM level ([0b0ac81fbe](https://github.com/facebook/react-native/commit/0b0ac81fbeebf819e744b6ecc19d549aaab8406d) by [@NickGerleman](https://github.com/NickGerleman))
- **runtime:** Fix interactions between removeClippedSubviews and RTL ([513e9669e7](https://github.com/facebook/react-native/commit/513e9669e78a4bfd9b0380335c61f581343c4009) by [@NickGerleman](https://github.com/NickGerleman))
- **runtime:** Fix: ReactDelegate/ReactFragment crashing on New Architecture apps ([12dda31bc1](https://github.com/facebook/react-native/commit/12dda31bc12f4a04ec9df70d30328b1001bb2cec) by [@cortinico](https://github.com/cortinico))
- **runtime:** ReactFragment should properly instantiate ReactDelegate on Bridgeless ([7176d11ce4](https://github.com/facebook/react-native/commit/7176d11ce468ca37e9cbe8afcc1f6344c250dd0c) by [@cortinico](https://github.com/cortinico))
- **runtime:** ARG_DISABLE_HOST_LIFECYCLE_EVENTS in ReactFragment to allow unmounting a surface without destroying ReactHost. ([40c875deca](https://github.com/facebook/react-native/commit/40c875decabaa56d6dd45ce03b22e8b3931781ac) by [@vincenzovitale](https://github.com/vincenzovitale))
- **runtime:** Use appropriate Nullable attribute for ReactRootView field in ReactDelegate ([cbddcfc691](https://github.com/facebook/react-native/commit/cbddcfc6911101608df36f2a8d047768296c63b2) by [@rozele](https://github.com/rozele))
- **runtime:** Hover events were dispatched incorrectly when multiple ReactRoots were layered. ([533ef2ca37](https://github.com/facebook/react-native/commit/533ef2ca37d3b19fc909315f183e3f30dbf4b93d) by [@javache](https://github.com/javache))
- **runtime:** Handle removal of in-transition views. ([f402ed17fa](https://github.com/facebook/react-native/commit/f402ed17fa6d75aea24e2ad99a8b8d8ad20840e3) by [@kkafar](https://github.com/kkafar))
- **ScrollView** Dispatch onMomentumScrollEnd after programmatic scrolling ([c69e330324](https://github.com/facebook/react-native/commit/c69e330324724a1e363f4786b2b03ee7ff4b35c5) by [@Biki-das](https://github.com/Biki-das))
- **ScrollView:** Fix RTL ScrollView position when content smaller than container ([0df59d4f03](https://github.com/facebook/react-native/commit/0df59d4f03f79c0fcb9ede2d21bf4d49c97c21ef) by [@NickGerleman](https://github.com/NickGerleman))
- **ScrollView:** Fixed incorrect scroll event/position for scroll views when doing a smooth scroll animation. ([b4c41ec768](https://github.com/facebook/react-native/commit/b4c41ec7685da6e8ef35c41c30aa402639bc42c1) by [@rubennorte](https://github.com/rubennorte))
- **Suspense** Fix crash in getViewState when using suspense fallbacks. ([bd133b5dd5](https://github.com/facebook/react-native/commit/bd133b5dd57b18140eae51c6d7aaab02874455c1) by [@javache](https://github.com/javache))
- **style:** Enable mix-blend-mode on ReactRootView so blending works with app background ([24b0ded3cf](https://github.com/facebook/react-native/commit/24b0ded3cf715bb0e849d9f7ca8cd2d4d42cbf90) by [@jorge-cab](https://github.com/jorge-cab))
- **style:** BoxShadow now supports platformColor. ([4ede9205a0](https://github.com/facebook/react-native/commit/4ede9205a0559fcaf7ac58a3d70bc902eb23fcb6) by [@javache](https://github.com/javache))
- **style:** MixBlendMode now properly does state updates ([fae572d815](https://github.com/facebook/react-native/commit/fae572d815c7fb9684fc6c3b7f001de35ea8fb69) by [@jorge-cab](https://github.com/jorge-cab))
- **style:** Linear gradient with platform colors ([6866968a79](https://github.com/facebook/react-native/commit/6866968a79d44518884965959760983acdadc17c) by [@intergalacticspacehighway](https://github.com/intergalacticspacehighway))
- **Text:** Ensure setSelection in onAttachedToWindow is within text range ([08759121cd](https://github.com/facebook/react-native/commit/08759121cda3785e4d7ee1f1c82011a3e3a955a9) by [@zeyap](https://github.com/zeyap))
- **Text:** Fixed crash in legacy ReactFontManager ([3da23f7093](https://github.com/facebook/react-native/commit/3da23f7093730e10aeda6b58f4934a381e226dd2) by [@javache](https://github.com/javache))
- **Text:** Reimplement Android lineHeight positioning/determination ([41265bac6b](https://github.com/facebook/react-native/commit/41265bac6b83ee0bb92d645ace81e314065bf5e0) by [@NickGerleman](https://github.com/NickGerleman))
- **Text:** Text without explicit font styles was potentially cut-off. ([95a5d1c628](https://github.com/facebook/react-native/commit/95a5d1c6287c7301265207d1962ba8b50d178b20) by [@javache](https://github.com/javache))
- **Text:** Fix mising `ANTI_ALIAS_FLAG` when resetting Text Paint ([276e3a7df7](https://github.com/facebook/react-native/commit/276e3a7df7de1b04dec0891fa7ed72917568ee7b) by [@NickGerleman](https://github.com/NickGerleman))
- **Text:** Properly fix measurement of trailing newlines ([060c594457](https://github.com/facebook/react-native/commit/060c59445740f9b92188d2193623b36c3d859ba7) by [@NickGerleman](https://github.com/NickGerleman))
- **Text:** Fixed text being measured incorrectly when ending with an empty line on the new architecture ([bd323929dc](https://github.com/facebook/react-native/commit/bd323929dc5be5666ee36043babec7d981a095dc) by [@j-piasecki](https://github.com/j-piasecki))
- **Text:** Improve text line height calculation ([65d8f66b50](https://github.com/facebook/react-native/commit/65d8f66b50471d2fb4ddd5e63e17fcc808623110) by [@mellyeliu](https://github.com/mellyeliu))
- **Text:** Fix generating empty line at the end of multiline text view when `textAlign` is set to `justify` ([08e8f6adfd](https://github.com/facebook/react-native/commit/08e8f6adfdcdfec59002f34bb7acf35bb842b331) by [@coado](https://github.com/coado))
- **TextInput:** Fix TextInput caret moving to the beginning when attached to window ([ca0abd1b9e](https://github.com/facebook/react-native/commit/ca0abd1b9ea164a566b39cb9090eaa75647aad5a) by [@QichenZhu](https://github.com/QichenZhu))
- **TextInput:** Fix NPE on ReactTextInputManager.setTextDecorationLine ([41c6ad5597](https://github.com/facebook/react-native/commit/41c6ad55978184cad1a32ec63c2d1f07e8282d5e) by [@cortinico](https://github.com/cortinico))
- **VirtualizedList:** Account for items dynamically scaling with the container when using `maintainVisibleContentPosition` in virtualized lists ([6c19996e10](https://github.com/facebook/react-native/commit/6c19996e10eda97a3501f53a68da246d1f122d01) by [@fabriziocucci](https://github.com/fabriziocucci))
- **Accessibility:** Make sure that the Increment and Decrement accessibility actions works on iOS ([303e0ed764](https://github.com/facebook/react-native/commit/303e0ed7641409acf2d852c077f6be426afd7a0c) by [@cipolleschi](https://github.com/cipolleschi))
- **ActionSheetIOS:** Fix ActionSheetIOS crash `attempt to insert nil object from objects` ([bebd6531b5](https://github.com/facebook/react-native/commit/bebd6531b5f4ef0300aa5a4b6f9d23e60b57a25e) by [@RodolfoGS](https://github.com/RodolfoGS))
- **AppClips:** Fix launching App Clips with nullish URLs. ([043e2fe14a](https://github.com/facebook/react-native/commit/043e2fe14a6f13885a552211f17d61292001fa76) by [@EvanBacon](https://github.com/EvanBacon))
- **Cocoapods:** Typo in spm.rb ([5e18f7f788](https://github.com/facebook/react-native/commit/5e18f7f788ccbea60e96b8e7deab29d423ccf1a6) by [@okwasniewski](https://github.com/okwasniewski))
- **infra:** Fallback to old resolve mechanism when node require fails to resolve react native path ([3cbaddbc16](https://github.com/facebook/react-native/commit/3cbaddbc164b9dc326b2a7ddc0b35ce885bc7d9d) by [@okwasniewski](https://github.com/okwasniewski))
- **infra:** Enable hermes debugger by configuration type instead of configuration name ([eda4f185b3](https://github.com/facebook/react-native/commit/eda4f185b381f7569a1029b7697f9a1c8bc6d108) by [@benhandanyan](https://github.com/benhandanyan))
- **ObjC:** Fix numerous class interfaces having incorrect designated initializer patterns ([b98846c2e3](https://github.com/facebook/react-native/commit/b98846c2e37c3ec895536ab942978d7701f51a5e) by Nolan O'Brien)
- **PrivacyInfo:** Don't reference PrivacyInfo.xcprivacy twice for new projects ([cadd41b1a2](https://github.com/facebook/react-native/commit/cadd41b1a2e16b1c77a8d3022f4ccbdbd5ea295f) by [@okwasniewski](https://github.com/okwasniewski))
- **ReactNativeDevTools:** "Reconnect DevTools" button not working sometimes ([8507204b53](https://github.com/facebook/react-native/commit/8507204b533cf87d1e4345a9c062cd10cf0022c1) by [@EdmondChuiHW](https://github.com/EdmondChuiHW))
- **ReactNativeDevTools:** Fix `r` & `d` not working from Metro sometimes ([9a60038a40](https://github.com/facebook/react-native/commit/9a60038a40e16925ea1adeb3e3c937c22a615485) by [@EdmondChuiHW](https://github.com/EdmondChuiHW))
- **ScrollView:** Fixed `onMomentumScrollBegin` event not firing on command-driven scroll events ([5b609cca09](https://github.com/facebook/react-native/commit/5b609cca099b3b0d4fc66d4cf50f69d3c5b7fc8e) by [@Abbondanzo](https://github.com/Abbondanzo))
- **ScrollView:** AutomaticallyAdjustKeyboardInsets not shifting scrollview content ([2d9933e616](https://github.com/facebook/react-native/commit/2d9933e616c3efe57ed0ca141277638182a69d9c) by [@zhongwuzw](https://github.com/zhongwuzw))
- **ScrollView:** Fixes scrollIndicatorInsets not work in old arch ([c1178ac208](https://github.com/facebook/react-native/commit/c1178ac2085e073afb07453eefc9095a1f5d530f) by [@zhongwuzw](https://github.com/zhongwuzw))
- **ScrollView:** fix: vertical scroll views are detected as horizontals ([ab8f3ff3e9](https://github.com/facebook/react-native/commit/ab8f3ff3e9e6445fa9961467e965792908d4c2bd) by [@coado](https://github.com/coado))
- **style:** Fixes CornerRadiiAreEqualAndSymmetrical error when check topLeftHorizontal == topLeftVertical ([af384a914a](https://github.com/facebook/react-native/commit/af384a914a4e9ef6a5d25b00bc14b0483e5af879) by [@zhongwuzw](https://github.com/zhongwuzw))
- **Text:** Fixes missing char mode of linebreakmode ([77889afa1c](https://github.com/facebook/react-native/commit/77889afa1c9d0bdb966102860a5d1d1d91187ae8) by [@zhongwuzw](https://github.com/zhongwuzw))
- **Text:** Fix possible NSRangeException when updating typing attributes in response to new text content ([6e06a810f0](https://github.com/facebook/react-native/commit/6e06a810f0ab1002f1d10351bc878babde36b1f1) by [@NickGerleman](https://github.com/NickGerleman))
- **runtime:** Fixed use of view commands from layout effects ([6f1c2a512e](https://github.com/facebook/react-native/commit/6f1c2a512e44d25edefea53e864f688018745c07) by [@sammy-SC](https://github.com/sammy-SC))
- **runtime:** Fixed crash on promise rejection handler in iOS 18. ([26d8d490e4](https://github.com/facebook/react-native/commit/26d8d490e47bd3fa46dc4a3b8e66e9ec35c15cf7) by David Rickard)
- **runtime:** Cast the UIScene to UIWindowScene only if the scene respond to the selector ([fdee0ebbcb](https://github.com/facebook/react-native/commit/fdee0ebbcb88f40c23b92b07792fbb9d1041c546) by [@cipolleschi](https://github.com/cipolleschi))
- **runtime:** Fixes the exported synchronous method not being called on the method queue when it's the main queue ([8bfd7e1039](https://github.com/facebook/react-native/commit/8bfd7e10393e649554c7246df430019c4f78d5e0) by [@zhongwuzw](https://github.com/zhongwuzw))
- **TextInput:** Fixes numeric TextInput not triggering `onSubmitEditing` ([0bcb0c2b2f](https://github.com/facebook/react-native/commit/0bcb0c2b2f460ed1a9d525d1a5b343f4b71f9347) by [@zhongwuzw](https://github.com/zhongwuzw))
- **TextInput:** Fixed problem with third party libraries overwriting `inputAccessoryView` ([d34032b6c0](https://github.com/facebook/react-native/commit/d34032b6c0bb3564a7b77ef270cc3289d99365f2) by [@kirillzyusko](https://github.com/kirillzyusko))
- **TextInput:** Workaround for Mac Catalyst TextInput crash due to serialization attempt of WeakEventEmitter ([e04738b7ec](https://github.com/facebook/react-native/commit/e04738b7ecec9e7da3aab49bb24a6336b9496b94) by [@rozele](https://github.com/rozele))
- **TextInput:** Fix `maxLength` not working in old arch ([4b3ef3b00c](https://github.com/facebook/react-native/commit/4b3ef3b00ce0026c0d1e1f2a5546fcec249255d8) by [@mateoguzmana](https://github.com/mateoguzmana))
## v0.76.6
### Fixed
- **layout:** Fix TextMeasureCacheKey Throwing Out Some LayoutConstraints ([f7a5db3c06](https://github.com/facebook/react-native/commit/f7a5db3c063b952321826ea431d3d238ef0de65d) by [@NickGerleman](https://github.com/NickGerleman))
#### Android specific
- **layout:** Restore layout/invalidate during ReactViewClippingManager.removeViewAt() ([0683206927](https://github.com/facebook/react-native/commit/068320692748f0c46867625786a780366fdbb1d6) by Thomas Nardone)
- **Native Modules:** Prioritise local OnLoad.cpp, falling back to default-app-setup ([8b1f049879](https://github.com/facebook/react-native/commit/8b1f04987936ab2bc7dcf62adc92bf394d35f77b) by [@timbocole](https://github.com/timbocole))
- **runtime:** Remove feature flag for allowRecursiveCommitsWithSynchronousMountOnAndroid ([fb7f87ecb2](https://github.com/facebook/react-native/commit/fb7f87ecb27f9006e2018b9622d329feb1ba23a4) by [@cipolleschi](https://github.com/cipolleschi))
#### iOS specific
- **TextInput:** Fixing TextInput `maxLength` not working in old arch ([9ecf290d27](https://github.com/facebook/react-native/commit/9ecf290d270598e45832a75f657d73cf20088a37) by [@mateoguzmana](https://github.com/mateoguzmana))
## v0.76.5
### Fixed
- Better support filtering out non linked platforms ([fcbcf80d1c](https://github.com/facebook/react-native/commit/fcbcf80d1c080af42b5277fc8a153059194efb95) by [@cipolleschi](https://github.com/cipolleschi))
#### Android specific
- Fix crash on HeadlessJsTaskService on old architecture ([4560fc0497](https://github.com/facebook/react-native/commit/4560fc049748a345d5945bc08d43f4b61ca51ff3) by [@cortinico](https://github.com/cortinico))
## v0.76.4
### Added
- Sync debugger-frontend to latest 0.76-stable (fix Expo node_modules entry points in Sources panel) ([43fe69c315](https://github.com/facebook/react-native/commit/43fe69c315e68aab96c303c7a6c9b3821a6e25e5) by [@huntie](https://github.com/huntie))
- Exclude unlinked libs from codegen ([3cedb09a65](https://github.com/facebook/react-native/commit/3cedb09a650adda0b3f24e931c25f27730af19b1) by [@cipolleschi](https://github.com/cipolleschi))
#### Android specific
- Avoid NPE when touch event is triggered before SurfaceManager is initiated ([b8095f4692](https://github.com/facebook/react-native/commit/b8095f4692610c7f4631b851dc7d8dc9b149a277) by [@CHOIMINSEOK](https://github.com/CHOIMINSEOK))
## v0.76.3
### Fixed
@@ -770,6 +1354,21 @@ created on the mqt_native thread. ([c4a6bbc8fd](https://github.com/facebook/reac
- **turbomodule:** Fixed race condition in native module invalidation. ([b7812a8b6c](https://github.com/facebook/react-native/commit/b7812a8b6c3afbeacaad94779cd010bcc5440785) by [@dmytrorykun](https://github.com/dmytrorykun))
- **xcode:** Do not use temporary node when creating the .xcode.env.local ([8408b8bc96](https://github.com/facebook/react-native/commit/8408b8bc96db15e265ca65fce7875ee65dcfdcec) by [@cipolleschi](https://github.com/cipolleschi))
## v0.74.7
### Fixed
#### Android specific
- Fix #41226 by suppressing path adjustment when not actually drawing a border ([8501b6396b](https://github.com/facebook/react-native/commit/8501b6396b0a4fd7a9bd2add2b3c8b9c755c27ae) by [@knappam](https://github.com/knappam))
- RGNP - Remove unnecessary dependency on `gradle-tooling-api-builders` - serviceOf failure ([b6bdecd309](https://github.com/facebook/react-native/commit/b6bdecd309bf74cfa80b71204d5266667cb3f843) by [@cortinico](https://github.com/cortinico))
#### iOS specific
- Fix iOS crash occurring when navigating to a new app screen with a displaying modal ([52888c0c1e](https://github.com/facebook/react-native/commit/52888c0c1e722a799f233c2f502e01b9dd4a7174) by Zhi Zhou)
- Fix ruby for CI ([1c80702e95](https://github.com/facebook/react-native/commit/1c80702e95a6bcf422f5448b4578d71e8e78071b) by [@cipolleschi](https://github.com/cipolleschi))
@@ -67,7 +64,7 @@ React Native is developed and supported by many companies and individual core co
## 📋 Requirements
React Native apps may target iOS 13.4 and Android 6.0 (API 23) or newer. You may use Windows, macOS, or Linux as your development operating system, though building and running iOS apps is limited to macOS. Tools like [Expo](https://expo.dev) can be used to work around this.
React Native apps may target iOS 15.1 and Android 7.0 (API 24) or newer. You may use Windows, macOS, or Linux as your development operating system, though building and running iOS apps is limited to macOS. Tools like [Expo](https://expo.dev) can be used to work around this.
import*asefrom"../platform/platform.js";constt=newURLSearchParams(location.search);letn,s="";classr{constructor(){}staticinstance(e={forceNew:null}){const{forceNew:t}=e;returnn&&!t||(n=newr),n}staticremoveInstance(){n=void0}staticqueryParam(e){returnt.get(e)}staticsetQueryParamForTesting(e,n){t.set(e,n)}staticexperimentsSetting(){try{returne.StringUtilities.toKebabCaseKeys(JSON.parse(self.localStorage&&self.localStorage.experiments?self.localStorage.experiments:"{}"))}catch(e){returnconsole.error("Failed to parse localStorage['experiments']"),{}}}staticsetPlatform(e){s=e}staticplatform(){returns}staticisDescriptorEnabled(e){const{experiment:t}=e;if("*"===t)return!0;if(t&&t.startsWith("!")&&o.isEnabled(t.substring(1)))return!1;if(t&&!t.startsWith("!")&&!o.isEnabled(t))return!1;const{condition:n}=e;return!n||n()}loadLegacyModule(e){returnimport(`../../${e}`)}}classi{#e;#t;#n;#s;#r;constructor(){this.#e=[],this.#t=newSet,this.#n=newSet,this.#s=newSet,this.#r=newSet}allConfigurableExperiments(){conste=[];for(consttofthis.#e)this.#n.has(t.name)||e.push(t);returne}setExperimentsSetting(e){self.localStorage&&(self.localStorage.experiments=JSON.stringify(e))}register(t,n,s,r,i){if(this.#t.has(t))thrownewError(`Duplicate registraction of experiment '${t}'`);this.#t.add(t),this.#e.push(newa(this,t,n,Boolean(s),r??e.DevToolsPath.EmptyUrlString,i??e.DevToolsPath.EmptyUrlString))}isEnabled(e){returnthis.checkExperiment(e),!1!==r.experimentsSetting()[e]&&(!(!this.#n.has(e)&&!this.#s.has(e))||(!!this.#r.has(e)||Boolean(r.experimentsSetting()[e])))}setEnabled(e,t){this.checkExperiment(e);constn=r.experimentsSetting();n[e]=t,this.setExperimentsSetting(n)}enableExperimentsTransiently(e){for(consttofe)this.checkExperiment(t),this.#n.add(t)}enableExperimentsByDefault(e){for(consttofe)this.checkExperiment(t),this.#s.add(t)}setServerEnabledExperiments(e){for(consttofe)this.checkExperiment(t),this.#r.add(t)}enableForTest(e){this.checkExperiment(e),this.#n.add(e)}disableForTest(e){this.checkExperiment(e),this.#n.delete(e)}clearForTest(){this.#e=[],this.#t.clear(),this.#n.clear(),this.#s.clear(),this.#r.clear()}cleanUpStaleExperiments(){conste=r.experimentsSetting(),t={};for(const{name:n}ofthis.#e)if(e.hasOwnProperty(n)){consts=e[n];(s||this.#s.has(n))&&(t[n]=s)}this.setExperimentsSetting(t)}checkExperiment(e){if(!this.#t.has(e))thrownewError(`Unknown experiment '${e}'`)}}classa{name;title;unstable;docLink;feedbackLink;#e;constructor(e,t,n,s,r,i){this.name=t,this.title=n,this.unstable=s,this.docLink=r,this.feedbackLink=i,this.#e=e}isEnabled(){returnthis.#e.isEnabled(this.name)}setEnabled(e){this.#e.setEnabled(this.name,e)}}consto=newi;varl,c;!function(e){e.REACT_NATIVE_SPECIFIC_UI="react-native-specific-ui",e.JS_HEAP_PROFILER_ENABLE="js-heap-profiler-enable",e.ENABLE_PERFORMANCE_PANEL="enable-performance-panel"}(l||(l={})),function(e){e.CAN_DOCK="can_dock",e.NOT_SOURCES_HIDE_ADD_FOLDER="!sources.hide_add_folder",e.REACT_NATIVE_UNSTABLE_NETWORK_PANEL="unstable_enableNetworkPanel"}(c||(c={}));constm={canDock:()=>Boolean(r.queryParam("can_dock")),notSourcesHideAddFolder:()=>Boolean(r.queryParam(c.NOT_SOURCES_HIDE_ADD_FOLDER)),reactNativeUnstableNetworkPanel:()=>Boolean(r.queryParam(c.REACT_NATIVE_UNSTABLE_NETWORK_PANEL))};varh=Object.freeze({__proto__:null,getRemoteBase:function(e=self.location.toString()){constt=newURL(e).searchParams.get("remoteBase");if(!t)returnnull;constn=/\/serve_file\/(@[0-9a-zA-Z]+)\/?$/.exec(t);returnn?{base:`devtools://devtools/remote/serve_file/${n[1]}/`,version:n[1]}:null},Runtime:r,ExperimentsSupport:i,Experiment:a,experiments:o,getRNExperimentName(){returnl},getConditionName(){returnc},conditions:m});export{hasRuntime};
import*asefrom"../platform/platform.js";constt=newURLSearchParams(location.search);letn,r="";classs{constructor(){}staticinstance(e={forceNew:null}){const{forceNew:t}=e;returnn&&!t||(n=news),n}staticremoveInstance(){n=void0}staticqueryParam(e){returnt.get(e)}staticsetQueryParamForTesting(e,n){t.set(e,n)}staticexperimentsSetting(){try{returne.StringUtilities.toKebabCaseKeys(JSON.parse(self.localStorage&&self.localStorage.experiments?self.localStorage.experiments:"{}"))}catch(e){returnconsole.error("Failed to parse localStorage['experiments']"),{}}}staticsetPlatform(e){r=e}staticplatform(){returnr}staticisDescriptorEnabled(e,t){const{experiment:n}=e;if("*"===n)return!0;if(n&&n.startsWith("!")&&o.isEnabled(n.substring(1)))return!1;if(n&&!n.startsWith("!")&&!o.isEnabled(n))return!1;const{condition:r}=e;return!r||r(t)}loadLegacyModule(e){returnimport(`../../${e}`)}}classi{#e;#t;#n;#r;#s;constructor(){this.#e=[],this.#t=newSet,this.#n=newSet,this.#r=newSet,this.#s=newSet}allConfigurableExperiments(){conste=[];for(consttofthis.#e)this.#n.has(t.name)||e.push(t);returne}setExperimentsSetting(e){self.localStorage&&(self.localStorage.experiments=JSON.stringify(e))}register(t,n,r,s,i){if(this.#t.has(t))thrownewError(`Duplicate registraction of experiment '${t}'`);this.#t.add(t),this.#e.push(newa(this,t,n,Boolean(r),s??e.DevToolsPath.EmptyUrlString,i??e.DevToolsPath.EmptyUrlString))}isEnabled(e){returnthis.checkExperiment(e),!1!==s.experimentsSetting()[e]&&(!(!this.#n.has(e)&&!this.#r.has(e))||(!!this.#s.has(e)||Boolean(s.experimentsSetting()[e])))}setEnabled(e,t){this.checkExperiment(e);constn=s.experimentsSetting();n[e]=t,this.setExperimentsSetting(n)}enableExperimentsTransiently(e){for(consttofe)this.checkExperiment(t),this.#n.add(t)}enableExperimentsByDefault(e){for(consttofe)this.checkExperiment(t),this.#r.add(t)}setServerEnabledExperiments(e){for(consttofe)this.checkExperiment(t),this.#s.add(t)}enableForTest(e){this.checkExperiment(e),this.#n.add(e)}disableForTest(e){this.checkExperiment(e),this.#n.delete(e)}clearForTest(){this.#e=[],this.#t.clear(),this.#n.clear(),this.#r.clear(),this.#s.clear()}cleanUpStaleExperiments(){conste=s.experimentsSetting(),t={};for(const{name:n}ofthis.#e)if(e.hasOwnProperty(n)){constr=e[n];(r||this.#r.has(n))&&(t[n]=r)}this.setExperimentsSetting(t)}checkExperiment(e){if(!this.#t.has(e))thrownewError(`Unknown experiment '${e}'`)}}classa{name;title;unstable;docLink;feedbackLink;#e;constructor(e,t,n,r,s,i){this.name=t,this.title=n,this.unstable=r,this.docLink=s,this.feedbackLink=i,this.#e=e}isEnabled(){returnthis.#e.isEnabled(this.name)}setEnabled(e){this.#e.setEnabled(this.name,e)}}consto=newi;varl,c;!function(e){e.REACT_NATIVE_SPECIFIC_UI="react-native-specific-ui",e.JS_HEAP_PROFILER_ENABLE="js-heap-profiler-enable",e.ENABLE_PERFORMANCE_PANEL="enable-performance-panel"}(l||(l={})),function(e){e.CAN_DOCK="can_dock",e.NOT_SOURCES_HIDE_ADD_FOLDER="!sources.hide_add_folder",e.REACT_NATIVE_UNSTABLE_NETWORK_PANEL="unstable_enableNetworkPanel"}(c||(c={}));constm={canDock:()=>Boolean(s.queryParam("can_dock")),notSourcesHideAddFolder:()=>Boolean(s.queryParam(c.NOT_SOURCES_HIDE_ADD_FOLDER)),reactNativeUnstableNetworkPanel:()=>Boolean(s.queryParam(c.REACT_NATIVE_UNSTABLE_NETWORK_PANEL))};varh=Object.freeze({__proto__:null,getRemoteBase:function(e=self.location.toString()){constt=newURL(e).searchParams.get("remoteBase");if(!t)returnnull;constn=/\/serve_file\/(@[0-9a-zA-Z]+)\/?$/.exec(t);returnn?{base:`devtools://devtools/remote/serve_file/${n[1]}/`,version:n[1]}:null},getPathName:function(){returnwindow.location.pathname},Runtime:s,ExperimentsSupport:i,Experiment:a,experiments:o,getRNExperimentName(){returnl},getConditionName(){returnc},conditions:m});export{hasRuntime};
import*asefrom"../../core/root/root.js";import*astfrom"../../services/puppeteer/puppeteer.js";import"../../third_party/lighthouse/lighthouse-dt-bundle.js";classs{sessionId;onMessage;onDisconnect;constructor(e){this.sessionId=e,this.onMessage=null,this.onDisconnect=null}setOnMessage(e){this.onMessage=e}setOnDisconnect(e){this.onDisconnect=e}getOnDisconnect(){returnthis.onDisconnect}getSessionId(){returnthis.sessionId}sendRawMessage(e){i("sendProtocolMessage",{message:e})}asyncdisconnect(){this.onDisconnect?.("force disconnect"),this.onDisconnect=null,this.onMessage=null}}letn,o;asyncfunctiona(a,r){letc;e.Runtime.Runtime.queryParam("isUnderTest")&&(console.log=()=>{},r.flags.maxWaitForLoad=2e3),self.listenForStatus((e=>{i("statusUpdate",{message:e[1]})}));try{if("endTimespan"===a){if(!o)thrownewError("Cannot end a timespan before starting one");conste=awaito();returno=void0,e}consti=awaitasyncfunction(t){consts=self.lookupLocale(t);if("en-US"===s||"en"===s)return;try{constt=e.Runtime.getRemoteBase();letn;n=t&&t.base?`${t.base}third_party/lighthouse/locales/${s}.json`:newURL(`../../third_party/lighthouse/locales/${s}.json`,import.meta.url).toString();consto=newPromise(((e,t)=>setTimeout((()=>t(newError("timed out fetching locale"))),5e3))),a=awaitPromise.race([o,fetch(n).then((e=>e.json()))]);returnself.registerLocaleData(s,a),s}catch(e){console.error(e)}return}(r.locales),l=r.flags;l.logLevel=l.logLevel||"info",l.channel="devtools",l.locale=i,"startTimespan"!==a&&"snapshot"!==a||(r.categoryIDs=r.categoryIDs.filter((e=>"lighthouse-plugin-publisher-ads"!==e)));constg=r.config||self.createConfig(r.categoryIDs,l.formFactor),p=r.url,{rootTargetId:u,mainSessionId:f}=r;n=news(f),c=awaitt.PuppeteerConnection.PuppeteerConnectionHelper.connectPuppeteerToConnectionViaTab({connection:n,rootTargetId:u,isPageTargetCallback:e=>"page"===e.type});const{page:h}=c;if(!h)thrownewError("Could not create page handle for the target page");if("snapshot"===a)returnawaitself.snapshot(h,{config:g,flags:l});if("startTimespan"===a){conste=awaitself.startTimespan(h,{config:g,flags:l});returnvoid(o=e.endTimespan)}returnawaitself.navigation(h,p,{config:g,flags:l})}catch(e){return{fatal:!0,message:e.message,stack:e.stack}}finally{"startTimespan"!==a&&await(c?.browser.disconnect())}}functioni(e,t){self.postMessage({action:e,args:t})}self.onmessage=asyncfunction(e){constt=e.data;switch(t.action){case"startTimespan":case"endTimespan":case"snapshot":case"navigation":{conste=awaita(t.action,t.args);e&&"object"==typeofe&&("report"ine&&deletee.report,"artifacts"ine&&(e.artifacts.Timing=JSON.parse(JSON.stringify(e.artifacts.Timing)))),self.postMessage({id:t.id,result:e});break}case"dispatchProtocolMessage":n?.onMessage?.(t.args.message);break;default:thrownewError(`Unknown event: ${e.data}`)}},globalThis.global=self,globalThis.global.isVinn=!0,globalThis.global.document={},globalThis.global.document.documentElement={},globalThis.global.document.documentElement.style={WebkitAppearance:"WebkitAppearance"},self.postMessage("workerReady");
import*asefrom"../../core/root/root.js";import*astfrom"../../services/puppeteer/puppeteer.js";import"../../third_party/lighthouse/lighthouse-dt-bundle.js";classs{sessionId;onMessage;onDisconnect;constructor(e){this.sessionId=e,this.onMessage=null,this.onDisconnect=null}setOnMessage(e){this.onMessage=e}setOnDisconnect(e){this.onDisconnect=e}getOnDisconnect(){returnthis.onDisconnect}getSessionId(){returnthis.sessionId}sendRawMessage(e){i("sendProtocolMessage",{message:e})}asyncdisconnect(){this.onDisconnect?.("force disconnect"),this.onDisconnect=null,this.onMessage=null}}letn,o;asyncfunctiona(a,r){letc;e.Runtime.Runtime.queryParam("isUnderTest")&&(console.log=()=>{},r.flags.maxWaitForLoad=2e3),self.listenForStatus((e=>{i("statusUpdate",{message:e[1]})}));try{if("endTimespan"===a){if(!o)thrownewError("Cannot end a timespan before starting one");conste=awaito();returno=void0,e}consti=awaitasyncfunction(t){consts=self.lookupLocale(t);if("en-US"===s||"en"===s)return;try{constt=e.Runtime.getRemoteBase();letn;n=t&&t.base?`${t.base}third_party/lighthouse/locales/${s}.json`:newURL(`../../third_party/lighthouse/locales/${s}.json`,import.meta.url).toString();consto=newPromise(((e,t)=>setTimeout((()=>t(newError("timed out fetching locale"))),5e3))),a=awaitPromise.race([o,fetch(n).then((e=>e.json()))]);returnself.registerLocaleData(s,a),s}catch(e){console.error(e)}return}(r.locales),l=r.flags;l.logLevel=l.logLevel||"info",l.channel="devtools",l.locale=i;constg=r.config||self.createConfig(r.categoryIDs,l.formFactor),p=r.url,{rootTargetId:f,mainSessionId:u}=r;n=news(u),c=awaitt.PuppeteerConnection.PuppeteerConnectionHelper.connectPuppeteerToConnectionViaTab({connection:n,rootTargetId:f,isPageTargetCallback:e=>"page"===e.type});const{page:d}=c;if(!d)thrownewError("Could not create page handle for the target page");if("snapshot"===a)returnawaitself.snapshot(d,{config:g,flags:l});if("startTimespan"===a){conste=awaitself.startTimespan(d,{config:g,flags:l});returnvoid(o=e.endTimespan)}returnawaitself.navigation(d,p,{config:g,flags:l})}catch(e){return{fatal:!0,message:e.message,stack:e.stack}}finally{"startTimespan"!==a&&await(c?.browser.disconnect())}}functioni(e,t){self.postMessage({action:e,args:t})}self.onmessage=asyncfunction(e){constt=e.data;switch(t.action){case"startTimespan":case"endTimespan":case"snapshot":case"navigation":{conste=awaita(t.action,t.args);e&&"object"==typeofe&&("report"ine&&deletee.report,"artifacts"ine&&(e.artifacts.Timing=JSON.parse(JSON.stringify(e.artifacts.Timing)))),self.postMessage({id:t.id,result:e});break}case"dispatchProtocolMessage":n?.onMessage?.(t.args.message);break;default:thrownewError(`Unknown event: ${e.data}`)}},globalThis.global=self,globalThis.global.isVinn=!0,globalThis.global.document={},globalThis.global.document.documentElement={},globalThis.global.document.documentElement.style={WebkitAppearance:"WebkitAppearance"},self.postMessage("workerReady");
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.