Compare commits

...
870 Commits
Author SHA1 Message Date
Nicola Corti ef2984d636 Centralize yarn install to use actions/yarn-install 2025-02-04 15:40:50 +00:00
Nicola CortiandFacebook GitHub Bot 55b3839183 Convert com.facebook.react.devsupport.RedBoxDialogSurfaceDelegate to Kotlin (#49091)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49091

Just another Kotlin migration for the devsupport package.

Changelog:
[Internal] [Changed] -

Reviewed By: Abbondanzo

Differential Revision: D68954219

fbshipit-source-id: 4d82a8965207916acec4fa3779627b9e93bb8b10
2025-02-04 07:02:40 -08:00
Nicola CortiandFacebook GitHub Bot 95f9ca5b5b Convert com.facebook.react.devsupport.RedBoxContentView to Kotlin (#49090)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49090

Just another Kotlin migration for the devsupport package.

Changelog:
[Internal] [Changed] -

Reviewed By: alanleedev

Differential Revision: D68954222

fbshipit-source-id: d24ceefb1419d24546ae362a6f37625e724c658b
2025-02-04 07:02:40 -08:00
Mateo GuzmánandFacebook GitHub Bot b76895d6f4 Make BorderRadiusStyle internal (#49150)
Summary:
As part of the initiative to reduce the public API surface, this class can be internalized. I've checked there are [no relevant OSS usages](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+com.facebook.react.uimanager.style.BorderRadiusStyle).

## Changelog:

[INTERNAL] - Make com.facebook.react.uimanager.style.BorderRadiusStyle internal

Pull Request resolved: https://github.com/facebook/react-native/pull/49150

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: rshest

Differential Revision: D69111932

Pulled By: cortinico

fbshipit-source-id: 2c6fbec27140e6fef78ee3077d8a64369f56b143
2025-02-04 06:57:17 -08:00
Pieter De BaetsandFacebook GitHub Bot 64fa41a573 Default XMLHttpRequest's trackingName to null (#49161)
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
2025-02-04 06:11:52 -08:00
Rubén NorteandFacebook GitHub Bot d2a6ff0c37 Add method to take a save a JS memory heap snapshot (#49125)
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
2025-02-04 04:51:00 -08:00
Mateo GuzmánandFacebook GitHub Bot 360cbf7433 Make ResponseUtil internal (#49153)
Summary:
As part of the initiative to reduce the public API surface, this class can be internalized. I've checked there are [no relevant OSS usages](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+com.facebook.react.modules.network.ResponseUtil).

## Changelog:

[Android][Breaking] - Make com.facebook.react.modules.network.ResponseUtil internal

Pull Request resolved: https://github.com/facebook/react-native/pull/49153

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: fabriziocucci

Differential Revision: D69111691

Pulled By: javache

fbshipit-source-id: 985677316be7546d06119826bb53b78e1ae11d75
2025-02-04 04:21:27 -08:00
Mateo GuzmánandFacebook GitHub Bot 1c51b77868 Fix Android Image defaultSource runtime error (#49097)
Summary:
Fixes https://github.com/facebook/react-native/issues/49075

The Image `defaultSource` prop is causing a runtime error from 0.77 just by using it in the Image component (see error in the linked issue). This might be a regression from some changes in the prop processing logic from either https://github.com/facebook/react-native/issues/47710, https://github.com/facebook/react-native/issues/47713 or https://github.com/facebook/react-native/issues/47754.

## Changelog:

[ANDROID] [FIXED] - Fix Image defaultSource runtime error

Pull Request resolved: https://github.com/facebook/react-native/pull/49097

Test Plan:
- Verify it doesn't throw any error on runtime anymore for Android.
- iOS behaviour should not be impacted as changes are Android specific

In the RNTester, you can use the following component:

```tsx
import * as React from 'react';
import {Image, View} from 'react-native';

function Playground() {
  return (
    <View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
      <Image
        defaultSource={require('../../assets/bandaged.png')}
        source={{
          uri: 'https://i.natgeofe.com/n/548467d8-c5f1-4551-9f58-6817a8d2c45e/NationalGeographic_2572187_4x3.jpg',
        }}
        style={{width: 200, height: 200}}
      />
    </View>
  );
}
```

Also, this `defaultSource` prop is ignored in debug builds for Android ([as per the docs](https://reactnative.dev/docs/image#defaultsource)) – but I've verified we get the defaultSource as a string, which is what we expect on the native side:

<details>
<summary>Screenshot of the Android logs</summary>

![image](https://github.com/user-attachments/assets/e62ae2c3-6a93-4e44-a2d7-c913f5db2173)

</details>

Reviewed By: javache

Differential Revision: D69052723

Pulled By: cortinico

fbshipit-source-id: 2860dd4c18cefcfcbc4e39f94dfa6305f45773a3
2025-02-04 03:51:29 -08:00
Tim YungandFacebook GitHub Bot bc4dee94fe Animated: Stabilize allowlist in useAnimatedPropsMemo (#49140)
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
2025-02-03 16:49:40 -08:00
Tim YungandFacebook GitHub Bot 5d4907dde7 Animated: Stabilize allowlist in useAnimatedProps (#49143)
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
2025-02-03 16:49:40 -08:00
Nick GerlemanandFacebook GitHub Bot 1e5cc693fc Add equality operators to CSS data types (#48989)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48989

tsia

Also added a quick helper to CSSColor used later.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D68741768

fbshipit-source-id: e0b4c75c15891e4957c7e05a7a89820c1bea72c3
2025-02-03 16:04:07 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 8af482cc4d Add Changelog for 0.78.0-rc3 (#49147)
Summary:
Add Changelog for 0.78.0-rc3

## Changelog:
[Internal] - Add Changelog for 0.78.0-rc3

Pull Request resolved: https://github.com/facebook/react-native/pull/49147

Test Plan: N/A

Reviewed By: NickGerleman

Differential Revision: D69069136

Pulled By: cipolleschi

fbshipit-source-id: 3314a715a82e1af5e4f907bb0f6aad2f6b9b3cd7
2025-02-03 15:31:30 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 480b2335c9 Remove circleci folder (#49121)
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
2025-02-03 14:07:07 -08:00
Riccardo CipolleschiandFacebook GitHub Bot ae7175d0ab Move analisys scripts to .github folder (#49123)
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
2025-02-03 10:02:19 -08:00
Riccardo CipolleschiandFacebook GitHub Bot d654ae51bb Remove references from CircleCI from the release scripts (#49122)
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
2025-02-03 10:02:19 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 870aca62de Remove references of CircleCI from the readme (#49120)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49120

This change removes any reference of CircleCI from the READMEs in React Native

## Changelog
[Internal] - Remove CircleCI references

Reviewed By: cortinico, huntie

Differential Revision: D69047437

fbshipit-source-id: 602350372c1d869098be0c8da7cb3db2077474d8
2025-02-03 10:02:19 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 839eb44300 Remove CircleCI configuration (#49119)
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
2025-02-03 10:02:19 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 6c6d3413cf Remove CircleCI references from gradle and android (#49118)
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
2025-02-03 10:02:19 -08:00
Nicola CortiandFacebook GitHub Bot e0da0fe710 Convert com.facebook.react.devsupport.PausedInDebuggerOverlayDialogManager to Kotlin (#49088)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49088

Just another Kotlin migration for the devsupport package.

Changelog:
[Internal] [Changed] -

Reviewed By: huntie

Differential Revision: D68954221

fbshipit-source-id: 40dd1227f6cd042b1ea47b1e5b77347a3cdcb136
2025-02-03 09:41:20 -08:00
Rubén NorteandFacebook GitHub Bot 7e12060420 Move Fantom-related specs to src/private/testing/fantom/specs (#49101)
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
2025-02-03 09:15:31 -08:00
Rubén NorteandFacebook GitHub Bot 2f27327f33 Rename src/private/specs as src/private/specs_DEPRECATED (#49068)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49068

Changelog: [internal]

Renamed directory to better signal it's deprecated and added README.md to clarify intent.

Reviewed By: huntie

Differential Revision: D68895998

fbshipit-source-id: 5bc70d0782194db27c27cc89cc402d99f11aafa4
2025-02-03 09:15:31 -08:00
Rubén NorteandFacebook GitHub Bot c8ecc32ece Move geometry to its own directory outside dom (#49100)
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
2025-02-03 09:15:31 -08:00
Alex HuntandFacebook GitHub Bot 4348a57503 Fix build-types script, align internal babel-register (#49133)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49133

Follow up to D68960540.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D69053411

fbshipit-source-id: ffc8aba923aab8f4cd0d74fb61c49893ff09b6c1
2025-02-03 08:32:39 -08:00
Mateo GuzmánandFacebook GitHub Bot 1a67214a3a Make SystraceRequestListener internal (#49107)
Summary:
As part of the initiative to reduce the public API surface, this class can be internalized. I've checked there are [no relevant OSS usages](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+com.facebook.react.modules.fresco.SystraceRequestListener).

## Changelog:

[INTERNAL] - Make com.facebook.react.modules.fresco.SystraceRequestListener internal

Pull Request resolved: https://github.com/facebook/react-native/pull/49107

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: cortinico

Differential Revision: D69046100

Pulled By: javache

fbshipit-source-id: 0cb4c6eda385f458c3e4b02068ce77f2dd15af23
2025-02-03 08:15:25 -08:00
kirillzyuskoandFacebook GitHub Bot 243aecc095 fix: avoid ConcurrentModificationException (#49109)
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
2025-02-03 07:27:58 -08:00
Alex HuntandFacebook GitHub Bot 880fd927a9 Remove internal XHRInterceptor API (#49132)
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
2025-02-03 06:56:08 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 3bd3f101b9 Be less strict with method parsing of TurboModule Interop Layer (#49072)
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
2025-02-03 06:50:05 -08:00
Pieter De BaetsandFacebook GitHub Bot e5ba5791b2 Enable -Wundef for react-native targets (#49041)
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
2025-02-03 06:29:28 -08:00
Pieter De BaetsandFacebook GitHub Bot 4799463435 Fix incorrect noexcept attributes (#49127)
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
2025-02-03 06:15:36 -08:00
Oskar KwaśniewskiandFacebook GitHub Bot ae59702f8e fix(iOS): bring back enableFixForViewCommandRace feature flag (#49126)
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
2025-02-03 06:12:12 -08:00
Alex HuntandFacebook GitHub Bot fb493fd72d Restore XMLHttpRequest setInterceptor API, rename as DO_NOT_USE (#49081)
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
2025-02-03 05:55:53 -08:00
Jakub PiaseckiandFacebook GitHub Bot 8d90be814e Refactor ActionSheetIOS to better align with OSS types (#49094)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49094

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D68957719

fbshipit-source-id: 4e4738a619583000ea6fe78808d46e300428504a
2025-02-03 04:47:06 -08:00
Alex HuntandFacebook GitHub Bot 71ad6369ce Remove unused nativeNetworkInspection flag, clarify static experiment key (#49096)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49096

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D68958813

fbshipit-source-id: d2222e8bcc1bc0664cf93d9017a796016ee270a2
2025-02-03 04:10:18 -08:00
Alex HuntandFacebook GitHub Bot 3cf400a51b Convert build scripts to regular Flow syntax (#49103)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49103

Changelog: [Internal]

Reviewed By: j-piasecki

Differential Revision: D68960540

fbshipit-source-id: 0ac01529eaea97db98b85b6021532092997d633b
2025-02-03 03:49:23 -08:00
Alex HuntandFacebook GitHub Bot e1575857dd Relocate babel-register script (#49102)
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
2025-02-03 03:49:23 -08:00
Mateo GuzmánandFacebook GitHub Bot 3a5e217df6 Add CountingOutputStream tests (#49058)
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
2025-02-03 03:43:55 -08:00
Nicola CortiandFacebook GitHub Bot bdbd0fa0ca Convert com.facebook.react.devsupport.IInspectorPackagerConnection to Kotlin (#49092)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49092

Just another Kotlin migration for the devsupport package.

Changelog:
[Internal] [Changed] -

Reviewed By: huntie

Differential Revision: D68954220

fbshipit-source-id: fbdf391152578ba5cc0b0a9b303a5a6700bfdb0e
2025-02-03 01:47:18 -08:00
Nicola CortiandFacebook GitHub Bot 17f7bf3773 Convert com.facebook.react.devsupport.HMRClient to Kotlin (#49089)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49089

Just another Kotlin migration for the devsupport package.

Changelog:
[Internal] [Changed] -

Reviewed By: tdn120

Differential Revision: D68954223

fbshipit-source-id: 6dd6e33ade211a6df2eea7a8dd761cc427bfd5c3
2025-02-03 01:47:18 -08:00
Edmond ChuiandFacebook GitHub Bot e45883e44f enable Network.enable behind feature flag (#49098)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49098

Changelog: [Internal][Added] enable Network.enable behind feature flag (in preparation for Network Panel)

Respond to `Network.enable` calls. Params are currently not supported. https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-enable

Reviewed By: huntie

Differential Revision: D68959142

fbshipit-source-id: 78a195979c39b1199be2fd8f9bdcfe4fe51dd6dd
2025-01-31 19:28:45 -08:00
Nicola CortiandFacebook GitHub Bot 4523fdd932 Internalize com.facebook.react.devsupport.inspector (#49086)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49086

Making all the classes inside `com.facebook.react.devsupport.inspector` internal.
Those should have not been exposed in the first place.

I've verified that there are no usages for those clases in OSS:
https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+%22import+com.facebook.react.devsupport.inspector.%22

Changelog:
[Internal] [Changed] -

Reviewed By: mdvacca

Differential Revision: D68954014

fbshipit-source-id: 02e0ab566977383105d5d42336123335309cfc34
2025-01-31 12:49:45 -08:00
Intl SchedulerandFacebook GitHub Bot cc74db2bba translation auto-update for Apps/Wilde/scripts/intl-config.json on master
Summary:
Chronos Job Instance ID: 1125907955550893
Sandcastle Job Instance ID: 1654683818
allow-large-files
ignore-conflict-markers
opt-out-review
drop-conflicts

Differential Revision: D68971915

fbshipit-source-id: c58b74d0998bd485dcd608defee0948409a503b4
2025-01-31 12:00:18 -08:00
Thomas NardoneandFacebook GitHub Bot 7cfb19e7e3 Add ReactBuildConfig.ENABLE_PERFETTO (#48981)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48981

Add entry for this flag in ReactBuildConfig

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D68725330

fbshipit-source-id: afce4093665ba0c78f4630ab412297219f65d157
2025-01-31 10:02:12 -08:00
Mateo GuzmánandFacebook GitHub Bot 491ede6404 Migrate com.facebook.react.packagerconnection interfaces to Kotlin (#49025)
Summary:
Migrate com.facebook.react.packagerconnection interfaces to Kotlin. Also, moving to `org.mockito.kotlin` instead of `org.mockito.Mockito` for JSPackagerClientTest to make it compatible with the migrated files.

## Changelog:

[INTERNAL] - Migrate com.facebook.react.packagerconnection interfaces to Kotlin

Pull Request resolved: https://github.com/facebook/react-native/pull/49025

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: cortinico, Abbondanzo

Differential Revision: D68842336

Pulled By: tdn120

fbshipit-source-id: c3062675b5535277970fd97490720739fc748f2a
2025-01-31 09:19:52 -08:00
Alex HuntandFacebook GitHub Bot cd78f44e58 Remove unused checkForGitChanges script (#49099)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49099

Changelog: [Internal]

Reviewed By: EdmondChuiHW

Differential Revision: D68960652

fbshipit-source-id: 138e83dfedef7ea717502a1e964eb802dae678c4
2025-01-31 09:18:31 -08:00
Nicola CortiandFacebook GitHub Bot d37a8d2830 Convert com.facebook.react.devsupport.inspector to Kotlin (#49087)
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
2025-01-31 07:50:28 -08:00
Dawid MałeckiandFacebook GitHub Bot 5c2153784d Create lint rule preventing uses of CommonJS exports (#49079)
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
2025-01-31 07:13:54 -08:00
Jakub PiaseckiandFacebook GitHub Bot c3ea606660 Align TextInput types with TypeScript (#48972)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48972

Changelog: [Internal]

Align TextInput types with TypeScript definitions.

Reviewed By: huntie

Differential Revision: D68713179

fbshipit-source-id: bb36d9333e45f2a30db91a17b8698b34cd792eb6
2025-01-31 04:54:42 -08:00
Jakub PiaseckiandFacebook GitHub Bot e815fdae53 Align TextInput event types with TypeScript (#48971)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48971

Changelog: [Internal]

Mosltly align event types of TextInput components with TypeScript definitions.

Reviewed By: mellyeliu, thatmichael85

Differential Revision: D68713180

fbshipit-source-id: d8e9c0458466ef492fecf516fd58bc5459b35e26
2025-01-31 04:54:42 -08:00
Alex HuntandFacebook GitHub Bot 21541b51b3 Apply stripPrivateProperties transform to public-api-test (#49064)
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
2025-01-31 04:27:13 -08:00
Rubén NorteandFacebook GitHub Bot 3d4906e7ec Optimize data structure to store listeners in EventTarget (#48964)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48964

Changelog: [internal]

This replaces the data structure used to store listeners in `EventTarget`, from a map of arrays to a map of maps.

This essentially optimizes listener registration/deregistraton at the expense of event dispatching. Given that it'll be common to have many nodes registering to events that are never dispatched, this might be the right trade-off.

* Before:

| (index) | Task name                                                             | Latency average (ns)  | Latency median (ns)    | Throughput average (ops/s) | Throughput median (ops/s) | Samples |
| ------- | --------------------------------------------------------------------- | --------------------- | ---------------------- | -------------------------- | ------------------------- | ------- |
| 0       | 'dispatchEvent, no bubbling, no listeners'                            | '4624.68 ± 0.49%'     | '4570.00'              | '218089 ± 0.02%'           | '218818'                  | 216232  |
| 1       | 'dispatchEvent, no bubbling, single listener'                         | '5771.34 ± 0.99%'     | '5670.00'              | '175389 ± 0.02%'           | '176367'                  | 173270  |
| 2       | 'dispatchEvent, no bubbling, multiple listeners'                      | '48207.35 ± 1.18%'    | '47290.00'             | '20964 ± 0.04%'            | '21146'                   | 20744   |
| 3       | 'dispatchEvent, bubbling, no listeners'                               | '185005.29 ± 0.16%'   | '184060.00'            | '5410 ± 0.05%'             | '5433'                    | 5406    |
| 4       | 'dispatchEvent, bubbling, single listener per target'                 | '286630.57 ± 0.11%'   | '285560.00'            | '3491 ± 0.06%'             | '3502'                    | 3489    |
| 5       | 'dispatchEvent, bubbling, multiple listeners per target'              | '4435944.62 ± 0.27%'  | '4425840.00 ± 30.00'   | '226 ± 0.12%'              | '226'                     | 1000    |
| 6       | 'addEventListener, one listener'                                      | '1734.88 ± 0.57%'     | '1670.00'              | '594938 ± 0.01%'           | '598802'                  | 576411  |
| 7       | 'addEventListener, one target, one type, multiple listeners'          | '266031.11 ± 0.68%'   | '261810.00'            | '3781 ± 0.15%'             | '3820'                    | 3759    |
| 8       | 'addEventListener, one target, multiple types, one listener per type' | '124768.56 ± 0.39%'   | '121160.00'            | '8112 ± 0.16%'             | '8254'                    | 8015    |
| 9       | 'addEventListener, one target, multiple types, multiple listeners'    | '27141326.31 ± 0.15%' | '27298945.00 ± 115.00' | '37 ± 0.15%'               | '37'                      | 1000    |
| 10      | 'addEventListener, multiple targets, one type, one listener'          | '142646.24 ± 0.49%'   | '137460.00'            | '7123 ± 0.19%'             | '7275'                    | 7011    |

* After:

| (index) | Task name                                                             | Latency average (ns)  | Latency median (ns)   | Throughput average (ops/s) | Throughput median (ops/s) | Samples |
| ------- | --------------------------------------------------------------------- | --------------------- | --------------------- | -------------------------- | ------------------------- | ------- |
| 0       | 'dispatchEvent, no bubbling, no listeners'                            | '4518.27 ± 0.51%'     | '4460.00'             | '223269 ± 0.02%'           | '224215'                  | 221324  |
| 1       | 'dispatchEvent, no bubbling, single listener'                         | '6563.10 ± 0.98%'     | '6450.00'             | '154311 ± 0.02%'           | '155039'                  | 152367  |
| 2       | 'dispatchEvent, no bubbling, multiple listeners'                      | '65429.69 ± 0.25%'    | '64840.00'            | '15330 ± 0.05%'            | '15423'                   | 15284   |
| 3       | 'dispatchEvent, bubbling, no listeners'                               | '181104.21 ± 0.13%'   | '180300.00'           | '5525 ± 0.05%'             | '5546'                    | 5522    |
| 4       | 'dispatchEvent, bubbling, single listener per target'                 | '367231.05 ± 0.10%'   | '366035.00 ± 5.00'    | '2724 ± 0.07%'             | '2732'                    | 2724    |
| 5       | 'dispatchEvent, bubbling, multiple listeners per target'              | '6269141.58 ± 0.24%'  | '6253275.00 ± 155.00' | '160 ± 0.11%'              | '160'                     | 1000    |
| 6       | 'addEventListener, one listener'                                      | '1665.23 ± 0.51%'     | '1610.00'             | '618122 ± 0.01%'           | '621118'                  | 600517  |
| 7       | 'addEventListener, one target, one type, multiple listeners'          | '97724.12 ± 1.34%'    | '94640.00'            | '10433 ± 0.14%'            | '10566'                   | 10233   |
| 8       | 'addEventListener, one target, multiple types, one listener per type' | '116915.60 ± 0.54%'   | '113380.00'           | '8707 ± 0.17%'             | '8820'                    | 8554    |
| 9       | 'addEventListener, one target, multiple types, multiple listeners'    | '12276537.38 ± 0.42%' | '11924070.00 ± 10.00' | '82 ± 0.35%'               | '84'                      | 1000    |
| 10      | 'addEventListener, multiple targets, one type, one listener'          | '133307.67 ± 0.58%'   | '128340.00'           | '7666 ± 0.20%'             | '7792'                    | 7502    |

Reviewed By: rshest

Differential Revision: D68671944

fbshipit-source-id: 1a555ba9400e5830b4a56cdf12fd9418cd4a2a4f
2025-01-31 04:00:31 -08:00
Rubén NorteandFacebook GitHub Bot 1f8ace8cce Expand benchmarks for EventTarget to include perf for addEventListener (#49070)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49070

Changelog: [internal]

Adds benchmarks for `addEventListener` in benchmark file for `EventTarget`.

Baseline:

| (index) | Task name                                                             | Latency average (ns)  | Latency median (ns)    | Throughput average (ops/s) | Throughput median (ops/s) | Samples |
| ------- | --------------------------------------------------------------------- | --------------------- | ---------------------- | -------------------------- | ------------------------- | ------- |
| 0       | 'dispatchEvent, no bubbling, no listeners'                            | '4624.68 ± 0.49%'     | '4570.00'              | '218089 ± 0.02%'           | '218818'                  | 216232  |
| 1       | 'dispatchEvent, no bubbling, single listener'                         | '5771.34 ± 0.99%'     | '5670.00'              | '175389 ± 0.02%'           | '176367'                  | 173270  |
| 2       | 'dispatchEvent, no bubbling, multiple listeners'                      | '48207.35 ± 1.18%'    | '47290.00'             | '20964 ± 0.04%'            | '21146'                   | 20744   |
| 3       | 'dispatchEvent, bubbling, no listeners'                               | '185005.29 ± 0.16%'   | '184060.00'            | '5410 ± 0.05%'             | '5433'                    | 5406    |
| 4       | 'dispatchEvent, bubbling, single listener per target'                 | '286630.57 ± 0.11%'   | '285560.00'            | '3491 ± 0.06%'             | '3502'                    | 3489    |
| 5       | 'dispatchEvent, bubbling, multiple listeners per target'              | '4435944.62 ± 0.27%'  | '4425840.00 ± 30.00'   | '226 ± 0.12%'              | '226'                     | 1000    |
| 6       | 'addEventListener, one listener'                                      | '1734.88 ± 0.57%'     | '1670.00'              | '594938 ± 0.01%'           | '598802'                  | 576411  |
| 7       | 'addEventListener, one target, one type, multiple listeners'          | '266031.11 ± 0.68%'   | '261810.00'            | '3781 ± 0.15%'             | '3820'                    | 3759    |
| 8       | 'addEventListener, one target, multiple types, one listener per type' | '124768.56 ± 0.39%'   | '121160.00'            | '8112 ± 0.16%'             | '8254'                    | 8015    |
| 9       | 'addEventListener, one target, multiple types, multiple listeners'    | '27141326.31 ± 0.15%' | '27298945.00 ± 115.00' | '37 ± 0.15%'               | '37'                      | 1000    |
| 10      | 'addEventListener, multiple targets, one type, one listener'          | '142646.24 ± 0.49%'   | '137460.00'            | '7123 ± 0.19%'             | '7275'                    | 7011    |

Reviewed By: lenaic

Differential Revision: D68708145

fbshipit-source-id: b3f2f1f9e239856dcc9d8e699edf4ed2ada404dd
2025-01-31 04:00:31 -08:00
Dawid MałeckiandFacebook GitHub Bot 4ccb2f2aa2 Add transform that strips private properties in build types script (#49060)
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
2025-01-31 02:02:08 -08:00
Nicola CortiandFacebook GitHub Bot 64c2a52ca9 Remove unnecessary public keyword (#49062)
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
2025-01-30 14:13:57 -08:00
Nicola CortiandFacebook GitHub Bot 9afa3596cb Make DevSettingsActivity internal (#49073)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49073

This activity should be internal as it's exposed by ReactNative's Debug Manifest.
No need to have it public. I checked that there are no OSS usages of it:

https://www.google.com/url?q=https://github.com/search?type%3Dcode%26q%3DNOT%2Bis%253Afork%2BNOT%2Borg%253Afacebook%2BNOT%2Brepo%253Areact-native-tvos%252Freact-native-tvos%2BNOT%2Brepo%253Anuagoz%252Freact-native%2BNOT%2Brepo%253A2lambda123%252Freact-native%2BNOT%2Brepo%253Apvinis%252Freact-native---investigation%2BNOT%2Brepo%253Abeanchips%252Ffacebookreactnative%2BNOT%2Brepo%253AfabOnReact%252Freact-native-notes%2BNOT%2Buser%253Ahuntie%2Bcom.facebook.react.devsupport.DevSettingsActivity&sa=D&source=editors&ust=1738261498882961&usg=AOvVaw295OXKV-8dAbdsMTY5usSx

Changelog:
[Internal] [Changed] -

Reviewed By: mdvacca

Differential Revision: D68904656

fbshipit-source-id: b98b417e60a3e8ebba0c9946959ee43ea963b066
2025-01-30 12:21:54 -08:00
Alex HuntandFacebook GitHub Bot 9ba4dd81db Delete Libraries/JSInspector (#49019)
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
2025-01-30 11:30:05 -08:00
Jorge Cabiedes AcostaandFacebook GitHub Bot accde40e1b Fix gapbetween making backgroundColor render when width/height is 0 (#49074)
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
2025-01-30 11:04:19 -08:00
Vitali ZaidmanandFacebook GitHub Bot 566a45e28c adjust rntester readme to use "yarn prepare-ios" (#49067)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49067

## Changelog:

[Internal] [Fixed] - fixed rntester readme to guide users to launch the correct ios prepare command

Reviewed By: cipolleschi

Differential Revision: D68897627

fbshipit-source-id: 93d30b2728f452e27448d0ef468ee148296f2324
2025-01-30 08:45:24 -08:00
Iwo PlazaandFacebook GitHub Bot 8783196ee5 Migrate files in Libraries/EventEmitter and Libraries/Image to use export syntax (#49020)
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
2025-01-30 07:27:03 -08:00
Rubén NorteandFacebook GitHub Bot 82cc465645 Clean up disableEventLoopOnBridgeless feature flag (#49065)
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
2025-01-30 07:20:52 -08:00
Iwo PlazaandFacebook GitHub Bot 4101a2f0b6 Add compat layer for react-native-codegen and processColorArray (#49063)
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
2025-01-30 07:16:54 -08:00
Rubén NorteandFacebook GitHub Bot 105e3ab837 Implement additional traversal methods on ReactNativeDocument (#49013)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49013

Changelog: [internal]

Adds `Document`-specific traversal methods to `ReactNativeDocument`:
* `childElementCount`
* `children`
* `firstElementChild`
* `lastElementChild`

Reviewed By: yungsters

Differential Revision: D67693032

fbshipit-source-id: 1e3279586ece809c5c3584279c07f991cadf0fc6
2025-01-30 07:11:43 -08:00
Rubén NorteandFacebook GitHub Bot 2436e3ba84 Implement ReactNativeDocument (#49012)
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
2025-01-30 07:11:43 -08:00
Rubén NorteandFacebook GitHub Bot 3dab9c66ba Expose new method in Fabric renderer to access root instance from root tag (#49011)
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
2025-01-30 07:11:43 -08:00
Rubén NorteandFacebook GitHub Bot 8f7f3be9af Add support for document instance in React Native (#32260) (#49051)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49051

## Summary

We're adding support for `Document` instances in React Native (as
`ReactNativeDocument` instances) in
https://github.com/facebook/react-native/pull/49012 , which requires the
React Fabric renderer to handle its lifecycle.

This modifies the renderer to create those document instances and
associate them with the React root, and provides a new method for React
Native to access them given its containerTag / rootTag.

## How did you test this change?

Tested e2e in https://github.com/facebook/react-native/pull/49012
manually syncing these changes.

DiffTrain build for [b2357ecd8203341a3668a96d32d68dd519e5430d](https://github.com/facebook/react/commit/b2357ecd8203341a3668a96d32d68dd519e5430d)

Reviewed By: javache

Differential Revision: D68839346

fbshipit-source-id: 589ddce15d0f32ba3eab1c03306c405d38616723
2025-01-30 07:11:43 -08:00
Iwo PlazaandFacebook GitHub Bot 4d6785bdb5 Migrate LayoutAnimation and Linking libraries to use export syntax (#49021)
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
2025-01-30 07:07:08 -08:00
Alex HuntandFacebook GitHub Bot 45a2d9c5a8 Delete deprecated YellowBox API (#49061)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49061

Changelog:
[General][Breaking] - Remove deprecated `YellowBox` and `console.ignoredYellowBox` APIs. Use `LogBox`.

Reviewed By: cortinico, hezi

Differential Revision: D68893550

fbshipit-source-id: 5030a20a2d1a60ca37eaf928339b8dd5d5abaa27
2025-01-30 06:49:13 -08:00
Rubén NorteandFacebook GitHub Bot 252294bc76 Improve naming for benchmark suite options (#49014)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49014

Changelog: [internal]

Use better names for the Fantom benchmarking API than the ones defined in `tinybench`:
* `time` => `minDuration`
* `iterations` = `minIterations`
* `warmupTime` => `minWarmupDuration`
* `warmupIterations` => `minWarmupIterations`

Reviewed By: rshest

Differential Revision: D68710952

fbshipit-source-id: 05dc1145a72a50ea73de7ccbb08bb28d7975245f
2025-01-30 03:24:39 -08:00
Tommy NguyenandFacebook GitHub Bot ee8088b615 fix(dev-middleware): add missing invariant dependency (#49047)
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
2025-01-30 01:58:27 -08:00
David VaccaandFacebook GitHub Bot 40575f26d2 Internalize ReactBridge (#49049)
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
2025-01-29 17:32:25 -08:00
Erica KleinandFacebook GitHub Bot 04afbd90e6 Back out "Fabric: Fixes crash of dynamic color when light/dark mode changed" (#49054)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49054

Original commit changeset: 01959845b742

Original Phabricator Diff: D68157559

Reviewed By: javache

Differential Revision: D68861984

fbshipit-source-id: c2e6fcf5d626447bd658b047adbb64947c2a5266
2025-01-29 15:55:32 -08:00
Rubén NorteandFacebook GitHub Bot 2c406d8b49 Remove logged errors for feature flags not implemented in native when skipNativeAPI is used (#49050)
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
2025-01-29 12:17:45 -08:00
Rubén NorteandFacebook GitHub Bot 17c34295a1 Migrate mounting tests to Fantom (#49018)
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
2025-01-29 11:31:51 -08:00
Rubén NorteandFacebook GitHub Bot bb24ad0397 Print nativeID in debug props for Props (#49017)
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
2025-01-29 11:31:51 -08:00
Rubén NorteandFacebook GitHub Bot 9c521bb68c Improve format of mounting logs (#49016)
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
2025-01-29 11:31:51 -08:00
Rubén NorteandFacebook GitHub Bot fb9b476d12 Rename getMountingLogs as takeMountingManagerLogs (#49015)
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
2025-01-29 11:31:51 -08:00
Christoph PurrerandFacebook GitHub Bot 67981efa14 Fix Turbo Module example in RNTester in bridgeless mode (#49028)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49028

## Changelog: [General] [Fixed]] - Fix Turbo Module example in RNTester in bridgeless mode

Reviewed By: cortinico, philIip

Differential Revision: D68810934

fbshipit-source-id: 5eab0e72fe383974fe02747acd1683a995300d4d
2025-01-29 11:06:49 -08:00
Rubén NorteandFacebook GitHub Bot a8bf742f29 Unbreak Flow
Summary:
Changelog: [internal]

Fixes broken Flow check after some files were moved.

bypass-github-export-checks

Reviewed By: elicwhite

Differential Revision: D68844033

fbshipit-source-id: edf5bc58c5ce94ef5c089998b52a4bb72a2d3997
2025-01-29 11:05:03 -08:00
Rubén NorteandFacebook GitHub Bot ea1260accb Set up test to validate refactor of XHR, FileReader and WebSocket classes to use the built-in EventTarget implementation (#48930)
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
2025-01-29 10:06:08 -08:00
Rubén NorteandFacebook GitHub Bot d80284c607 Make some objects read-only in event-related APIs (#49045)
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
2025-01-29 10:06:08 -08:00
Rubén NorteandFacebook GitHub Bot 4ba0e79712 Refactor NetworkOverlay to use a symbol instead of a public property in XHR (#48928)
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
2025-01-29 10:06:08 -08:00
Alex HuntandFacebook GitHub Bot 389779c348 Move XHRInterceptor to src/private/inspector/ (#49023)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49023

Changelog:
[General][Breaking] - Move `XHRInterceptor` API to `src/private/`

Reviewed By: christophpurrer

Differential Revision: D68781897

fbshipit-source-id: af52f65b0f64da68a78babf326a1a9b8a1fc1d96
2025-01-29 09:56:54 -08:00
Alex HuntandFacebook GitHub Bot 0bde08fe67 Move Libraries/Inspector/ to src/private/ (#49022)
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
2025-01-29 09:56:54 -08:00
Ian ElliottandFacebook GitHub Bot 9a9aa19387 Upgrade cross-spawn to 7.0.5 (#48750)
Summary:
Bump cross-spawn 7.0.5

Pull Request resolved: https://github.com/facebook/react-native/pull/48750

Test Plan: Sandcastle

Reviewed By: huntie

Differential Revision: D68282390

Pulled By: ide-2

fbshipit-source-id: 1bc81b4fbda986c7820e214364dcc322f8729baa
2025-01-29 09:44:16 -08:00
Rubén NorteandFacebook GitHub Bot 8678d15892 Prepare ReactNativePrivateInterface for new React renderer calls to handle root/document nodes (#49010)
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
2025-01-29 09:39:49 -08:00
Rubén NorteandFacebook GitHub Bot 7cdc3d81ad Abstract away use of shadow nodes as native node references (#49009)
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
2025-01-29 09:39:49 -08:00
Rubén NorteandFacebook GitHub Bot 591b0ffc0e Add basic benchmarks for rendering views (#49008)
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
2025-01-29 09:39:49 -08:00
Rickard ZrinskiandFacebook GitHub Bot 97cf42f979 Fix maxFontSizeMultiplier prop on Text and TextInput components in new architecture (#47614)
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
2025-01-29 09:27:44 -08:00
Alex HuntandFacebook GitHub Bot 97ee93fd5a Add Content-Type header to dev server requests (#49042)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49042

Minor fix to align with adjacent `/open-stack-frame` call: https://fburl.com/code/o9rwbmxr.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D68830215

fbshipit-source-id: 87ef0c14bdedd34153014721b85bd24af24c1db7
2025-01-29 09:18:46 -08:00
Pieter De BaetsandFacebook GitHub Bot 26afc804b7 Error when tests finish with pending tasks (#49032)
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
2025-01-29 08:49:49 -08:00
Mateo GuzmánandFacebook GitHub Bot 2f6cb8ba08 Migrate com.facebook.react.uimanager.layoutanimation interfaces to Kotlin (#49026)
Summary:
Migrate com.facebook.react.uimanager.layoutanimation interfaces to Kotlin

## Changelog:

[INTERNAL] - Migrate com.facebook.react.uimanager.layoutanimation interfaces to Kotlin

Pull Request resolved: https://github.com/facebook/react-native/pull/49026

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: NickGerleman

Differential Revision: D68794415

Pulled By: Abbondanzo

fbshipit-source-id: 690d69e8360fb51eb0232b2ed2b4676e0d1a9ee6
2025-01-29 07:09:04 -08:00
Pieter De BaetsandFacebook GitHub Bot e4d1cf8ce9 Delete RawProps assignment operators (#49030)
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
2025-01-29 06:16:20 -08:00
Jakub PiaseckiandFacebook GitHub Bot 5d7fedacd0 Add flow definitions for Alert and align them with TypeScript (#49006)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49006

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D68774525

fbshipit-source-id: 509f26b0f5f0d309502681f3228ae519689d480a
2025-01-29 05:36:53 -08:00
Jakub PiaseckiandFacebook GitHub Bot 8058aab0d6 Ignore implementation files when .flow.js file exists during type translation (#49039)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49039

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D68774523

fbshipit-source-id: 07776e7e0d551e3bad5a30eff1de8a76769e5761
2025-01-29 05:36:53 -08:00
Jakub PiaseckiandFacebook GitHub Bot df6be9f665 Use alert to test type generation prototype (#49038)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49038

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D68774524

fbshipit-source-id: 791da64babebc8d08f671262fa63f67aff2c0942
2025-01-29 05:36:53 -08:00
Pieter De BaetsandFacebook GitHub Bot 90c6f7eab8 Fix ScrollEvent DebugStringCovertible (#49029)
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
2025-01-29 05:05:04 -08:00
Nicola CortiandFacebook GitHub Bot 6307fe869f Remove unused methods from TurboModulePerfLogger (#49033)
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
2025-01-29 05:04:27 -08:00
Nicola CortiandFacebook GitHub Bot 71d39c5cfd Migrate TurboModulePerfLogger to Kotlin + internalize it. (#49034)
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
2025-01-29 05:04:27 -08:00
Iwo PlazaandFacebook GitHub Bot e767dc3458 Migrate files in Libraries/Lists to export syntax (#49024)
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
2025-01-29 04:15:30 -08:00
Ruslan LesiutinandFacebook GitHub Bot dd240edd6d Explicitly check that Debugger domain is disabled before starting Tracing (#49007)
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
2025-01-29 03:51:58 -08:00
Nicola CortiandFacebook GitHub Bot bd050ac191 Remove unused FallbackJSBundleLoader (#49005)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49005

This is essentially dead code. Not used at all but publicly exposed.
I found no meaningful usages in OSS so this is safe to remove:
https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Apvinis%2Freact-native---investigation+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+com.facebook.react.bridge.FallbackJSBundleLoader

Changelog:
[Internal] [Changed] -

Reviewed By: mdvacca

Differential Revision: D68773273

fbshipit-source-id: 96a028cb0caf95ee899db1488dbf5ae82cc567f9
2025-01-29 03:51:35 -08:00
Fabrizio CucciandFacebook GitHub Bot 7377d57874 Add changelog entry for v0.78.0-rc.2 (#49031)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49031

As per title.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D68826401

fbshipit-source-id: ce2d6d95f41d6ce9059dbbba1fecd991fbafd0f3
2025-01-29 03:44:53 -08:00
Nick GerlemanandFacebook GitHub Bot 8e2de303e3 Disallow invalid unitless lengths in box shadows (#48988)
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
2025-01-28 22:47:40 -08:00
Nick GerlemanandFacebook GitHub Bot 3b5dc5626b Fix some CSSRatio Behavior (#48984)
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
2025-01-28 17:38:50 -08:00
Nolan O'BrienandFacebook GitHub Bot 2ed0ba0722 Improve definitions in METAXXHashUtils (#49027)
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
2025-01-28 16:35:40 -08:00
Nicola CortiandFacebook GitHub Bot d797b7aa4d Minor Kotlin cleanup (#49000)
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
2025-01-28 11:37:53 -08:00
Iwo PlazaandFacebook GitHub Bot c93bd436a5 Migrate Libraries/ReactNative/*.js to use export syntax. (#48650)
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
2025-01-28 11:21:55 -08:00
zhongwuzwandFacebook GitHub Bot cbaff1c7aa Fabric: Fixes crash of dynamic color when light/dark mode changed (#48496)
Summary:
The reason is when light/dark mode changed, the `hash` value also changed because we used `color.getColor()`. leads to size balanced break.

```
Assertion failed: (index_.size() == lru_.size()), function size, file EvictingCacheMap.h, line 439.

(lldb) bt
* thread https://github.com/facebook/react-native/issues/1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
    frame #0: 0x00000001089a9108 libsystem_kernel.dylib`__pthread_kill + 8
    frame https://github.com/facebook/react-native/issues/1: 0x0000000105de3408 libsystem_pthread.dylib`pthread_kill + 256
    frame https://github.com/facebook/react-native/issues/2: 0x000000018016c4ec libsystem_c.dylib`abort + 104
    frame https://github.com/facebook/react-native/issues/3: 0x000000018016b934 libsystem_c.dylib`__assert_rtn + 268
  * frame https://github.com/facebook/react-native/issues/4: 0x00000001073e386c React_FabricComponents`folly::EvictingCacheMap<facebook::react::AttributedString, std::__1::shared_ptr<void>, folly::HeterogeneousAccessHash<facebook::react::AttributedString, void>, folly::HeterogeneousAccessEqualTo<facebook::react::AttributedString, void>>::size(this=0x0000600003900348) const at EvictingCacheMap.h:439:5
    frame https://github.com/facebook/react-native/issues/5: 0x00000001073e34f4 React_FabricComponents`void folly::EvictingCacheMap<facebook::react::AttributedString, std::__1::shared_ptr<void>, folly::HeterogeneousAccessHash<facebook::react::AttributedString, void>, folly::HeterogeneousAccessEqualTo<facebook::react::AttributedString, void>>::setImpl<facebook::react::AttributedString>(this=0x0000600003900348, key=0x000000016b9f20a8, value=nullptr, promote=true, pruneHook=folly::EvictingCacheMap<facebook::react::AttributedString, std::__1::shared_ptr<void>, folly::HeterogeneousAccessHash<facebook::react::AttributedString, void>, folly::HeterogeneousAccessEqualTo<facebook::react::AttributedString, void> >::PruneHookCall @ 0x000000016b9f1cc8) at EvictingCacheMap.h:674:27
    frame https://github.com/facebook/react-native/issues/6: 0x00000001073deb88 React_FabricComponents`folly::EvictingCacheMap<facebook::react::AttributedString, std::__1::shared_ptr<void>, folly::HeterogeneousAccessHash<facebook::react::AttributedString, void>, folly::HeterogeneousAccessEqualTo<facebook::react::AttributedString, void>>::set(this=0x0000600003900348, key=0x000000016b9f20a8, value=ptr = 0x60000024ae20 strong=2 weak=1, promote=true, pruneHook=folly::EvictingCacheMap<facebook::react::AttributedString, std::__1::shared_ptr<void>, folly::HeterogeneousAccessHash<facebook::react::AttributedString, void>, folly::HeterogeneousAccessEqualTo<facebook::react::AttributedString, void> >::PruneHookCall @ 0x000000016b9f1d98) at EvictingCacheMap.h:346:5
    frame https://github.com/facebook/react-native/issues/7: 0x00000001073d91dc React_FabricComponents`facebook::react::SimpleThreadSafeCache<facebook::react::AttributedString, std::__1::shared_ptr<void>, 256>::get(this=0x0000600003900348, key=0x000000016b9f20a8, generator= Lambda in File RCTTextLayoutManager.mm at Line 337) const at SimpleThreadSafeCache.h:40:12
    frame https://github.com/facebook/react-native/issues/8: 0x00000001073d9058 React_FabricComponents`-[RCTTextLayoutManager _nsAttributedStringFromAttributedString:](self=0x0000600003900340, _cmd="_nsAttributedStringFromAttributedString:", attributedString=AttributedString @ 0x000000016b9f20a8) at RCTTextLayoutManager.mm:337:42
    frame https://github.com/facebook/react-native/issues/9: 0x00000001073d6378 React_FabricComponents`-[RCTTextLayoutManager drawAttributedString:paragraphAttributes:frame:drawHighlightPath:](self=0x0000600003900340, _cmd="drawAttributedString:paragraphAttributes:frame:drawHighlightPath:", attributedString=AttributedString @ 0x000000016b9f23a8, paragraphAttributes=ParagraphAttributes @ 0x000000016b9f2378, frame=(origin = (x = 0, y = 0), size = (width = 92, height = 21.666748046875)), block=0x00000001061602d0) at RCTTextLayoutManager.mm:73:56
    frame https://github.com/facebook/react-native/issues/10: 0x000000010616020c RCTFabric`-[RCTParagraphTextView drawRect:](self=0x000000012beb9dc0, _cmd="drawRect:", rect=(origin = (x = 0, y = 0.000081380208335701809), size = (width = 92, height = 21.666666666666664))) at RCTParagraphComponentView.mm:346:3
    frame https://github.com/facebook/react-native/issues/11: 0x0000000186043e60 UIKitCore`-[UIView(CALayerDelegate) drawLayer:inContext:] + 584
    frame https://github.com/facebook/react-native/issues/12: 0x000000018af40080 QuartzCore`CABackingStoreUpdate_ + 244
    frame https://github.com/facebook/react-native/issues/13: 0x000000018b0bec88 QuartzCore`invocation function for block in CA::Layer::display_() + 108
    frame https://github.com/facebook/react-native/issues/14: 0x000000018b0b5524 QuartzCore`-[CALayer _display] + 1596
    frame https://github.com/facebook/react-native/issues/15: 0x000000018b0c7e74 QuartzCore`CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 392
    frame https://github.com/facebook/react-native/issues/16: 0x000000018affca50 QuartzCore`CA::Context::commit_transaction(CA::Transaction*, double, double*) + 464
    frame https://github.com/facebook/react-native/issues/17: 0x000000018b02b260 QuartzCore`CA::Transaction::commit() + 652
    frame https://github.com/facebook/react-native/issues/18: 0x000000018b02c7b4 QuartzCore`CA::Transaction::flush_as_runloop_observer(bool) + 68
    frame https://github.com/facebook/react-native/issues/19: 0x0000000185ad6c1c UIKitCore`_UIApplicationFlushCATransaction + 48
    frame https://github.com/facebook/react-native/issues/20: 0x0000000185a07ccc UIKitCore`__setupUpdateSequence_block_invoke_2 + 352
    frame https://github.com/facebook/react-native/issues/21: 0x000000018505d28c UIKitCore`_UIUpdateSequenceRun + 76
    frame https://github.com/facebook/react-native/issues/22: 0x0000000185a07670 UIKitCore`schedulerStepScheduledMainSection + 168
    frame https://github.com/facebook/react-native/issues/23: 0x0000000185a06aa8 UIKitCore`runloopSourceCallback + 80
    frame https://github.com/facebook/react-native/issues/24: 0x000000018041b7c4 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
    frame https://github.com/facebook/react-native/issues/25: 0x000000018041b70c CoreFoundation`__CFRunLoopDoSource0 + 172
    frame https://github.com/facebook/react-native/issues/26: 0x000000018041ae70 CoreFoundation`__CFRunLoopDoSources0 + 232
    frame https://github.com/facebook/react-native/issues/27: 0x00000001804153b4 CoreFoundation`__CFRunLoopRun + 788
    frame https://github.com/facebook/react-native/issues/28: 0x0000000180414c24 CoreFoundation`CFRunLoopRunSpecific + 552
    frame https://github.com/facebook/react-native/issues/29: 0x000000019020ab10 GraphicsServices`GSEventRunModal + 160
    frame https://github.com/facebook/react-native/issues/30: 0x0000000185ad82fc UIKitCore`-[UIApplication _run] + 796
    frame https://github.com/facebook/react-native/issues/31: 0x0000000185adc4f4 UIKitCore`UIApplicationMain + 124
    frame https://github.com/facebook/react-native/issues/32: 0x0000000104521f68 RNTester.debug.dylib`main(argc=1, argv=0x000000016b9f5af8) at main.m:15:12
    frame https://github.com/facebook/react-native/issues/33: 0x00000001045b9410 dyld_sim`start_sim + 20
    frame https://github.com/facebook/react-native/issues/34: 0x0000000104796274 dyld`start + 2840
```

## Changelog:

[IOS] [FIXED] - Fabric: Fixes crash of dynamic color when light/dark mode changed

Pull Request resolved: https://github.com/facebook/react-native/pull/48496

Test Plan:
RNTester -> PlatformColor example -> changed the dark/light mode  in the system settings -> go back to App and pop and push the PlatformColor example, it would crash:

![Simulator Screen Recording - iPhone 16 - 2025-01-05 at 15 46 08](https://github.com/user-attachments/assets/f6faaf80-ad03-49c6-9a56-b1117bdc2659)

Reviewed By: sammy-SC

Differential Revision: D68157559

Pulled By: cipolleschi

fbshipit-source-id: 01959845b742ce748186d3877b2792f0f9132ff5
2025-01-28 11:20:18 -08:00
Vitali ZaidmanandFacebook GitHub Bot ff2e40371e don't inline sourceMapURL in Debugger.scriptParsed (#49001)
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
2025-01-28 11:09:32 -08:00
Nicola CortiandFacebook GitHub Bot 362a191aee Convert CxxCallbackImpl to Kotlin (#49004)
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
2025-01-28 11:01:59 -08:00
Iwo PlazaandFacebook GitHub Bot 156ee5bee7 Migrate StyleSheet/processColorArray.js to use export syntax (#48905)
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
2025-01-28 09:46:50 -08:00
Iwo PlazaandFacebook GitHub Bot aac312da8e Migrate DrawerAndroid, ProgressBarAndroid, SafeAreaView, ScrollView, TextInput, ToastAndroid, UnimplementedView and View components to export syntax (#48807)
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
2025-01-28 09:06:57 -08:00
Ruslan LesiutinandFacebook GitHub Bot 600d814381 Update debugger-frontend from 7727db8...d126cc8 (#48979)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48979

Changelog: [Internal] - Update `react-native/debugger-frontend` from 7727db8...d126cc8

Resyncs `react-native/debugger-frontend` from GitHub - see `rn-chrome-devtools-frontend` [changelog](https://github.com/facebookexperimental/rn-chrome-devtools-frontend/compare/7727db85ac767cf41cce3e9ee54d27e97b2637f9...d126cc87f2b61e12e9579ddbfd4c0eb516bce881).

Reviewed By: huntie

Differential Revision: D68717476

fbshipit-source-id: ac2fd0551b069ae9077646ecb6b22f066e3e567c
2025-01-28 08:36:10 -08:00
Ruslan LesiutinandFacebook GitHub Bot 07860545f5 Roll out 6.1.0 on fbsource (#48963)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48963

# Changelog:
[General] [Changed] - upgrade React DevTools to 6.1.0.

allow-large-files

Reviewed By: robhogan

Differential Revision: D68705543

fbshipit-source-id: 293034cc3e4cb93fed6a05df905ee63ea5382562
2025-01-28 08:36:10 -08:00
Dawid MałeckiandFacebook GitHub Bot 89af3e804f Add explicit type for Symbol.iterator in URLSearchParams (#48999)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48999

Changelog:
[General][Changed] - Added explicit type for Symbol.iterator in URLSearchParams

Reviewed By: cortinico

Differential Revision: D68766996

fbshipit-source-id: 47aeed737134628b838e9382b04e0bb95513bee0
2025-01-28 08:07:13 -08:00
Rubén NorteandFacebook GitHub Bot c925872e72 Throw an error when calling root.render outside of a task (#49003)
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
2025-01-28 07:26:23 -08:00
Cedric van PuttenandFacebook GitHub Bot 32fe244744 fix(react-native): pass the protocol from bundle URL to HMR client on Android (#48998)
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
2025-01-28 07:20:32 -08:00
Alex HuntandFacebook GitHub Bot bb1e3cdb04 Update cli-server-api middleware imports (#48997)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48997

Follows https://github.com/react-native-community/cli/pull/2584.

- Also add FIXME comment flagging potential core APIs gap without CLI.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D68766565

fbshipit-source-id: 60747715f76c4323e306c39ab0613fb4818b4914
2025-01-28 07:11:13 -08:00
Eric RozellandFacebook GitHub Bot 037504cc7b Fix durability of PerformanceObserver mark/measure example (#48940)
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
2025-01-28 07:08:11 -08:00
Iwo PlazaandFacebook GitHub Bot 48d900b703 Migrate files in Libraries/Inspector to use export syntax (#48931)
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
2025-01-28 06:13:07 -08:00
Mateo GuzmánandFacebook GitHub Bot 9572bcf028 Add OkHttpClientProvider tests (#48958)
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
2025-01-28 06:04:05 -08:00
VidocqHandFacebook GitHub Bot 2ae45ec3ce fix TextInput dataDetectorTypes (#48952)
Summary:
Setting `dataDetectorTypes` has no effect. As I am new to the react native codebase, it seems like `dataDetectorTypes` has not implemented on new arch yet.

issue: https://github.com/facebook/react-native/issues/48951

## Changelog:

[IOS] [FIXED] - implement `dataDetectorTypes` in the same way as the old architecture

Pull Request resolved: https://github.com/facebook/react-native/pull/48952

Test Plan: <img width="356" alt="image" src="https://github.com/user-attachments/assets/192a683c-f7b7-48ac-98cd-76866901f008" />

Reviewed By: javache

Differential Revision: D68715166

Pulled By: cipolleschi

fbshipit-source-id: 612119e7453da012e6f75e1fc3a22ddedcb569a4
2025-01-28 05:07:26 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 98b8f17811 Add extra parameter to define whether codegen is invoked by lib or app (#48995)
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
2025-01-28 05:06:54 -08:00
Nicola CortiandFacebook GitHub Bot 08ddc11269 Stable API - Refactor and remove unnecessary RuntimeConfig (#48934)
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
2025-01-28 04:58:35 -08:00
Alex HuntandFacebook GitHub Bot 514ec4192f Remove hanging reference to Remote Debugging endpoint on Android (#48996)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48996

Follows https://github.com/react-native-community/discussions-and-proposals/discussions/872.

Changelog:
[Android][Removed] - Remove `DevSupportManagerFactory.launchJSDevtools` API

Reviewed By: hoxyq

Differential Revision: D68766564

fbshipit-source-id: a9dad3a81ecc3fc03f056d4ccac8aa3e489cf242
2025-01-28 04:55:49 -08:00
CHOIMINSEOKandFacebook GitHub Bot 541e655832 fix wrong cocoapods script on new_architecture.rb (#48992)
Summary:
It seems that the `new_architecture.rb` script has an incorrect dependency configuration. The decision to install either “hermes-engine” or “React-jsc” should depend on whether Hermes is enabled or not. However, in the current `new_architecture.rb` setup, the build script toggles between “hermes-engine” and “React-jsi”.

```
        if ENV["USE_HERMES"] == nil || ENV["USE_HERMES"] == "1"
            spec.dependency "hermes-engine"
        else
            spec.dependency "React-jsi" // <=  this must be "React-jsc", not "React-jsi"
        end
```
https://github.com/facebook/react-native/blob/701622506248022c3a2fcea1c0066bba6e80232a/packages/react-native/scripts/cocoapods/new_architecture.rb#L141

When you try to use reanimated in brownfield app, you can reproduce runtime exception by this.

Reproduce Repo: https://github.com/CHOIMINSEOK/FullScreenOverlayIssue
script patch for this issue : https://github.com/CHOIMINSEOK/FullScreenOverlayIssue/blob/main/rn-app/.yarn/patches/react-native-reanimated-npm-3.16.7-1e7cd6d376.patch

## Changelog:

[IOS] [FIXED] - fix wrong cocoapods script on new_architecture.rb

Pull Request resolved: https://github.com/facebook/react-native/pull/48992

Test Plan: I have no idea how to test regression.

Reviewed By: cortinico

Differential Revision: D68763630

Pulled By: cipolleschi

fbshipit-source-id: 7c2a0ea48815be5d77be7ed7aceed6a5bf574349
2025-01-28 04:53:23 -08:00
zhongwuzwandFacebook GitHub Bot c8f1506f13 Clean up RCTBridgeDelegate to remove shouldBridgeUseCustomJSC method (#48948)
Summary:
`shouldBridgeUseCustomJSC` comes from https://github.com/zhongwuzw/react-native/commit/cb3e575deb8a2be972298b12761ed9ee8f0ae63d, seems it's not working anymore. So we can clean up it .

## Changelog:

[IOS] [REMOVED] - Clean up RCTBridgeDelegate to remove shouldBridgeUseCustomJSC method

Pull Request resolved: https://github.com/facebook/react-native/pull/48948

Test Plan: Everything should works.

Reviewed By: christophpurrer

Differential Revision: D68728588

Pulled By: javache

fbshipit-source-id: 8a762b5f3d6272fa7be57e0b17cb655eba743b5d
2025-01-28 04:37:37 -08:00
Rubén NorteandFacebook GitHub Bot e8eae9448f Remove expected ESLint error (#48980)
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
2025-01-28 03:32:15 -08:00
Mateo GuzmánandFacebook GitHub Bot 7016225062 Sync Modal system bars visibility with current activity (#48516)
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
2025-01-27 18:02:46 -08:00
Dmitry RykunandFacebook GitHub Bot 409047bb6d Remove some code duplication in ConcreteComponentDescriptor::cloneProps (#48938)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48938

Simple cleanup. Move the instantiation of shadowNodeProps outside of the IF statement.

Changelog: [Internal]

Reviewed By: philIip

Differential Revision: D68634269

fbshipit-source-id: 40a103060fc96a5c74c7d81f7d6e8ac0565948c8
2025-01-27 16:24:27 -08:00
Jorge Cabiedes AcostaandFacebook GitHub Bot f8d5e3b3f0 Fix innerBoxShadows not getting border-radius applied (#48983)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48983

tsia

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D68734160

fbshipit-source-id: 05edb5c1f97353517ade58ca690d58cbe4bd1068
2025-01-27 16:03:13 -08:00
Jorge Cabiedes AcostaandFacebook GitHub Bot f7d78f81cc Fix elevation with border-radius set (#48982)
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
2025-01-27 14:41:16 -08:00
Pieter De BaetsandFacebook GitHub Bot 6e9a4627c4 Revert D68711137: fix(react-native): pass the protocol from bundle URL to HMR client on Android
Differential Revision:
D68711137

Original commit changeset: 230c1c91c818

Original Phabricator Diff: D68711137

fbshipit-source-id: 00cc23468596d8b75800d7dd388b2c51518d79e6
2025-01-27 14:41:14 -08:00
Nick GerlemanandFacebook GitHub Bot 9aae84a688 Remove some web debugging remnants (#48054)
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
2025-01-27 14:40:33 -08:00
zhongwuzwandFacebook GitHub Bot 3e2e8ec757 Bridge: Fixes HostTarget use after free when deallocated bridge (#48847)
Summary:
Fixes https://github.com/facebook/react-native/issues/48805 .

## Changelog:

[IOS] [FIXED] - Bridge: Fixes HostTarget use after free when deallocated bridge

Pull Request resolved: https://github.com/facebook/react-native/pull/48847

Test Plan:
Test code:
```
  __weak RCTAlertManager *weakModule;
  autoreleasepool {
    RCTAlertManager *module = [RCTAlertManager new];
    RCTBridge *bridge = [[RCTBridge alloc] initWithBundleURL:[self sourceURLForBridge:nil]
                                              moduleProvider:^{
      return @[ module ];
    }
                                               launchOptions:nil];
    weakModule = module;
    (void)bridge;
  }
```

Reviewed By: realsoelynn

Differential Revision: D68495576

Pulled By: huntie

fbshipit-source-id: c3086a429f24488ac286ff22d039b8f049ccbffd
2025-01-27 12:15:37 -08:00
Nick GerlemanandFacebook GitHub Bot 1593142648 Support parsing hwb() functions (#48913)
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
2025-01-27 12:07:21 -08:00
Nick GerlemanandFacebook GitHub Bot 676359efd9 Breaking: Remove incorrect hwb() syntax support from normalize-color (#48912)
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
2025-01-27 12:07:21 -08:00
Christoph PurrerandFacebook GitHub Bot a419315543 Use uint32_t for httpStatus (#48946)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48946

[Changelog] [Internal] - [jsinspector-modern] Use uint32_t for httpStatus

Reviewed By: hoxyq

Differential Revision: D68676415

fbshipit-source-id: 748a2167fa695151095b74cf901f13951f28b0fa
2025-01-27 11:51:13 -08:00
Alex HuntandFacebook GitHub Bot 45cd63c259 Back out "Migrate Libraries/Utilities/*.js to use export syntax." (#48976)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48976

Changelog: [Internal] - Will reattempt

Differential Revision: D68713280

fbshipit-source-id: 069d7dfd9846ab6272865b83163e772a6b17936a
2025-01-27 11:18:56 -08:00
Tim YungandFacebook GitHub Bot 50b75a74d1 Animated: Setup scheduleAnimatedCleanupInMicrotask Feature Flag (#48878)
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
2025-01-27 11:04:34 -08:00
Riccardo CipolleschiandFacebook GitHub Bot e77fe5c471 Bump React Native monorepo packages (#48975)
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
2025-01-27 11:01:34 -08:00
Samuel SuslaandFacebook GitHub Bot 6acd541f94 disable failing Differentiator test (#48973)
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
2025-01-27 10:24:20 -08:00
Nicola CortiandFacebook GitHub Bot a08a6c9adc Remove unnecessary visiblity modifiers for internal classes (#48968)
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
2025-01-27 10:17:31 -08:00
Cedric van PuttenandFacebook GitHub Bot ba894c908a fix(react-native): pass the protocol from bundle URL to HMR client on Android (#48970)
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
2025-01-27 09:43:55 -08:00
Nicola CortiandFacebook GitHub Bot e05a2735cd Add Changelog for 0.74.7 (#48974)
Summary:
Changelog for 0.74.7

## Changelog:

[Internal] [Changed] -

Pull Request resolved: https://github.com/facebook/react-native/pull/48974

Test Plan: N/A

Reviewed By: cipolleschi

Differential Revision: D68714820

Pulled By: cortinico

fbshipit-source-id: 42ee0e2cb83cf2ee16161468d1127fa2a8cc73bb
2025-01-27 09:37:04 -08:00
Håkon KnutzenandFacebook GitHub Bot 2a18d83521 Make RCTDeviceInfo._invalidated std::atomic<BOOL> (#48890)
Summary:
When running the tests associated with `RNTestPods` with `TSan` enabled, I get a data race:

```
WARNING: ThreadSanitizer: data race (pid=28047)
  Read of size 1 at 0x000144c30be9 by thread T32:
    #0 -[RCTDeviceInfo invalidate] <null> (RNTesterUnitTests:arm64+0x434bf8)
    https://github.com/facebook/react-native/issues/1 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ <null> (CoreFoundation:arm64+0x5e7fc)
    https://github.com/facebook/react-native/issues/2 decltype(std::declval<void () block_pointer __strong&>()()) std::__1::__invoke[abi:de180100]<void () block_pointer __strong&>(&&, decltype(std::declval<void () block_pointer __strong&>()())&&...) <null> (RNTesterUnitTests:arm64+0x2a19d4)
    https://github.com/facebook/react-native/issues/3 std::__1::__function::__func<void () block_pointer __strong, std::__1::allocator<std::__1::allocator>, void ()>::operator()() <null> (RNTesterUnitTests:arm64+0x2a16ec)
    https://github.com/facebook/react-native/issues/4 std::__1::__function::__value_func<void ()>::operator()[abi:de180100]() const <null> (RNTesterUnitTests:arm64+0x2455d4)
    https://github.com/facebook/react-native/issues/5 std::__1::function<void ()>::operator()() const <null> (RNTesterUnitTests:arm64+0x245404)
    https://github.com/facebook/react-native/issues/6 facebook::react::tryAndReturnError(std::__1::function<void ()> const&) <null> (RNTesterUnitTests:arm64+0x2c85b4)
    https://github.com/facebook/react-native/issues/7 -[RCTCxxBridge _tryAndHandleError:] <null> (RNTesterUnitTests:arm64+0x27c9e8)
    https://github.com/facebook/react-native/issues/8 __NSThreadPerformPerform <null> (Foundation:arm64+0x76c5e8)
    https://github.com/facebook/react-native/issues/9 __NSThread__start__ <null> (Foundation:arm64+0x76c27c)

  Previous write of size 1 at 0x000144c30be9 by thread T30:
    #0 -[RCTDeviceInfo invalidate] <null> (RNTesterUnitTests:arm64+0x434c1c)
    https://github.com/facebook/react-native/issues/1 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ <null> (CoreFoundation:arm64+0x5e7fc)
    https://github.com/facebook/react-native/issues/2 decltype(std::declval<void () block_pointer __strong&>()()) std::__1::__invoke[abi:de180100]<void () block_pointer __strong&>(&&, decltype(std::declval<void () block_pointer __strong&>()())&&...) <null> (RNTesterUnitTests:arm64+0x2a19d4)
    https://github.com/facebook/react-native/issues/3 std::__1::__function::__func<void () block_pointer __strong, std::__1::allocator<std::__1::allocator>, void ()>::operator()() <null> (RNTesterUnitTests:arm64+0x2a16ec)
    https://github.com/facebook/react-native/issues/4 std::__1::__function::__value_func<void ()>::operator()[abi:de180100]() const <null> (RNTesterUnitTests:arm64+0x2455d4)
    https://github.com/facebook/react-native/issues/5 std::__1::function<void ()>::operator()() const <null> (RNTesterUnitTests:arm64+0x245404)
    https://github.com/facebook/react-native/issues/6 facebook::react::tryAndReturnError(std::__1::function<void ()> const&) <null> (RNTesterUnitTests:arm64+0x2c85b4)
    https://github.com/facebook/react-native/issues/7 -[RCTCxxBridge _tryAndHandleError:] <null> (RNTesterUnitTests:arm64+0x27c9e8)
    https://github.com/facebook/react-native/issues/8 __NSThreadPerformPerform <null> (Foundation:arm64+0x76c5e8)
    https://github.com/facebook/react-native/issues/9 __NSThread__start__ <null> (Foundation:arm64+0x76c27c)

  Location is heap block of size 48 at 0x000144c30bd0 allocated by main thread:
    #0 calloc <null> (libclang_rt.tsan_iossim_dynamic.dylib:arm64+0x53b90)
    https://github.com/facebook/react-native/issues/1 _malloc_type_calloc_outlined <null> (libsystem_malloc.dylib:arm64+0xf8dc)
    https://github.com/facebook/react-native/issues/2 -[RCTModuleData setUpInstanceAndBridge:] <null> (RNTesterUnitTests:arm64+0x32715c)
    https://github.com/facebook/react-native/issues/3 __25-[RCTModuleData instance]_block_invoke <null> (RNTesterUnitTests:arm64+0x32a288)
    https://github.com/facebook/react-native/issues/4 RCTUnsafeExecuteOnMainQueueSync <null> (RNTesterUnitTests:arm64+0x3d6e1c)
    https://github.com/facebook/react-native/issues/5 -[RCTModuleData instance] <null> (RNTesterUnitTests:arm64+0x329d78)
    https://github.com/facebook/react-native/issues/6 __49-[RCTCxxBridge _prepareModulesWithDispatchGroup:]_block_invoke <null> (RNTesterUnitTests:arm64+0x287e74)
    https://github.com/facebook/react-native/issues/7 __wrap_dispatch_group_async_block_invoke <null> (libclang_rt.tsan_iossim_dynamic.dylib:arm64+0x7cffc)
    https://github.com/facebook/react-native/issues/8 _dispatch_client_callout <null> (libdispatch.dylib:arm64+0x3c04)
    https://github.com/facebook/react-native/issues/9 __70-[XCTestCase _shouldContinueAfterPerformingSetUpSequenceWithSelector:]_block_invoke.136 <null> (XCTestCore:arm64+0x2d068)

  Thread T32 (tid=4154385, running) created by main thread at:
    #0 pthread_create <null> (libclang_rt.tsan_iossim_dynamic.dylib:arm64+0x3027c)
    https://github.com/facebook/react-native/issues/1 -[NSThread startAndReturnError:] <null> (Foundation:arm64+0x76bec4)
    https://github.com/facebook/react-native/issues/2 -[RCTBridge setUp] <null> (RNTesterUnitTests:arm64+0x23d638)
    https://github.com/facebook/react-native/issues/3 -[RCTBridge initWithDelegate:bundleURL:moduleProvider:launchOptions:] <null> (RNTesterUnitTests:arm64+0x23addc)
    https://github.com/facebook/react-native/issues/4 -[RCTBridge initWithBundleURL:moduleProvider:launchOptions:] <null> (RNTesterUnitTests:arm64+0x23aa4c)
    https://github.com/facebook/react-native/issues/5 -[RCTImageLoaderTests testImageLoaderUsesImageDecoderWithHighestPriority] <null> (RNTesterUnitTests:arm64+0xc578)
    https://github.com/facebook/react-native/issues/6 __invoking___ <null> (CoreFoundation:arm64+0x132cdc)

  Thread T30 (tid=4154383, running) created by main thread at:
    #0 pthread_create <null> (libclang_rt.tsan_iossim_dynamic.dylib:arm64+0x3027c)
    https://github.com/facebook/react-native/issues/1 -[NSThread startAndReturnError:] <null> (Foundation:arm64+0x76bec4)
    https://github.com/facebook/react-native/issues/2 -[RCTBridge setUp] <null> (RNTesterUnitTests:arm64+0x23d638)
    https://github.com/facebook/react-native/issues/3 -[RCTBridge initWithDelegate:bundleURL:moduleProvider:launchOptions:] <null> (RNTesterUnitTests:arm64+0x23addc)
    https://github.com/facebook/react-native/issues/4 -[RCTBridge initWithBundleURL:moduleProvider:launchOptions:] <null> (RNTesterUnitTests:arm64+0x23aa4c)
    https://github.com/facebook/react-native/issues/5 -[RCTImageLoaderTests testImageDecoding] <null> (RNTesterUnitTests:arm64+0xa8d0)
    https://github.com/facebook/react-native/issues/6 __invoking___ <null> (CoreFoundation:arm64+0x132cdc)
```

The proposed solution is making the `BOOL` ivar in question a `std::atomic<BOOL>` instead.

## Changelog:

[IOS][FIXED] Data race related to read/write of RCTDeviceInfo._invalidated.

Pull Request resolved: https://github.com/facebook/react-native/pull/48890

Test Plan: Existing tests in `RNTesterPods` and manually running RNTester application.

Reviewed By: christophpurrer

Differential Revision: D68629011

Pulled By: javache

fbshipit-source-id: 229d0db4aa13253b96ce0a20c9795c17e344cfc1
2025-01-27 09:20:47 -08:00
Rubén NorteandFacebook GitHub Bot f282baa26a Implement CustomEvent (#48922)
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
2025-01-27 07:48:50 -08:00
Rubén NorteandFacebook GitHub Bot 8445ebc248 Create module to handle event handler attributes (#48920)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48920

Changelog: [internal]

Implements a module with helpers to define event handler IDL attributes in classes extending `EventTarget`. E.g.:

```
import {getEventHandlerAttribute, setEventHandlerAttribute} from '../path/to/EventHandlerAttributes';

class EventTargetSubclass extends EventTarget {
  get oncustomevent(): EventListener | null {
    return getEventHandlerAttribute(this, 'customEvent');
  }
  set oncustomevent(listener: EventListener | null) {
    setEventHandlerAttribute(this, 'customEvent', listener);
  }
}

const eventTargetInstance = new EventTargetSubclass();

eventTargetInstance.oncustomevent = (event: Event) => {
  console.log('custom event received');
};
eventTargetInstance.dispatchEvent(new Event('customEvent'));
// Logs 'custom event received' to the console.

eventTargetInstance.oncustomevent = null;
eventTargetInstance.dispatchEvent(new Event('customEvent'));
// Does not log anything to the console.

```

Reviewed By: javache

Differential Revision: D67839560

fbshipit-source-id: f301d174fa9a4c010940b875cadfc31298947c26
2025-01-27 07:48:50 -08:00
Rubén NorteandFacebook GitHub Bot 9fbc02a031 Move all properties of EventTarget to symbols to avoid polluting the global scope (#48962)
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
2025-01-27 07:48:50 -08:00
Rubén NorteandFacebook GitHub Bot b28ab79f1b Make constants in Event more spec compliant (#48918)
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
2025-01-27 07:48:50 -08:00
Rubén NorteandFacebook GitHub Bot e04e502f77 Further optimizations for event dispatching (#48426)
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
2025-01-27 07:48:50 -08:00
Rubén NorteandFacebook GitHub Bot 47e490f084 Make EventTarget compatible with the existing implementation of ReadOnlyNode (#48427)
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
2025-01-27 07:48:50 -08:00
Rubén NorteandFacebook GitHub Bot 07df02d14d Add regression test for EventTarget (#48431)
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
2025-01-27 07:48:50 -08:00
Rubén NorteandFacebook GitHub Bot 3c50d87d05 Add benchmark for EventTarget (#48886)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48886

Changelog: [internal]

Creates a benchmarks to measure the performance of `EventTarget`.

Reviewed By: javache

Differential Revision: D67750677

fbshipit-source-id: 7023d5f3bcdc5eec1f5f03298781800d2f9bfe16
2025-01-27 07:48:50 -08:00
Rubén NorteandFacebook GitHub Bot e5024a08d1 Implement Event and EventTarget (#48429)
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
2025-01-27 07:48:50 -08:00
Thomas NardoneandFacebook GitHub Bot fc98babe3e Nullsafe jcf/react/animated (#48932)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48932

Results of running nullsafe script with `--patch=apply_fixmes`, `--patch=mark_nullsafe`, with minimal manual fixes to get all checks passing.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D68629827

fbshipit-source-id: f9d3e741c634743731bdc2870cdccbf73ab58cc1
2025-01-27 07:21:12 -08:00
Mateo GuzmánandFacebook GitHub Bot bbd1e0ff17 Fix FlatList dark mode examples (#48873)
Summary:
- Fix FlatList Nested and Multicolumn dark mode examples
- Convert MultiColumn example from class to functional component
- Fixing several FlowFixMe annotations for both examples

## Changelog:

[INTERNAL] - Fix FlatList dark mode examples

Pull Request resolved: https://github.com/facebook/react-native/pull/48873

Test Plan:
<details>
<summary>Screenshots</summary>

| Before                           | After                          |
|------------------------------------|------------------------------------|
| ![Image 1](https://github.com/user-attachments/assets/c22cbbc1-26e0-4e6b-a21a-0e0a47a23fc2) | ![Image 2](https://github.com/user-attachments/assets/bea957e5-9633-4d1f-91ed-0f4eac58b723) |
| ![Image 3](https://github.com/user-attachments/assets/0d601cdc-a84d-4b06-9f15-ebf793414f53) | ![Image 4](https://github.com/user-attachments/assets/4b605fa5-98d9-4d62-9108-1f7c7148a445) |

</details>

Reviewed By: cortinico

Differential Revision: D68630288

Pulled By: Abbondanzo

fbshipit-source-id: 41c240e4f8c6e6eacf537d53ab4a06bb0b7ef0de
2025-01-27 07:05:50 -08:00
Matthew HoranandFacebook GitHub Bot c499ae1192 Fixes for Keyboard Observer, KeyboardAvoidingView on iOS (#48131)
Summary:
**Convert keyboard position to window coordinate space on iOS**
The keyboard frame passed to keyboardWillChangeFrame is in the screen's coordinate space [1]. It needs to be converted to the window's coordinate space to support Slide Over and Stage Manager.

[1] https://developer.apple.com/documentation/uikit/uikeyboardframeenduserinfokey?language=objc

|Before|After|
|---|---|
|![Simulator Screenshot - iPad mini (A17 Pro) - 2024-12-05 at 18 58 31](https://github.com/user-attachments/assets/6af21fde-32f1-4b15-83be-09a6dbae8784)|![Simulator Screenshot - iPad mini (A17 Pro) - 2024-12-05 at 19 01 27](https://github.com/user-attachments/assets/c63c2bef-c1a6-4ad4-91cf-74629c26dbb0)|

**Improve detached keyboard detection on iOS**
The iOS keyboard may be in one of three states:
1) floating (previously supported with a width check)
2) split
3) or undocked.

In addition, when using Stage Manager, the keyboard may be wider than the window itself. This would cause the floating keyboard check to incorrectly set the bottom position to zero.

Instead, rely on the fact that the UIKeyboardWillHideNotification notification is sent when the keyboard is in any detached state.

This requires listening for UIKeyboardWillShowNotification instead of UIKeyboardWillChangeFrameNotification. This is fine, since the show notification is also sent when the keyboard resizes while open.

Combined with the coordinate system adjustments in the previous commit, this also fixes an issue with Stage Manager, since the keyboard may be attached yet wider than the application window.

|Before|After|
|---|---|
|![Simulator Screenshot - iPad mini (A17 Pro) - 2024-12-05 at 18 58 40](https://github.com/user-attachments/assets/4e747ece-b084-49ad-a8d6-5dfe623ae597)|![Simulator Screenshot - iPad mini (A17 Pro) - 2024-12-05 at 19 01 41](https://github.com/user-attachments/assets/50391302-4c83-4aa3-a96b-6056bba891ec)|
|![Simulator Screenshot - iPad mini (A17 Pro) - 2024-12-05 at 19 48 19](https://github.com/user-attachments/assets/576691b3-6b84-41cf-87f4-0cf52fc405d4)|![Simulator Screenshot - iPad mini (A17 Pro) - 2024-12-05 at 19 05 33](https://github.com/user-attachments/assets/4bb60ca6-beb3-471e-bc71-38a18fc9c0f1)|
|![Simulator Screenshot - iPad mini (A17 Pro) - 2024-12-05 at 19 48 55](https://github.com/user-attachments/assets/baf456fb-aa61-455b-9c20-a01a6a979cb5)|![Simulator Screenshot - iPad mini (A17 Pro) - 2024-12-05 at 19 05 56](https://github.com/user-attachments/assets/0b7fe954-a72f-407a-bb41-0f47253c9448)|

## 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] - Keyboard events are converted to window coordinate space
[iOS] [FIXED] - Improve detached keyboard detection, support Stage Manager on iOS

Pull Request resolved: https://github.com/facebook/react-native/pull/48131

Test Plan: See screenshots above.

Reviewed By: yungsters

Differential Revision: D67337314

Pulled By: cipolleschi

fbshipit-source-id: abe872ac8c83336f316917074f72cdb23a39caab
2025-01-27 06:57:02 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 4141560afc Call cocoapods passing the RCT_IGNORE_PODS_DEPRECATION flag (#48967)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48967

This change updates the core-cli-utils package to call `pod install` by passing the `RCT_IGNORE_PODS_DEPRECATION` flag.

## Changelog:
[iOS][Changed] - Ignore deprecation warning when calling pod install through core-cli-utils

Reviewed By: cortinico

Differential Revision: D68704956

fbshipit-source-id: 5ce56e3ec8c5718f6403f8871bebf6aceeeb407b
2025-01-27 06:52:35 -08:00
Riccardo CipolleschiandFacebook GitHub Bot cc1e8d1523 Move running codegen to core-cli-utils (#48965)
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
2025-01-27 06:52:35 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 2527d29a96 Update Gemfile (#48966)
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
2025-01-27 06:52:35 -08:00
Riccardo CipolleschiandFacebook GitHub Bot f15094ef88 Stop running Codegen on Pod install when a flag is passed (#48961)
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
2025-01-27 06:52:35 -08:00
Riccardo CipolleschiandFacebook GitHub Bot e3def00d7a Warn users when calling pod install (#48960)
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
2025-01-27 06:52:35 -08:00
Iwo PlazaandFacebook GitHub Bot bdc23fa2b4 Migrate files in Libraries/Interaction to use export syntax (#48933)
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
2025-01-27 06:32:58 -08:00
Samuel SuslaandFacebook GitHub Bot 0f0344984f ship useOptimisedViewPreallocationOnAndroid everywhere and remove gating (#48903)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48903

changelog: [internal]

Reviewed By: rubennorte

Differential Revision: D68490542

fbshipit-source-id: f743e9c82328c5f06b431cffe77f9a28608535b9
2025-01-27 06:26:35 -08:00
Edmond ChuiandFacebook GitHub Bot 46e86dca87 Update tests to support new didOpen delegate fn
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
2025-01-27 05:53:15 -08:00
Mateo GuzmánandFacebook GitHub Bot 53d94c3abe Migrate com.facebook.react.modules.network.OkHttpClientFactory to Kotlin (#48945)
Summary:
Migrate com.facebook.react.modules.network.OkHttpClientFactory to Kotlin

## Changelog:

[INTERNAL] - Migrate com.facebook.react.modules.network.OkHttpClientFactory to Kotlin

Pull Request resolved: https://github.com/facebook/react-native/pull/48945

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: cortinico

Differential Revision: D68705783

Pulled By: arushikesarwani94

fbshipit-source-id: 9c2cc2927eae50d0dce91384bf945a8c795c0bbd
2025-01-27 04:48:22 -08:00
Samuel SuslaandFacebook GitHub Bot 1257122a02 introduce Fantom.flushAllNativeEvents (#48943)
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
2025-01-27 04:42:44 -08:00
Samuel SuslaandFacebook GitHub Bot aa5760837c introduce Fantom.scrollTo (#48907)
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
2025-01-25 14:58:28 -08:00
Samuel SuslaandFacebook GitHub Bot 84b8e6a531 unify Fantom calling convention to Fantom.foo (#48924)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48924

changelog: [internal]

All other Fantom tests are using Fantom.foo style instead of `foo`. Let's unify codebase on this.

Reviewed By: christophpurrer

Differential Revision: D68552829

fbshipit-source-id: eeefc449b1f33161b3583dd68b08f83455d1a959
2025-01-25 14:58:28 -08:00
David VaccaandFacebook GitHub Bot e44b2fa973 Migrate ReactBridge to kotlin (#48904)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48904

Migrate ReactBridge to kotlin

changelog: [internal] internal

Reviewed By: tdn120, cortinico

Differential Revision: D68540709

fbshipit-source-id: 35a6d19f940dabdecbe7b7f835953d9f07f7222b
2025-01-24 16:17:58 -08:00
Pieter De BaetsandFacebook GitHub Bot 73968dc778 Cleanup initEagerTurboModulesOnNativeModulesQueueAndroid flag (#48917)
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
2025-01-24 10:57:41 -08:00
Pieter De BaetsandFacebook GitHub Bot 7f62ff6b02 Cleanup completeReactInstanceCreationOnBgThreadOnAndroid and useImmediateExecutorInAndroidBridgeless flags (#48916)
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
2025-01-24 10:57:41 -08:00
Tim YungandFacebook GitHub Bot b186d8f9b8 Animated: Hoist Non-Lifecycle Logic from useAnimatedPropsLifecycle (#48877)
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
2025-01-24 10:48:44 -08:00
Nicola CortiandFacebook GitHub Bot 54e0b69e7e Stable API - Make AnimatedNodeWithUpdateableConfig internal (#48900)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48900

I've verified that this interface is not used externally, so I'm making it internal.
https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Apvinis%2Freact-native---investigation+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+NOT+repo%3Amolangning%2Freversing-discord+com.facebook.react.animated.AnimatedNodeWithUpdateableConfig+

Changelog:
[Android] [Removed] - Stable API - Make `AnimatedNodeWithUpdateableConfig` internal as it was not used in OSS

Reviewed By: tdn120, mdvacca

Differential Revision: D68562055

fbshipit-source-id: 0f06c22dc096efabce9fb937f099775effbff3f6
2025-01-24 10:22:23 -08:00
David VaccaandFacebook GitHub Bot 2fa0494bc4 Internalize ReactNativeFeatureFlags generated accessor classes (#48909)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48909

Internalize ReactNativeFeatureFlags generated accessor classes

changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D68579670

fbshipit-source-id: 63606793e2a63f1901c7de2cb40e68c27193259d
2025-01-24 10:15:58 -08:00
David VaccaandFacebook GitHub Bot c0ad6a4cd5 Internalize ReactNativeFeatureFlags Accessor interfaces & Classes (#48910)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48910

Internalize ReactNativeFeatureFlags Accessor interfaces & Classes

changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D68579453

fbshipit-source-id: 9549221b47e93a9c8a3161c3914ece849f7f9a52
2025-01-24 10:15:58 -08:00
Nicola CortiandFacebook GitHub Bot c495a8ab1b Remove unused AndroidUnicodeUtils. (#48919)
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
2025-01-24 10:03:04 -08:00
Iwo PlazaandFacebook GitHub Bot 52ffda7e55 Migrate Libraries/Utilities/*.js to use export syntax. (#48665)
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
2025-01-24 09:17:55 -08:00
Iwo PlazaandFacebook GitHub Bot 1be7e1a95f Migrate Libraries/Text, Libraries/Share and Libraries/Settings to use export syntax (#48901)
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
2025-01-24 08:49:15 -08:00
Ruslan LesiutinandFacebook GitHub Bot b578647980 Use custom tracks for measures (#48926)
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
2025-01-24 08:41:48 -08:00
Ruslan LesiutinandFacebook GitHub Bot 2e5fa4e35d Migrate to Inspector trace (#48923)
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
2025-01-24 08:41:48 -08:00
Ruslan LesiutinandFacebook GitHub Bot 4b7906bc15 Switch from single Complete event to a pair of Async Nestable events (#48906)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48906

# Changelog: [Internal]

It looks like on `Chrome` side, Complete events (`ph="X"`) are only used for Renderer-related events.

For user-land events with duration (non-instant events), there is a [set of supported types](https://github.com/ChromeDevTools/devtools-frontend/blob/99a9104ae974f8caa63927e356800f6762cdbf25/front_end/models/trace/types/TraceEvents.ts#L62-L65), which don't include `"X"`.

Later, pair of such events will form a [performance measure event](https://github.com/ChromeDevTools/devtools-frontend/blob/99a9104ae974f8caa63927e356800f6762cdbf25/front_end/models/trace/types/TraceEvents.ts#L2256-L2258).

Reviewed By: huntie

Differential Revision: D68564754

fbshipit-source-id: dac87ab06c47925a70e03f43f0628364217a06a2
2025-01-24 08:41:48 -08:00
Vitali ZaidmanandFacebook GitHub Bot d85294b953 fix ignoring of temp local project settings for RNTester
Summary: Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D68625659

fbshipit-source-id: b5ce8ff04b5bb678b5fd19bc6fa5d1c5451df3a9
2025-01-24 07:53:32 -08:00
Andrew DatsenkoandFacebook GitHub Bot 1b050b571e Upgrade undici to 5.28.5 (#48898)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48898

Changelog: [Internal]

GitHub has identified a security vulnerability in a package dependency defined in the repository, facebook/react-native.

Package name: undici
Affected versions: >= 4.5.0, < 5.28.5
Fixed in version: 5.28.5
Severity: MODERATE

Identifiers
GHSA-c76h-2ccp-4975
CVE-2025-22150

References
https://github.com/nodejs/undici/security/advisories/GHSA-c76h-2ccp-4975
https://nvd.nist.gov/vuln/detail/CVE-2025-22150
https://github.com/nodejs/undici/commit/711e20772764c29f6622ddc937c63b6eefdf07d0
https://github.com/nodejs/undici/commit/c2d78cd19fe4f4c621424491e26ce299e65e934a
https://github.com/nodejs/undici/commit/c3acc6050b781b827d80c86cbbab34f14458d385
https://hackerone.com/reports/2913312
https://blog.securityevaluators.com/hacking-the-javascript-lottery-80cc437e3b7f
https://github.com/nodejs/undici/blob/8b06b8250907d92fead664b3368f1d2aa27c1f35/lib/web/fetch/body.js#L113
https://github.com/advisories/GHSA-c76h-2ccp-4975

Reviewed By: NickGerleman

Differential Revision: D68561080

fbshipit-source-id: 7aa71e959ac38f3e0f49d8503a471f60d2f44c5d
2025-01-24 07:06:10 -08:00
Samuel SuslaandFacebook GitHub Bot 70fa456ddc remove explicit calls to root.destroy (#48927)
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
2025-01-24 07:03:27 -08:00
Iwo PlazaandFacebook GitHub Bot e5818d92a8 Migrate files in Libraries/Core to export syntax (#48889)
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
2025-01-24 05:43:28 -08:00
Dawid MałeckiandFacebook GitHub Bot d2adb976ab Replace $FlowFixMe in WebSocketInterceptor callbacks (#48702)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48702

Changelog:
[General][Changed] - Improved types in WebSockertInterceptor callbacks

Reviewed By: cortinico

Differential Revision: D68210857

fbshipit-source-id: 4f2a47be6f96e26db25edbaffcbe97b76ffbdc33
2025-01-24 04:51:43 -08:00
Rubén NorteandFacebook GitHub Bot 348b917c58 Move methods to access internals of DOM nodes to a separate module (#48854)
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
2025-01-24 04:42:45 -08:00
Ruslan LesiutinandFacebook GitHub Bot ad67f8099b add optional id field (#48897)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48897

# Changelog: [Internal]

Adds optional `id` field to Trace Event spec. This field will be required once we are going to emit trace with real custom tracks.

For custom tracks, we would need to emit pair of trace events:
1. Begin Event with type `b`.
2. End Event with type `e`.

They are [matched](https://github.com/ChromeDevTools/devtools-frontend/blob/99a9104ae974f8caa63927e356800f6762cdbf25/front_end/models/trace/helpers/Trace.ts#L261-L294) by Chrome DevTools frontend by `id` and `name` fields.

Reviewed By: huntie

Differential Revision: D68559862

fbshipit-source-id: 732ae52691e31213f9c63474905eb7c1b12adb8c
2025-01-24 04:38:18 -08:00
Ruslan LesiutinandFacebook GitHub Bot df4d9d1cce Split stopTracingAndCollectEvents (#48795)
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
2025-01-24 04:27:55 -08:00
Jorge Cabiedes AcostaandFacebook GitHub Bot 6c6e0a9085 Fix anti-aliasing on older Android devices
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
2025-01-23 20:52:48 -08:00
Joe VilchesandFacebook GitHub Bot 1b710a0cb2 Back out "Allow text links to be navigatable via keyboard by default"
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
2025-01-23 19:19:13 -08:00
David VaccaandFacebook GitHub Bot 5ea7594b5c Fully rollout enableDeletionOfUnmountedViews feature flag (#48872)
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
2025-01-23 17:38:38 -08:00
Nick GerlemanandFacebook GitHub Bot fae6edb65c Support parsing hsl() and hsla() functions (#48843)
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
2025-01-23 16:19:48 -08:00
Nick GerlemanandFacebook GitHub Bot 91add1e4e0 Remove redundant check in CSSRatio (#48842)
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
2025-01-23 16:19:48 -08:00
Nick GerlemanandFacebook GitHub Bot a4b112cb0b Do not consume delimeter when not consuming component value (#48841)
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
2025-01-23 16:19:48 -08:00
Nick GerlemanandFacebook GitHub Bot 5b3d8d3410 More spec compliant rgb function parsing (#48839)
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
2025-01-23 16:19:48 -08:00
Nick GerlemanandFacebook GitHub Bot 24393c7dde Add CSSDelimeter::OptionalWhitespace and CSSDelimeter::CommaOrWhitespaceOrSolidus (#48828)
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
2025-01-23 16:19:48 -08:00
David VaccaandFacebook GitHub Bot d40f90b5e7 Migrate PackagerStatusCheck to Kotlin (#48838)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48838

Migrate PackagerStatusCheck to Kotlin

changelog: [internal] internal

Reviewed By: tdn120, cortinico

Differential Revision: D68467780

fbshipit-source-id: ace98692ebcf96bf0ca36640183c432121d95519
2025-01-23 14:57:33 -08:00
Chi TsaiandFacebook GitHub Bot d9d824055e Add createFromUtf16 JSI method (#48211)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48211

Adding the default implementation for `createFromUtf16` method for JSI
String and PropNameId.

Changelog: [Internal]

Reviewed By: tmikov

Differential Revision: D67070206

fbshipit-source-id: 47297e6ae3028ee0e101628aab5bc076fcbbdebc
2025-01-23 14:54:17 -08:00
Jorge Cabiedes AcostaandFacebook GitHub Bot f89f191c26 Go back to object approach instead of manual drawable layer handling for CompositeBackgroundDrawable (#48835)
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
2025-01-23 12:39:25 -08:00
Samuel SuslaandFacebook GitHub Bot 0353648f46 add tests for ScrollView.onScroll (#48891)
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
2025-01-23 11:47:31 -08:00
Samuel SuslaandFacebook GitHub Bot f695411bf3 add isUnique option to Fantom.dispatchNativeEvent (#48801)
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
2025-01-23 11:47:31 -08:00
Riccardo CipolleschiandFacebook GitHub Bot b9f418e9bc Fix images not displayed when extension is implicit (#48888)
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
2025-01-23 11:37:16 -08:00
Nicola CortiandFacebook GitHub Bot 3702c986ed RNGP - Update comment on INCLUDE_JITPACK_REPOSITORY_DEFAULT (#48896)
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
2025-01-23 10:52:34 -08:00
Edmond ChuiandFacebook GitHub Bot 9b977def6c Fix app lagging while attempting a connection to Metro (#48895)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48895

Changelog:
[General][Breaking][Fixed] - removed a long-running loop causing the app to lag while attempting a connection to Metro

Round 2: Sorry I broke VR/Java apps in D68023397. Helpful teammates have reverted and Jedi landed it via D68522537.

This diff adds the missing method call that caused the crash:

```
makeNativeMethod(
  "didOpen",
  JCxxInspectorPackagerConnectionWebSocketDelegate::didOpen
)
```

Test plan has been updated to include testing VR Store.

This error wasn't caught by existing automated tests, because it only impacts development builds while using Metro. vzaidman is leading the effort to bring Jest E2E tests on React Native DevTools, which could catch crashes like this.

Original summary in D68023397:

D65952134 fixed the auto-reconnection between Metro and the device.

There's an existing "constructed = connected" contract as [discussed](https://www.internalfb.com/diff/D65952134?dst_version_fbid=3741052436109227&transaction_fbid=581445277659906):

https://www.internalfb.com/code/fbsource/[1592525fbcbb]/xplat/js/react-native-github/packages/react-native/ReactCommon/jsinspector-modern/WebSocketInterfaces.h?lines=16-20

In compliance, busy-waiting was [introduced](https://www.internalfb.com/diff/D65952134?dst_version_fbid=896147259315683&transaction_fbid=427393513742494) in V4 to wait for the connection result in the constructor.

xArthasx [discovered](https://www.internalfb.com/diff/D65952134?dst_version_fbid=896147259315683&transaction_fbid=1406890420289706) a performance issue from this impl via a profiling result.

In favour of async connection results, we're going back to V3 design with the imperative `isConnected()` check to the interface. xArthasx has confirmed this fixes the perf issue.

While I haven't found a compelling reason against removing this contract from the initial design in D52134592, please let me know if I've missed one.

This also means there was a scenario where messages were sent before the websocket is open. Those were dropped silently previously (before the busy-waiting while loop was introduced):

https://www.internalfb.com/code/fbsource/[f7113e167ee1]/fbobjc/VendorLib/SocketRocket/src/SocketRocket/SRWebSocket.m?lines=630-637

This means message senders must now consider the connection state, e.g. by maintaining a pre-connection message queue, if they need to guarantee the messages to be sent.

Reviewed By: robhogan

Differential Revision: D68559198

fbshipit-source-id: afb3d8bfbf949c3324cbf126e9f3e3fc25e50541
2025-01-23 10:43:59 -08:00
Iwo PlazaandFacebook GitHub Bot ecae8a2908 Remove seemingly unused AnimatedWeb file. (#48894)
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
2025-01-23 10:32:59 -08:00
Ruslan LesiutinandFacebook GitHub Bot a995ecc9c6 Encapsulate Trace Event format (#48648)
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
2025-01-23 10:29:48 -08:00
Rubén NorteandFacebook GitHub Bot 0736234e90 Use test name as a hint for benchmarks (#48882)
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
2025-01-23 10:26:47 -08:00
Rubén NorteandFacebook GitHub Bot 8702ed5f37 Improve format of benchmark results (#48881)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48881

Changelog: [internal]

Small improvement in the printed benchmark results.

Reviewed By: andrewdacenko

Differential Revision: D68552379

fbshipit-source-id: 39312a757a9de57e462c17a9f1455dfe8cab53f1
2025-01-23 10:26:47 -08:00
Andrew DatsenkoandFacebook GitHub Bot c5bab82a60 migrate console-itest to beforeEach/afterEach (#48821)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48821

Changelog: [Internal]
Add setup and teardown to console-itest

Reviewed By: rubennorte

Differential Revision: D68454178

fbshipit-source-id: 277e1125248b860a6fe085a5e47dddf4c5cd12da
2025-01-23 09:45:21 -08:00
Andrew DatsenkoandFacebook GitHub Bot cf6b807745 Add support for (before|after)(Each|All) methods (#48820)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48820

Changelog: [Internal]
Add capability to setup / teardown tests

Reviewed By: rubennorte

Differential Revision: D68454176

fbshipit-source-id: 93c19c91dfe2b8b98385547da24955fd31adbf0b
2025-01-23 09:45:21 -08:00
Iwo PlazaandFacebook GitHub Bot da695f3a20 Migrated components to export syntax (part 4) (#48808)
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
2025-01-23 09:03:46 -08:00
Samuel SuslaandFacebook GitHub Bot 56a60601da add tests for TextInput.onChange and TextInput.onChangeText (#48899)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48899

changelog: [internal]

Add tests for `TextInput.onChange` and `TextInput.onChangeText`.

Reviewed By: rubennorte

Differential Revision: D68498998

fbshipit-source-id: 212bc251700b343f7290fb7e2a5f2ddfdb68dfd1
2025-01-23 08:59:13 -08:00
Iwo PlazaandFacebook GitHub Bot 7df73eebdc Migrated Libraries/WebSocket/* to export syntax. (#48884)
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
2025-01-23 08:55:25 -08:00
Alex HuntandFacebook GitHub Bot b8ee2b3503 Add source transformation pipeline to build-types (#48893)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48893

Updates `build-types` to support source file AST transforms, and templates out an initial `stripPrivateProperties` transform.

- Also, parallelise file translation via `Promise.all`.

Changelog: [Internal]

Reviewed By: iwoplaza

Differential Revision: D68558012

fbshipit-source-id: 6eb3881fcf30bf8f4ba045522f6569fbbad14f62
2025-01-23 08:29:09 -08:00
Rubén NorteandFacebook GitHub Bot 8a2b44568d Partially restore feature flag to disable event loop on bridgeless (#48892)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48892

Changelog: [internal]

Reviewed By: javache, Abbondanzo

Differential Revision: D68557746

fbshipit-source-id: d94877d03dc6ea2bf6bca45da77a0a769fa0efeb
2025-01-23 08:12:35 -08:00
Ritesh Kumar ShuklaandFacebook GitHub Bot 317f130267 Update info.ts (#48876)
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
2025-01-23 07:19:55 -08:00
Riccardo CipolleschiandFacebook GitHub Bot dab9b3b440 Stop generating the ReactCodegen.podspec in Cocoapods (#48815)
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
2025-01-23 05:38:20 -08:00
Samuel SuslaandFacebook GitHub Bot 3e29cbe1d0 add test for TextInput blut and focus (#48862)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48862

changelog: [internal]

Add simple tests that use new `Fantom.dispatchNativeEvent` and `Fantom.runOnUIThread`.

Reviewed By: rubennorte

Differential Revision: D68492472

fbshipit-source-id: 33537ed7a728c2cc01abdcc5aa178b3afa3779fa
2025-01-23 05:30:24 -08:00
Samuel SuslaandFacebook GitHub Bot 864c34e9f6 add event category to Fantom.dispatchNativeEvent (#48855)
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
2025-01-23 04:02:06 -08:00
Alex HuntandFacebook GitHub Bot d4c1c7bfe3 Move experimental type generation into dedicated script (#48867)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48867

Also:
- Rename output dir to `types_generated/`.
- Support source patterns outside of the `react-native` package.

Changelog: [Internal]

Reviewed By: j-piasecki

Differential Revision: D68498211

fbshipit-source-id: 7f9f540efd6d3d2c70b8b1721738f3fea569641d
2025-01-23 02:39:32 -08:00
Ruslan LesiutinandFacebook GitHub Bot 8a586f2fa1 Move setUpReactDevTools to InitializeCore (#48871)
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
2025-01-22 22:06:43 -08:00
David VaccaandFacebook GitHub Bot c5af75294a Migrate SurfaceHandlerBinding to kotlin (#48870)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48870

Migrate SurfaceHandlerBinding to kotlin

changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D68480893

fbshipit-source-id: a326d2646212598ded962d25cb8d1caf7a2ed6aa
2025-01-22 22:06:37 -08:00
Tim YungandFacebook GitHub Bot d1028885ee Back out "Fix app lagging while attempting a connection to Metro"
Summary: Reverts {D68023397}

Reviewed By: Abbondanzo

Differential Revision: D68522537

fbshipit-source-id: 1c331969fea898fdee06dd988f86c5e1f034684f
2025-01-22 15:12:57 -08:00
David VaccaandFacebook GitHub Bot 159fc9922c Migrate FabricUIManagerProviderImpl to kotlin (#48869)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48869

Migrate FabricUIManagerProviderImpl to kotlin

changelog: [internal] internal

Reviewed By: tdn120, cortinico

Differential Revision: D68480341

fbshipit-source-id: bf0f548230f9c8bcba07fe32a1fde5d9a1d72550
2025-01-22 13:20:37 -08:00
Joe VilchesandFacebook GitHub Bot 98b0991128 Allow text links to be navigatable via keyboard by default (#48773)
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
2025-01-22 12:16:14 -08:00
Samuel SuslaandFacebook GitHub Bot 4d96467954 add payload to Fantom.dispatchNativeEvent (#48794)
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
2025-01-22 12:16:11 -08:00
Chi TsaiandFacebook GitHub Bot 7b0f83165e Fix unicode character usage in windows tests (#48840)
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
2025-01-22 12:07:20 -08:00
David VaccaandFacebook GitHub Bot 2c50e7043b Implement prop diffing for nativeForegroundAndroid prop (#48834)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48834

Implement prop diffing for nativeForegroundAndroid prop

changelog: [internal] internal

Reviewed By: rshest

Differential Revision: D60001410

fbshipit-source-id: c6b5b71ddb66136f9cf61e2cca5aeb6e1274841e
2025-01-22 12:07:06 -08:00
David VaccaandFacebook GitHub Bot 48fad21759 Implement prop diffing for accessibility props in <View> (#48833)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48833

This diff implements the diffing for accessibility props of <View>

changelog: [internal] internal

Reviewed By: rshest

Differential Revision: D59972041

fbshipit-source-id: 171381744e0e695cbc144507fa86b2d2ef536c30
2025-01-22 12:07:06 -08:00
David VaccaandFacebook GitHub Bot 2e8720af44 Implement prop diffing for transform props in <View> (#48832)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48832

This diff implements the diffing for transform props of <View>

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D59972039

fbshipit-source-id: e4c3beff4c6411595ab83ff62b54b948f9337851
2025-01-22 12:07:06 -08:00
David VaccaandFacebook GitHub Bot 9a5e365865 Implement prop diffing for border props in <View> (#48831)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48831

This diff implements the diffing for border props of <View>

changelog: [internal] internal

Reviewed By: sammy-SC

Differential Revision: D59972037

fbshipit-source-id: b93a0962616222686a4340cd1e7f2943bd3bc140
2025-01-22 12:07:06 -08:00
David VaccaandFacebook GitHub Bot 4396487742 Implement prop diffing for event props in <View> (#48830)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48830

This diff implements the diffing for event props of <View>

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D59972038

fbshipit-source-id: ddd42068a74862f44ecf374e12d80aaaf493e04f
2025-01-22 12:07:06 -08:00
David VaccaandFacebook GitHub Bot 92d79461e9 Implement prop diffing for basic props in <View> (#48829)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48829

This diff implements the diffing for basic props of <View>

changelog: [internal] internal

Reviewed By: NickGerleman

Differential Revision: D59972040

fbshipit-source-id: 148b5fc9b73887c153535648182386d75bf9381b
2025-01-22 12:07:06 -08:00
David VaccaandFacebook GitHub Bot 5ee2289298 Introduce getDiffProps for <View> (#45552)
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
2025-01-22 12:07:06 -08:00
David VaccaandFacebook GitHub Bot 33e0bab567 Mark MemoryPressureRouter as nullsafe (#48740)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48740

Mark MemoryPressureRouter as nullsafe

changelog: [internal] internal

Reviewed By: tdn120

Differential Revision: D68275418

fbshipit-source-id: 8437f017f020e4e9f66916df2661850702b77486
2025-01-22 11:55:11 -08:00
Jin LeeandFacebook GitHub Bot 9b06d0d8a9 Back out "Disable weak event emitter in AttributedString for Apple Silicon Mac running iOS build app" (#48868)
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
2025-01-22 11:52:34 -08:00
Rubén NorteandFacebook GitHub Bot 04f9451dab Modify public API script to make it opt-in in src/private, instead of opt-out (#48866)
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
2025-01-22 11:24:25 -08:00
Rubén NorteandFacebook GitHub Bot e2c433b657 Move some internal modules to internals directories (#48859)
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
2025-01-22 11:24:25 -08:00
Dawid MałeckiandFacebook GitHub Bot 8befab1760 Replace $FlowFixMe in ScrollViewNativeComponentType (#48858)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48858

Changelog:
[General][Changed] - Replaced $FlowFixMe with PressEvent in ScrollViewNativeComponentType

Reviewed By: fabriziocucci

Differential Revision: D68496466

fbshipit-source-id: 19c5738a906908336ef93e339092e6cb6fa2d860
2025-01-22 11:23:21 -08:00
Christoph PurrerandFacebook GitHub Bot d154cd5ba1 Fix data race in TraceSection.h (#48774)
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
2025-01-22 10:41:42 -08:00
Dawid MałeckiandFacebook GitHub Bot e31ff4212b Added type for _captureRef in SectionList (#48863)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48863

Changelog:
[General][Changed] - Added explicit type for argument in _captureRef in SectionList

Reviewed By: huntie

Differential Revision: D68493326

fbshipit-source-id: 906a13b13e9fc7ee2c61a8d5c7caa72c0656440f
2025-01-22 10:34:21 -08:00
Dawid MałeckiandFacebook GitHub Bot 1be2ba4597 Replace $FlowFixMe in ScrollView (#48857)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48857

Changelog:
[General][Changed] - Improved types in ScrollView

Reviewed By: huntie

Differential Revision: D68496037

fbshipit-source-id: b044e884fb78bb92c0da5acd7570a87ff328a479
2025-01-22 10:00:50 -08:00
Edmond ChuiandFacebook GitHub Bot 0e5adb9128 Fix app lagging while attempting a connection to Metro (#48642)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48642

Changelog:
[General][Breaking][Fixed] - removed a long-running loop causing the app to lag while attempting a connection to Metro

D65952134 fixed the auto-reconnection between Metro and the device.

There's an existing "constructed = connected" contract as [discussed](https://www.internalfb.com/diff/D65952134?dst_version_fbid=3741052436109227&transaction_fbid=581445277659906):

https://www.internalfb.com/code/fbsource/[1592525fbcbb]/xplat/js/react-native-github/packages/react-native/ReactCommon/jsinspector-modern/WebSocketInterfaces.h?lines=16-20

In compliance, busy-waiting was [introduced](https://www.internalfb.com/diff/D65952134?dst_version_fbid=896147259315683&transaction_fbid=427393513742494) in V4 to wait for the connection result in the constructor.

xArthasx [discovered](https://www.internalfb.com/diff/D65952134?dst_version_fbid=896147259315683&transaction_fbid=1406890420289706) a performance issue from this impl via a profiling result.

In favour of async connection results, we're going back to V3 design with the imperative `isConnected()` check to the interface. xArthasx has confirmed this fixes the perf issue.

While I haven't found a compelling reason against removing this contract from the initial design in D52134592, please let me know if I've missed one.

This also means there was a scenario where messages were sent before the websocket is open. Those were dropped silently previously (before the busy-waiting while loop was introduced):

https://www.internalfb.com/code/fbsource/[f7113e167ee1]/fbobjc/VendorLib/SocketRocket/src/SocketRocket/SRWebSocket.m?lines=630-637

This means message senders must now consider the connection state, e.g. by maintaining a pre-connection message queue, if they need to guarantee the messages to be sent.

Reviewed By: christophpurrer

Differential Revision: D68023397

fbshipit-source-id: dd80acf75790e77454798c96f06bb0a4ee6afe61
2025-01-22 09:49:01 -08:00
Marc RousavyandFacebook GitHub Bot f830f2c667 feat: Add getConcretePropsShared() (#48710)
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
2025-01-22 09:17:31 -08:00
Tim YungandFacebook GitHub Bot ab77bdf471 Animated: Feature Flags Cleanup (#48509)
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
2025-01-22 08:54:58 -08:00
Rubén NorteandFacebook GitHub Bot 0883207e44 Clean up feature flag to disable event loop on bridgeless (#48851)
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
2025-01-22 08:24:29 -08:00
Iwo PlazaandFacebook GitHub Bot bdb5804f32 Migrated Core/ReactNativeVersion to use export syntax. (#48853)
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
2025-01-22 07:41:04 -08:00
Arushi KesarwaniandFacebook GitHub Bot 44da5d2ee0 Make setLayoutAnimationEnabledExperimental a no-op in Bridgeless (#48856)
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
2025-01-22 07:16:44 -08:00
Tim YungandFacebook GitHub Bot c8a387c2d1 VirtualizedList: Delete Batchinator (#48515)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48515

Deletes `Batchinator`, inlines the timer, and cleans up the `disableInteractionManagerInBatchinator` feature flag.

Changelog:
[Internal]

Reviewed By: javache, NickGerleman

Differential Revision: D67885194

fbshipit-source-id: 5f3ec71a02cf1f1b382b41a480beed28fc8c5439
2025-01-22 07:14:37 -08:00
Samuel SuslaandFacebook GitHub Bot ff0bcb2427 introduce Fantom.dispatchNativeEvent (#48793)
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
2025-01-22 06:55:18 -08:00
Dawid MałeckiandFacebook GitHub Bot a24f9ef825 Add type for _lastNativeRefreshing and change React import in RefreshControl (#48809)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48809

Changelog:
[General][Changed] - Added explicit type for _lastNativeRefreshing and changed React import syntax in RefreshControl

Reviewed By: cortinico

Differential Revision: D68437259

fbshipit-source-id: e3e842870c485b235e41e1a634b55f2f12b63115
2025-01-22 06:04:25 -08:00
Iwo PlazaandFacebook GitHub Bot ce412746b1 Migrated components to export syntax (part 2) (#48767)
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
2025-01-22 03:43:59 -08:00
Dawid MałeckiandFacebook GitHub Bot b200c7cb2f Replace $FlowFixMeProps in UnimplementedView (#48810)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48810

Changelog:
[General][Changed] - Improved Props type in UnimplementedView

Reviewed By: cortinico

Differential Revision: D68437542

fbshipit-source-id: 134b834d77f65a94a6488c21298d79b060ea8109
2025-01-22 03:28:28 -08:00
Dawid MałeckiandFacebook GitHub Bot cd7a30ce48 Replace $FlowFixMe in InteractionManager (#48797)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48797

Changelog:
[General][Changed] - Replaced $FlowFixMe in InteractionManager to Function type

Reviewed By: cortinico

Differential Revision: D68416677

fbshipit-source-id: 4b2adf299021c9008c73e2374092a7ad52da2245
2025-01-22 03:27:05 -08:00
Jakub PiaseckiandFacebook GitHub Bot f1a33c5982 Add generated types to the gitignore (#48848)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48848

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D68489815

fbshipit-source-id: ddb6e19e1ef060f537bfeacf6d8a916e08cff75b
2025-01-22 03:07:08 -08:00
Mateo GuzmánandFacebook GitHub Bot 480ee4b935 Migrate com.facebook.react.modules.network interfaces to Kotlin (#48679)
Summary:
Migrate com.facebook.react.modules.network interfaces to Kotlin: `ProgressListener`, `CustomClientBuilder` and `NetworkInterceptorCreator`.

## Changelog:

[INTERNAL] - Migrate com.facebook.react.modules.network interfaces to Kotlin

Pull Request resolved: https://github.com/facebook/react-native/pull/48679

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: javache

Differential Revision: D68186452

Pulled By: mdvacca

fbshipit-source-id: 814bf4c525ba1da49e26046345c71abf2c1e39ce
2025-01-21 21:24:46 -08:00
David VaccaandFacebook GitHub Bot c871c4c93b Delete ViewHierarchyUtil (#48837)
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
2025-01-21 20:30:29 -08:00
Nick GerlemanandFacebook GitHub Bot 8803dca0bb Support parsing rgb() and rgba() functions into CSSColor (#48827)
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
2025-01-21 20:20:04 -08:00
Nick GerlemanandFacebook GitHub Bot fe3e3a54a3 Simplify consuming solidus separated component values (#48826)
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
2025-01-21 20:20:04 -08:00
Nick GerlemanandFacebook GitHub Bot e73d4ff015 Simplify "rollback" on optional or invalid syntax (#48825)
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
2025-01-21 20:20:04 -08:00
David VaccaandFacebook GitHub Bot 4ed2b35bf6 Fix execution of early InteropEvents (#48823)
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
2025-01-21 19:03:24 -08:00
David VaccaandFacebook GitHub Bot 2a9a13d567 Reduce visibility of methods in FabricUIManager (#48824)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48824

Reduce visibility of methods in FabricUIManager and fix lint warnings

changelog: [Android][Breaking] Reduce visibility of  FabricUIManager.setBinding() method, unused outside of react native

Reviewed By: philIip

Differential Revision: D68459708

fbshipit-source-id: 59081b9a87607b1d35c3fc88bb16e5980cfbd721
2025-01-21 18:58:15 -08:00
David VaccaandFacebook GitHub Bot 10f4772551 Migrate SelectionWatcher to Kotlin (#48747)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48747

Migrate SelectionWatcher to Kotlin

changelog: [internal] internal

Reviewed By: tdn120, cortinico

Differential Revision: D68284145

fbshipit-source-id: 40b7d00fe0be75c5387a169038b1c58a048ac88a
2025-01-21 18:58:13 -08:00
Liron YahdavandFacebook GitHub Bot 6cbdc94456 Add feature flag to enable running JS GC on memory pressure with Bridgeless (#48771)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48771

Pre Bridgeless RN iOS apps relied on [RCTCxxBridge](https://www.internalfb.com/code/fbsource/[44b3ff81a2875d66675774f2c71643622ea03c36]/xplat/js/react-native-github/packages/react-native/React/CxxBridge/RCTCxxBridge.mm?lines=376) to tell Hermes to GC when the OS detects memory pressure. With bridgeless we don't use RCTCxxBridge so we don't get that behavior anymore. This adds a feature flag to experiment with getting the same behavior with Bridgeless.

Changelog: [iOS] [Added] - Add feature flag to enable running JS GC on iOS memory pressure with Bridgeless

Reviewed By: yungsters

Differential Revision: D68290689

fbshipit-source-id: d4df16f44e56ad22c2d3d4073b8a870bd7ade645
2025-01-21 17:41:42 -08:00
Tim YungandFacebook GitHub Bot 0ead7de5e8 VirtualizedList: More Resilient Unit Tests (#48819)
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
2025-01-21 16:43:36 -08:00
Nicola CortiandFacebook GitHub Bot 9afad527b8 Convert HeadlessJsTaskService to Kotlin (#48800)
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
2025-01-21 11:02:17 -08:00
Nicola CortiandFacebook GitHub Bot acaf31d175 Collapse the 0.77 changelog (#48811)
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
2025-01-21 10:06:22 -08:00
Oskar KwaśniewskiandFacebook GitHub Bot 0141a44026 fix(ios): add missing nonnull annotations (#48817)
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
2025-01-21 09:48:40 -08:00
Marc RousavyandFacebook GitHub Bot f2553d39da feat: Add REACT_NATIVE_VERSION_* definitions to ReactNativeVersion.h (#48813)
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
2025-01-21 09:00:20 -08:00
Fabrizio CucciandFacebook GitHub Bot 00c6b21ecb Build codegen CLI when running yarn test-e2e-local (#48816)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48816

Given the recent changes, the error mentioned in [this](https://fb.workplace.com/groups/1374515773430764/permalink/1406615956887412)  post can show up also when testing iOS.

So here we are building the codegen when running `yarn test-e2e-local` regardless by the platform.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D68441078

fbshipit-source-id: 9067545b61be59ec595142c2e4ba888e20d9a13a
2025-01-21 07:58:52 -08:00
Fabrizio CucciandFacebook GitHub Bot 037687df53 Update changelog for 0.78.0-rc.1 (#48806)
Summary:
Changelog for 0.78.0-rc.1

## Changelog:
[Internal] Changelog

Pull Request resolved: https://github.com/facebook/react-native/pull/48806

Test Plan: N/A

Reviewed By: cipolleschi

Differential Revision: D68436101

Pulled By: fabriziocucci

fbshipit-source-id: f7f519a43a045a41ed45eb5b590b8130d97f3592
2025-01-21 07:07:29 -08:00
Dawid MałeckiandFacebook GitHub Bot b634fa1edb Add explicit type for _memoizedRenderer and change React and View import in FlatList (#48798)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48798

Changelog:
[General][Changed] - Added explicit type for _memoizedRenderer and changed React and View import in FlatList

Reviewed By: cortinico

Differential Revision: D68417026

fbshipit-source-id: 0af75381f6f8c33be10add940f0791b059de3473
2025-01-21 07:06:39 -08:00
Mateo GuzmánandFacebook GitHub Bot 4f99f0bb1a Convert com.facebook.react.modules.network.ResponseUtil to Kotlin (#48781)
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
2025-01-21 07:06:19 -08:00
Mateo GuzmánandFacebook GitHub Bot 299a7a959d Improve ToastAndroid jsdocs (#48779)
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
2025-01-21 07:03:39 -08:00
Dawid MałeckiandFacebook GitHub Bot 44d84f2af6 Add type for export object in AssetRegistry (#48734)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48734

Changelog:
[General][Changed] - Added type for exported object in AssetRegistry

Reviewed By: cortinico

Differential Revision: D68272679

fbshipit-source-id: 1202009f886b2d35528009a3ac58aab24af9ef82
2025-01-21 07:02:21 -08:00
Iwo PlazaandFacebook GitHub Bot 9eeef22a67 Migrated components to export syntax (part 1) (#48765)
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
2025-01-21 07:00:35 -08:00
Dawid MałeckiandFacebook GitHub Bot 379242eb83 Change ScrollView and React imports in NetworkOverlay (#48796)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48796

Changelog:
[Internal] - Changed ScrollView and React imports in NetworkOverlay

Reviewed By: cortinico

Differential Revision: D68416261

fbshipit-source-id: 3159e14747fe43f25b479f7ef31bdb7daf0a1eb9
2025-01-21 06:59:52 -08:00
Iwo PlazaandFacebook GitHub Bot 09700327f7 Migrated BugReporting, ErrorUtils, Vibration & YellowBox to use export syntax. (#48763)
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
2025-01-21 01:49:27 -08:00
Iwo PlazaandFacebook GitHub Bot 9a70bc0418 Migrated files in Libraries/Blob to use export syntax. (#48761)
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
2025-01-21 01:41:44 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 140b3b38df Add prepare-ios script (#48799)
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
2025-01-20 12:20:36 -08:00
Rick HanlonandFacebook GitHub Bot b1b5a9e2e5 Improve ExceptionManager tests (#48787)
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
2025-01-20 10:07:00 -08:00
Rick HanlonandFacebook GitHub Bot e015d1b19a ensure react dev tools is patched before console.error (#48784)
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
2025-01-20 10:07:00 -08:00
Rick HanlonandFacebook GitHub Bot 0affa544c3 Show component code frame, if available (#48785)
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
2025-01-20 10:07:00 -08:00
Rick HanlonandFacebook GitHub Bot 967ef32154 Add support for owner stacks (#48782)
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
2025-01-20 08:35:32 -08:00
Dawid MałeckiandFacebook GitHub Bot 1536a7f196 Remove context in addEventListener in Linking (#48726)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48726

Changelog:
[General][Changed] - Removed context from addEventListener arguments in Linking

Reviewed By: rshest

Differential Revision: D68215201

fbshipit-source-id: 011bcd59fe8101df5ecd1b72bb75febdcb60a511
2025-01-20 07:17:38 -08:00
Dawid MałeckiandFacebook GitHub Bot f4b3f1daa3 Change InspectorAgent import syntax in NetworkAgent (#48729)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48729

Changelog:
[Internal] - Changed InspectorAgent import syntax in NetworkAgent

Reviewed By: rshest

Differential Revision: D68270365

fbshipit-source-id: d8cea061d82f6fd4c36830820ef8fef2115f1d43
2025-01-20 05:38:58 -08:00
Dawid MałeckiandFacebook GitHub Bot 3c02738ec4 Add explicit types for Types and Properties in LayoutAnimation (#48728)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48728

Changelog:
[General][Changed] - Improved types for exported Types and Properties in LayoutAnimation

Reviewed By: rshest

Differential Revision: D68270119

fbshipit-source-id: 7e9e6e6f20b6c17990b40d423eb4571807004b49
2025-01-20 05:36:41 -08:00
Dawid MałeckiandFacebook GitHub Bot 812c3b33cd Replaced $FlowFixMe in CodegenTypes
Summary:
Changelog:
[General][Changed] Replaced $FlowFixMe in CodegenTypes with Object type

Reviewed By: elicwhite, rshest

Differential Revision: D68327690

fbshipit-source-id: 34b354cd52c786788e86cc4bd7723ddf1e3881fc
2025-01-20 05:30:39 -08:00
Dawid MałeckiandFacebook GitHub Bot 8df6cfa56b Replace $FlowFixMe in RCTDeviceEventEmitter (#48758)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48758

Changelog:
[General][Changed] - Replaced $FlowFixMe in RCTDeviceEventEmitter with any

Reviewed By: rshest

Differential Revision: D68327375

fbshipit-source-id: 30f65308f81d6349c191900ce16036741e71efae
2025-01-20 05:29:30 -08:00
Dawid MałeckiandFacebook GitHub Bot 286a360d9b Replace $FlowFixMe in NativeModules (#48757)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48757

Changelog:
[General][Changed] - Replaced $FlowFixMe in NativeModules with any type

Reviewed By: elicwhite, rshest

Differential Revision: D68327176

fbshipit-source-id: 9cde462853012bbe40d0caa40d0c18fa32c699a1
2025-01-20 05:25:50 -08:00
Dawid MałeckiandFacebook GitHub Bot 5b07743ae9 Add src/private directory in public-api-test.js (#48641)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48641

Changelog:
[Internal] - Added src/private directory to API snap generation in public-api-test.js

Reviewed By: cortinico

Differential Revision: D68102311

fbshipit-source-id: 655734689bbc788f8b4699f787832cfc8c9b2504
2025-01-20 04:26:48 -08:00
Nick GerlemanandFacebook GitHub Bot 22e7691473 Split value parsing tests (#48770)
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
2025-01-17 15:44:48 -08:00
Nick GerlemanandFacebook GitHub Bot 743de70141 Add CSSComponentValueDelimiter::CommaOrWhitespace (#48769)
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
2025-01-17 15:44:48 -08:00
Nick GerlemanandFacebook GitHub Bot c33dd62afd Restrict CSSDataTypeParser function and simple block parsing to block scope (#48768)
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
2025-01-17 15:44:48 -08:00
Iwo PlazaandFacebook GitHub Bot 135277ace1 Migrate AppState and BatchedBridge files to use export syntax. (#48737)
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
2025-01-17 11:19:43 -08:00
Nicola CortiandFacebook GitHub Bot d9a77e1d02 RNGP - Do not access project. during task execution. (#48745)
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
2025-01-17 08:56:46 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 6f6a438330 Make sure the New Architecture is the default (#48764)
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
2025-01-17 08:28:27 -08:00
Jakub PiaseckiandFacebook GitHub Bot 25c0b7ff5e Bootstrap experimental types build for main package (#48661)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48661

Pull Request resolved: https://github.com/facebook/react-native/pull/48647

Changelog: [Internal]

Reviewed By: iwoplaza

Differential Revision: D68102875

fbshipit-source-id: abb77737dc2f46d6caba0d9a4c44b26e8a595cff
2025-01-17 07:58:08 -08:00
Dawid MałeckiandFacebook GitHub Bot b9df812b67 Added types in TouchHistoryMath (#48730)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48730

Changelog:
[General][Changed] - Added types in TouchHistoryMath

Reviewed By: rshest

Differential Revision: D68271085

fbshipit-source-id: b5ce3134d7bd7cb23b94761079d1d7753aaa97c1
2025-01-17 07:27:42 -08:00
Mateo GuzmánandFacebook GitHub Bot e39776b1b8 Fix Alert and SafeAreaView examples in dark mode (#48752)
Summary:
Fix Alert and SafeAreaView examples in dark mode. Converting also SafeAreaView examples into functional components

## Changelog:

[INTERNAL] - Fix Alert and SafeAreaView examples in dark mode

Pull Request resolved: https://github.com/facebook/react-native/pull/48752

Test Plan:
<details>
<summary>Screenshots</summary>

| After | Before |
|--------|-------|
| ![Simulator Screenshot - iPhone SE (3rd generation) - 2025-01-16 at 18 10 12](https://github.com/user-attachments/assets/9cbe4403-47bd-452a-9b36-a75a24f792e4) | ![Simulator Screenshot - iPhone SE (3rd generation) - 2025-01-16 at 18 09 47](https://github.com/user-attachments/assets/47706394-f394-4a3e-936c-da2f0716a274) |
| ![Simulator Screenshot - iPhone SE (3rd generation) - 2025-01-16 at 18 07 31](https://github.com/user-attachments/assets/5835e4f9-7f5e-4a9d-963d-501a1a577da7) | ![Simulator Screenshot - iPhone SE (3rd generation) - 2025-01-16 at 15 20 26](https://github.com/user-attachments/assets/d9ff678f-dce3-4684-9a15-bf11c2bab4bd) |

</details>

Reviewed By: cortinico

Differential Revision: D68322518

Pulled By: rshest

fbshipit-source-id: 9f153862efff7ef1e834bac9843f4042dbefbd1b
2025-01-17 06:20:53 -08:00
Yajur GroverandFacebook GitHub Bot 8c06f57860 Add default case to facebook::react::displayModeToInt() (#48711)
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
2025-01-17 05:14:55 -08:00
Riccardo CipolleschiandFacebook GitHub Bot eced906bed Re-enable the New Architecture by default (#48755)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48755

When [cleaning up the pre-alpha flags](https://github.com/facebook/react-native/commit/9a4b2cecd57dc797f90280be33eb4c80a06aaf72), we disabled the new architecture by default by mistake.

This change fixes that.

## Changelog:
[Internal] - Restore the New Arch by default

Reviewed By: GijsWeterings

Differential Revision: D68323159

fbshipit-source-id: cae96fc7c50319808e0afecf46ebf927e4db254a
2025-01-17 05:07:05 -08:00
Riccardo CipolleschiandFacebook GitHub Bot a7aed70ab1 Fix Dependencies of RCTFabric for RCTInterpolateColorInRange (#48753)
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
2025-01-17 05:07:05 -08:00
Riccardo CipolleschiandFacebook GitHub Bot a0ddcd256a Only include ReactCommon and ios platform for TextInput (#48754)
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
2025-01-17 05:07:05 -08:00
Sam ZhouandFacebook GitHub Bot 7278ff01d7 Deploy 0.259.1 to xplat (#48751)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48751

Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D68294434

fbshipit-source-id: 8827369836906464566069cf22b584a4c672ec92
2025-01-16 16:29:30 -08:00
nishan (o^▽^o)andFacebook GitHub Bot cc89ddd50b feat: linear gradient px and transition hint syntax support (#48410)
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
2025-01-16 15:00:37 -08:00
Pieter VanderwerffandFacebook GitHub Bot c65117eba9 Deploy 0.259.0 to fbsource (#48744)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48744

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D68279682

fbshipit-source-id: 2a7e19b75863d5fd31037e04fa334efda28de79e
2025-01-16 11:43:13 -08:00
Nick GerlemanandFacebook GitHub Bot 69f761f1ac Allow parser to support generic data types (#48718)
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
2025-01-16 11:42:34 -08:00
Nick GerlemanandFacebook GitHub Bot 2b925c8358 Fix unintentional fallthrough in keyword parsing (#48717)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48717

tsia

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D68246769

fbshipit-source-id: a5192880423cb00616981f4e1b24b7819062bc3b
2025-01-16 11:42:34 -08:00
Nick GerlemanandFacebook GitHub Bot ddf68eb949 Handle "transparent" color ident (#48716)
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
2025-01-16 11:42:34 -08:00
Nicola CortiandFacebook GitHub Bot de5bccf080 Cleanup prealpha logic from the JS Publishing Scripts (#48691)
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
2025-01-16 11:36:42 -08:00
David VaccaandFacebook GitHub Bot 878185678f Migrate ContentSizeWatcher to kotlin (#48743)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48743

Migrate ContentSizeWatcher to kotlin
changelog: [internal] internal

Reviewed By: tdn120

Differential Revision: D68278772

fbshipit-source-id: ba3c88be13aad3c49a8dd3771332b48725ea76c1
2025-01-16 11:36:06 -08:00
David VaccaandFacebook GitHub Bot c5041ea099 Migrate ScrollWatcher to Kotlin (#48742)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48742

Migrate ScrollWatcher to Kotlin

changelog: [internal] internal

Reviewed By: tdn120

Differential Revision: D68278771

fbshipit-source-id: 550c3b6c83999b1d610cb3d75ec91f552d89c028
2025-01-16 11:36:06 -08:00
Nicola CortiandFacebook GitHub Bot 40c18e1259 Remove last tasks.creating invocation inside hermes-engine (#48739)
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
2025-01-16 11:00:59 -08:00
Rob HoganandFacebook GitHub Bot f30c46efbd Fix "paused on debugger" overlay icon (#48736)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48736

Pull Request resolved: https://github.com/facebook/react-native/pull/48735

This icon was broken by D65457771, identified in [OSS testing for the 0.77 release](https://github.com/reactwg/react-native-releases/issues/724).

By explicitly setting the image for the `Disabled` state to the same as `Normal`, we get the same behaviour as the deprecated [`adjustsImageWhenDisabled = NO`](https://developer.apple.com/documentation/uikit/uibutton/adjustsimagewhendisabled?language=objc) without the need for `configurationUpdateHandler`.

Changelog: [iOS][Fixed] Restore "Paused in debugger" overlay icon

Reviewed By: cipolleschi

Differential Revision: D68274336

fbshipit-source-id: 3f4b84eb7cfb518ca953c721da9885df8f98b437
2025-01-16 10:51:58 -08:00
Samuel SuslaandFacebook GitHub Bot 6fa4cc6085 Back out "Animated: Optimize onUserDrivenAnimationEnded Deopt" (#48733)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48733

Original commit changeset: e7d7e486bbfd

Original Phabricator Diff: D67872307

changelog: [internal]

Reviewed By: yungsters

Differential Revision: D68268701

fbshipit-source-id: 1eb0dcb257c2d568cbc02ab2aa4a16b161797b24
2025-01-16 10:48:23 -08:00
Samuel SuslaandFacebook GitHub Bot 67fc85615a Back out "fix Pressable when transform style is animated" (#48732)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48732

Original commit changeset: e2ac108b064a

Original Phabricator Diff: D68154908

changelog: [internal]

please read summary in D68268701

Reviewed By: yungsters

Differential Revision: D68268700

fbshipit-source-id: ba908e0be5bd171d818efe1bcbb3a97279bafafe
2025-01-16 10:48:23 -08:00
Samuel SuslaandFacebook GitHub Bot b059050c87 Back out "Animated: Defer onAnimatedValueUpdate on Attach + Native" (#48731)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48731

Original commit changeset: 2089100a773e

Original Phabricator Diff: D68236594

changelog: [internal]

please read summary in D68268701

Reviewed By: yungsters

Differential Revision: D68268698

fbshipit-source-id: f122336209c4a5ec480d7a6a37224391eb1d2311
2025-01-16 10:48:23 -08:00
iwaterandFacebook GitHub Bot 0511e2e49a Disable weak event emitter in AttributedString for Apple Silicon Mac running iOS build app (#48583)
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
2025-01-16 10:09:03 -08:00
Peter AbbondanzoandFacebook GitHub Bot 8a12672e8a Declare shared interface for accessibility delegate methods (#48543)
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
2025-01-16 10:05:30 -08:00
Rob HoganandFacebook GitHub Bot b1938e9026 Add changelog for 0.77.0-rc.7 (#48738)
Summary:
Changelog for 0.77.0-rc.7

## Changelog:
[Internal] Changelog

Pull Request resolved: https://github.com/facebook/react-native/pull/48738

Test Plan: N/A

Reviewed By: cortinico

Differential Revision: D68276563

Pulled By: robhogan

fbshipit-source-id: ae57d179d98cd5200a449adbc1b38909633b10d1
2025-01-16 09:56:25 -08:00
Nicola CortiandFacebook GitHub Bot 44b18b9207 Use Gradle configuration avoidance API (#48603)
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
2025-01-16 08:49:32 -08:00
Peter AbbondanzoandFacebook GitHub Bot bc810e5115 Only apply event throttling to scroll view events (#48712)
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
2025-01-16 07:46:03 -08:00
Parsa NasirimehrandFacebook GitHub Bot 166347ead9 chore(Android): migrate MessageQueueThread and it's implementation to Kotlin (#48652)
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
2025-01-16 07:34:03 -08:00
Mateo GuzmánandFacebook GitHub Bot 9f1236eff2 Fix RTL examples in dark mode (#48719)
Summary:
RTL examples are not visible in dark mode.

## Changelog:

[INTERNAL] - Fix RTL examples in dark mode

Pull Request resolved: https://github.com/facebook/react-native/pull/48719

Test Plan:
<details>
<summary>Before and after screenshots</summary>

| Before                                                                                     | After                                                                                     |
|--------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------|
| ![Screenshot_1737000292](https://github.com/user-attachments/assets/4f36c5d3-ea51-4e9a-a962-b6cafbeb82da) | ![Screenshot_1737000381](https://github.com/user-attachments/assets/42f87100-6452-465b-b1de-e5dd26542459) |
</details>

Reviewed By: Abbondanzo

Differential Revision: D68265351

Pulled By: rshest

fbshipit-source-id: c4abcc3d11240c77248475ee34fbe4f5196e7834
2025-01-16 06:53:09 -08:00
Dawid MałeckiandFacebook GitHub Bot c720000ae0 Change Promise import syntax (#48725)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48725

Changelog:
[Internal] - Changed Promise import syntax

Reviewed By: cipolleschi

Differential Revision: D68214422

fbshipit-source-id: 1a92449dfae85148c680e449348fef0830c38769
2025-01-16 06:13:48 -08:00
Ruslan ShestopalyukandFacebook GitHub Bot 918638c1be Fix crash in TouchEvent when initialized with scroll MotionEvent action (#48723)
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
2025-01-16 04:35:51 -08:00
Dawid MałeckiandFacebook GitHub Bot 0e6cb590ec Replace $FlowFixMe generated in StaticRenderer snap and migrate to the 'export' syntax (#48667)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48667

Changelog:
[General][Changed] - refactored StaticRenderer syntax

Reviewed By: javache, elicwhite

Differential Revision: D68155216

fbshipit-source-id: a9ea2adef8e2d5aeaac5be4ec4a021595c4edf1f
2025-01-16 04:23:20 -08:00
Nicola CortiandFacebook GitHub Bot 1b15f57c25 No need to invoke 'input keyevent 82' on test-e2e-local (#48707)
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
2025-01-16 04:11:13 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 198adb47af Fix ruby (#48721)
Summary:
Following the suggestions [here](https://stackoverflow.com/questions/79360526/uninitialized-constant-activesupportloggerthreadsafelevellogger-nameerror), it seems that concurrent-ruby has been released tonight and it is bugged. Let's pin it to the right version.

## Changelog:
[iOS][Changed] - Pin 'concurrent-ruby' to a working version

Pull Request resolved: https://github.com/facebook/react-native/pull/48721

Test Plan: GHA

Reviewed By: robhogan

Differential Revision: D68262719

Pulled By: cipolleschi

fbshipit-source-id: fc6410e28cc96f9d3769d3082a77cac0a3efe6db
2025-01-16 02:57:24 -08:00
Dawid MałeckiandFacebook GitHub Bot fa2fac1372 Replace $FlowFixMe in WebSocketEvent (#48693)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48693

Changelog:
[General][Changed] - Improved eventInitDict type in WebSocketEvent class

Reviewed By: elicwhite, cortinico

Differential Revision: D68207452

fbshipit-source-id: 55bb62134c2d67f250c5079304a9c2758d9361df
2025-01-16 02:19:54 -08:00
Dawid MałeckiandFacebook GitHub Bot 9a29264ffb Set explicit types in I18nManager exports
Summary:
Changelog:
[Internal] - Added explicit types in I18nManager exports

Reviewed By: elicwhite

Differential Revision: D68214193

fbshipit-source-id: 960ef7b9c0171aed983f4db620bb895ccbff6cd2
2025-01-16 02:08:37 -08:00
Dawid MałeckiandFacebook GitHub Bot 595d8c7fa1 Replace import syntax in ReactNativeTestTools (#48687)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48687

Changelog:
[Internal] - Replaced React and ReactTestRenderer import syntax in ReactNativeTestTools

Reviewed By: javache

Differential Revision: D68205425

fbshipit-source-id: 9dd31b57f3d09f602f8e5746b70e16edaf11cb4e
2025-01-16 02:07:05 -08:00
Dawid MałeckiandFacebook GitHub Bot 68ae3ca5e9 Change flatten import syntax in StyleSheet (#48705)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48705

Changelog:
[Internal] - Changed flatten import syntax in StyleSheet

Reviewed By: elicwhite

Differential Revision: D68213648

fbshipit-source-id: bf6c33387ae9d36b6ce41b57639948c2b4902e55
2025-01-16 02:04:05 -08:00
Dawid MałeckiandFacebook GitHub Bot df9d43f02b Replace $FlowFixMe in TextAncestor (#48704)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48704

Changelog:
[General][Changed] - Improved types in TextAncestor

Reviewed By: fabriziocucci

Differential Revision: D68213115

fbshipit-source-id: d71a2703799b518eb1adb70fb5792165b5956868
2025-01-16 01:48:51 -08:00
Tim YungandFacebook GitHub Bot 843582b8b5 Animated: Defer onAnimatedValueUpdate on Attach + Native (#48715)
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
2025-01-15 17:00:44 -08:00
Tim YungandFacebook GitHub Bot e0c0476553 RN: Re-enable useInsertionEffectsForAnimations (#48708)
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
2025-01-15 10:32:27 -08:00
Devan BuggayandFacebook GitHub Bot e566c1ec06 Implement escape/cancel key press callback for TextInput (#48680)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48680

## Changelog:

[General] [Added] - Adds the escape key to the key press event handler payload.

Reviewed By: shwanton

Differential Revision: D68186072

fbshipit-source-id: 01786c309bff4991c12fa667e933ff6105efe638
2025-01-15 08:34:55 -08:00
Iwo PlazaandFacebook GitHub Bot c89c5d7e3d Migrated Alert/*.js and ActionSheetIOS/*.js to use export syntax. (#48703)
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
2025-01-15 08:23:49 -08:00
Dawid MałeckiandFacebook GitHub Bot 1126bbb149 Add explicit type to supported commands in TextInputNativeCommands (#48688)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48688

Changelog:
[General][Changed] - Added explicit type to supported commands in TextInputNativeCommands

Reviewed By: cortinico

Differential Revision: D68205568

fbshipit-source-id: 53501cdeaf4d790b36156b59f76686e8fef5cc5f
2025-01-15 08:15:37 -08:00
Dawid MałeckiandFacebook GitHub Bot f36bfe5dfa Remove redundant {||} syntax (#48686)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48686

Changelog:
[Internal] - Removed redundant `{||}` syntax

Reviewed By: javache

Differential Revision: D68205038

fbshipit-source-id: f7d3271142b6443a5859c3b668b7aebd3ce3ef3f
2025-01-15 07:07:01 -08:00
Fabrizio CucciandFacebook GitHub Bot e8a64fd638 Migrate rn-tester/IntegrationTests/ImageCachePolicyTest.js to function components (#48701)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48701

As per title.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D68153254

fbshipit-source-id: 24789c814550cd592cb68a0576c5037088734a75
2025-01-15 06:11:21 -08:00
Fabrizio CucciandFacebook GitHub Bot 8c64e0868e Migrate rn-tester/IntegrationTests/SimpleSnapshotTest.js to function components (#48700)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48700

As per title.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D68152855

fbshipit-source-id: 121cb5dd65673121a021da12d10c7a7e118bd0dc
2025-01-15 06:11:21 -08:00
Fabrizio CucciandFacebook GitHub Bot 086e93d227 Migrate rn-tester/IntegrationTests/AppEventsTest.js to function components (#48699)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48699

As per title.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D68152557

fbshipit-source-id: 9fa6cad408f6fbd3da513623379b864d0c33c63d
2025-01-15 06:11:21 -08:00
Fabrizio CucciandFacebook GitHub Bot f864d6b533 Migrate rn-tester/IntegrationTests/ImageSnapshotTest.js to function components (#48698)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48698

As per title.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D68152467

fbshipit-source-id: 0f747f1646be5a3ca010c2c0e0591f13bfcaf2f4
2025-01-15 06:11:21 -08:00
Fabrizio CucciandFacebook GitHub Bot d1153ff468 Migrate rn-tester/IntegrationTests/PromiseTest.js to function components (#48697)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48697

As per title.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D68152416

fbshipit-source-id: 32d6d503ed119f8d7e5b9c139060b61ef44b8768
2025-01-15 06:11:21 -08:00
Fabrizio CucciandFacebook GitHub Bot 1a1714300e Migrate rn-tester/IntegrationTests/SyncMethodTest.js to function components (#48696)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48696

As per title.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D68152294

fbshipit-source-id: 16b36d4702159528fe99c1a7d54c2c7b58d30349
2025-01-15 06:11:21 -08:00
Fabrizio CucciandFacebook GitHub Bot c33954c80d Migrate rn-tester/IntegrationTests/GlobalEvalWithSourceUrlTest.js to function components (#48695)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48695

As per title.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D68152232

fbshipit-source-id: 918236f8c9789efab9cc43b85e53fa398909808c
2025-01-15 06:11:21 -08:00
Tim YungandFacebook GitHub Bot 00d272fb3b Animated: Fix onUserDrivenAnimationEnded w/ Insertion Effects (#48678)
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
2025-01-15 05:40:15 -08:00
Mateo GuzmánandFacebook GitHub Bot e7378f0d9e Migrate HeaderUtil to Kotlin (#48676)
Summary:
Migrate `HeaderUtil` to Kotlin.

## Changelog:

[INTERNAL] - Migrate `HeaderUtil` to Kotlin

Pull Request resolved: https://github.com/facebook/react-native/pull/48676

Test Plan:
The file had tests:

```bash
yarn test-android
```

Reviewed By: fabriziocucci

Differential Revision: D68205283

Pulled By: javache

fbshipit-source-id: 23ad7726a5e597d5012eec6b194af3b1e10a8b7a
2025-01-15 04:45:02 -08:00
Nicola CortiandFacebook GitHub Bot d90c278672 Reformat MutationObserver test to comply with yarn lint --fix (#48692)
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
2025-01-15 04:43:50 -08:00
Nicola CortiandFacebook GitHub Bot 9a4b2cecd5 Cleanup prealpha logic from Cocoapods (#48690)
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
2025-01-15 04:30:37 -08:00
Nicola CortiandFacebook GitHub Bot 63442d3757 RNGP - Cleanup prealpha logic from the Gradle Plugin (#48689)
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
2025-01-15 04:30:37 -08:00
LeviandFacebook GitHub Bot c09b71b990 Fabric: Support stylistic sets for fontVariant (#48674)
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
![image](https://github.com/user-attachments/assets/e4b661ba-0013-4e60-90d0-1864be538159)

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
2025-01-15 04:23:39 -08:00
Pieter De BaetsandFacebook GitHub Bot a18bc58645 Provide default implementation of ViewManager#getDelegate (#48664)
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
2025-01-15 04:05:47 -08:00
Pieter De BaetsandFacebook GitHub Bot 54ac150324 Convert com.facebook.react.uimanager.ViewManagerPropertyUpdater to Kotlin (#48658)
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
2025-01-15 04:05:47 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 5b1877fb3f Create changelog for 0.78.0-rc.0 (#48685)
Summary:
Add changelog for 0.78.0-rc.0

## Changelog:
[Internal] - Add changelog for 0.78.0-rc.0

Pull Request resolved: https://github.com/facebook/react-native/pull/48685

Test Plan: N/A

Reviewed By: cortinico

Differential Revision: D68205113

Pulled By: cipolleschi

fbshipit-source-id: f3f572e1da475ef6229b2432d3fff821ec2f5ae1
2025-01-15 03:06:55 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 559d070e8e Use RNTester App downloaded from CI instead of building (#48637)
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
2025-01-15 01:04:29 -08:00
Joe VilchesandFacebook GitHub Bot 3420eb87b0 Allow text inputs to handle native requestFocus calls (#48547)
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
2025-01-14 16:31:52 -08:00
Rayner KristantoandFacebook GitHub Bot 0f1d4704df Revert D68017325: Migrate StyleSheet/*.js to use export statements
Differential Revision:
D68017325

Original commit changeset: 3c5b94742f10

Original Phabricator Diff: D68017325

fbshipit-source-id: d7ea1edfe9cca151560e9c0e5554a07153cdb8da
2025-01-14 15:22:26 -08:00
Riccardo CipolleschiandFacebook GitHub Bot b3648be84f Bump maestro to see if it improves stability (#48677)
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
2025-01-14 13:32:51 -08:00
Fabrizio CucciandFacebook GitHub Bot 9d1e24cb2f Migrate rn-tester/IntegrationTests/IntegrationTestHarnessTest.js to function components (#48671)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48671

As per title.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D68151272

fbshipit-source-id: 5d42da93ab4fe8aaf34b8916a6d0a234f51c235a
2025-01-14 12:18:41 -08:00
Samuel SuslaandFacebook GitHub Bot 2204ec94d4 fix Pressable when transform style is animated (#48672)
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
2025-01-14 11:05:07 -08:00
Luna WeiandFacebook GitHub Bot e3c63cfd34 Remove native optionality (#48653)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48653

Changelog:
[General][Changed] - Mark intersectionRect required in NativeIntersectionObserverEntry

Reviewed By: rubennorte

Differential Revision: D68120751

fbshipit-source-id: 196b3d48cf33721031a0c2a9fa0a55d250926cbe
2025-01-14 09:58:50 -08:00
Dawid MałeckiandFacebook GitHub Bot 48cafc0b69 Replace $FlowFixMe in StatusBar (#48662)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48662

Changelog:
[General][Changed] - Improved types in StatusBar by adding StackProps

Reviewed By: javache

Differential Revision: D68152452

fbshipit-source-id: a1ec30526e78eb7205e786ae1d0209037e4a0aba
2025-01-14 09:51:04 -08:00
Nicola CortiandFacebook GitHub Bot 6368555ab0 RN-Tester: Reorder buttons in the New Architecture sample (#48666)
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
2025-01-14 09:15:36 -08:00
Nicola CortiandFacebook GitHub Bot ef7f714f57 Remove unnecessary LICENSE-docs (#48670)
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
2025-01-14 08:53:58 -08:00
Fabrizio CucciandFacebook GitHub Bot 51fb5ab87a Migrate rn-tester/IntegrationTests/AccessibilityManagerTest.js to function components (#48663)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48663

As per title.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D68151132

fbshipit-source-id: 6fd9c4999a95a6888795c5200aafb15ff623479f
2025-01-14 08:45:21 -08:00
Thomas NardoneandFacebook GitHub Bot a511c1bdee Fix null safety in views/text/frescosupport (#48612)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48612

Manual fixes to resolve nullsafe issues.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D67992722

fbshipit-source-id: a26cde9788bc3456ec756326208b4907ad989d4e
2025-01-14 08:28:03 -08:00
Thomas NardoneandFacebook GitHub Bot 8b8b0ba5dc Mark nullsafe fixmes in views/text/frescosupport (#48613)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48613

First step for nullsafe - annotate and mark fixmes

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D67992721

fbshipit-source-id: 0c0a3ac7d4442d35bba1f48d6aabf13a3a1d47c2
2025-01-14 08:28:03 -08:00
Samuel SuslaandFacebook GitHub Bot c799aa07e2 Back out "RN: Enable useInsertionEffectsForAnimations" (#48669)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48669

Original commit changeset: d09b2f1b7607

Original Phabricator Diff: D65906157

## Changelog:

[General] [Fixed] - Buttons becoming unresponsive when transform is animated

Reviewed By: yungsters

Differential Revision: D68152746

fbshipit-source-id: aa0c0aa3243c67c95128a75b40dd6aa1251abbca
2025-01-14 08:20:05 -08:00
Riccardo CipolleschiandFacebook GitHub Bot f44ff97c47 Properly test JSC for template_app e2e tests (#48656)
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
2025-01-14 08:11:25 -08:00
Dawid MałeckiandFacebook GitHub Bot 9f7bacaa6b Add explicit types for methods from AnimatedImplementation in AnimatedMock (#48610)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48610

Changelog:
[Internal] - Improved typings for AnimatedImplementation methods exported from AnimatedMock

Reviewed By: huntie

Differential Revision: D68019816

fbshipit-source-id: ee73213c0b519be9b72b8dfb2e91a125021de63e
2025-01-14 07:31:54 -08:00
Wojciech LewickiandFacebook GitHub Bot 07769d4d7e feat: Make DefaultReactNativeHost.clear() also invalidate DefaultReactHost (#48338)
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
2025-01-14 07:31:35 -08:00
Dawid MałeckiandFacebook GitHub Bot 8b5e2ea683 Replace ExactReactElement_DEPRECATED in ScrollViewStickyHeader (#48659)
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
2025-01-14 07:16:41 -08:00
Nicola CortiandFacebook GitHub Bot b7eccf23de Back out "Do not reset rn-artifacts-version on release branch" (#48651)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48651

Original commit changeset: dace7c931ec3

Original Phabricator Diff: D67975049

Reviewed By: cipolleschi

Differential Revision: D68114130

fbshipit-source-id: 9fb1707191037127b9ae985d2e3298a64e911590
2025-01-14 07:09:27 -08:00
Nicola CortiandFacebook GitHub Bot 85f9939031 Fix crash for Hermes Release due to HermesExecutor migration (#48660)
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
2025-01-14 06:12:00 -08:00
Iwo PlazaandFacebook GitHub Bot e4d969a4ab Migrate StyleSheet/*.js to use export statements (#48609)
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
2025-01-14 05:34:18 -08:00
Fabrizio CucciandFacebook GitHub Bot d95909ea15 Migrate rn-tester/js/components/RNTesterTitle.js to function components (#48649)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48649

As per title.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D68099051

fbshipit-source-id: 867010b692e6d71e4683cc12b4455be730413268
2025-01-14 03:20:05 -08:00
Fabrizio CucciandFacebook GitHub Bot 817cb17f78 Migrate rn-tester/js/examples/Layout/LayoutExample.js to function components (#48646)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48646

As per title.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D68098856

fbshipit-source-id: ad878569f5b88afa57895b4b08de32c880ee8242
2025-01-14 03:20:05 -08:00
Dawid MałeckiandFacebook GitHub Bot 2056794d24 Refactor import syntax that caused $FlowFixMe generation in snap (#48639)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48639

Changelog:
[Internal] - refactored import syntax in File, ElementProperties, Inspector, InspectorOverlay, InspectorPanel, PerformanceOverlay, Modal, YellowBoxDeprecated

Reviewed By: andrewdacenko

Differential Revision: D68099152

fbshipit-source-id: a0d840a6000fd3974a3ce4673455180a8be66288
2025-01-14 03:08:44 -08:00
Dawid MałeckiandFacebook GitHub Bot 647ca90a30 Replace $FlowFixMe in AnimatedWeb (#48633)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48633

Changelog:
[General][Changed] - Improved types in AnimatedWeb

Reviewed By: huntie

Differential Revision: D68092072

fbshipit-source-id: 396efffc64030b0b2d4085f969b92c422b227c0d
2025-01-14 02:59:52 -08:00
David VaccaandFacebook GitHub Bot 2d320fbd76 Cache ViewManagerDelegate on ViewManagers (#48550)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48550

Cache ViewManagerDelegate on ViewManagers

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D67957883

fbshipit-source-id: 8ec2f34fca04833e391b0bd5b9329cdc9ee12f08
2025-01-13 23:39:45 -08:00
Fabrizio CucciandFacebook GitHub Bot 980458c061 Migrate rn-tester/js/components/RNTesterButton.js to function components (#48645)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48645

As per title.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D68098118

fbshipit-source-id: 09f9c318afc210ca2ce6967dac7109544ef6717c
2025-01-13 13:07:44 -08:00
Pieter De BaetsandFacebook GitHub Bot 5a290c4cab Fix nullability of ViewManagerDelegate method args (#48602)
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
2025-01-13 10:54:37 -08:00
Fabrizio CucciandFacebook GitHub Bot 90d2f65301 Migrate rn-tester/js/examples/AppState/AppStateExample.js to function components (#48644)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48644

As per title.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D68095480

fbshipit-source-id: 2487fa5e66d672883cbfde0c68348a90db09d484
2025-01-13 10:47:13 -08:00
Fabrizio CucciandFacebook GitHub Bot 05e8007e12 Migrate rn-tester/js/examples/OrientationChange/OrientationChangeExample.js to function components (#48643)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48643

As per title.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D68095232

fbshipit-source-id: fdf45a3bb64c590ea21222a02ae94d975579db49
2025-01-13 10:47:13 -08:00
Fabrizio CucciandFacebook GitHub Bot 1e0009407d Migrate rn-tester/js/components/TextInlineView.js to function components (#48640)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48640

As per title.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D68095013

fbshipit-source-id: a593af63029352844e544245d88e7b4c9d7eb75c
2025-01-13 08:59:43 -08:00
Parsa NasirimehrandFacebook GitHub Bot 12e321daf0 chore(Android): Migrate Hermes Executor to Kotlin (#48617)
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
2025-01-13 08:44:05 -08:00
Thomas NardoneandFacebook GitHub Bot c7785e7ead Convert ReactTextInlineImageShadowNode (#48576)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48576

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D67981753

fbshipit-source-id: 5d8a2408af9af350c0d3b369677ff8ee00335554
2025-01-13 08:39:18 -08:00
Rubén NorteandFacebook GitHub Bot fe8d102663 Create placeholder for User Timing API tests (#48634)
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
2025-01-13 07:01:03 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 671520943f Remove build codegen from Cocoapods (#48631)
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
2025-01-13 07:00:12 -08:00
Mateo GuzmánandFacebook GitHub Bot d4407d6f77 Fix RNTester strict mode warnings (#48619)
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
2025-01-13 05:11:13 -08:00
6cb2684b43 fix modal becoming unresponsive with PullToRefresh
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>
2025-01-13 04:53:04 -08:00
Mateo GuzmánandFacebook GitHub Bot cc4e4c7fec Fix RNTester strict mode warnings (#48620)
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
2025-01-13 04:46:57 -08:00
Ilia SidorenkoandFacebook GitHub Bot 2f2281718a Resolve master specs repo warning shown in pod install (#48628)
Summary:
Fix for https://github.com/facebook/react-native/issues/48627

## Changelog:

[IOS] [FIXED] - Resolve "Your project does not explicitly specify the CocoaPods master specs repo" `pod install` warning

Pull Request resolved: https://github.com/facebook/react-native/pull/48628

Test Plan:
1. Run `bundle exec pod install`
2. Observe the warning no longer showing

Reviewed By: rshest

Differential Revision: D68094563

Pulled By: fabriziocucci

fbshipit-source-id: 8f7ef67e4c5f71af65b7958e67bb58e7277a3e0e
2025-01-13 04:33:27 -08:00
Dawid MałeckiandFacebook GitHub Bot f832c450a5 Replace $FlowFixMe in BoxInspector and refactor (#48601)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48601

Changelog:
[General][Changed] - Improved types in BoxInspector and refactored a code

Reviewed By: NickGerleman

Differential Revision: D68017470

fbshipit-source-id: f55b958aeee44babb41cea996f944cbc551a7a7b
2025-01-13 02:11:33 -08:00
Dawid MałeckiandFacebook GitHub Bot 49e5c58c59 Replace $FlowFixMeProps in StyleInspector and refactor (#48608)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48608

Changelog:
[General][Changed] - Improved types in StyleInspector and refactored a code

Reviewed By: fabriziocucci

Differential Revision: D68018846

fbshipit-source-id: ce737ec28a54c5d80d98f79380327b049c3e394b
2025-01-13 02:09:30 -08:00
Dawid MałeckiandFacebook GitHub Bot 2959d49e8d Replace $FlowFixMeProps in ElementBox and refactor (#48605)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48605

Changelog:
[General][Changed] - Improved types in ElementBox and refactored a code

Reviewed By: NickGerleman

Differential Revision: D68018112

fbshipit-source-id: 369b5fb06d1f9d0bd450f487ab792b23b1d094af
2025-01-13 00:19:36 -08:00
Dawid MałeckiandFacebook GitHub Bot 48a7840919 Replace $FlowFixMe in BorderBox (#48593)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48593

Changelog: [General][Changed] - Improve types on BorderBox

Reviewed By: NickGerleman

Differential Revision: D68014754

fbshipit-source-id: ab6af9ffb4a80a4040011c1a27ede95ea2c59171
2025-01-13 00:17:56 -08:00
Samuel SuslaandFacebook GitHub Bot 83699228c0 isolate use of folly to interpolateViewProps on Android (#48556)
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
2025-01-10 16:15:05 -08:00
Christoph PurrerandFacebook GitHub Bot 55d0bc4b77 Align logic in BaseTextInputShadowNode to calculate placeholder string with AndroidTextInputShadowNode (#48584)
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
2025-01-10 15:35:34 -08:00
Eli WhiteandFacebook GitHub Bot cf5ab03d43 Include cxx modules in codegen schema (#48581)
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
2025-01-10 14:38:57 -08:00
David VaccaandFacebook GitHub Bot db57080e08 Refactor ViewManager codegen to use new ViewManagerInterface (#48549)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48549

Refactor ViewManager codegen to use new ViewManagerInterface

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D67957884

fbshipit-source-id: 7abcd453580ab2219770fd1aff780ba2977dfc8a
2025-01-10 13:58:28 -08:00
David VaccaandFacebook GitHub Bot 40a0cdbc99 Introduce ViewManagerInterface (#48548)
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
2025-01-10 13:58:28 -08:00
Christoph PurrerandFacebook GitHub Bot 6865e5a993 Preparation for sharing common ShadowNode functionality in BaseTextInputShadowNode for Android (#48582)
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
2025-01-10 13:28:16 -08:00
Nick GerlemanandFacebook GitHub Bot e53b76b6c6 Cleanup enableAndroidLineHeightCentering flag (#48577)
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
2025-01-10 13:08:45 -08:00
Nicola CortiandFacebook GitHub Bot 2ab9a8c135 Cleanup enableAlignItemsBaselineOnFabricIOS (#48607)
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
2025-01-10 11:15:03 -08:00
Nicola CortiandFacebook GitHub Bot a40a885d88 Fix test-e2e-local with RNTester due to unbuilt codegen (#48558)
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
2025-01-10 08:46:37 -08:00
Pieter De BaetsandFacebook GitHub Bot f6f7de61f4 Drop dependency on native/fb (#48568)
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
2025-01-10 08:16:26 -08:00
Pieter De BaetsandFacebook GitHub Bot b0466d8cdd Remove unnecessary interpolation for logcat logging (#48567)
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
2025-01-10 08:16:26 -08:00
Nicola CortiandFacebook GitHub Bot 7dcbc799eb Fix crash for setEventEmitterCallback NoSuchMethodError on API lvl 26 (#48606)
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
2025-01-10 07:56:17 -08:00
Nicola CortiandFacebook GitHub Bot 4c7c836ebf AGP to 8.8.0 (#48604)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48604

Just keeping our dependency up to date.

Changelog:
[Android] [Changed] - Bumped Android Gradle Plugin (AGP) to 8.8.0

Reviewed By: cipolleschi

Differential Revision: D68017839

fbshipit-source-id: 6a452d60cce9bb60e67013eab0bef27e2f2adfc0
2025-01-10 07:38:19 -08:00
Nicola CortiandFacebook GitHub Bot 7bb92a3c2d refactor: Remove unnecessary parameter from configureRepositories (#48596)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48596

The second parameter of `configureRepositories` was unused. Let's remove it.

Changelog:
[Internal] [Changed] - refactor: Remove unnecessary parameter from configureRepositories

Reviewed By: cipolleschi

Differential Revision: D68016105

fbshipit-source-id: 9fa05cd33e2f7a6986cf1fcdef0d75e74f315843
2025-01-10 07:38:08 -08:00
Nicola CortiandFacebook GitHub Bot a98528e609 Make the addition of JitPack repository configurable (#48595)
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
2025-01-10 07:38:08 -08:00
Nicola CortiandFacebook GitHub Bot c85be01cba Add .kotlin/ to gitignore (#48598)
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
2025-01-10 07:35:12 -08:00
Rubén NorteandFacebook GitHub Bot fd0894b1c7 Add support for the columns option in console.table (#48592)
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
2025-01-10 05:41:37 -08:00
Rubén NorteandFacebook GitHub Bot 7154c62afb Improve formatting of table in console.table (#48591)
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
2025-01-10 05:41:37 -08:00
Rubén NorteandFacebook GitHub Bot caa77fbe2b Prevent console.table from modifying passed values (#48590)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48590

Changelog: [General][Fixed] Modified `console.table` to avoid mutating the received argument.

Reviewed By: sammy-SC

Differential Revision: D67791795

fbshipit-source-id: a889fe95914cf7850e6429742845b126917babc7
2025-01-10 05:41:37 -08:00
Rubén NorteandFacebook GitHub Bot 7f985f29e3 Add tests for console.table (#48589)
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
2025-01-10 05:41:37 -08:00
Nicola CortiandFacebook GitHub Bot a28d3961bd Do not reset rn-artifacts-version on release branch (#48572)
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
2025-01-10 03:44:04 -08:00
Rubén NorteandFacebook GitHub Bot deea42329e Remove verification function from ReactFabricPublicInstance benchmark (#48588)
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
2025-01-10 03:35:04 -08:00
Samuel SuslaandFacebook GitHub Bot bb6bbfc261 remove folly::tryTo (#48557)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48557

changelog: [internal]

delete use of folly::tryTo from react native.

Reviewed By: christophpurrer

Differential Revision: D67942789

fbshipit-source-id: 976caa12b6ff6063041be3259aa8ebd642ca3ca0
2025-01-10 03:23:11 -08:00
Jakub PiaseckiandFacebook GitHub Bot 1051bd8f3e Explicitly type UIManagerProperties (#48587)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48587

Changelog: [Internal]

Reviewed By: cortinico, huntie

Differential Revision: D67977469

fbshipit-source-id: 0f866aeaa3d19ba2bc01d2e4685487c9b1a3329f
2025-01-10 02:26:57 -08:00
Peter AbbondanzoandFacebook GitHub Bot 071506fa61 Add tinted vector drawable example to RNTester (#48541)
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
2025-01-09 19:56:12 -08:00
Nick GerlemanandFacebook GitHub Bot 9b646c8b7b Fix incorrect height of single line TextInput without definite size (#48523)
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
2025-01-09 10:57:05 -08:00
Rubén NorteandFacebook GitHub Bot 8310d651e0 Mark benchmark API as unstable (#48570)
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
2025-01-09 10:11:18 -08:00
Samuel SuslaandFacebook GitHub Bot 8d67d51bdc remove use of folly::init (#48573)
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
2025-01-09 08:43:22 -08:00
Alex HuntandFacebook GitHub Bot b5155fba89 Replace $FlowFixMe in DrawerLayoutAndroid (#48569)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48569

Changelog:
[General][Changed] - Improve types on DrawerLayoutAndroid

Reviewed By: cipolleschi

Differential Revision: D67975172

fbshipit-source-id: 922d51d78b9e035f7703b1d53af39fa6dae8060b
2025-01-09 07:47:58 -08:00
Riccardo CipolleschiandFacebook GitHub Bot f7977387f4 Update classification of Fixed (#48561)
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
2025-01-09 07:11:57 -08:00
Riccardo CipolleschiandFacebook GitHub Bot efb2aa0d5b Update classification of Deprecated (#48562)
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
2025-01-09 07:11:57 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 36daa41c26 Update classification of Changed (#48563)
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
2025-01-09 07:11:57 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 16b047968f Update classification of Added (#48564)
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
2025-01-09 07:11:57 -08:00
Riccardo CipolleschiandFacebook GitHub Bot d9af80f471 Update classification of RCs (#48565)
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
2025-01-09 07:11:57 -08:00
Riccardo CipolleschiandFacebook GitHub Bot cdc8c9db09 Start fixing changelog for 0.77 (#48528)
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
2025-01-09 07:11:57 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 85745f3551 Add Changelog for 0.76.6 (#48566)
Summary:
Add changelog for 0.76.6

## Changelog:
[Internal] - Add Changelog for 0.76.6

Pull Request resolved: https://github.com/facebook/react-native/pull/48566

Test Plan: N/A

Reviewed By: cortinico

Differential Revision: D67973501

Pulled By: cipolleschi

fbshipit-source-id: a3c5c78620dfd7bb1c917dfc33d98801abe0a373
2025-01-09 06:51:53 -08:00
Samuel SuslaandFacebook GitHub Bot 1cbcea49bf write fantom tests percentage based width and height (#48560)
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
2025-01-09 06:09:36 -08:00
Rubén NorteandFacebook GitHub Bot e7a37c1b5f Move assets for feature flags docs to a __docs__ directory (#48555)
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
2025-01-09 05:31:19 -08:00
Rubén NorteandFacebook GitHub Bot f1cbf25c09 Extract common logic in ErrorHandlers to a shared method (#48366)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48366

Changelog: [internal]

Just removing some unnecessary duplication from this file.

Reviewed By: christophpurrer

Differential Revision: D67407220

fbshipit-source-id: 2f3e1ac4dddb7f8ede75175242e4b37e628196a0
2025-01-09 04:35:08 -08:00
Nicola CortiandFacebook GitHub Bot 1282361573 Silence the eden info output from react-native-codegen (#48540)
Summary:
We currently see this error message on console:
![Screenshot 2025-01-08 at 19 09 47](https://github.com/user-attachments/assets/3b384772-9abc-40a5-83b3-9b4ccce85f4a)

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
2025-01-09 04:01:29 -08:00
Rubén NorteandFacebook GitHub Bot 742e14d47f Add a few more tests to ReactNativeElement (#48428)
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
2025-01-09 03:45:27 -08:00
Nicola CortiandFacebook GitHub Bot 5e6478954c Gradle to 8.12 (#48539)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48539

This keeps our Gradle version up to date ahead of the branch cut for 0.78.
https://docs.gradle.org/current/release-notes.html

Changelog:
[Android] [Changed] - Bump Gradle to 8.12

Reviewed By: NickGerleman

Differential Revision: D67946619

fbshipit-source-id: 0b5ea8d9543ca565ea8b3bdd48e5fc711f832ce8
2025-01-09 03:10:02 -08:00
David VaccaandFacebook GitHub Bot cfec590f6a Defining constant'types for API stability (#48546)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48546

Defining constant'types for API stability

changelog: [internal] internal

Reviewed By: shwanton

Differential Revision: D67953794

fbshipit-source-id: 7f833d1999340a6a4073f3eb303251c52d9d6fc6
2025-01-08 16:15:58 -08:00
David VaccaandFacebook GitHub Bot a79a1123c9 Internalize RootViewManager (#48545)
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
2025-01-08 16:15:58 -08:00
Peter AbbondanzoandFacebook GitHub Bot dc5535cf88 Improve documentation for AssetSourceResolver (#48532)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48532

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D67942309

fbshipit-source-id: 0f3901bfcd58863adf6dc8466bb5d587438e0d2c
2025-01-08 14:54:17 -08:00
Peter AbbondanzoandFacebook GitHub Bot 6feb90bb29 Replace custom XmlFormat with Fresco built-in (#48533)
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
2025-01-08 14:54:17 -08:00
Peter AbbondanzoandFacebook GitHub Bot 819b5c2c8d Bump Fresco to 3.6.0 (#48542)
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
2025-01-08 14:54:17 -08:00
Peter AbbondanzoandFacebook GitHub Bot 218815959b xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewAccessibilityDelegate.java (#48530)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48530

Changelog: [Internal]

Reviewed By: tdn120

Differential Revision: D67912326

fbshipit-source-id: b03be79dfbf3bf8d92b11eb6228ecc36282b29cf
2025-01-08 14:46:01 -08:00
David VaccaandFacebook GitHub Bot 843588ffe5 Refactor PointerEvents strings as constants (#48537)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48537

Refactor PointerEvents strings as constants

changelog: [internal] internal

Reviewed By: shwanton

Differential Revision: D67924567

fbshipit-source-id: 7d9976d293cef3eeedbbb72abd20d8f877b768d0
2025-01-08 11:37:47 -08:00
David VaccaandFacebook GitHub Bot e4ec22de9d Delete POSITION_SPACING_TYPES from ViewProps (#48536)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48536

POSITION_SPACING_TYPES is not being used, let's delete it

changelog: [internal] internal

Reviewed By: christophpurrer

Differential Revision: D67924569

fbshipit-source-id: 6cc4b0537032f4a4b54dbd728ca52ba216fd6cee
2025-01-08 11:37:47 -08:00
David VaccaandFacebook GitHub Bot c17e6ce0f0 Delete ON_LAYOUT constant (#48535)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48535

ON_LAYOUT is not being used, lets delete it

changelog: [internal] internal

Reviewed By: christophpurrer

Differential Revision: D67924570

fbshipit-source-id: b5522317c943c07f8617508c0345b18a6f31ce7e
2025-01-08 11:37:47 -08:00
David VaccaandFacebook GitHub Bot 98b413416c Delete unused constants in ViewProps (#48534)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48534

IS_ATTACHMENT is unused, let's delete it

changelog: [internal] internal

Reviewed By: christophpurrer

Differential Revision: D67924566

fbshipit-source-id: 49718f4ce667abe919a314a853dbd7853bfe1292
2025-01-08 11:37:47 -08:00
Nick GerlemanandFacebook GitHub Bot f7a5db3c06 Fix TextMeasureCacheKey Throwing Out Some LayoutConstraints (#48525)
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
2025-01-08 10:33:25 -08:00
Tim YungandFacebook GitHub Bot 85e58f334e Prettier: Cleanup eslint-plugin-prettier Dependency (#48524)
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
2025-01-08 09:42:59 -08:00
Tim YungandFacebook GitHub Bot 6d67d6a7f6 Animated: Optimize onUserDrivenAnimationEnded Deopt (#48511)
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
2025-01-08 09:03:17 -08:00
Sam ZhouandFacebook GitHub Bot abf0384434 Deploy 0.258.1 to xplat
Summary: Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D67927891

fbshipit-source-id: ac9c7bd87e9f1e2fecdbd7141cd0e5c5a62c7ce6
2025-01-08 08:47:41 -08:00
Pieter De BaetsandFacebook GitHub Bot a62230a54d Merge copies of GuardedFrameCallback (#48529)
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
2025-01-08 07:40:32 -08:00
Peter AbbondanzoandFacebook GitHub Bot ec72af403c Mark string props as nullable in scrollview managers (#48520)
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
2025-01-07 15:13:34 -08:00
Oskar KwaśniewskiandFacebook GitHub Bot 8b0af4542e fix(iOS): enable/disable keyboard shortcuts only on iOS (#48518)
Summary:
This PR guards code that enables/disables keyboard shortcuts only on iOS (iPadOS included).

![CleanShot 2025-01-07 at 14 49 36@2x](https://github.com/user-attachments/assets/cba4e19c-5a52-4874-94cf-a3e18112c8a3)

## 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
2025-01-07 13:21:19 -08:00
Tim YungandFacebook GitHub Bot 38c46fe865 Animated: Lower onAnimatedValueUpdate to AnimatedValue (#48514)
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
2025-01-07 10:05:15 -08:00
Tim YungandFacebook GitHub Bot d3c5f6d1df Animated: Add Missing super.__attach() Calls (#48513)
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
2025-01-07 10:05:15 -08:00
Pieter De BaetsandFacebook GitHub Bot 3f6fc32a5c Fix nullability of ViewManagerDelegate
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
2025-01-07 09:52:55 -08:00
Rob HoganandFacebook GitHub Bot 7a58f1f5bf Add changelog for 0.77.0-rc.6 (#48508)
Summary:
Changelog for 0.77.0-rc.6

## Changelog:

[Internal]

Pull Request resolved: https://github.com/facebook/react-native/pull/48508

Test Plan: N/A

Reviewed By: christophpurrer

Differential Revision: D67866154

Pulled By: robhogan

fbshipit-source-id: a64f2aa83abe31bbc8d9e1a2ac47e00bba55c389
2025-01-07 08:45:34 -08:00
Pieter De BaetsandFacebook GitHub Bot afd77d52ed Rename SurfaceRegistryBinding to AppRegistryBinding (#48337)
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
2025-01-07 07:40:40 -08:00
Pieter De BaetsandFacebook GitHub Bot dbb75e36dc Always use AppRegistry globals in SurfaceRegistryBinding (#48336)
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
2025-01-07 07:40:40 -08:00
Pieter De BaetsandFacebook GitHub Bot 65bda54232 Remove getInspectorDataForInstance (#48335)
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
2025-01-07 07:40:40 -08:00
Alex HuntandFacebook GitHub Bot eda29f0a56 Remove legacy InspectorPackagerConnection (#48506)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48506

Cleanup after the original experiment removal in D57730921, and having launched Fusebox for a full release cycle.

- This was previously opened as D58017460 and reverted in D58132473 ([see comment](https://www.internalfb.com/diff/D58017460?transaction_fbid=980942997022731)).

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D67858259

fbshipit-source-id: f4b29247dd4c310cc1f6b6f45688756d7b925a5e
2025-01-07 05:48:00 -08:00
Blake FriedmanandFacebook GitHub Bot a8cf53fcd1 Add messaging to phabricator (#48470)
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
2025-01-07 03:41:42 -08:00
Parsa NasirimehrandFacebook GitHub Bot d22dbb5c51 chore(Android): Migrate Hermes Instruments to Kotlin (#48378)
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
2025-01-07 00:49:59 -08:00
generatedunixname89002005232357andFacebook GitHub Bot cd40e4e387 Revert D67868219 (#48512)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48512

This diff reverts D67868219
Breaking OTA Compatibility Check https://fburl.com/onedetection/m0hqsvjp

[General][Changed] - Revert: Mark intersectionRect required in NativeIntersectionObserverEntry to reflect native logic.

Reviewed By: lunaleaps

Differential Revision: D67882016

fbshipit-source-id: 8cff299ee823f8ef06fe96667e832b68be45666d
2025-01-06 22:28:51 -08:00
Christoph PurrerandFacebook GitHub Bot 65c6a0a941 Add getSurfaceProps helper method to SurfaceManager (#48487)
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
2025-01-06 21:49:49 -08:00
Christoph PurrerandFacebook GitHub Bot 44525aaf8b Add isSurfaceRunning / getRunningSurfaces util functions to SurfaceManager (#48484)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48484

[Changelog] [Internal] - Add isSurfaceRunning / getRunningSurfaces util functions to SurfaceManager

This exposes convience getter methods to data already stored in SurfaceManager

Reviewed By: rshest

Differential Revision: D67814092

fbshipit-source-id: af5e9df3b380d5efc0c11627a0d9a56796526639
2025-01-06 18:51:46 -08:00
Eli WhiteandFacebook GitHub Bot 25c673e357 Fixing schema types for component command params of Arrays (#48476)
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
2025-01-06 18:42:37 -08:00
Eli WhiteandFacebook GitHub Bot c748b44183 Add command type to CompleteTypeAnnotation (#48475)
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
2025-01-06 18:42:37 -08:00
Eli WhiteandFacebook GitHub Bot 825492b199 Separate component array types and command array types (#48474)
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
2025-01-06 18:42:37 -08:00
Eli WhiteandFacebook GitHub Bot c91cfd1ec1 Simplify CompleteTypeAnnotation (#48473)
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
2025-01-06 18:42:37 -08:00
Eli WhiteandFacebook GitHub Bot 02c6790842 Make CompleteType contain module and component reserved names (#48477)
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
2025-01-06 18:42:37 -08:00
Christoph PurrerandFacebook GitHub Bot c8552519b3 Make SurfaceManager const correct (#48485)
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
2025-01-06 14:41:39 -08:00
Luna WeiandFacebook GitHub Bot 8681fc2ab2 Remove optionality of intersectionRect
Summary:
Changelog:
[General][Changed] - Mark `intersectionRect` required in `NativeIntersectionObserverEntry` to reflect native logic.

Reviewed By: rubennorte

Differential Revision: D67868219

fbshipit-source-id: cdc15908c0cf687b13d1424a59ee1e2383811ab3
2025-01-06 13:30:10 -08:00
Christoph PurrerandFacebook GitHub Bot 3744349ed7 Add RuntimeSchedulerKey constant for RuntimeScheduler lookup (#48486)
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
2025-01-06 11:23:04 -08:00
Christoph PurrerandFacebook GitHub Bot c4edfe7323 Remove startEmptySurface from SurfaceManager (#48479)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48479

[Changelog] [Internal] - Remove startEmptySurface from SurfaceManager

Most of the logic deleted here does not seem to be needed as the core functionality is in:

https://github.com/facebook/react-native/blob/main/packages/react-native/ReactCommon/react/renderer/scheduler/SurfaceHandler.cpp#L88-L96

And this code path can be reached both via
- `startSurface` (by passing in an empty `moduleModule` OR
- `startEmptySurface`

Reviewed By: shwanton, rubennorte

Differential Revision: D67805569

fbshipit-source-id: e3d06dcaa637996498a6cb52b5c1b98f740326ce
2025-01-06 10:32:16 -08:00
Mykhailo KravchenkoandFacebook GitHub Bot 0154372b93 feat: Manage keyboard shortcuts visibility of TextInput (#47671)
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
2025-01-06 09:54:29 -08:00
zhongwuzwandFacebook GitHub Bot a3dfc4984d Fabric: Added ScrollEndDragEvent for scrollEndDrag event (#48319)
Summary:
Fixes https://github.com/facebook/react-native/issues/42533 .

## Changelog:

[IOS] [FIXED] -  Fabric: Added ScrollEndDragEvent for scrollEndDrag event

Pull Request resolved: https://github.com/facebook/react-native/pull/48319

Test Plan: Repro please see https://github.com/facebook/react-native/issues/42533 .

Reviewed By: javache

Differential Revision: D67517912

Pulled By: cipolleschi

fbshipit-source-id: aa1caebfb690d09a207b3ebce382eceb520009e5
2025-01-06 08:44:23 -08:00
Rubén NorteandFacebook GitHub Bot cb308bdc5e Add benchmark for host component class variants (#48450)
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
2025-01-06 07:10:28 -08:00
Rubén NorteandFacebook GitHub Bot ff7c550a86 Run benchmarks in test mode when not specifying verification functions in CI (#48451)
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
2025-01-06 07:10:28 -08:00
Rubén NorteandFacebook GitHub Bot 3795f0fb66 Add API to run benchmarks in Fantom (#48452)
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
2025-01-06 07:10:28 -08:00
Rubén NorteandFacebook GitHub Bot 96205dd78e Add tinybench to run benchmarks in Fantom (#48453)
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
2025-01-06 07:10:28 -08:00
Rubén NorteandFacebook GitHub Bot bc3072eafc Implement native module to measure CPU time (#48454)
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
2025-01-06 07:10:28 -08:00
Alex HuntandFacebook GitHub Bot eee2866508 Fix InspectorFlags debug default, clean up legacy Buck opt in (#48504)
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
2025-01-06 07:02:22 -08:00
Mateo GuzmánandFacebook GitHub Bot b477cfa0ba Add AppStateModule Android unit tests (#48492)
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
2025-01-06 06:49:27 -08:00
Kræn HansenandFacebook GitHub Bot 7a85b91125 Fix ruby unit tests (#48498)
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
2025-01-06 02:31:42 -08:00
Ruslan ShestopalyukandFacebook GitHub Bot 5ce07386e1 Convert FabricEventDispatcher (#48491)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48491

# Changelog:
[Internal] -

As in the title.

Reviewed By: christophpurrer

Differential Revision: D67825655

fbshipit-source-id: e94431ae6978332c0566ab0a500e1a85f1ad9a7d
2025-01-06 01:46:46 -08:00
Ruslan ShestopalyukandFacebook GitHub Bot a9d86be3a4 Migrate EventDispatcher interface to Kotlin (#48445)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48445

# Changelog:
[Internal] -

As in the title.

Reviewed By: christophpurrer

Differential Revision: D67760373

fbshipit-source-id: 6360ed5b488ec47bdd2e4d0357d0d06e8e42f614
2025-01-06 01:46:46 -08:00
Ruslan ShestopalyukandFacebook GitHub Bot d470f39d8a Migrate RCTEventEmitter to Kotlin (#48467)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48467

# Changelog:
[Internal] -

As in the title.

Reviewed By: christophpurrer

Differential Revision: D67793304

fbshipit-source-id: 39bbdebf8434ad57bab3e1d309915a8132033f5b
2025-01-06 01:46:46 -08:00
Alan LeeandFacebook GitHub Bot d5f33c19cb com.facebook.react.views.text.frescosupport.FrescoBasedReactTextInlineImageViewManager.java (#47561)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47561

Convert Java to Kotlin

Changelog:

[Android][Breaking] changed visibility of FrescoBasedReactTextInlineImageViewManager to internal

Reviewed By: javache

Differential Revision: D65606954

fbshipit-source-id: bfdb5624a104029c8d667ddb9262c862ab846a61
2025-01-06 01:26:14 -08:00
woxtuandFacebook GitHub Bot 088fcb1e5d Resolve run script build phase warnings (#48495)
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
2025-01-06 00:46:51 -08:00
Ruslan ShestopalyukandFacebook GitHub Bot e99b47ce48 Use proper mockito/kotlin for RootViewTest and JSPointerDispatcherTest (#48490)
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
2025-01-05 08:38:43 -08:00
Ruslan ShestopalyukandFacebook GitHub Bot b867c01fa6 Convert RCTModernEventEmitter (#48466)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48466

# Changelog:
[Internal] -

As in the title.

Reviewed By: christophpurrer

Differential Revision: D67793108

fbshipit-source-id: 1730f4519f740372bde392236feae23ad4a18f0a
2025-01-04 12:44:48 -08:00
Ruslan ShestopalyukandFacebook GitHub Bot 4ad6a94c60 Kotlinify EventEmitterWrapper (#48489)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48489

# Changelog:
[Internal] -

As in the title.

Reviewed By: christophpurrer

Differential Revision: D67823110

fbshipit-source-id: 840d15d891066b3fc8e6fa8cd2e856ee51e72ce3
2025-01-04 12:24:50 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 23780f8cb7 Use the app artifact in E2E tests (#48469)
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
2025-01-04 09:02:17 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 9bf7aff882 Fix code to record and upload videos (#48444)
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
2025-01-04 09:02:17 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 3d2e5447be Store the RNTester artifacts to speed-up E2E (#48442)
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
2025-01-04 09:02:17 -08:00
Christoph PurrerandFacebook GitHub Bot 6abcca8374 Stop all surfaces on SurfaceManager destruction (#48481)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48481

[Changelog] [Internal] - Stop all surfaces on SurfaceManager destruction

Reviewed By: zeyap

Differential Revision: D67809574

fbshipit-source-id: 150ddd091e6822c3a40f8ea413aa65da50445ede
2025-01-03 19:58:06 -08:00
Ruslan ShestopalyukandFacebook GitHub Bot a6e6f5e869 ReactEventEmitter -> Kotlin (#48464)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48464

# Changelog:
[Internal] -

As in the title.

Reviewed By: christophpurrer

Differential Revision: D67791375

fbshipit-source-id: eca1f999b43c405ce48aa5fa3518ec08363f5836
2025-01-03 16:24:09 -08:00
Ruslan ShestopalyukandFacebook GitHub Bot 076920647e Migrate PointerEventHelper (#48459)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48459

# Changelog:
[Internal] -

As in the title.

Reviewed By: tdn120

Differential Revision: D67762029

fbshipit-source-id: c29010d20aa7a4cbe2d92aeacc1851eec3c7701e
2025-01-03 16:24:09 -08:00
Mateo GuzmánandFacebook GitHub Bot 33aebc34bf Fix RNTester dark mode Android Text examples (#48380)
Summary:
The Android `Text` examples in dark mode are not readable. This PR addresses that by replacing the `Text` usages with `RNTesterText`.

## Changelog:

[INTERNAL] [FIXED] - Fixing dark mode Android `Text` examples

Pull Request resolved: https://github.com/facebook/react-native/pull/48380

Test Plan:
Some screenshots after the fixes.

| Image 1 | Image 2 | Image 3 | Image 4 | Image 5 |
|---------|---------|---------|---------|---------|
| ![Screenshot_1734981250](https://github.com/user-attachments/assets/d9c27ac7-5024-478b-a47c-3c057801eea1) | ![Screenshot_1734981168](https://github.com/user-attachments/assets/92c6e11a-ac30-46f5-8878-3659d9e40f9a) | ![Screenshot_1734981146](https://github.com/user-attachments/assets/8bfba649-e036-473a-a622-2289daf67951) | ![Screenshot_1734981127](https://github.com/user-attachments/assets/9b1e2a68-8b34-463b-8637-f2b5682733d2) | ![Screenshot_1734981115](https://github.com/user-attachments/assets/af0c85c5-6216-4af1-ae92-b818213f3719) |
| Image 6 | Image 7 | Image 8 | Image 9 | Image 10 |
|---------|---------|---------|---------|---------|
| ![Screenshot_1734981101](https://github.com/user-attachments/assets/91a07f43-8b9e-4462-8906-5ee1f68741a5) | ![Screenshot_1734981080](https://github.com/user-attachments/assets/3b8ffe9a-53b9-4863-b332-d3055740aa18) | ![Screenshot_1734980904](https://github.com/user-attachments/assets/c5aa8bb6-f1f6-4693-bc31-74557946f009) | ![Screenshot_1734981057](https://github.com/user-attachments/assets/10c8c785-58b8-401a-ad18-7bdcd91cd28d) | ![Screenshot_1734980876](https://github.com/user-attachments/assets/d9ed3b35-01fe-4311-adf3-7a6e4e13aeab) |

Reviewed By: javache

Differential Revision: D67657571

Pulled By: philIip

fbshipit-source-id: da93d072f4bb32017961ee70c76f6add8a874ae1
2025-01-03 15:44:16 -08:00
Sam ZhouandFacebook GitHub Bot b030418649 Deploy 0.258.0 to xplat (#48482)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48482

Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D67810693

fbshipit-source-id: 82e858d4d5ef3c9896ea3bd58a4f4364dce5bdd0
2025-01-03 15:37:43 -08:00
Blake FriedmanandFacebook GitHub Bot af000b7aaa Remove forward declarations (#48461)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48461

Remove forward class or struct declarations.

Changelog: [Internal]

```
$ sl log --stat tools/api/ReactNativeCPP.api
 xplat/js/react-native-github/tools/api/ReactNativeCPP.api |  637
 1 files changed, 96 insertions(+), 541 deletions(-)
```

Reviewed By: cipolleschi

Differential Revision: D67763260

fbshipit-source-id: 396314be9cb6153f6cff1348aa596d4a5b61fbe7
2025-01-03 13:18:48 -08:00
Rubén NorteandFacebook GitHub Bot 1120f88401 Update test for DOM APIs to show current vs. desired behavior for getRootNode (#48439)
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
2025-01-03 12:57:16 -08:00
Rubén NorteandFacebook GitHub Bot 4d2649bac8 Extend tests for ReadOnlyNode.compareDocumentPosition (#48438)
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
2025-01-03 12:57:16 -08:00
Rubén NorteandFacebook GitHub Bot a1b13f6a55 Extract ensureInstance utility from tests (#48434)
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
2025-01-03 12:57:16 -08:00
Rubén NorteandFacebook GitHub Bot 35d0d7c97b Small refactor to lazy load RendererProxy (#48437)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48437

Changelog: [internal]

Just a small refactor to slightly improve readability (and potentially performance).

Reviewed By: christophpurrer

Differential Revision: D67520444

fbshipit-source-id: 9f53a432c4f4363b42083fb52c3beedb8016ccd4
2025-01-03 12:57:16 -08:00
Rubén NorteandFacebook GitHub Bot 6c383ea7b8 Set more sensible defaults for viewport width and height (#48436)
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
2025-01-03 12:57:16 -08:00
Rubén NorteandFacebook GitHub Bot bac56bf828 Allow configuring viewport width, height and device pixel ratio (#48433)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48433

Changelog: [internal]

Allows customizing the root dimensions.

Reviewed By: christophpurrer

Differential Revision: D67693031

fbshipit-source-id: ddbe426a6492512dc2eb7554f26b63d14d5ce75d
2025-01-03 12:57:16 -08:00
Ruslan ShestopalyukandFacebook GitHub Bot 13bad5268b Migrate EventDispatcherListener/Provider interfaces to Kotlin (#48463)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48463

# Changelog:
[Internal] -

As in the title.

Reviewed By: cortinico

Differential Revision: D67791241

fbshipit-source-id: 99d937e08a1e4ee1a5bd3f8eda71bc814ddbfffe
2025-01-03 12:38:17 -08:00
Blake FriedmanandFacebook GitHub Bot 6d85c7c476 Avoid adding stdlib (#48468)
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
2025-01-03 10:30:00 -08:00
Blake FriedmanandFacebook GitHub Bot 9542b1af55 Starlark needs hg instead of sl (#48460)
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
2025-01-03 10:30:00 -08:00
Blake FriedmanandFacebook GitHub Bot 5f54386a66 Add a BUCK target (#48457)
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
2025-01-03 10:30:00 -08:00
Blake FriedmanandFacebook GitHub Bot 4f30b94a0d Add snapshot of ObjC/PP API (#48456)
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
2025-01-03 10:30:00 -08:00
Alex HuntandFacebook GitHub Bot 546d21c796 Remove fuseboxEnabledDebug flag (#48435)
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
2025-01-03 05:56:04 -08:00
Rubén NorteandFacebook GitHub Bot 39757da650 Add environment variable to enable C++ debugging (#48441)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48441

Changelog: [internal]

Adds a new environment variable (`FANTOM_ENABLE_CPP_DEBUGGING`) to enable C++ debugging via `fdb`.

Reviewed By: RSNara

Differential Revision: D67683048

fbshipit-source-id: d074a1a063c5da6b048d5456036e83cc14245eaf
2025-01-03 04:57:43 -08:00
Rubén NorteandFacebook GitHub Bot d28300ad9d Add environment variables to print Fantom output and buck commands (#48440)
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
2025-01-03 04:57:43 -08:00
Rubén NorteandFacebook GitHub Bot 42b911b5cb Implement streaming mode for console logs in tests (#48372)
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
2025-01-03 04:57:43 -08:00
Rubén NorteandFacebook GitHub Bot f1ba4ef131 Add async flavors for runCommand and runBuck2 utilities (#48371)
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
2025-01-03 04:57:43 -08:00
Rubén NorteandFacebook GitHub Bot 8f096ab4f8 Refactor utility to run buck2 commands as a method to run arbitrary commands (#48370)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48370

Changelog: [internal]

Small refactor in preparation for async commands with streaming.

Reviewed By: javache

Differential Revision: D67600611

fbshipit-source-id: 11fe6b6ccd8849f904338ccc9454361ad5923863
2025-01-03 04:57:43 -08:00
Rubén NorteandFacebook GitHub Bot 726a72328e Use structured output for Fantom logs and test results (#48369)
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
2025-01-03 04:57:43 -08:00
Rubén NorteandFacebook GitHub Bot 5f09c36942 Remove unnecessary filter for AppRegistry logs (#48367)
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
2025-01-03 04:57:43 -08:00
Rubén NorteandFacebook GitHub Bot fb3b87c2b5 Remove existing logs and warnings from tests (#48391)
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
2025-01-03 04:57:43 -08:00
Rubén NorteandFacebook GitHub Bot d7d9e1c090 Use codegen for Fantom native module (#48432)
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
2025-01-03 04:57:43 -08:00
Rubén NorteandFacebook GitHub Bot c0f3e64070 Follow naming convention for NativeFantom module (#48368)
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
2025-01-03 04:57:43 -08:00
Alex HuntandFacebook GitHub Bot 3e0fc8899b Remove hermes-inspector-msggen (#48465)
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
2025-01-03 04:29:09 -08:00
Rubén NorteandFacebook GitHub Bot f20486cc77 Improve error messages in expect().toThrow(message) (#48430)
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
2025-01-03 02:16:38 -08:00
Mateo GuzmánandFacebook GitHub Bot 7e029b0dcf Modal: FLAG_SECURE not respected in modal dialog (#48317)
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
2025-01-02 20:40:09 -08:00
Blake FriedmanandFacebook GitHub Bot 3a7aed6ed8 Follow-ups to issues earlier in the stack (#48455)
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
2025-01-02 15:58:04 -08:00
Blake FriedmanandFacebook GitHub Bot 27ef13174c Add simple Objective-C/CPP api tracking (#48449)
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
2025-01-02 15:58:04 -08:00
Joe VilchesandFacebook GitHub Bot 1b88c5b429 Fix case when dashed/dotted borders do not work with overflow: hidden (#48414)
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
2025-01-02 14:03:26 -08:00
Ruslan ShestopalyukandFacebook GitHub Bot febf6f4a9c Convert TouchesHelper.java (#48447)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48447

# Changelog:
[Internal] -

As in the title.

Reviewed By: tdn120

Differential Revision: D67760245

fbshipit-source-id: 5054408438de7cbdfaa7c98d9f5935f03ee93760
2025-01-02 13:59:54 -08:00
Eli WhiteandFacebook GitHub Bot 9e0a7e3263 Converge component's bespoke StringEnumTypeAnnotation into StringLiteralUnionTypeAnnotation (#48343)
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
2025-01-02 13:20:02 -08:00
Eli WhiteandFacebook GitHub Bot b691122afc Share ArrayTypeAnnotation between components and modules (#48318)
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
2025-01-02 13:20:02 -08:00
Alex HuntandFacebook GitHub Bot 697e9462d5 Convert assets-registry to Flow comment syntax (#48458)
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
2025-01-02 12:23:14 -08:00
Ruslan ShestopalyukandFacebook GitHub Bot 5ef9e1fffe TouchEventCoalescingKeyHelper -> Kotlin (#48448)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48448

# Changelog:
[Internal] -

As in the title.

Reviewed By: tdn120

Differential Revision: D67759862

fbshipit-source-id: 7a8e133962cdc43aed0bae38a89d37fb7e6031a6
2025-01-02 11:18:07 -08:00
Ruslan ShestopalyukandFacebook GitHub Bot e8347b9854 Migrate EventCategoryDef to Kotlin (#48446)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48446

# Changelog:
[Internal] -

As in the title.

Reviewed By: tdn120

Differential Revision: D67759756

fbshipit-source-id: bc922b3062d8790ada3f9d5ee71593a08046752b
2025-01-02 11:18:07 -08:00
Alex HuntandFacebook GitHub Bot 79c7c58656 Document monorepo build setup (#48420)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48420

Adds a long overdue README for our newer monorepo build setup.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D67740763

fbshipit-source-id: 0c7686d75272acf74c0af5a1c4c08336fb45e2a2
2025-01-02 10:33:34 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 2c338a719e Build Release version for RNTester to speed-up E2E (#48443)
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
2025-01-02 09:52:22 -08:00
Alex HuntandFacebook GitHub Bot 430f7d8b72 Update debugger-frontend from 486803f...7727db8 (#48328)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48328

NOTE: This update is significant, as it includes the frontend repo sync with `chromium/6613` (https://github.com/facebookexperimental/rn-chrome-devtools-frontend/pull/144).

Changelog: [Internal] - Update `react-native/debugger-frontend` from 486803f...7727db8

Resyncs `react-native/debugger-frontend` from GitHub - see `rn-chrome-devtools-frontend` [changelog](https://github.com/facebookexperimental/rn-chrome-devtools-frontend/compare/486803f6bf272e0629297265dee8048a2f1269dd...7727db85ac767cf41cce3e9ee54d27e97b2637f9).

Reviewed By: hoxyq

Differential Revision: D67402065

fbshipit-source-id: f32d328c5319ed25d8942e813db152921ca22ec8
2025-01-02 06:01:42 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 93117ea1b8 Move E2E scripts to js (#48419)
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
2024-12-31 09:21:18 -08:00
zhongwuzwandFacebook GitHub Bot 09995fc874 Change Image load event size info from logical size to pixel (#45198)
Summary:
Fixes https://github.com/facebook/react-native/issues/45188. This fixes old arch. fabric fix may wait until https://github.com/facebook/react-native/issues/44918.

## Changelog:

[IOS] [BREAKING] - Change Image load event size info from logical size to pixel

Pull Request resolved: https://github.com/facebook/react-native/pull/45198

Test Plan:
Android/iOS return the same size .
```
    <Image
      style={{width: '100%', height: '100%'}}
      source={{
        uri: 'https://image-placeholder.com/images/actual-size/75x75.png',
      }}
      resizeMode={'cover'}
      onLoad={e => {
        console.log(
          `RNImage:${Platform.OS} load JPEG image from url`,
          e.nativeEvent,
        );
      }}
    />
```

Reviewed By: cortinico

Differential Revision: D67735347

Pulled By: cipolleschi

fbshipit-source-id: 72422d8c15e4cc6313215bf6d9a2c1e6b5a235ad
2024-12-31 09:03:54 -08:00
Nicola CortiandFacebook GitHub Bot b10491a3c4 Fix RN-Tester JSC instacrashing (#48418)
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
2024-12-31 08:24:38 -08:00
TobiasHandFacebook GitHub Bot 920867d949 Fix useWindowDimensions not updating because of delayed applicationState update on iOS devices (#46353)
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
![IMG_6089](https://github.com/user-attachments/assets/5d928613-2742-45fb-97fa-d87eaf64ea97)

### After change:

Same steps as above, now emits correct values
![IMG_6091](https://github.com/user-attachments/assets/eb46ed22-c3c5-4e77-8069-4a604a21947e)

Reviewed By: cortinico

Differential Revision: D67735523

Pulled By: cipolleschi

fbshipit-source-id: 146e5d62d55eeef0f6b17f962ca84ab418a7b7f0
2024-12-31 07:49:36 -08:00
Oskar KwaśniewskiandFacebook GitHub Bot 081be01a5d feat: implement ReactNativeFactory (#46298)
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
2024-12-31 07:45:25 -08:00
timbocoleandFacebook GitHub Bot 8b1f049879 fix: Prioritise local cpp (use default as fallback) (#48340)
Summary:
https://github.com/facebook/react-native/pull/47379 removed local cpp sources from the sources being built with the app. This resulted in a local `android/app/src/main/jni/OnLoad.cpp` file being ignored at build time. I have therefore added logic to the cmake file to prioritise local `cpp` files and fallback to `${REACT_ANDROID_DIR}/cmake-utils/default-app-setup/*.cpp` if none exist.

This resolves https://github.com/facebook/react-native/issues/48298

## Changelog:
[ANDROID] [FIXED] - Prioritise local OnLoad.cpp, falling back to default-app-setup

Pull Request resolved: https://github.com/facebook/react-native/pull/48340

Test Plan:
- Followed the https://reactnative.dev/docs/the-new-architecture/pure-cxx-modules guide (which was broken > 0.76.1)
- Applied the patch to the reproduction repository linked to https://github.com/facebook/react-native/issues/47352 to ensure no regression

Reviewed By: cipolleschi

Differential Revision: D67736012

Pulled By: cortinico

fbshipit-source-id: 87f6b8edf1613682585a94e1d1b3e6b4b792e4f5
2024-12-31 05:30:26 -08:00
Peter AbbondanzoandFacebook GitHub Bot a3c8e21370 Enable vector drawable support by default (#48347)
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
2024-12-30 14:32:55 -08:00
Ruslan ShestopalyukandFacebook GitHub Bot 6dd4195d2d Avoid calling fmod twice in roundLayoutResultsToPixelGrid (#48404)
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
2024-12-30 12:38:48 -08:00
Rob HoganandFacebook GitHub Bot 7e665d4c70 Add Changelog for 0.77.0-rc.5 (#48413)
Summary:
Changelog for 0.77.0-rc.5

## Changelog:

[Internal] Changelog for 0.77.0-rc.5

Pull Request resolved: https://github.com/facebook/react-native/pull/48413

Test Plan: N/A

Reviewed By: christophpurrer

Differential Revision: D67718909

Pulled By: robhogan

fbshipit-source-id: df2407ec7911e01f91a340c14517f8af2dc63a21
2024-12-30 11:03:15 -08:00
Ruslan ShestopalyukandFacebook GitHub Bot dd1cfb70e9 Improve typing of BackHandler (#48411)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48411

## Changelog:
[Internal] -

Floow-up to https://github.com/facebook/react-native/pull/48388, based on the diff discussion (D67648077).

Adds a bit better typing to `BackHandler.js`.

Reviewed By: blakef

Differential Revision: D67713236

fbshipit-source-id: 95435898d8ea87f6ae32a6db859d6641e1264972
2024-12-30 06:17:39 -08:00
Maddie LordandFacebook GitHub Bot 85bdd75828 Add "jsEngine: hermes" to JS runtime Error prototype (#48401)
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
2024-12-27 16:59:49 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 9ceabd341d Fix iOS E2E Tests (#48400)
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
2024-12-27 07:38:47 -08:00
BleemIs42andFacebook GitHub Bot 44705fe11b - Fix BackHandle callback undefined cause crash issue (#48388)
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
2024-12-27 04:37:57 -08:00
zhongwuzwandFacebook GitHub Bot 8dfed7df4b RNTester: Fixes crash when app back to background (#48385)
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
2024-12-27 04:16:25 -08:00
Ruslan ShestopalyukandFacebook GitHub Bot fcf3c8cab7 Rename SystraceSection to TraceSection (#48383)
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
2024-12-24 16:31:50 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 4a667e1a50 Set timeout for E2E tests. (#48381)
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
2024-12-24 08:15:22 -08:00
Ruslan ShestopalyukandFacebook GitHub Bot 17a644a230 Map SystraceSection to Perfetto instrumentation if the latter is enabled (#48379)
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
2024-12-24 07:47:50 -08:00
Gaspard ViotandFacebook GitHub Bot 74bdab8bd8 Reduce memory allocations when computing accessibilityLabel (#44605)
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
2024-12-24 07:42:33 -08:00
zhongwuzwandFacebook GitHub Bot 6d2b61691a Fabric: Fixes assert failure when surface stop before we start surface (#48213)
Summary:
Fixes https://github.com/facebook/react-native/issues/48149. Actually this issue is not caused by React 19. The underlying problem arises because we retain the surface in RCTHost at the time of its creation. Even though we call stop, there is a return check that prevents execution if the status is not running. For reference, you can view the relevant code here: [RCTFabricSurface.mm](https://github.com/facebook/react-native/blob/7d771de8a79b05e8dfed91e07de30d9f72d3c1c3/packages/react-native/React/Fabric/Surface/RCTFabricSurface.mm#L118).

To resolve this issue, we can implement a weak reference to the surface.

bt:
```
(lldb) bt
* thread https://github.com/facebook/react-native/issues/13, queue = 'com.apple.root.user-interactive-qos', stop reason = signal SIGABRT
    frame #0: 0x0000000105699008 libsystem_kernel.dylib`__pthread_kill + 8
    frame https://github.com/facebook/react-native/issues/1: 0x00000001045df408 libsystem_pthread.dylib`pthread_kill + 256
    frame https://github.com/facebook/react-native/issues/2: 0x000000018016c4ec libsystem_c.dylib`abort + 104
    frame https://github.com/facebook/react-native/issues/3: 0x000000018016b934 libsystem_c.dylib`__assert_rtn + 268
    frame https://github.com/facebook/react-native/issues/4: 0x000000010651f4b4 React_Fabric`facebook::react::SurfaceHandler::setUIManager(this=0x0000000108108620, uiManager=0x0000000000000000) const at SurfaceHandler.cpp:317:3
    frame https://github.com/facebook/react-native/issues/5: 0x00000001064c98f4 React_Fabric`facebook::react::Scheduler::unregisterSurface(this=0x0000600003500370, surfaceHandler=0x0000000108108620) const at Scheduler.cpp:252:18
    frame https://github.com/facebook/react-native/issues/6: 0x0000000104c3e8a8 RCTFabric`-[RCTScheduler unregisterSurface:](self=0x000060000212a940, _cmd="unregisterSurface:", surfaceHandler=0x0000000108108620) at RCTScheduler.mm:163:15
    frame https://github.com/facebook/react-native/issues/7: 0x0000000104c61fc4 RCTFabric`-[RCTSurfacePresenter unregisterSurface:](self=0x00000001081080d0, _cmd="unregisterSurface:", surface=0x0000000108108610) at RCTSurfacePresenter.mm:126:5
  * frame https://github.com/facebook/react-native/issues/8: 0x0000000104bc30a0 RCTFabric`-[RCTFabricSurface dealloc](self=0x0000000108108610, _cmd="dealloc") at RCTFabricSurface.mm:87:3
    frame https://github.com/facebook/react-native/issues/9: 0x0000000104b9ae44 RCTFabric`__destroy_helper_block_ea8_32s((null)=0x0000600000cb5a70) at RCTBoxShadow.mm:0
    frame https://github.com/facebook/react-native/issues/10: 0x00000001800f6edc libsystem_blocks.dylib`_call_dispose_helpers_excp + 44
    frame https://github.com/facebook/react-native/issues/11: 0x00000001800f7d24 libsystem_blocks.dylib`_Block_release + 300
    frame https://github.com/facebook/react-native/issues/12: 0x000000010760a7b8 libdispatch.dylib`_dispatch_client_callout + 16
    frame https://github.com/facebook/react-native/issues/13: 0x000000010761e608 libdispatch.dylib`_dispatch_root_queue_drain + 936
    frame https://github.com/facebook/react-native/issues/14: 0x000000010761ef7c libdispatch.dylib`_dispatch_worker_thread2 + 256
    frame https://github.com/facebook/react-native/issues/15: 0x00000001045dbb38 libsystem_pthread.dylib`_pthread_wqthread + 224
```

## Changelog:

[IOS] [FIXED] - Fabric: Fixes assert failure when surface stop before we start surface

Pull Request resolved: https://github.com/facebook/react-native/pull/48213

Test Plan:
Please see demo in https://github.com/facebook/react-native/issues/48149. Or open RNTester and apply the patch like below:
```
 diff --git a/packages/rn-tester/RNTester/AppDelegate.mm b/packages/rn-tester/RNTester/AppDelegate.mm
index 64c5d4122e7..cf015458619 100644
 --- a/packages/rn-tester/RNTester/AppDelegate.mm
+++ b/packages/rn-tester/RNTester/AppDelegate.mm
@@ -50,7 +50,10 @@ static NSString *kBundlePath = @"js/RNTesterApp.ios";

   [[UNUserNotificationCenter currentNotificationCenter] setDelegate:self];

-  return [super application:application didFinishLaunchingWithOptions:launchOptions];
+  [super application:application didFinishLaunchingWithOptions:launchOptions];
+  self.window.rootViewController = [UIViewController new];
+  [self.window makeKeyAndVisible];
+  return YES;
 }

 - (void)applicationDidEnterBackground:(UIApplication *)application

```

Reviewed By: javache

Differential Revision: D67335792

Pulled By: cipolleschi

fbshipit-source-id: e93aaaa60b3d204d7ed2cda6758b3b1d9dfcbc88
2024-12-24 07:41:51 -08:00
Alex ToudicandFacebook GitHub Bot adaceba546 Fix applicationDidEnterBackground not being called (#48376)
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
2024-12-24 06:56:55 -08:00
Mateo GuzmánandFacebook GitHub Bot 974fdf9a37 Migrating FpsListener to Kotlin (#48360)
Summary:
Migrating `FpsListener` to Kotlin

## Changelog:

[INTERNAL] - Migrating `FpsListener` to Kotlin

Pull Request resolved: https://github.com/facebook/react-native/pull/48360

Test Plan:
```bash
yarn test-android
```

Reviewed By: bnalls33

Differential Revision: D67599802

Pulled By: Abbondanzo

fbshipit-source-id: 769dbe26688309ffcf15565c5d51003e23c56412
2024-12-23 15:51:14 -08:00
Ramanpreet NaraandFacebook GitHub Bot a5a3d372be Rename ParsedError to ProcessedError
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
2024-12-23 12:42:14 -08:00
Rob HoganandFacebook GitHub Bot 29e5de579c Add Changelog for 0.77.0-rc.4 (#48374)
Summary:
Add changelog for 0.77.0-rc.4

## Changelog:
[Internal]

Pull Request resolved: https://github.com/facebook/react-native/pull/48374

Test Plan: N/A

Reviewed By: christophpurrer

Differential Revision: D67602257

Pulled By: robhogan

fbshipit-source-id: 79becf41cfad105e682d648f2f957f18bdbad5f6
2024-12-23 09:50:15 -08:00
Riccardo CipolleschiandFacebook GitHub Bot e87296f356 Do not install jq as it is already installed (#48363)
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
2024-12-23 07:46:02 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 5b6534e727 Fix typo in configuration (#48364)
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
2024-12-23 07:46:02 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 27aa28b1f5 USe the debug APK instead of the release one (#48365)
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
2024-12-23 07:46:02 -08:00
Intl SchedulerandFacebook GitHub Bot 5b6e35afda translation auto-update for Apps/Wilde/scripts/intl-config.json on master
Summary:
Chronos Job Instance ID: 1125907954543643
Sandcastle Job Instance ID: 18014400108783919
allow-large-files
ignore-conflict-markers
opt-out-review
drop-conflicts

Differential Revision: D67558410

fbshipit-source-id: 98a48c02e85aa4f3481ac4800362728bfdb152db
2024-12-21 04:24:28 -08:00
Sam ZhouandFacebook GitHub Bot 66342d3ccd Deploy 0.257.1 to xplat
Summary: Changelog: [Internal]

Reviewed By: panagosg7

Differential Revision: D67548045

fbshipit-source-id: 0c983b327b54580dddf483b6250ff1261df8ce75
2024-12-20 15:58:17 -08:00
Sam ZhouandFacebook GitHub Bot 4c1dd906b0 Replace React$Node with React.Node
Summary: Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D67529040

fbshipit-source-id: 09221c6f866628bbf9174293124e650b7fffa967
2024-12-20 13:00:12 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 953889da51 Stabilize Android tests adding retries for failed tests (#48324)
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
2024-12-20 06:19:17 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 5443359c88 Revert "Include autolinkin.h in OnLoad.cpp only if it exists (#47875)" (#48341)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48341

We reverted [this commit](https://github.com/facebook/react-native/commit/5b2bbb84b14208905fc0dd7eade9ee6ce6e079b7) in 0.76 and 0.77 as it was not the right fix.

## Changelog
[Internal] - Revert excluding `autolinking.h` only if it exists

Reviewed By: alanleedev

Differential Revision: D67456530

fbshipit-source-id: 0f7bfc11d23f7a8fef5100784754add5b4ecda58
2024-12-20 03:15:55 -08:00
David VaccaandFacebook GitHub Bot 7b8412d66d Migrate ReactDrawableHelper to Kotlin (#48346)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48346

Migrate ReactDrawableHelper to Kotlin

changelog: [internal] internal

Reviewed By: rshest

Differential Revision: D67420410

fbshipit-source-id: 524062d0c0a0d3440bf5ac4c61e8cae53b32a0d2
2024-12-20 00:18:50 -08:00
David VaccaandFacebook GitHub Bot e9faea2f3e Migrate ReactPackageLogger to kotlin (#48345)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48345

Migrate ReactPackageLogger to kotlin

changelog: [internal] internal

Reviewed By: rshest

Differential Revision: D67420585

fbshipit-source-id: a82fc7f17828ef6ad36a666113673526eb723600
2024-12-20 00:15:54 -08:00
Krzysztof PiaskowyandFacebook GitHub Bot 23eb06f662 Static Hermes for React Native (#48327)
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
2024-12-19 16:23:41 -08:00
Thomas NardoneandFacebook GitHub Bot 0683206927 Restore subclipping view removal (#48329)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48329

With the call to `removeView()` removed from `ReactViewClippingManager` in https://github.com/facebook/react-native/pull/47634, we're seeing views erroneously sticking around in the layout.

While `removeViewWithSubviewClippingEnabled()` calls `removeViewsInLayout()`, it does not trigger the corresponding side effects of [removeView()](https://android.googlesource.com/platform/frameworks/base/+/refs/tags/android-15.0.0_r9/core/java/android/view/ViewGroup.java#5501):
```
public void removeView(View view) {
  if (removeViewInternal(view)) {
--> requestLayout();
--> invalidate(true);
  }
}
```
To compensate, flip `removeViewsInLayout()` to [`removeViews()`](https://android.googlesource.com/platform/frameworks/base/+/refs/tags/android-15.0.0_r9/core/java/android/view/ViewGroup.java#5562), which will ensure layout.

Changelog: [Android][Fixed] Restore layout/invalidate during ReactViewClippingManager.removeViewAt()

Reviewed By: javache

Differential Revision: D67398971

fbshipit-source-id: b100db468cc3be6ddc6edd6c6d078a8a0b59a2c1
2024-12-19 15:27:13 -08:00
Pieter De BaetsandFacebook GitHub Bot a9f60bea72 Remove unused perftests JNI code (#48344)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48344

Matching Java code was removed in D60581611

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D67460124

fbshipit-source-id: 1c7e986fbb0c02af51e0c4035b2f131fcc2c64ec
2024-12-19 14:51:26 -08:00
Mateo GuzmánandFacebook GitHub Bot 52b6592559 Modal: Setting resource-id from testID prop (#48313)
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
2024-12-19 11:49:45 -08:00
zhongwuzwandFacebook GitHub Bot dd303b2dde Fabric: Fixes AccessoryView not disappeared when pop up the page (#47311)
Summary:
Fixes AccessoryView not disappeared when page poped up. After page pop up, we can see a white view it the bottom of scrren.

Fixed:
https://github.com/user-attachments/assets/90305720-656b-4546-8730-53b89fee7a66

Before:
https://github.com/user-attachments/assets/8e4fbea3-1882-48f8-aa5f-0c4e9ddc4efd

## Changelog:

[IOS] [FIXED] - Fabric: Fixes AccessoryView not disappeared when pop up the page

Pull Request resolved: https://github.com/facebook/react-native/pull/47311

Test Plan: RNTester InputAccessoryView example, repro steps please see the video above.

Reviewed By: christophpurrer

Differential Revision: D67455393

Pulled By: javache

fbshipit-source-id: b5d3a88bce41da77079eeb49fea8163f56d722dd
2024-12-19 10:55:21 -08:00
kirillzyuskoandFacebook GitHub Bot 5fc582783d fix: do not overwrite external inputAccessoryView on Fabric (#48339)
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
2024-12-19 10:12:36 -08:00
Matin Zadeh DolatabadandFacebook GitHub Bot ea56c432b7 Disable react-in-jsx-scope rule in eslint config (#46587)
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
2024-12-19 06:02:32 -08:00
Pieter De BaetsandFacebook GitHub Bot 44ef2c484a Revert D66839601: Remove unused-variable in xplat/js/react-native-github/packages/react-native/React/Base/RCTModuleData.mm +3
Differential Revision:
D66839601

Original commit changeset: dfba4aab6d73

Original Phabricator Diff: D66839601

fbshipit-source-id: 4d59b3616193dc184f0de7df8556f2b9b192df67
2024-12-19 03:37:20 -08:00
Sam ZhouandFacebook GitHub Bot b8f3f919cc Deploy 0.257.0 to xplat (#48331)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48331

Changelog: [Internal]

Reviewed By: pieterv

Differential Revision: D67423622

fbshipit-source-id: 09ca17bedf15174e210e943b989537c67f197659
2024-12-18 17:39:30 -08:00
Richard BarnesandFacebook GitHub Bot 72007a14af Remove unused-variable in xplat/js/react-native-github/packages/react-native/React/Base/RCTModuleData.mm +3 (#48250)
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
2024-12-18 15:24:52 -08:00
Thomas NardoneandFacebook GitHub Bot 783cc5777a Remove GuardedAsyncTask wrapper for call.cancel() (#48251)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48251

The original comment mentioning https://github.com/square/okhttp/issues/869 predates the [upgrade to okhttp3](https://github.com/facebook/react-native/commit/6bbaff2944dafd6fa7e5b77ef46dece0ec2c9983), which resolved the issue via https://github.com/square/okhttp/issues/1592.

Cancel calls should now be async and don't need to be guarded.  Removing this also fixes a discrepancy in NetworkingModule unit test verification.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D67157018

fbshipit-source-id: 72ce4deaaff306ef1dde6eda7be88707c37f0be7
2024-12-18 14:36:38 -08:00
Zeya PengandFacebook GitHub Bot 2ea9a7b51f Allow debugID key in InterpolationNode config & Support debugID in NVE (#48323)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48323

Allow `debugID` key in InterpolationNode config
Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D67185006

fbshipit-source-id: ec0081617103bd4b7bb78210702872a42db26361
2024-12-18 09:10:13 -08:00
Saad NajmiandFacebook GitHub Bot b04d17afca Fix Direct Debugging with JSC (#39549)
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
2024-12-18 08:00:19 -08:00
Oskar KwaśniewskiandFacebook GitHub Bot 9f12fce53b fix(iOS): remove unused RCTTurboModuleManagerDelegate method (#48290)
Summary:
Hey, this PR removes unused method from RCTAppDelegate.

The only called method from RCTTurboModuleManagerDelegate is `getTurboModule:jsInvoker`, the `getTurboModule:initParams:` is never called.

https://github.com/facebook/react-native/blob/5a81ceed2a6c974211e6a238efee3eea68b9568a/packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm#L207

## Changelog:

[INTERNAL] [REMOVED] - remove unused RCTTurboModuleManagerDelegate method

Pull Request resolved: https://github.com/facebook/react-native/pull/48290

Test Plan: CI Green, ensure everything works as before

Reviewed By: javache

Differential Revision: D67392056

Pulled By: cipolleschi

fbshipit-source-id: e7f35f81c48cdc163cfff45987e0b7eb022cbf7d
2024-12-18 07:14:04 -08:00
Eli WhiteandFacebook GitHub Bot 4dac99cf6d Fix FlowFixMes in CodegenVersionDiffing (#48312)
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
2024-12-17 20:23:24 -08:00
Sam ZhouandFacebook GitHub Bot f8119fc52b Pre-suppress errors in xplat ahead of 0.257.0 release
Summary: Changelog: [Internal]

Reviewed By: panagosg7

Differential Revision: D67368232

fbshipit-source-id: 23111f62c5731b5a58e15ac8ef2dcd9ea8006573
2024-12-17 18:28:25 -08:00
generatedunixname499836121andFacebook GitHub Bot 7948044179 Apply fixup patch to fbsource
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
2024-12-17 13:33:11 -08:00
Thomas NardoneandFacebook GitHub Bot e577e48ad7 Remove reflection in OkHttpCallUtil (#48308)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48308

Reflection is overkill here, we can simply suppress the deprecation "error".

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D67337980

fbshipit-source-id: 12076258ed4cb5c8737c84378621dda3072ec5a0
2024-12-17 11:22:46 -08:00
Alex HuntandFacebook GitHub Bot dfdacb84ce Refactor PerformanceTracer buffer type to use output event format (#48310)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48310

Refactors the internal storage format of trace events buffered by `PerformanceTracer`.

Aligning with the emitted [Trace Event Format](https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU/preview?pli=1&tab=t.0#heading=h.yr4qxyxotyw) enables us to simplify away the issue of defining and converting from any intermediate formats. This becomes desirable as we generalise to more event types and forthcoming browser-emulating `__metadata` events.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D67337442

fbshipit-source-id: 580928dfb4fcf4ac5efc82f93ab85a0d1d6dfb5c
2024-12-17 10:57:39 -08:00
Mitya KononchukandFacebook GitHub Bot 8696b79f73 Fix running fantom tests with high parallelism (#48307)
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
2024-12-17 10:07:26 -08:00
Thomas NardoneandFacebook GitHub Bot 5a01291598 Categorize SoftAssertions (#48306)
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
2024-12-17 09:18:55 -08:00
Dmitry RykunandFacebook GitHub Bot 0ceb0b3942 Calculate Android mounting instructions based on updates accumulated in rawProps (#48303)
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
2024-12-17 09:03:08 -08:00
zhongwuzwandFacebook GitHub Bot 5c789c3d3a Fabric: Fixes TextInput crash when textShadowOffset is set and textShadowRadius is nan (#48296)
Summary:
Fixes https://github.com/facebook/react-native/issues/48288

## Changelog:

[IOS] [FIXED] - Fabric: Fixes TextInput crash when textShadowOffset is set and textShadowRadius is nan

Pull Request resolved: https://github.com/facebook/react-native/pull/48296

Test Plan: Repro demo in https://github.com/facebook/react-native/issues/48288

Reviewed By: cipolleschi

Differential Revision: D67334179

Pulled By: NickGerleman

fbshipit-source-id: a9456a152d31bef1666669cbded28d99ec8a2028
2024-12-17 06:53:47 -08:00
Mateo GuzmánandFacebook GitHub Bot 5370347f54 Upgrading typescript-config module version to esnext (#48230)
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
2024-12-17 06:08:43 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 0a0a1d90a7 Add Changelog for 0.77.0-rc.3 (#48302)
Summary:
Add Changelog for 0.77.0-rc.3

## Changelog:
[Internal] - Add Changelog for 0.77.0-rc.3

Pull Request resolved: https://github.com/facebook/react-native/pull/48302

Test Plan: N/A

Reviewed By: fabriziocucci

Differential Revision: D67332176

Pulled By: cipolleschi

fbshipit-source-id: 335e0b6da5d51934d383a08c5749b6d1f57d6a3d
2024-12-17 04:53:50 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 03b9f041db Improve E2E Stability for Android (#48286)
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
2024-12-17 03:45:18 -08:00
Riccardo CipolleschiandFacebook GitHub Bot b511a95652 Fix Text tests (#48279)
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
2024-12-17 03:45:18 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 3f3ff554bc Bump Android executor and add timeout (#48280)
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
2024-12-17 03:45:18 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 4c4c87beaf Improve metro waiting times in E2E (#48281)
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
2024-12-17 03:45:18 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 6c8473e52c Bump maestro to 1.39.5 (#48282)
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
2024-12-17 03:45:18 -08:00
Thomas NardoneandFacebook GitHub Bot c832f94cf7 Extract SoftException categories (#48289)
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
2024-12-16 20:33:18 -08:00
David VaccaandFacebook GitHub Bot 2516414f02 Migrate UIBlock to Kotlin (#48294)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48294

Migrate UIBlock to Kotlin

changelog: [internal] internal

Reviewed By: tdn120

Differential Revision: D67187378

fbshipit-source-id: ae38998d5adebbaddd1976397e229435229a7471
2024-12-16 20:24:22 -08:00
David VaccaandFacebook GitHub Bot b88346f9ea Update deprecation message (#48293)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48293

Update deprecation message

changelog: [internal] internal

Reviewed By: arushikesarwani94

Differential Revision: D67292511

fbshipit-source-id: 4d3315ce05f5c5ae1060659e98832305fee93377
2024-12-16 19:21:26 -08:00
David VaccaandFacebook GitHub Bot 45e4a3afce Migrate ReactPointerEventsView to kotlin (#47749)
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
2024-12-16 18:39:54 -08:00
David VaccaandFacebook GitHub Bot 25ee3e805d Migrate ReactOverflowView to kotlin (#47750)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47750

Migrate ReactOverflowView to kotlin

changelog: [internal] internal

Reviewed By: NickGerleman

Differential Revision: D66217252

fbshipit-source-id: 8cd642dee2077006eab10d718a1887a77fd029a7
2024-12-16 18:39:12 -08:00
Ruslan LesiutinandFacebook GitHub Bot 03a1246c35 Refactor TraceEvent format (#48269)
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
2024-12-16 15:19:16 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 4368368ef5 Fix some peer dependencies on React types (#48292)
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
2024-12-16 14:08:19 -08:00
Thomas NardoneandFacebook GitHub Bot b662b1f4e4 Update ReactOkHttpNetworkFetcherTest (#48205)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48205

Flip mockito usages to mockito-kotlin

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D66985841

fbshipit-source-id: 23c501c96567e6f4f884bc4db8930f1d68b0351c
2024-12-16 13:00:50 -08:00
Thomas NardoneandFacebook GitHub Bot 3960a2dd8c Fix up network module tests (#48160)
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
2024-12-16 13:00:50 -08:00
Thomas NardoneandFacebook GitHub Bot 1cbda5f64e Fix NetworkingModuleTest (#48159)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48159

Fix the setup for ignored tests and re-enable them.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D66897564

fbshipit-source-id: bac777c981976e08140bc0832f5402995ffceb8e
2024-12-16 13:00:50 -08:00
Thomas NardoneandFacebook GitHub Bot e393711ef8 Add mockito-kotlin (#48158)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48158

Changelog: [Android][Added] Add mockito-kotlin for Kotlin unit testing

Reviewed By: cortinico

Differential Revision: D66897263

fbshipit-source-id: c608622e2431578f4eaa3fecff4f6c82a56b5090
2024-12-16 13:00:50 -08:00
Stefano FormicolaandFacebook GitHub Bot d31ac832c5 Add CCACHE_BINARY path to Xcode build settings and use it in ccache scripts (#48257)
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
2024-12-16 10:58:28 -08:00
Rubén NorteandFacebook GitHub Bot 06584241ba Fix ESLint warnings and remove from ignore list (#48291)
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
2024-12-16 09:19:55 -08:00
Mateo GuzmánandFacebook GitHub Bot 92bffe6571 Fix PR warnings generated by unsorted imports from RCTNetworking.js.flow (#48272)
Summary:
There are a some warnings in the PRs generated by the unsorted imports in the `RCTNetworking.js.flow` file.

This PR addresses that. As an example: https://github.com/facebook/react-native/pull/48271/files

<img width="721" alt="image" src="https://github.com/user-attachments/assets/7e5347a5-c802-4c21-870d-f4983b515a7b" />

## Changelog:

[INTERNAL] [FIXED] - Sorting `RCTNetworking.js.flow` imports that generate a warning in the PRs

Pull Request resolved: https://github.com/facebook/react-native/pull/48272

Test Plan: Verify that this PR doesn't show these warnings anymore

Reviewed By: NickGerleman

Differential Revision: D67274752

Pulled By: javache

fbshipit-source-id: 84ac36e0aaaeaf0156e40de9f6c61bd70fa1db85
2024-12-16 08:44:03 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 5a81ceed2a React Native sync for revisions de68d2f...372ec00 (#48196)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48196

X-link: https://github.com/facebook/metro/pull/1400

- **[372ec00c03](https://github.com/facebook/react/commit/372ec00c03 )**: Update ReactDebugInfo types to declare timing info separately ([#31714](https://github.com/facebook/react/pull/31714)) //<Sebastian Markbåge>//
- **[3d2ab01a55](https://github.com/facebook/react/commit/3d2ab01a55 )**: [Flight] Extract special cases for Server Component return value position ([#31713](https://github.com/facebook/react/pull/31713)) //<Sebastian Markbåge>//
- **[1c9b138714](https://github.com/facebook/react/commit/1c9b138714 )**: Don't serialize chunk ids for Hint and Console rows ([#31671](https://github.com/facebook/react/pull/31671)) //<Sebastian Markbåge>//
- **[de68d2f4a2](https://github.com/facebook/react/commit/de68d2f4a2 )**: Register Suspense retry handlers in commit phase ([#31667](https://github.com/facebook/react/pull/31667)) //<Josh Story>//
- **[16d2bbbd1f](https://github.com/facebook/react/commit/16d2bbbd1f )**: Client render dehydrated Suspense boundaries on document load ([#31620](https://github.com/facebook/react/pull/31620)) //<Josh Story>//
- **[5b0ef217ef](https://github.com/facebook/react/commit/5b0ef217ef )**: s/server action/server function ([#31005](https://github.com/facebook/react/pull/31005)) //<Ricky>//
- **[e3b7ef32be](https://github.com/facebook/react/commit/e3b7ef32be )**: [crud] Only export uRC when flag is enabled ([#31617](https://github.com/facebook/react/pull/31617)) //<lauren>//
- **[aba370f1e4](https://github.com/facebook/react/commit/aba370f1e4 )**: Add moveBefore Experiment ([#31596](https://github.com/facebook/react/pull/31596)) //<Sebastian Markbåge>//
- **[1345c37941](https://github.com/facebook/react/commit/1345c37941 )**: Mark all lanes in order on every new render ([#31615](https://github.com/facebook/react/pull/31615)) //<Sebastian Markbåge>//
- **[91061073d5](https://github.com/facebook/react/commit/91061073d5 )**: Mark ping time as update ([#31611](https://github.com/facebook/react/pull/31611)) //<Sebastian Markbåge>//
- **[a9f14cb44e](https://github.com/facebook/react/commit/a9f14cb44e )**: Fix Logging of Immediately Resolved Promises ([#31610](https://github.com/facebook/react/pull/31610)) //<Sebastian Markbåge>//
- **[c11c9510fa](https://github.com/facebook/react/commit/c11c9510fa )**: [crud] Fix deps comparison bug ([#31599](https://github.com/facebook/react/pull/31599)) //<lauren>//
- **[64f89510af](https://github.com/facebook/react/commit/64f89510af )**: [crud] Enable on RTR FB builds ([#31590](https://github.com/facebook/react/pull/31590)) //<lauren>//
- **[7558ffe84d](https://github.com/facebook/react/commit/7558ffe84d )**: [crud] Fix copy paste typo ([#31588](https://github.com/facebook/react/pull/31588)) //<lauren>//
- **[7c254b6576](https://github.com/facebook/react/commit/7c254b6576 )**: Log yielded time in the Component Track ([#31563](https://github.com/facebook/react/pull/31563)) //<Sebastian Markbåge>//
- **[6177b18c66](https://github.com/facebook/react/commit/6177b18c66 )**: Track suspended time when the render doesn't commit because it suspended ([#31552](https://github.com/facebook/react/pull/31552)) //<Sebastian Markbåge>//
- **[eaf2d5c670](https://github.com/facebook/react/commit/eaf2d5c670 )**: fix[eslint-plugin-react-hooks]: Fix error when callback argument is an identifier with an `as` expression ([#31119](https://github.com/facebook/react/pull/31119)) //<Mark Skelton>//
- **[047d95e85f](https://github.com/facebook/react/commit/047d95e85f )**: [crud] Basic implementation ([#31523](https://github.com/facebook/react/pull/31523)) //<lauren>//
- **[92c0f5f85f](https://github.com/facebook/react/commit/92c0f5f85f )**: Track separate SuspendedOnAction flag by rethrowing a separate SuspenseActionException sentinel ([#31554](https://github.com/facebook/react/pull/31554)) //<Sebastian Markbåge>//
- **[053b3cb050](https://github.com/facebook/react/commit/053b3cb050 )**: [crud] Rename Effect type ([#31557](https://github.com/facebook/react/pull/31557)) //<lauren>//
- **[7dd6b9e68a](https://github.com/facebook/react/commit/7dd6b9e68a )**: [crud] Add enableUseResourceEffectHook flag ([#31556](https://github.com/facebook/react/pull/31556)) //<lauren>//
- **[d8afd1c82e](https://github.com/facebook/react/commit/d8afd1c82e )**: [crud] Scaffold initial types ([#31555](https://github.com/facebook/react/pull/31555)) //<lauren>//
- **[3720870a97](https://github.com/facebook/react/commit/3720870a97 )**: Log Render Phases that Never Committed ([#31548](https://github.com/facebook/react/pull/31548)) //<Sebastian Markbåge>//
- **[8a41d6ceab](https://github.com/facebook/react/commit/8a41d6ceab )**: Unify RootDidNotComplete and RootSuspendedWithDelay exit path  ([#31547](https://github.com/facebook/react/pull/31547)) //<Sebastian Markbåge>//
- **[63cde684f5](https://github.com/facebook/react/commit/63cde684f5 )**: (chore): copy fix in <style> precedence error ([#31524](https://github.com/facebook/react/pull/31524)) //<Zack Tanner>//
- **[b01722d585](https://github.com/facebook/react/commit/b01722d585 )**: Format event with "warning" yellow and prefix with "Event: " ([#31536](https://github.com/facebook/react/pull/31536)) //<Sebastian Markbåge>//
- **[c13986da78](https://github.com/facebook/react/commit/c13986da78 )**: Fix Overlapping "message" Bug in Performance Track ([#31528](https://github.com/facebook/react/pull/31528)) //<Sebastian Markbåge>//
- **[4686872159](https://github.com/facebook/react/commit/4686872159 )**: Log passive commit phase when it wasn't delayed ([#31526](https://github.com/facebook/react/pull/31526)) //<Sebastian Markbåge>//
- **[5d89471ca6](https://github.com/facebook/react/commit/5d89471ca6 )**: Export __COMPILER_RUNTIME in stable ([#31540](https://github.com/facebook/react/pull/31540)) //<lauren>//
- **[3644f0bd21](https://github.com/facebook/react/commit/3644f0bd21 )**: Use completedRenderEndTime as the start of the commit phase if it's an immediate commit ([#31527](https://github.com/facebook/react/pull/31527)) //<Sebastian Markbåge>//
- **[8657869999](https://github.com/facebook/react/commit/8657869999 )**: Separate Tracks for Components and Phases ([#31525](https://github.com/facebook/react/pull/31525)) //<Sebastian Markbåge>//
- **[b15135b9f5](https://github.com/facebook/react/commit/b15135b9f5 )**: [ez] Update useMemoCache return type ([#31539](https://github.com/facebook/react/pull/31539)) //<lauren>//

Changelog:
[General][Changed] - Bump React from 18.3.1 to 19.0.0

bypass-github-export-checks
jest_e2e[run_all_tests]

Reviewed By: cortinico

Differential Revision: D67018480

fbshipit-source-id: 39bca3261ffaa8bb7d74187510724d77cc36b196
2024-12-16 06:58:21 -08:00
Rubén NorteandFacebook GitHub Bot 18243d07e4 Customize log level in Fantom output (#48263)
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
2024-12-16 06:03:03 -08:00
Rubén NorteandFacebook GitHub Bot d1293f6d44 Allow creating empty surfaces without using AppRegistry initialization paths (#48262)
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
2024-12-16 06:03:03 -08:00
Pieter De BaetsandFacebook GitHub Bot 173b65803d Store backfaceVisibility as boolean (#48268)
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
2024-12-16 05:54:38 -08:00
Dmitry RykunandFacebook GitHub Bot eac4b32573 Rename the last remaining usage of parentShadowView.tag to parentTag (#48267)
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
2024-12-16 05:37:13 -08:00
Rubén NorteandFacebook GitHub Bot 358fd38825 Add scheduleTask and runWorkLoop to public API (#48284)
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
2024-12-16 04:50:15 -08:00
zhongwuzwandFacebook GitHub Bot 5d67490574 Fabric: Fixes Numeric TextInput not triggering onSubmitEditing (#48276)
Summary:
Fixes https://github.com/facebook/react-native/issues/48259 . The paper code like :
https://github.com/facebook/react-native/blob/2fee13094b3d384c071978776fd8b7cff0b6530f/packages/react-native/Libraries/Text/TextInput/RCTBaseTextInputView.mm#L777-L784

## Changelog:

[IOS] [FIXED] - Fabric: Fixes Numeric TextInput not triggering onSubmitEditing

Pull Request resolved: https://github.com/facebook/react-native/pull/48276

Test Plan: Repro in https://github.com/facebook/react-native/issues/48259

Reviewed By: cipolleschi

Differential Revision: D67274739

Pulled By: javache

fbshipit-source-id: 57396c6e1a8ef96a1b29cae4a9aa9b5f48f6080b
2024-12-16 04:46:03 -08:00
Mateo GuzmánandFacebook GitHub Bot 87b1bad45e ActivityIndicator: setting resource-id from the testID prop (#48271)
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
2024-12-16 04:42:38 -08:00
zhongwuzwandFacebook GitHub Bot 6076a41560 Fabric: Fixes LayoutConformanceView not work (#48253)
Summary:
Fixes iOS LayoutConformanceView not work, seems caused by https://github.com/facebook/react-native/issues/48188. NickGerleman can you help to review please?

## Changelog:

[IOS] [FIXED] - Fabric: Fixes LayoutConformanceView not work

Pull Request resolved: https://github.com/facebook/react-native/pull/48253

Test Plan:
Before:
![image](https://github.com/user-attachments/assets/ca1f12c1-825b-4167-849d-b88f8ec54e21)

After:
![image](https://github.com/user-attachments/assets/c81b3192-8552-4147-b3af-3a8920a91d6c)

Reviewed By: NickGerleman, cipolleschi

Differential Revision: D67195461

Pulled By: javache

fbshipit-source-id: 2f45d9a9aa2389ba7cb89e601e7225dbef4f7abf
2024-12-16 04:18:28 -08:00
Pieter De BaetsandFacebook GitHub Bot 5edd32bf3f Fix MacOS build (#48285)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48285

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D67275514

fbshipit-source-id: 6512cbb090e90f827f643353a0a73c4f9516f651
2024-12-16 04:06:27 -08:00
Pieter De BaetsandFacebook GitHub Bot ba8136e41d Create TurboModule for test helpers (#48283)
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
2024-12-16 04:06:27 -08:00
Kræn HansenandFacebook GitHub Bot 2fee13094b App fails to build when Node binary path contains a space (#48275)
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
2024-12-15 18:15:49 -08:00
Eric RozellandFacebook GitHub Bot 00c7174c24 Add override to RCTHermesInstance destructor (#48265)
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
2024-12-13 16:44:01 -08:00
Eric RozellandFacebook GitHub Bot 9a2b807dcb Remove unnecessary semi-colon before method body (#48266)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48266

For some clang build configurations the semi-colon triggers `-Wsemicolon-before-method-body`. This fixes that warning in iOS sources.

## Changelog

[Internal]

Reviewed By: cipolleschi

Differential Revision: D67203041

fbshipit-source-id: f2f2f3799691c3fc59e102a852ca2cf61154e55e
2024-12-13 16:44:01 -08:00
Christoph PurrerandFacebook GitHub Bot ae90dd3aaa Share TextLayoutManager.h across all platforms (#48210)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48210

[Changelog] [Internal] - Share TextLayoutManager.h across all platforms

The goal of this change is to enable to share `TextLayoutManager.h` across all platforms, the same we do for:

https://github.com/facebook/react-native/blob/main/packages/react-native/ReactCommon/react/renderer/imagemanager/ImageManager.h

Reviewed By: philIip

Differential Revision: D67064488

fbshipit-source-id: 15ee02f3c2351ad65590b5f0dee2f3dbbde4df32
2024-12-13 16:12:40 -08:00
Maddie LordandFacebook GitHub Bot c2fd35a442 Add logging in ReactInstanceManager.onHostPause when activity is incorrectly null (#48226)
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
2024-12-13 13:35:08 -08:00
Mateo GuzmánandFacebook GitHub Bot 81c74cd35f ScrollView: handling testID correctly for horizontal scroll view (#48254)
Summary:
Fixes https://github.com/facebook/react-native/issues/46180

This PR fixes the `testID` not being set as a `resource-id` in the `HorizontalScrollView`.

Currently the `resource-id` is being set correctly when we use a vertical scroll view (this is done [here](https://github.com/facebook/react-native/blob/main/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java#L156) for reference) but we still miss setting this when we use a horizontal one as the managers for both components are different.

## Changelog:

[ANDROID][FIXED] - Handling `testID` correctly for horizontal scroll view

Pull Request resolved: https://github.com/facebook/react-native/pull/48254

Test Plan:
Render a simple `ScrollView` component with `horizontal` set as `true` and pass a `testID` property as shown:

```tsx
function Playground() {
  return (
    <ScrollView testID="customScrollViewTestId" horizontal>
      <View
        style={{
          marginVertical: 400,
          backgroundColor: 'white',
          padding: 14,
          margin: 50,
          width: 200,
          height: 200,
        }}
      />
    </ScrollView>
  );
}
```

Open Maestro Studio and search for **customScrollViewTestId** in the search bar.

<details>
<summary>Before the fix: The `testID` is not found. (See screenshot)</summary>

![image](https://github.com/user-attachments/assets/9f1c6438-e105-468e-8bf4-4e2238824f9f)
</details>

<details>
<summary>See the same in Appium. (See screenshot)</summary>

<img width="900" alt="image" src="https://github.com/user-attachments/assets/4f1a7858-4549-45b2-bb5f-d0b3485e5d69" />

</details>

 ---

Apply this fix, and search again in Maestro Studio.

<details>
<summary>After the fix: The `testID` is now recognised and can be found in the search bar. (See screenshot)</summary>

![image](https://github.com/user-attachments/assets/371f6d1f-5a41-461b-b276-7c0e702ee1e2)
</details>

<details>
<summary>See the same in Appium. (See screenshot)</summary>

<img width="891" alt="image" src="https://github.com/user-attachments/assets/ef03310c-c1ab-4ef7-b2c5-60c3b8d84c10" />

</details>

Reviewed By: tdn120, mdvacca

Differential Revision: D67201619

Pulled By: javache

fbshipit-source-id: 016faf724a482e0eca6dedfbf94dd9ea56255757
2024-12-13 12:39:31 -08:00
Hanno J. GödeckeandFacebook GitHub Bot ed36e896ac feat: add getState for StateWrapperImpl (#48255)
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
2024-12-13 10:02:32 -08:00
Hanno J. GödeckeandFacebook GitHub Bot ecf17666ad fix(android): fix mapbuffer jni headers not found consuming react-native from prefab (#48243)
Summary:
I was getting build errors when I tried to include `StateWrapperImpl.h` in my library's code on android. The error was:
![CleanShot 2024-12-12 at 15 02 44@2x](https://github.com/user-attachments/assets/bffb69f4-f80c-4610-9ad7-bd8098ac5340)

```
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:

![CleanShot 2024-12-12 at 14 53 26@2x](https://github.com/user-attachments/assets/ccd8c738-e887-40ba-a83b-38a7d2103d36)

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:

![CleanShot 2024-12-12 at 14 41 43@2x](https://github.com/user-attachments/assets/72598263-8775-4551-ab4a-91e9c9496b61)

Reviewed By: cipolleschi

Differential Revision: D67200010

Pulled By: cortinico

fbshipit-source-id: 127a17392fcca0a3a07643497729979849f0a17a
2024-12-13 09:32:15 -08:00
Rubén NorteandFacebook GitHub Bot edb3850adb Log status code when commands fail (#48222)
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
2024-12-13 08:10:59 -08:00
Nick GerlemanandFacebook GitHub Bot 06751aa0d1 "experimental_layoutConformance" ViewProp -> "experimental_LayoutConformance" component (#48188)
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
2024-12-12 14:57:04 -08:00
zhongwuzwandFacebook GitHub Bot 4adaacb4f7 Exclude Android HorizontalScrollContentView cxx component code (#48138)
Summary:
Exclude Android HorizontalScrollContentView cxx component code, iOS don't need it. cc NickGerleman can you help to review? :)

## Changelog:

[IOS] [FIXED] - Exclude Android HorizontalScrollContentView cxx component code

Pull Request resolved: https://github.com/facebook/react-native/pull/48138

Test Plan: iOS don't include any Android HorizontalScrollContentView code.

Reviewed By: christophpurrer

Differential Revision: D67127853

Pulled By: NickGerleman

fbshipit-source-id: 7901aa7bf62eada58d973e07e8a95e4d595c1ea5
2024-12-12 14:50:59 -08:00
Pieter De BaetsandFacebook GitHub Bot 49a594a513 Remove references to legacy JSC SamplingProfiler
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
2024-12-12 14:43:18 -08:00
Pieter De BaetsandFacebook GitHub Bot e06fa5d102 Remove legacy JSC HeapCapture (#48239)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48239

The native method this module references (`nativeCaptureHeap`) no longer exists, and Metro no longer emits this command.

Changelog: [Android][Removed] Removed JSCHeapCapture module, deprecated PackagerCommandListener#onCaptureHeapCommand

Reviewed By: fabriziocucci

Differential Revision: D67140120

fbshipit-source-id: 7c318366c38868c8a0c589473b6abadd0a09bdde
2024-12-12 14:43:18 -08:00
Jorge Cabiedes AcostaandFacebook GitHub Bot a2db0ba9c4 Add expectedReleaseValue to RN Feature Flags (#48073)
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
2024-12-12 13:55:35 -08:00
Hanno J. GödeckeandFacebook GitHub Bot d6919526a6 feat: RawPropsParser add useRawPropsJsiValue parameter (#48231)
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
2024-12-12 12:52:16 -08:00
Pieter De BaetsandFacebook GitHub Bot fd5bd3e5de Pass JSI Dynamic filter callback by ref (#48242)
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
2024-12-12 11:38:36 -08:00
Hanno J. GödeckeandFacebook GitHub Bot feff4a7556 feat(android): allow passing filter function for prop folly::dynamic conversion (#48202)
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:

![CleanShot 2024-12-11 at 09 18 26@2x](https://github.com/user-attachments/assets/b460187e-5442-4547-ae36-ffd188f444f2)

### 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
2024-12-12 11:38:36 -08:00
CHEN Xian-anandFacebook GitHub Bot 1763321c89 Support system font families on iOS (#47544)
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
2024-12-12 10:50:34 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 61e876ef89 Convert HelloWorld to Swift (#48246)
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
2024-12-12 10:44:27 -08:00
Christoph PurrerandFacebook GitHub Bot 59c72e9d29 (Almost) align Android TextLayoutManager interface with iOS one (#48209)
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
2024-12-12 10:22:25 -08:00
Christoph PurrerandFacebook GitHub Bot 26f4c78aa2 Use ShadowNode::Traits instead of directly enable Yoga measurement (#48223)
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
2024-12-12 10:15:39 -08:00
Nick GerlemanandFacebook GitHub Bot a28867f952 Remove home-rolled yarn caching (#48237)
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
2024-12-12 09:13:52 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 9f4b4aba93 Test Old Arch with Maestro (#48244)
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
2024-12-12 09:01:31 -08:00
Pieter De BaetsandFacebook GitHub Bot 8fc4e8b35b Use registerCallableModule consistently (#48238)
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
2024-12-12 08:30:58 -08:00
Pieter De BaetsandFacebook GitHub Bot c06f13e7fb Error when using runTask in a re-entrant way (#48235)
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
2024-12-12 08:09:02 -08:00
Hanno J. GödeckeandFacebook GitHub Bot 9dce26215b feat: add RawPropsParser as optional parameter to Concrete-/ComponentDescriptor (#48232)
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
2024-12-12 07:26:21 -08:00
Nick GerlemanandFacebook GitHub Bot f4a17fbb93 Add missing glog dep to React-idlecallbacksnativemodule.podspec (#48241)
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
2024-12-12 06:57:43 -08:00
Rubén NorteandFacebook GitHub Bot 6059660c60 Ship feature flag shouldSkipStateUpdatesForLoopingAnimations by default (#48224)
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
2024-12-12 05:41:01 -08:00
Rubén NorteandFacebook GitHub Bot 11c49d60cc Make feature flags module and overrides read-only (#48229)
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
2024-12-12 05:41:01 -08:00
Eric RozellandFacebook GitHub Bot e04738b7ec Disable weak event emitter in AttributedString for Mac Catalyst (#48225)
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
2024-12-12 05:39:51 -08:00
Alex HuntandFacebook GitHub Bot 9888b499f5 Add support for Performance.mark events in PerformanceTracer (#48200)
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
2024-12-12 04:40:43 -08:00
Alex HuntandFacebook GitHub Bot fd9cdf3214 Add new Fusebox Tracing API, integrate into PerformanceEntryReporter (2/2) (#48043)
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
2024-12-12 04:40:43 -08:00
Alex HuntandFacebook GitHub Bot 59969b6135 Remove Fusebox calls from ReactPerfLogger, rename (1/2) (#48044)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48044

Updates `ReactPerfLogger` (now renamed `ReactPerfettoLogger`) to log to Perfetto only.

This precedes integrating `FuseboxTracer` calls into `PerformanceEntryReporter` for User Timing events and Interaction events.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D66600278

fbshipit-source-id: f250f6b018d091d740bb13d5fcce9b716c4a6f72
2024-12-12 04:40:43 -08:00
Mateo GuzmánandFacebook GitHub Bot 79ed11f8f4 fix(rn-tester): text input and xml http request dark mode adjustments (#48207)
Summary:
Was troubleshooting in these modules recently and noticed a few texts off in dark mode. Replacing a few instances of the Text component in all I could see in the two screens.

## Changelog:

[INTERNAL] - RN Tester `TextInput` & `XMLHttpRequest` dark mode adjustments

Pull Request resolved: https://github.com/facebook/react-native/pull/48207

Test Plan:
<details>
<summary>View Screenshots (before fixes)</summary>

| Screenshot 1 | Screenshot 2 | Screenshot 3 | Screenshot 4 | Screenshot 5 | Screenshot 6 |
|--------------|--------------|--------------|--------------|--------------|--------------|
| ![Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-11 at 00 11 36](https://github.com/user-attachments/assets/c396bc5d-4b3c-4f63-8ac0-68bc808aa9d4) | ![Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-11 at 00 11 21](https://github.com/user-attachments/assets/cd8e5a2f-9066-4bc7-b56b-65dbd6df7dc4) | ![Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-11 at 00 10 30](https://github.com/user-attachments/assets/da451c18-40cd-4421-b8f5-a2462f82fee9) | ![Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-11 at 00 10 23](https://github.com/user-attachments/assets/32925fdb-f983-439f-b898-6986b739895a) | ![Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-11 at 00 10 19](https://github.com/user-attachments/assets/f0db7b49-dfef-4abc-aef0-2d55b016c0f8) | ![Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-11 at 00 10 16](https://github.com/user-attachments/assets/bad6dc45-3679-4bb6-aadd-6743053cd90f) |
| ![Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-11 at 00 10 10](https://github.com/user-attachments/assets/43028f51-c6e2-4b26-b20d-a3639606d6d5) | ![Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-11 at 00 10 07](https://github.com/user-attachments/assets/f8e2196e-bc64-4507-b330-d1d85730ddff) | ![Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-11 at 00 09 59](https://github.com/user-attachments/assets/a7100770-4b38-421f-9b73-09e4fff9e012) | ![Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-11 at 00 09 53](https://github.com/user-attachments/assets/27759c8c-0e56-4b92-8173-ba031b994e5c) | | | |

</details>

<details>
<summary>View Screenshots (after fixes)</summary>

| Screenshot 1 | Screenshot 2 | Screenshot 3 | Screenshot 4 | Screenshot 5 | Screenshot 6 |
|--------------|--------------|--------------|--------------|--------------|--------------|
| ![Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-11 at 00 05 30](https://github.com/user-attachments/assets/71c0287d-d98a-4bfe-85dc-1e08da12ce43) | ![Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-11 at 00 05 26](https://github.com/user-attachments/assets/45eac165-f42a-4193-98cc-3ee85d963382) | ![Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-11 at 00 05 23](https://github.com/user-attachments/assets/c0e4432d-2d1d-487f-8965-3829c3257364) | ![Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-11 at 00 05 19](https://github.com/user-attachments/assets/ab81500c-66c1-4b90-b2b1-f7c490e0029b) | ![Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-11 at 00 05 16](https://github.com/user-attachments/assets/aafcad74-e851-49a8-9db0-df06f81f0b30) | ![Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-11 at 00 05 11](https://github.com/user-attachments/assets/29a2a6c8-e448-4c90-844d-29a248f9ab69) |
| ![Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-11 at 00 05 07](https://github.com/user-attachments/assets/54e505c4-c554-4000-aac1-61b97e034f55) | ![Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-11 at 00 04 39](https://github.com/user-attachments/assets/0e91dc29-199d-424e-b36a-6b0f7a317cd2) | ![Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-11 at 00 04 22](https://github.com/user-attachments/assets/e965b01d-0b03-4d01-a971-57c3bd550146) | ![Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-11 at 00 04 15](https://github.com/user-attachments/assets/50ef03a6-bf1a-4db3-845b-e98373369574) |  |  |

</details>

Reviewed By: cipolleschi

Differential Revision: D67087492

Pulled By: javache

fbshipit-source-id: c9c64377d8c10d965bc5db7783aa80f099ce858a
2024-12-12 04:07:10 -08:00
Mateo GuzmánandFacebook GitHub Bot dffa57fa25 Exclude packages/react-native/ReactAndroid/build from lint checks (#48217)
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
2024-12-12 03:12:32 -08:00
Panos VekrisandFacebook GitHub Bot e5a526ff44 remove as_const option (on by default) in fbsource (#48227)
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
2024-12-12 02:01:35 -08:00
Andrew CoatesandFacebook GitHub Bot 849407ae6f Fix no return static analysis error in SchedulerPriorityUtils.h (#47911)
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
2024-12-12 01:31:18 -08:00
Chi TsaiandFacebook GitHub Bot e34c1e9bd2 Add default implementation for Object.create(prototype) (#47946)
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
2024-12-12 01:14:00 -08:00
Chi TsaiandFacebook GitHub Bot 04f33ecd58 Add default implementation for Object.getPrototypeOf and Object.setPrototypeOf (#47996)
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
2024-12-12 01:14:00 -08:00
Christoph PurrerandFacebook GitHub Bot 07d723cb72 Remove unused (Android) TextLayoutManager getter (#48208)
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
2024-12-11 23:45:21 -08:00
hoxyq (Meta Employee)andFacebook GitHub Bot a80baac58e Remove comment syntax from ReactNativeTypes (#31457)
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
2024-12-11 22:47:38 -08:00
Sam ZhouandFacebook GitHub Bot 7000b9b76c Add annotations and casts to fix future flow error (#48219)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48219

Changelog: [internal]

Reviewed By: panagosg7

Differential Revision: D67099060

fbshipit-source-id: fbb975d6194b071aa8f30dcd2b8f7f40130d31fb
2024-12-11 14:16:58 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 3ff9212ce4 Fix React-graphics podspec source_files (#48216)
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
2024-12-11 08:48:31 -08:00
Hanno J. GödeckeandFacebook GitHub Bot 03d2186ace Construct RawValue directly from jsi::Value (#48047)
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
2024-12-11 08:38:12 -08:00
Juliusz WajgeltandFacebook GitHub Bot 7d0338cb0b fix incorrect mmap file offset in JSBigFileString (#48198)
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
2024-12-11 08:24:50 -08:00
Mitya KononchukandFacebook GitHub Bot 477489ce84 Fix running fantom tests via buck-test (#48215)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48215

Changelog: [internal]

Reviewed By: rubennorte

Differential Revision: D66976980

fbshipit-source-id: d553c2f702d6928fb0ad88fcc2c6f04160a65d02
2024-12-11 07:07:10 -08:00
Ben HandanyanandFacebook GitHub Bot 462fae4a29 Use configuration type when adding ndebug flag to pods in release (#48193)
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
2024-12-11 04:37:48 -08:00
Christoph PurrerandFacebook GitHub Bot 7d771de8a7 Share common ShadowNode functionality in BaseTextInputShadowNode for iOS (#48164)
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
2024-12-10 18:05:42 -08:00
Pieter De BaetsandFacebook GitHub Bot 93c6be496e Configure __RCTProfileIsProfiling for perfetto builds (#48201)
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
2024-12-10 16:53:05 -08:00
Mateo GuzmánandFacebook GitHub Bot 9ecf290d27 Paper: TextInput maxLength is not working in old arch (#48126)
Summary:
Fixes https://github.com/facebook/react-native/issues/47563

It seems like a regression from https://github.com/facebook/react-native/issues/45401, where it was aimed to fix `onChangeText` being called multiple times when changing the text programmatically in an input with the `multiline` prop set as true.

This PR reverts that partially, as the `maxLength` check is not being evaluated correctly before setting the text. Not reverting it completely as when removing the second part of the fix, the `onChangeText` gets called multiple times again.

## Changelog:

[IOS] [FIXED] - Fixing TextInput `maxLength` not working in old arch

Pull Request resolved: https://github.com/facebook/react-native/pull/48126

Test Plan:
The issue could be reproduced in the rn-tester. See my videos with the before and after the fix.

<details>
<summary>Before:</summary>

https://github.com/user-attachments/assets/86fd67eb-fc14-469a-a5f8-8e83b49f857c

</details>

<details>
<summary>After:</summary>

https://github.com/user-attachments/assets/368383b1-c1bd-4e0b-ac44-c78022462fa0

</details>

Reviewed By: cortinico

Differential Revision: D67025182

Pulled By: cipolleschi

fbshipit-source-id: 720c400eef362618106ae434aef421c7529214fe
2024-12-10 11:57:48 -08:00
zhongwuzwandFacebook GitHub Bot d20897f6d4 Fabric: Fixes transform when there are multiple values that contain a matrix (#47477)
Summary:
Fixes https://github.com/facebook/react-native/issues/47467 .

## Changelog:

[IOS] [FIXED] - Fabric: Fixes transform when there are multiple values that contain a matrix

Pull Request resolved: https://github.com/facebook/react-native/pull/47477

Test Plan: Repro in Fixes https://github.com/facebook/react-native/issues/47467

Reviewed By: javache

Differential Revision: D65594337

Pulled By: cipolleschi

fbshipit-source-id: 50f255e753e2f233415099c3fbdd0e43b0afefc0
2024-12-10 10:29:29 -08:00
Mateo GuzmánandFacebook GitHub Bot 9a21b99918 Making RCTNetworking js exports consistent (#48166)
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
2024-12-10 10:17:42 -08:00
Rubén NorteandFacebook GitHub Bot 6ba8b65e9f Remove legacy ReactNativeConfig abstraction (#47247)
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
2024-12-10 09:34:27 -08:00
Rubén NorteandFacebook GitHub Bot c24f963330 Make ReactNativeConfig an empty interface (#47246)
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
2024-12-10 09:34:27 -08:00
Pieter De BaetsandFacebook GitHub Bot 746d584a23 Fix animation.stop not being flushed (#48199)
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
2024-12-10 09:24:05 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 8ab524312a Skip hidden folders when looking for third party components (#48182)
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
2024-12-10 02:32:10 -08:00
Blake FriedmanandFacebook GitHub Bot 538fa01fb3 Add Changelog for 0.77.0-rc.2 (#48192)
Summary:
Add Changelog for 0.77.0-rc.2

Changelog: [Internal] - Add Changelog for 0.77.0-rc.2

Pull Request resolved: https://github.com/facebook/react-native/pull/48192

Reviewed By: christophpurrer

Differential Revision: D66998575

Pulled By: blakef

fbshipit-source-id: 4dbfa3cae00b69ed8dd199a2b36cbd095ef4cbc2
2024-12-10 01:57:59 -08:00
Alex Taylor (alta)andFacebook GitHub Bot 8aeba2a3b8 Deploy 0.256.0 to xplat (#48190)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48190

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D66979174

fbshipit-source-id: d94e8c42edd225fe367aac75e55d2c1d054acc07
2024-12-10 01:47:05 -08:00
Blake FriedmanandFacebook GitHub Bot 3b079f38f4 Add Changelog for 0.76.5 (#48191)
Summary:
Add Changelog for 0.76.5

Changelog: [Internal] - Add Changelog for 0.76.5

Pull Request resolved: https://github.com/facebook/react-native/pull/48191

Reviewed By: christophpurrer

Differential Revision: D66993996

Pulled By: blakef

fbshipit-source-id: 4d69bcea64822aa108c2bac24a3ab399aacd5419
2024-12-09 23:31:40 -08:00
Andrew DatsenkoandFacebook GitHub Bot a298ccabe2 Add snapshot update / delete capability (#48096)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48096

Changelog: [Internal]

Managing snapshot state internally by adding / updating snapshot data.

Reviewed By: christophpurrer

Differential Revision: D66707175

fbshipit-source-id: 0366d834eafa0ca702f03de0210392181fd90a58
2024-12-09 19:09:57 -08:00
Andrew DatsenkoandFacebook GitHub Bot a8a136f3ef Add .toMatchSnapshot() (#48029)
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
2024-12-09 19:09:57 -08:00
Andrew DatsenkoandFacebook GitHub Bot a4a2c2867a Add jest-snapshot (#48095)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48095

Changelog: [Internal]
Add `jest-snapshot` `v29.7.0`

Reviewed By: christophpurrer

Differential Revision: D66714069

fbshipit-source-id: 783584519e95b337d36c4a00610bcd970a041d4d
2024-12-09 19:09:57 -08:00
Jorge Cabiedes AcostaandFacebook GitHub Bot 6d235853fb Fix background getting clipped when border-radius is set (#47939)
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
2024-12-09 18:35:45 -08:00
Christoph PurrerandFacebook GitHub Bot 0b866aa40d Share common (Base)TextInputState properties (#48133)
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
2024-12-09 15:02:58 -08:00
heoblitzandFacebook GitHub Bot 331d99a941 Update YGNodeStyleGetGap to return YGValue (#47973)
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
2024-12-09 13:38:05 -08:00
Pieter De BaetsandFacebook GitHub Bot 4ec4a85b1b Unbreak OSS Android CI (#48186)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48186

Broken by https://github.com/facebook/react-native/commit/37c532a063c6054ea974612a40551f7c1399c147 since we use different OkHttp versions internally and in open-source.

Changelog: [Internal]

Reviewed By: tdn120

Differential Revision: D66968229

fbshipit-source-id: a110cec0f9bd55e6ae5c90b766e8e6220703e6c3
2024-12-09 13:11:18 -08:00
Christoph PurrerandFacebook GitHub Bot 7ea5deb802 Remove unused defaultThemePaddingStart|End|Top|Bottom from AndroidTextInputState (#48161)
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
2024-12-09 11:22:57 -08:00
Nick LefeverandFacebook GitHub Bot aef13d1f43 Enable shadow node reference updates by default (#48180)
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
2024-12-09 10:52:21 -08:00
Pieter De BaetsandFacebook GitHub Bot c31b42aaa2 Fix flow-type of selectionColor (#48184)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48184

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D66962089

fbshipit-source-id: cd45784d830a12a620800290235a5a1cad3097f3
2024-12-09 10:20:12 -08:00
Jakub PiaseckiandFacebook GitHub Bot 47822e9048 Fix adjustsFontSizeToFit for strings with a single character (#47082)
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
2024-12-09 10:12:10 -08:00
Ben HandanyanandFacebook GitHub Bot eda4f185b3 Enable hermes debugger by configuration type instead of configuration name (#48174)
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
2024-12-09 08:51:00 -08:00
Pieter De BaetsandFacebook GitHub Bot 0916d530f0 Allow CookieJar to be disabled in NetworkingModule (#48113)
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
2024-12-09 08:37:32 -08:00
Mateo GuzmánandFacebook GitHub Bot 37c532a063 test(image): [android] react okhttp network fetcher cache control tests (#47953)
Summary:
This is a follow up for the new cache control options for the Android Image component introduced in https://github.com/facebook/react-native/issues/47182, https://github.com/facebook/react-native/issues/47348 & https://github.com/facebook/react-native/issues/47426. And to make sure the cache control header works as expected and avoid missing the issue fixed in https://github.com/facebook/react-native/issues/47922, this PR introduces test cases to make sure this is getting applied as expected in the `ReactOkHttpNetworkFetcher`.

## Changelog:

[INTERNAL] [ADDED] - `ReactOkHttpNetworkFetcher` cache control tests

Pull Request resolved: https://github.com/facebook/react-native/pull/47953

Test Plan:
```bash
yarn test-android
```

Reviewed By: rshest

Differential Revision: D66498305

Pulled By: javache

fbshipit-source-id: 7a9a0cc596e49964943e59189614743ca8a472a1
2024-12-09 07:36:46 -08:00
Rubén NorteandFacebook GitHub Bot 3cc67fed36 Add Fantom mode for development with Hermes bytecode (#48178)
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
2024-12-09 05:43:27 -08:00
Rubén NorteandFacebook GitHub Bot 4d07fb7662 Use enum for Fantom modes (#48179)
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
2024-12-09 05:43:27 -08:00
Rubén NorteandFacebook GitHub Bot 07a7b63fdd Only prewarm in CI (#48151)
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
2024-12-09 05:43:27 -08:00
Rubén NorteandFacebook GitHub Bot 82abba9936 Implement warmup for optimized mode (#48150)
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
2024-12-09 05:43:27 -08:00
Rubén NorteandFacebook GitHub Bot 47589f53b1 Add tests for Fantom modes (#48123)
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
2024-12-09 05:43:27 -08:00
Rubén NorteandFacebook GitHub Bot d05214665c Delete tests migrated to Fantom and unnecessary mocks for FabricUIManager, DOM, etc. (2nd attempt) (#48117)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48117

Changelog: [internal]

Re-land https://github.com/facebook/react-native/pull/48087 with some CI fixes.

Reviewed By: rshest

Differential Revision: D66820310

fbshipit-source-id: 1df4559c1daf5ec0085b299d702ce36deaa681b5
2024-12-09 05:05:07 -08:00
Pieter De BaetsandFacebook GitHub Bot 351b1bae95 Use OkHttp3 for NetworkingModuleTest (#48012)
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
2024-12-09 05:00:41 -08:00
Nicola CortiandFacebook GitHub Bot 8babc21b79 Convert com.facebook.react.jstasks to Kotlin (#48147)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48147

This converts all the classes inside `com.facebook.react.jstasks` to Kotlin

Changelog:
[Internal] [Changed] -

Reviewed By: javache

Differential Revision: D66875442

fbshipit-source-id: 0a9d485e3902626a04db5e7a1a0ccad32b2bc44c
2024-12-09 04:17:14 -08:00
Blake FriedmanandFacebook GitHub Bot 4165884b70 Add Changelog for 0.76.4 (#48163)
Summary:
Add Changelog for 0.76.4

Changelog: [Internal] - Add Changelog for 0.76.4

Pull Request resolved: https://github.com/facebook/react-native/pull/48163

Reviewed By: cipolleschi

Differential Revision: D66908649

Pulled By: blakef

fbshipit-source-id: cb64fcc5dbc6a1f758d99f99c451f24374fd4768
2024-12-07 09:46:51 -08:00
Christoph PurrerandFacebook GitHub Bot e9f92fad0a Remove unused code in AndroidTextInputShadowNode.h|cpp (#48136)
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
2024-12-06 20:38:43 -08:00
Dmitry RykunandFacebook GitHub Bot 6200a4d330 Annotate the experimental image prefetching API as @UnstableReactNativeAPI (#48120)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48120

This diff annotates the experimental image prefetching API as `UnstableReactNativeAPI` instead of `Deprecated`.

Changelog: [Internal]

Reviewed By: cortinico, philIip

Differential Revision: D66822045

fbshipit-source-id: a95ef3112a621a0735d4dcda0aed6078be7d7a38
2024-12-06 17:49:40 -08:00
Jorge Cabiedes AcostaandFacebook GitHub Bot 4102aa4a6b Revise iOS's implementation of ensureNoOverlap for borders (#48094)
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
2024-12-06 16:05:44 -08:00
Joe VilchesandFacebook GitHub Bot 0b40cb8b7f Use crossAxisOwnerSize instead of ownerHeight in cross axis bound call (#48080)
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
2024-12-06 15:34:06 -08:00
Pieter De BaetsandFacebook GitHub Bot 3c5019a376 Remove enableFabricRendererExclusively feature-flag (#48157)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48157

Changelog: [Internal]

Reviewed By: jehartzog

Differential Revision: D66787414

fbshipit-source-id: f27cc551fd7ceabf9fc656db2810476815fce1bf
2024-12-06 14:49:10 -08:00
Zeya PengandFacebook GitHub Bot 4238299bf3 Allow setting debugID on all types of AnimatedNode and Animation (#48129)
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
2024-12-06 14:47:30 -08:00
Christoph PurrerandFacebook GitHub Bot d47ff26f37 Allow to provide a custom TextLayoutManager for cxx platform (#48127)
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
2024-12-06 13:38:58 -08:00
Blake FriedmanandFacebook GitHub Bot 05b4146270 ci: verify JS build artifacts aren't committed (#48091)
Summary:
Building our JS packages dirties the repo. This makes sure we don't
accidentally commit these to the repo, as it'll break Flow tests with an
obscure error message.

Changelog: [Internal]

Pull Request resolved: https://github.com/facebook/react-native/pull/48091

Test Plan:
Ran this locally, the GH lint action should run on this PR.
I'll intentionally add a build artifact to validate.
| A | B | C |
| - | - | - |
| ![CleanShot 2024-12-04 at 14 11 16@2x](https://github.com/user-attachments/assets/11c05c32-12c8-4d85-9a28-b3bdffb42ea0) | ![CleanShot 2024-12-04 at 14 11 22@2x](https://github.com/user-attachments/assets/b4c4f1dc-2cb9-4138-8931-13e71c015a6d) | ![CleanShot 2024-12-04 at 14 19 31@2x](https://github.com/user-attachments/assets/953bf783-57ba-4832-bbd8-b36e23a2ccb4) |

Reviewed By: cipolleschi

Differential Revision: D66760144

Pulled By: blakef

fbshipit-source-id: 81f20fa0a83d5f17b5773d1608664b683ba74409
2024-12-06 13:21:23 -08:00
Kudo ChienandFacebook GitHub Bot e42a3a6b84 Migrate jsc-android to mavenCentral (#47972)
Summary:
Since people mostly use Hermes, it doesn't make sense to download jsc-android from npm even when jsc is not used. This PR migrates the jsc-android to [mavenCentral](https://repo1.maven.org/maven2/io/github/react-native-community/jsc-android/2026004.0.0/). The new jsc-android supports Android 16KB memory page sizes and packaged by prefab.
Relevant PRs:
  - https://github.com/react-native-community/jsc-android-buildscripts/pull/184
  - https://github.com/react-native-community/jsc-android-buildscripts/pull/185

## Changelog:

[ANDROID] [CHANGED] - Migrate jsc-android to mavenCentral

Pull Request resolved: https://github.com/facebook/react-native/pull/47972

Test Plan: CI passed

Reviewed By: cipolleschi

Differential Revision: D66772407

Pulled By: cortinico

fbshipit-source-id: e34d2d138996e394763ef67d7aad65bb3e7b13dc
2024-12-06 12:50:34 -08:00
Dmitry RykunandFacebook GitHub Bot c9ac94a000 Rename shouldNotify to shouldNotifyLoadEvents (#48100)
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
2024-12-06 12:06:33 -08:00
Mateo GuzmánandFacebook GitHub Bot f5506dc1d0 Migrate HeadlessJsTaskEventListener to Kotlin (#48103)
Summary:
Migrate `HeadlessJsTaskEventListener` to Kotlin

## Changelog:

[INTERNAL] - Migrate `HeadlessJsTaskEventListener` to Kotlin

Pull Request resolved: https://github.com/facebook/react-native/pull/48103

Test Plan:
```bash
yarn test-android
```

Reviewed By: javache

Differential Revision: D66814483

Pulled By: cortinico

fbshipit-source-id: 5aef4ce020f97164845e3e0d53a107c7e407a6aa
2024-12-06 12:06:20 -08:00
Nicola CortiandFacebook GitHub Bot 4560fc0497 Fix crash on HeadlessJsTaskService on old architecture (#48124)
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
2024-12-06 12:05:58 -08:00
Nicola CortiandFacebook GitHub Bot ddfa2120ba Cleanup NoRetryPolicy unnecessary visibility. (#48146)
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
2024-12-06 12:05:53 -08:00
Tim YungandFacebook GitHub Bot 8793b7d89b RN: Backout "Scheduling Animated End Callbacks in Microtask" (#48132)
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
2024-12-06 12:05:46 -08:00
Thomas NardoneandFacebook GitHub Bot f15fe4b8a1 Convert WebSocketModule to Kotlin (#47491)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47491

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D65502519

fbshipit-source-id: fa75416a27f809701837e8e1b96d7fe3a1ea040a
2024-12-06 09:22:30 -08:00
Kræn HansenandFacebook GitHub Bot acecf99c38 Update build-hermes-xcode.sh to fail faster (#47894)
Summary:
While debugging an error building hermes from source in a React Native app, I kept getting this weird error:

> Building for 'iOS-simulator', but linking in dylib ({redacted}/ios/Pods/hermes-engine/destroot/Library/Frameworks/ios/hermes.framework/hermes) built for 'macOS'

The root cause was a call to `cmake` failing, but `/sdks/hermes-engine/utils/build-hermes-xcode.sh` didn't exit on the error and instead continued building the hermes.framework from the dummy frameworks created by `./sdks/hermes-engine/utils/create-dummy-hermes-xcframework.sh`.

I suggest fixing this by introducing a `set -e` call similar to that used in `build-hermesc-xcode.sh`:
https://github.com/facebook/react-native/blob/2f523f0acf3b589bf962d5d20d2c04e453baf1da/packages/react-native/sdks/hermes-engine/utils/build-hermesc-xcode.sh#L7

## Changelog:

[Internal] - Ensure building hermes from source exits early on failures

Pull Request resolved: https://github.com/facebook/react-native/pull/47894

Test Plan:
I followed https://github.com/facebook/hermes/blob/main/doc/ReactNativeIntegration.md getting to a state of building a React Native app with Hermes built from source. I then introduced an error in `hermes/API/hermes/hermes.cpp` (I simply typed `asd` in the top of the file) and built the app from Xcode:

![Screenshot 2024-11-22 at 15 13 04](https://github.com/user-attachments/assets/c8c4a1e2-3bf1-4d08-b9f9-583dba3df159)

If you scroll up, you can see the failed cmake build, but it just continues trying to build the framework, effectively hiding the error:

![Screenshot 2024-11-22 at 15 14 19](https://github.com/user-attachments/assets/3accf7b1-1667-42fc-b9c0-01fd9b1c2d8f)

When applying this patch and cleaning the build folder, the error is more prominent and actionable:

![Screenshot 2024-11-22 at 15 18 27](https://github.com/user-attachments/assets/f01afd6c-c1bb-4e87-9d28-dcdea41feb3e)

Reviewed By: andrewdacenko

Differential Revision: D66494603

Pulled By: dmytrorykun

fbshipit-source-id: dbeeba17b4cc1101001c9628914135bea6006d4a
2024-12-06 09:08:58 -08:00
Blake FriedmanandFacebook GitHub Bot ae775aff5d Danger shouldn't warn for package.json changes (#48148)
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
2024-12-06 08:48:55 -08:00
Rubén NorteandFacebook GitHub Bot c54ba09d2e Add package.json script to run Fantom tests (#48144)
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
2024-12-06 05:24:31 -08:00
Rubén NorteandFacebook GitHub Bot 81fbd18410 Move remaining Fantom files to react-native-fantom (#48143)
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
2024-12-06 05:24:31 -08:00
Rubén NorteandFacebook GitHub Bot 923b194e47 Rename ReactNativeTester as just Fantom (#48142)
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
2024-12-06 05:24:31 -08:00
Rubén NorteandFacebook GitHub Bot 3fafc9f9cf Rename FantomRenderedOutput as getFantomRenderedOutput to follow convention (#48141)
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
2024-12-06 05:24:31 -08:00
Rubén NorteandFacebook GitHub Bot ba8d184b77 Move render output tests to ReactNativeTester (#48140)
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
2024-12-06 05:24:31 -08:00
Rubén NorteandFacebook GitHub Bot b253b0fe94 Create @react-native/fantom package (#48125)
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
2024-12-06 05:24:31 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 8d3c9ec3a1 Exclude mapping generation of core component (#48145)
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
2024-12-06 05:05:48 -08:00
hyochanandFacebook GitHub Bot 3efbe33ce0 Add pointerEvents support to Text component (#48081)
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
2024-12-06 03:56:14 -08:00
Pieter De BaetsandFacebook GitHub Bot 4134b1c60d Pass around parentTag instead of parentShadowView (#48062)
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
2024-12-06 03:31:04 -08:00
Zeya PengandFacebook GitHub Bot 87ec0965a2 Allow setting debugID on AnimatedValue and TimingAnimation (#48106)
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
2024-12-06 02:40:30 -08:00
Chi TsaiandFacebook GitHub Bot c6f12254d1 Add default getStringData/getPropNameIdData implementation (#47530)
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
2024-12-06 01:35:18 -08:00
Christoph PurrerandFacebook GitHub Bot e9f279117e Allow to provide a custom ImageManager for cxx platform (#48109)
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
2024-12-05 19:00:39 -08:00
Rubén NorteandFacebook GitHub Bot 7a81fd7a8a Migrate all feature flags to pragmas (#48098)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48098

Changelog: [internal]

TSIA. No more manual feature flag overrides in Fantom tests :D

Reviewed By: sammy-SC

Differential Revision: D66760120

fbshipit-source-id: a0493d6ca57f4fdad33a0667e3af99ed0f0b66ca
2024-12-05 17:06:11 -08:00
Rubén NorteandFacebook GitHub Bot be9b076087 Add support for specifying feature flags in pragmas (#48097)
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
2024-12-05 17:06:11 -08:00
Rubén NorteandFacebook GitHub Bot db70b791ba Add ReactNativeFeatureFlagsDynamicProvider to allow configuration in C++ using dynamic values (#48093)
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
2024-12-05 17:06:11 -08:00
Rubén NorteandFacebook GitHub Bot da6d089305 Extract logic to get Fantom test config to a standalone module (2nd attempt) (#48119)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48119

Changelog: [internal]

This is a re-land of https://github.com/facebook/react-native/pull/48092

Reviewed By: rshest

Differential Revision: D66820309

fbshipit-source-id: 6b07edcca6988eeb014f6b51ec82296d451bee14
2024-12-05 17:06:11 -08:00
Rubén NorteandFacebook GitHub Bot 1243679fe2 Export existing Fantom tests (2nd attempt) (#48118)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48118

Changelog: [internal]

This is a re-land of https://github.com/facebook/react-native/pull/48085

Reviewed By: rshest

Differential Revision: D66820308

fbshipit-source-id: b0ccd4b52965988015422ebdb8cd1172d1f5e9db
2024-12-05 17:06:11 -08:00
Pieter De BaetsandFacebook GitHub Bot 18ebea533d Convert com.facebook.react.modules.network.ReactCookieJarContainer to Kotlin (#48089)
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
2024-12-05 16:29:37 -08:00
Pieter De BaetsandFacebook GitHub Bot e750059d98 Convert com.facebook.react.modules.network.ForwardingCookieHandler to Kotlin (#48088)
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
2024-12-05 16:29:37 -08:00
Richard BarnesandFacebook GitHub Bot e7b9d70e0a Remove unused-variable in ../xplat/js/react-native-github/packages/react-native/React/CxxLogUtils/RCTDefaultCxxLogFunction.mm +2 (#48105)
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
2024-12-05 14:14:21 -08:00
Nicola CortiandFacebook GitHub Bot 13900d75b8 Remove replaceAll from RNTester sample code (#48099)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48099

This is currently breaking the Sample Module screen on RN-Tester. Let's remove it.

Changelog:
[Internal] [Changed] - Remove replaceAll from RNTester sample code

Reviewed By: cipolleschi

Differential Revision: D66764656

fbshipit-source-id: acd123374d23b37977d5506f70f29da7f5d6311f
2024-12-05 09:54:47 -08:00
Ramanpreet NaraandFacebook GitHub Bot 2f0977d8e4 Also report non-fatal non-warning errors (#48104)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48104

Just porting over the logic after D28815228.

Changelog: [Internal]

Reviewed By: mlord93

Differential Revision: D66563226

fbshipit-source-id: 41e21812dd0b2104fa66b970212f51bbb77d910b
2024-12-05 09:42:44 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 00d5caee99 Do not install CMake on Windows machine (#48122)
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
2024-12-05 09:19:58 -08:00
Nikita RubilovandFacebook GitHub Bot ea84bc666c Revert D66599197: Delete tests migrated to Fantom and unnecessary mocks for FabricUIManager, DOM, etc.
Differential Revision:
D66599197

Original commit changeset: 33822588c217

Original Phabricator Diff: D66599197

fbshipit-source-id: 00891602920f84a04ea9eac32758d2af08f3d4c7
2024-12-05 06:46:15 -08:00
Nikita RubilovandFacebook GitHub Bot ca908c0681 Revert D66702625: Export existing Fantom tests
Differential Revision:
D66702625

Original commit changeset: e136ea5ea42c

Original Phabricator Diff: D66702625

fbshipit-source-id: 43600daaf46e5c1522758d721b0d2f2c9abc7e25
2024-12-05 06:46:15 -08:00
Nikita RubilovandFacebook GitHub Bot eee5d2ec3c Revert D66760119: Extract logic to get Fantom test config to a standalone module
Differential Revision:
D66760119

Original commit changeset: e955e8f59669

Original Phabricator Diff: D66760119

fbshipit-source-id: ef77a5cdc87efd81bbe503a2a943b1deef4a7e15
2024-12-05 06:46:15 -08:00
zhongwuzwandFacebook GitHub Bot efd57d681c Fabric: Post RCTInstanceDidLoadBundle notification after bundle loaded (#48082)
Summary:
Fixes https://github.com/facebook/react-native/issues/47949

## Changelog:

[IOS] [FIXED] - Fabric: Post RCTInstanceDidLoadBundle notification after bundle loaded

Pull Request resolved: https://github.com/facebook/react-native/pull/48082

Test Plan: Post RCTInstanceDidLoadBundle notification after bundle loaded

Reviewed By: philIip

Differential Revision: D66754060

Pulled By: cipolleschi

fbshipit-source-id: d30f0ed73e127936082e6f91e137b9b4013c6651
2024-12-05 06:00:34 -08:00
Rubén NorteandFacebook GitHub Bot bc0b5ca5df Extract logic to get Fantom test config to a standalone module (#48092)
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
2024-12-05 05:18:08 -08:00
Rubén NorteandFacebook GitHub Bot f6aae38e52 Export existing Fantom tests (#48085)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48085

Changelog: [internal]

Reviewed By: rshest

Differential Revision: D66702625

fbshipit-source-id: e136ea5ea42c1e1942e4c22e65855e91ad96e3f8
2024-12-05 05:18:08 -08:00
Rubén NorteandFacebook GitHub Bot 2e7e065d09 Delete tests migrated to Fantom and unnecessary mocks for FabricUIManager, DOM, etc. (#48087)
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
2024-12-05 05:18:08 -08:00
Rubén NorteandFacebook GitHub Bot b487e65869 Add support for expect() .toBeLessThan and .toBeGreaterThan (#48086)
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
2024-12-05 05:18:08 -08:00
Rubén NorteandFacebook GitHub Bot ff934cd249 Extract definitions for expect and mocks from generic test setup to standalone modules (#48083)
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
2024-12-05 05:18:08 -08:00
Rubén NorteandFacebook GitHub Bot 118c18f3bb Allow async functions in ReactNativeTester and add tests (#48063)
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
2024-12-05 05:18:08 -08:00
Wojciech LewickiandFacebook GitHub Bot e7f943de2f fix: long not implemented on native side (#48017)
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
2024-12-05 04:46:28 -08:00
jodeppoandFacebook GitHub Bot 8aac234ce2 Remove Trigger E2E Tests on Comment (#47923)
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
2024-12-05 03:23:52 -08:00
Kacper KafaraandFacebook GitHub Bot f402ed17fa Fix handling removal of transitioning views (#47634)
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
2024-12-04 15:24:35 -08:00
Nicola CortiandFacebook GitHub Bot 734730df75 Re-introduce the deprecated constructor on ReactModuleInfo (#48090)
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
2024-12-04 11:03:03 -08:00
Mateo GuzmánandFacebook GitHub Bot 50d0157f0c test(network): [android] ResponseUtil unit tests (#48075)
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
2024-12-04 10:26:04 -08:00
Andrew DatsenkoandFacebook GitHub Bot 2e444d2b40 Add ReactNativetester#getRenderedOutput() API (#47970)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47970

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D65617491

fbshipit-source-id: 49369b694a81b7dfb541c75d9e24b62fc141d980
2024-12-04 09:55:56 -08:00
Nick GerlemanandFacebook GitHub Bot 366270e742 Update requirements in README (#48079)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48079

We updated these in 0.76, and should update them in the README as well. https://reactnative.dev/blog/2024/10/23/release-0.76-new-architecture#updates-to-minimum-ios-and-android-sdk-requirements

Changelog: [Internal]

Reviewed By: lunaleaps, philIip

Differential Revision: D66735446

fbshipit-source-id: c9145bab14e4956ed070fb906dd1c1676905bfb6
2024-12-04 09:45:46 -08:00
Soe LynnandFacebook GitHub Bot 469978f170 Fix Interop code for having unsync ViewManager between ModuleRegistry and BridgeProxy (#48069)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48069

Changelog [Internal]:
Fix Interop code for having unsync ViewManager between ModuleRegistry and BridgeProxy

Reviewed By: RSNara

Differential Revision: D66137400

fbshipit-source-id: ace3f60b6b972f17c7124ec33f0d3e8d035e966c
2024-12-04 09:40:16 -08:00
Rob HoganandFacebook GitHub Bot 7ee7e69cdf Update changelog for v0.77.0-rc.1 (#48084)
Summary:
Changelog for v0.77.0-rc.1

https://github.com/facebook/react-native/compare/v0.77.0-rc.0...v0.77.0-rc.1

## Changelog:
[Internal]

Pull Request resolved: https://github.com/facebook/react-native/pull/48084

Reviewed By: cipolleschi

Differential Revision: D66753599

Pulled By: robhogan

fbshipit-source-id: 9a02df5cb7174270b4d293c48c6b0468a4042c87
2024-12-04 09:40:07 -08:00
zhongwuzwandFacebook GitHub Bot efcfe5dcd6 Fabric: Fixes insets not adjust when keyboard disappear (#47924)
Summary:
Fixes https://github.com/facebook/react-native/issues/47731 .

## Changelog:

[IOS] [FIXED] - Fabric: Fixes insets not adjust when keyboard disappear

Pull Request resolved: https://github.com/facebook/react-native/pull/47924

Test Plan: Demo in https://github.com/facebook/react-native/issues/47731

Reviewed By: blakef

Differential Revision: D66651865

Pulled By: cipolleschi

fbshipit-source-id: a75afbd1a7651f0c77022d913f910821c482fcf7
2024-12-04 07:49:12 -08:00
Rob HoganandFacebook GitHub Bot b5b9e032c2 Fix Android JSC compatibility - replaceAll -> replace (#48076)
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
2024-12-04 06:07:21 -08:00
Rubén NorteandFacebook GitHub Bot 4c62d46525 Remove legacy versions of the native methods for performance.mark and performance.measure (#48067)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48067

Changelog: [internal]

We don't need to keep these versions for backwards compatibility anymore.

Reviewed By: rshest

Differential Revision: D65423761

fbshipit-source-id: 59046a577c1de4aedb2593a12a45d9deb3bb4260
2024-12-04 04:38:54 -08:00
Phillip PanandFacebook GitHub Bot 0217d7e19c have RCTInstance decorate non-app provided turbomodules with bridgeless APIs (#48053)
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
2024-12-03 22:23:04 -08:00
Joe VilchesandFacebook GitHub Bot 74f3ab7d40 Properly camelcase mainAxisownerSize in FlexLine (#48077)
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
2024-12-03 19:16:56 -08:00
Eli WhiteandFacebook GitHub Bot 949d229b5f Apply enum changes to new codegen version (#48000)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48000

Adding this type to CompleteTypes

Changelog: [Internal]

Reviewed By: GijsWeterings

Differential Revision: D65305755

fbshipit-source-id: 962297ba21b3b88f0117631fb4192c111e903fc6
2024-12-03 16:41:36 -08:00
Vojtech NovakandFacebook GitHub Bot 52f09276cc fix hermes param handling in test-e2e-local.js (#48068)
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
2024-12-03 16:14:32 -08:00
Richard BarnesandFacebook GitHub Bot 5e7eb9f3a6 Revert D66143498
Summary:
This diff reverts D66143498
T209377282 Breaking tests on Twilight

Differential Revision: D66717950

fbshipit-source-id: 640592761fec29ed6e11a8b6faf441dd44685c42
2024-12-03 14:31:53 -08:00
Dmitry RykunandFacebook GitHub Bot 725527885a Android: Initiate image prefetching on ImageShadowNode layout (#47932)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47932

This diff introduces a code path to trigger image prefetching from `ImageShadowNode::layout`.
Changelog: [Internal]

Reviewed By: javache

Differential Revision: D66454087

fbshipit-source-id: 17f5fed7d29c7d69cf76c28562898a81fac24044
2024-12-03 13:31:24 -08:00
Luna WeiandFacebook GitHub Bot d19f5f97b8 Fix naming convention for new rootThreshold related APIs and add Fantom tests (#48071)
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
2024-12-03 13:29:51 -08:00
Luna WeiandFacebook GitHub Bot 9aa21b5e87 Return intersection rect (#48070)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48070

Changelog: [General][Changed]

Return the clipped `intersectionRect` in IntersectionObserverEntry regardless of whether the observer `isIntersecting` or not. This addresses a deviance from the [web spec](https://www.w3.org/TR/intersection-observer/?fbclid=IwZXh0bgNhZW0CMTEAAR1XaWZim1ij0N1p07aCM__SYerXhu88UTDZRFCZEvRhQW2crRMwEvfwAdQ_aem_zH8WjTh0VFjEeORG76rcew#intersection-observer-entry)

Reviewed By: rubennorte

Differential Revision: D66516179

fbshipit-source-id: fdc766f0e6fc0a899b1b11547a2aa06010b8d010
2024-12-03 13:29:51 -08:00
Pieter De BaetsandFacebook GitHub Bot 9800c8e47e Improve differentiator logging (#48061)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48061

Improve consistency of debug logs in differentiator.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D66654292

fbshipit-source-id: f4accdea184b932f94359c893e6de59f8139ca22
2024-12-03 10:17:02 -08:00
Pieter De BaetsandFacebook GitHub Bot 34901d4861 Fix differentiator emitting updates with incorrect parentTag (#48055)
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
2024-12-03 10:17:02 -08:00
Fabrizio CucciandFacebook GitHub Bot 21c9491926 Migrate package com.facebook.react.uimanager.RootView to Kotlin (#47701)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47701

As per title.

Changelog:
[Android][Breaking] Convert RootView to Kotlin

Reviewed By: cortinico

Differential Revision: D66159881

fbshipit-source-id: 082881a03946088293dde3c085e1d1882bac96be
2024-12-03 09:59:48 -08:00
Blake FriedmanandFacebook GitHub Bot 9df20d414e Log out which workflow artifact we're using (#48046)
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
2024-12-03 09:34:48 -08:00
Alex HuntandFacebook GitHub Bot d6f286a4a0 Add description to React-jsinspector.podspec, refactoring (#48066)
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
2024-12-03 08:44:48 -08:00
Dmitry RykunandFacebook GitHub Bot 318db8eedf Add Android-specific ImageRequestParams (#47930)
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
2024-12-03 04:09:42 -08:00
Richard BarnesandFacebook GitHub Bot 071d223ee0 Remove unused-variable in ../xplat/compphoto/gpuEngine/tools/ToolHelpers.cpp +3 (#48052)
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
2024-12-03 04:07:49 -08:00
David VaccaandFacebook GitHub Bot 67bff8734f Delete GuardedResultAsyncTask (#48058)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48058

Delete unused abstract class GuardedResultAsyncTask

I'm deleting without depreacting becuase I didn't find usages internally or externally

changelog: [Android][Breaking] Delete unused abstract class GuardedResultAsyncTask

Reviewed By: javache

Differential Revision: D66416570

fbshipit-source-id: 8b369dfcd3e99b24f97c62cec9229f82ba5eed77
2024-12-02 18:45:27 -08:00
David VaccaandFacebook GitHub Bot b25b65ba19 Delete deprecated class FabricViewStateManager (#48057)
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
2024-12-02 18:45:27 -08:00
David VaccaandFacebook GitHub Bot a4849cb3d6 Reduce visibility of ComponentNameResolver to internal (#48056)
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
2024-12-02 18:45:27 -08:00
David VaccaandFacebook GitHub Bot 385b9f4265 Migrate ComponentNameResolver to kotlin (#47919)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47919

Migrate ComponentNameResolver to kotlin

changelog: [Android][Changed] Migrate ComponentNameResolver to kotlin

Reviewed By: javache

Differential Revision: D66403041

fbshipit-source-id: 7af1a89988373014c5aeb1f6145324cf889a1a36
2024-12-02 18:45:27 -08:00
Mateo GuzmánandFacebook GitHub Bot bfc8b3391e Migrate BatchEventDispatchedListener to kotlin (#48038)
Summary:
Migrating `BatchEventDispatchedListener` from Java to Kotlin

## Changelog:

[INTERNAL] - Migrating `BatchEventDispatchedListener` from Java to Kotlin

Pull Request resolved: https://github.com/facebook/react-native/pull/48038

Test Plan:
```bash
yarn test-android
```

Reviewed By: tdn120, cortinico

Differential Revision: D66653052

Pulled By: javache

fbshipit-source-id: 494866c54d349587e313c18717c6c587a2228aa8
2024-12-02 17:53:59 -08:00
Joe VilchesandFacebook GitHub Bot 2df7552fa2 Back out "Back out "[yoga][intrinsic sizing] Update public API for intrinsic sizing setters""
Summary:
Original commit changeset: 793f77dad021

Original Phabricator Diff: D66332309

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D66662661

fbshipit-source-id: 22ed3ac9492f0a563c041ce4cb5fba4b65b53211
2024-12-02 17:29:49 -08:00
Joe VilchesandFacebook GitHub Bot e1623b7525 Back out "Back out "[yoga][intrinsic sizing] Modify private apis to set, store, and get intrinsic sizing keywords"" (#48049)
Summary:
X-link: https://github.com/facebook/yoga/pull/1756

Pull Request resolved: https://github.com/facebook/react-native/pull/48049

Changelog: [Internal]

Original commit changeset: 1d596964e0c8

Original Phabricator Diff: D66332307

Reviewed By: NickGerleman

Differential Revision: D66662662

fbshipit-source-id: 4f9ac2b1557b848f519dcd728d7097b52f1190b3
2024-12-02 17:29:49 -08:00
Eli WhiteandFacebook GitHub Bot fa8a25eb6b Make enum types annotation objects instead of literal strings and numbers (#47349)
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
2024-12-02 14:32:35 -08:00
Eli WhiteandFacebook GitHub Bot 96c2be8567 Don't store pretty printed json in schema
Summary: Changelog: [Internal]

Reviewed By: javache

Differential Revision: D66603960

fbshipit-source-id: 2d7844df76f168b99eb76bb19359ee71e953d0b2
2024-12-02 14:32:35 -08:00
Thomas NardoneandFacebook GitHub Bot 53bc661138 ReactViewGroup - track clipped views (#47987)
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
2024-12-02 14:28:35 -08:00
Ramanpreet NaraandFacebook GitHub Bot 69ecaef068 Remove native -> js call noop-ing after early js error (#47915)
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
2024-12-02 14:18:55 -08:00
Alex HuntandFacebook GitHub Bot 215b0a50cf Update debugger-frontend from 6b80704...486803f (#48051)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48051

Changelog: [Internal] - Update `react-native/debugger-frontend` from 6b80704...486803f

Resyncs `react-native/debugger-frontend` from GitHub - see `rn-chrome-devtools-frontend` [changelog](https://github.com/facebookexperimental/rn-chrome-devtools-frontend/compare/6b80704fd50ea0bf10f5f5da5a4343de29aff8b2...486803f6bf272e0629297265dee8048a2f1269dd).

Reviewed By: hoxyq

Differential Revision: D66664563

fbshipit-source-id: 8c04c0f99e203f594d4e86a52aca99803c4b005f
2024-12-02 12:02:07 -08:00
Alex HuntandFacebook GitHub Bot 11c214d0c9 Update FuseboxTracer to closer align with Chrome trace events (#48020)
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
2024-12-02 11:24:34 -08:00
Andrew DatsenkoandFacebook GitHub Bot dc88683798 Corrently symbolicate message (#48048)
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
2024-12-02 11:16:03 -08:00
Alex HuntandFacebook GitHub Bot 1a9780f0e3 Remove FuseboxClient CDP domain (#48004)
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
2024-12-02 08:27:52 -08:00
Peter AbbondanzoandFacebook GitHub Bot 72bb2f4089 Bump Fresco to 3.5.0
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
2024-12-02 07:33:37 -08:00
Pieter De BaetsandFacebook GitHub Bot 70a957452c Restore deprecated TurboReactPackage (#48039)
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
2024-12-02 07:30:52 -08:00
Alex HuntandFacebook GitHub Bot a4310ede9c Update debugger-frontend from b61aae3...6b80704 (#48042)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48042

Changelog: [Internal] - Update `react-native/debugger-frontend` from b61aae3...6b80704

Resyncs `react-native/debugger-frontend` from GitHub - see `rn-chrome-devtools-frontend` [changelog](https://github.com/facebookexperimental/rn-chrome-devtools-frontend/compare/b61aae3ccc6e2684dfbf1e2a06b0f985b459f11f...6b80704fd50ea0bf10f5f5da5a4343de29aff8b2).

Reviewed By: blakef

Differential Revision: D66651149

fbshipit-source-id: 6848eebb4b7c04c7c04ae1f784fc39785945bf7b
2024-12-02 06:25:54 -08:00
Rubén NorteandFacebook GitHub Bot 0580e88aa5 Allow tests to specify opt/dev mode (#48022)
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
2024-12-02 06:06:26 -08:00
Rubén NorteandFacebook GitHub Bot 762389f775 Extract logic to debug command errors to shared function (#48019)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48019

Changelog: [internal]

Just a minor refactor to reduce code duplication.

Reviewed By: rshest

Differential Revision: D66596730

fbshipit-source-id: 2afa501cd5664402adf4aceba059a4d987c3ed62
2024-12-02 06:06:26 -08:00
Rubén NorteandFacebook GitHub Bot 4bced9099a Implement warm up step to remove costly builds from individual test running time (#48015)
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
2024-12-02 06:06:26 -08:00
Rubén NorteandFacebook GitHub Bot 21cc745d51 Extract some logic from runner to utils module (#48014)
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
2024-12-02 06:06:26 -08:00
Vojtech NovakandFacebook GitHub Bot 9147b0753a fix IOException in BuildCodegenCLITask (#48008)
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
2024-12-02 05:09:54 -08:00
Rubén NorteandFacebook GitHub Bot 2480de6ffb Add Fantom test for LongTask API (#48041)
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
2024-12-02 04:47:17 -08:00
Rubén NorteandFacebook GitHub Bot b6f2b148f4 Add suppor for toBeLessThanOrEqual and toBeGreaterThanOrEqual (#48040)
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
2024-12-02 04:47:17 -08:00
Rubén NorteandFacebook GitHub Bot 60a4d22307 Migrate ReactFabricPublicInstance tests to Fantom (#48025)
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
2024-12-02 04:47:17 -08:00
Rubén NorteandFacebook GitHub Bot 09f6d165ec Export ReactNativeTester (#48024)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48024

Changelog: [internal]

Reviewed By: rshest

Differential Revision: D66599071

fbshipit-source-id: 52585e030642e5b6bd8921d2c9f9d14ee5d6ce71
2024-12-02 04:47:17 -08:00
Nicola CortiandFacebook GitHub Bot 88c9a42fca Fix eslint warnings in react-native (#48016)
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
2024-12-02 04:11:22 -08:00
zhongwuzwandFacebook GitHub Bot 28ced2e558 Fabric: Fixes Modal onRequestClose not called (#48037)
Summary:
Fixes https://github.com/facebook/react-native/issues/48030 .

## Changelog:

[IOS] [FIXED] - Fabric: Fixes Modal onRequestClose not called

Pull Request resolved: https://github.com/facebook/react-native/pull/48037

Test Plan: Repro please see  https://github.com/facebook/react-native/issues/48030.

Reviewed By: cortinico

Differential Revision: D66647232

Pulled By: cipolleschi

fbshipit-source-id: 773517dfe45f6f2e6348cda225e972fbac05edc2
2024-12-02 04:06:40 -08:00
CHOIMINSEOKandFacebook GitHub Bot b8095f4692 Avoid NPE when touch event is triggered before SurfaceManager is initiated (#48007)
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
2024-12-02 03:54:34 -08:00
Wojciech LewickiandFacebook GitHub Bot 44b04b6d42 fix: add mising subpsec to React-Fabric podspec (#48023)
Summary:
Running app with static linking fails to compile. Probably during https://github.com/facebook/react-native/pull/43581 adding that code was overlooked since the analogous thing seems to be added: https://github.com/facebook/react-native/pull/43581/files#diff-6680f6849631e3dcc5897ee3961a9d6d2bc57aff3eccb79a9d9c634183276202R566.

cc rubennorte since you made the linked 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] [FIXED] - Add missing subpsec to React-Fabric podspec.

Pull Request resolved: https://github.com/facebook/react-native/pull/48023

Test Plan: Run https://github.com/WoLewicki/reproducer-react-native/tree/%40wolewicki/static-linking-with-live-markdown and see that it won't compile without this change.

Reviewed By: cipolleschi

Differential Revision: D66600486

Pulled By: cortinico

fbshipit-source-id: 9de64541e49d27cdf00f37942adab6620476f15a
2024-12-02 03:23:45 -08:00
Wojciech LewickiandFacebook GitHub Bot fa03840e68 fix: typo in inherited (#48013)
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
2024-12-02 03:23:01 -08:00
Nicola CortiandFacebook GitHub Bot 490db92562 Gradle to 8.11.1 (#48026)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48026

This should mitigate this particular issue we're seeing on Windows:
- https://github.com/facebook/react-native/issues/46210

Changelog:
[Android] [Changed] - Gradle to 8.11.1

Reviewed By: javache

Differential Revision: D66600321

fbshipit-source-id: d58437485222e189d90bcf4d6b41ca956449ed22
2024-12-02 03:22:32 -08:00
Rob HoganandFacebook GitHub Bot e996b3f346 Fix Animated on JSC: Object.hasOwn -> obj.hasOwnProperty (#48035)
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
2024-12-02 03:16:28 -08:00
Hugo FOYARTandFacebook GitHub Bot f791fb9e66 fix: FormData filename in content-disposition (#46543)
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
2024-12-02 03:14:28 -08:00
Kacper RozniataandFacebook GitHub Bot b886bc4db9 feat(android): migrate ReactSwitchManager to Kotlin (#48003)
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
2024-12-02 02:41:31 -08:00
zhongwuzwandFacebook GitHub Bot 91e217ff54 Add completion block when call js module function (#47998)
Summary:
Fabric bridgeless don't call completion block when call js module method, so let's support it :).

## Changelog:

[IOS] [FIXED] - [Fabric] Add completion block when call js module function

Pull Request resolved: https://github.com/facebook/react-native/pull/47998

Test Plan: Module call js module method when passed `onComplete` block can be called successfully in bridgeless mode.

Reviewed By: fabriziocucci

Differential Revision: D66594514

Pulled By: javache

fbshipit-source-id: 74644b1f359a24cfa93389451e172fbc6a8ee1a1
2024-11-29 04:08:52 -08:00
Andrew DatsenkoandFacebook GitHub Bot 5ff59b448b Add defaults to ParagraphAttributes::getDebugProps (#47986)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47986

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D66542033

fbshipit-source-id: d1f3d1776138d076636765262e27ae8e5e7342c5
2024-11-28 12:07:56 -08:00
Andrew DatsenkoandFacebook GitHub Bot de30f408e5 Add defaults to TextAttributes::getDebugProps (#47985)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47985

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D66542032

fbshipit-source-id: ccecd660f00d3d32909a57534897ba110d53d7b3
2024-11-28 12:07:56 -08:00
Andrew DatsenkoandFacebook GitHub Bot 212a743fdf Add float comparison to debugStringConvertilbeUtils (#47984)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47984

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D66541322

fbshipit-source-id: 1adb52de5c9b0321e328532c4394d8067ffce3d8
2024-11-28 12:07:56 -08:00
Andrew DatsenkoandFacebook GitHub Bot b27bd00a38 add jest-diff to dependencies (#47990)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47990

Changelog:
[General][Added] - add `jest-diff v29.7.0` to devDependencies

Reviewed By: NickGerleman

Differential Revision: D66541001

fbshipit-source-id: 01c59a936b66f85ce034b59c7928df3c3f8c2a01
2024-11-28 10:04:46 -08:00
lihaitaoandFacebook GitHub Bot 2aa79979d3 fix:setColorScheme exception when activity recreate (#47955)
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
2024-11-28 09:37:07 -08:00
Alex HuntandFacebook GitHub Bot 2fcf7b1f49 Allow fuseboxClientType_ detection from ReactNativeApplication.enable method (#47962)
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
2024-11-28 09:26:03 -08:00
Rubén NorteandFacebook GitHub Bot 7ccc5934d0 Implement symbolication of error stack traces (#48006)
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
2024-11-28 07:59:26 -08:00
Pieter De BaetsandFacebook GitHub Bot bc9e4db9e9 Demonstrate bug in differentiator where reparented nodes reference non-existent nodes (#48002)
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
2024-11-28 06:06:59 -08:00
Kudo ChienandFacebook GitHub Bot 24fee29f7a Add useColorScheme mock test (#47988)
Summary:
add a jest test to test when `useColorScheme` is not mocked. following up https://github.com/facebook/react-native/pull/47629#issuecomment-2491534678

## Changelog:

[GENERAL] [ADDED] - Add useColorScheme mock test

Pull Request resolved: https://github.com/facebook/react-native/pull/47988

Test Plan: ci passed

Reviewed By: javache

Differential Revision: D66573172

Pulled By: blakef

fbshipit-source-id: 820227f6fc4e18a968b3181fad8f534a716f1e9e
2024-11-28 05:05:31 -08:00
Rubén NorteandFacebook GitHub Bot 6ae49ee9e3 Improve error messages in tests (#47994)
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
2024-11-28 04:31:20 -08:00
Jorge Cabiedes AcostaandFacebook GitHub Bot ce9f5345e3 Fix Android ensureNoOverlap function and revise implementation (#47989)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47989

- Fixing Android's ensureNoOverlap algorithm. (For real this time)
- Improve verbiage for `ensureNoOverlap` function.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D66514729

fbshipit-source-id: 99908deee2232cc125bb0998ae7acd636a1f7e10
2024-11-27 19:57:55 -08:00
Arushi KesarwaniandFacebook GitHub Bot 5da7089e35 NIT: Updating docstring for DefaultReactHost for missing arguments (#47992)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47992

TSIA

Changelog: [Internal]

Reviewed By: shwanton

Differential Revision: D66552119

fbshipit-source-id: 6dcd461fcea1444a58db4f98316bf8878ae98781
2024-11-27 17:26:19 -08:00
Arushi KesarwaniandFacebook GitHub Bot 762bcc6073 NIT: Updating docstring for DefaultReactHost to match the arguments. (#47991)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47991

TSIA

Changelog: [Internal]

Reviewed By: shwanton

Differential Revision: D66550256

fbshipit-source-id: b3c18032a421fd9f0bd69c142e72d884f96340f8
2024-11-27 17:26:19 -08:00
Alex HuntandFacebook GitHub Bot 7f57018e25 Add profiling_target_registered event, log to terminal (#47968)
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
2024-11-27 11:42:31 -08:00
Alex HuntandFacebook GitHub Bot b95631ed7f Enable identifying profiling builds on proxy registration (#47967)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47967

(Android only) Updates `jsinspector-modern` to enable identifying profiling builds (experimental) when registering the debug target with the Inspector Proxy.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D66501768

fbshipit-source-id: bbe2b9a2c7c014c952ef5ee49284a161dbeefb09
2024-11-27 11:42:31 -08:00
Alex HuntandFacebook GitHub Bot b9762d568a Enable identifying profiling builds over CDP (#47966)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47966

Updates `jsinspector-modern` to enable identifying profiling builds (experimental) to the frontend over CDP.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D66501770

fbshipit-source-id: 9d079da862a59d5e2dc6f970e7418339620e1451
2024-11-27 11:42:31 -08:00
Rubén NorteandFacebook GitHub Bot a36dbae486 Optimize performance of ReactNativeElement constructor (#47983)
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
2024-11-27 11:24:31 -08:00
Jakub RomanczykandFacebook GitHub Bot 881d8a720f refactor(community-cli-plugin): use node builtin fetch (#47397)
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
2024-11-27 10:39:39 -08:00
Joe VilchesandFacebook GitHub Bot 1d909efa23 Align order of params between calculateLayoutInternal and calculateLayoutImpl (#47975)
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
2024-11-26 22:48:24 -08:00
Phillip PanandFacebook GitHub Bot 3c09d6bfce allow bindings installer to be passed down to DefaultReactHost (#47944)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47944

Changelog: [Internal]

adding an option to pass down bindings installer from product layer

Reviewed By: mlord93

Differential Revision: D66477349

fbshipit-source-id: 9462cbe0b1fcee875c18de0426c0c1b02f086ff1
2024-11-26 19:20:56 -08:00
Joe VilchesandFacebook GitHub Bot 40c194cf47 Camel case LengthValue in Node.cpp (#47971)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47971

X-link: https://github.com/facebook/yoga/pull/1754

This was annoying me

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D66510734

fbshipit-source-id: d1b952f2e82e7018b16dc0c572d9b98aec18c0e5
2024-11-26 15:23:08 -08:00
Alex HuntandFacebook GitHub Bot 24f010d5b5 Update unstable-react-profiling to use PerftestDevSupportManager (#47715)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47715

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D66167302

fbshipit-source-id: 23e6154eedd36c2011062de3195887cba7af8a72
2024-11-26 12:48:37 -08:00
Andrei MarchenkoandFacebook GitHub Bot df7b6ae092 fix item disappearing with scroll in VirtualizedList (#47965)
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
2024-11-26 10:44:30 -08:00
Rob HoganandFacebook GitHub Bot 016f44518e Changelog for 0.77.0-rc.0 (#47958)
Summary:
Changelog as generated by rnx-kit + manual fixes.

Changelog: [Internal]

Pull Request resolved: https://github.com/facebook/react-native/pull/47958

Reviewed By: rshest, blakef

Differential Revision: D66498590

Pulled By: robhogan

fbshipit-source-id: 81efda2615f8e61be5f5922511362946f3ba3c6b
2024-11-26 08:06:18 -08:00
Dmitry RykunandFacebook GitHub Bot 69356b7f21 Introduce ImageRequestParams (#47723)
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
2024-11-26 07:27:02 -08:00
Dmitry RykunandFacebook GitHub Bot a6b2355b8d Introduce Android ImageManger (#47721)
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
2024-11-26 04:22:09 -08:00
Pieter De BaetsandFacebook GitHub Bot 8869fa4c2c Fix stale reference to ReactViewGroup#mAllChildren (#47950)
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
2024-11-26 04:00:14 -08:00
Pieter De BaetsandFacebook GitHub Bot 84adf268e1 Add more diagnostics for subview clipping crash (#47937)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47937

Changelog: [Internal]

Reviewed By: tdn120

Differential Revision: D66469161

fbshipit-source-id: d32f0592787ecae850854b2ff04d7c703ee8ec2e
2024-11-26 04:00:14 -08:00
Sam ZhouandFacebook GitHub Bot d86412dcc6 prepare for primitive literal changes (#47943)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47943

Changelog: [Internal]

Reviewed By: panagosg7

Differential Revision: D66461724

fbshipit-source-id: b526ed1617667b70337472f4dad4e19f152a266b
2024-11-26 00:07:32 -08:00
Jorge Cabiedes AcostaandFacebook GitHub Bot f70c3cae5b Fix border disappearing when only one edge is transparent (#47940)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47940

Fixes https://github.com/facebook/react-native/issues/47905

Border was disappearing when only one edge had an alpha of 0. This was due to clipping conditional

Changelog: [Internal]

Reviewed By: shwanton, NickGerleman

Differential Revision: D66397736

fbshipit-source-id: 8937323ad16e0c6e98a55051f244c08ef54c96eb
2024-11-25 18:15:25 -08:00
Jorge Cabiedes AcostaandFacebook GitHub Bot 96e66e7b48 Add unit tests for CompositeBackgroundDrawable layer ordering optimization (#47913)
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
2024-11-25 16:48:39 -08:00
Sam ZhouandFacebook GitHub Bot cb7cd89a10 Deploy 0.255.0 to xplat (#47941)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47941

Changelog: [Internal]

Reviewed By: pieterv

Differential Revision: D66477998

fbshipit-source-id: f4d1dbe506d6c42751fade897637031f0a43aa29
2024-11-25 16:06:09 -08:00
Brett LavallaandFacebook GitHub Bot f363b43856 Make color value of ShadowStyleSpan public (#47934)
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
2024-11-25 15:45:57 -08:00
danandFacebook GitHub Bot fe7e97a2fd Fix ScrollView centerContent losing taps and causing jitter on iOS (#47591)
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
2024-11-25 14:56:02 -08:00
Jorge Cabiedes AcostaandFacebook GitHub Bot 2a2f58ad9d Add mixBlendMode to iterator style parser (#47292)
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
2024-11-25 13:12:12 -08:00
Jorge Cabiedes AcostaandFacebook GitHub Bot b41fb6c88e Add fabric check to drawChild function (#47293)
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
2024-11-25 13:12:12 -08:00
Dmitry RykunandFacebook GitHub Bot 8d83da6460 Introduce experimental image prefetching API (#47755)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47755

TIA.
Changelog: [Internal]

Reviewed By: tdn120

Differential Revision: D65596686

fbshipit-source-id: 9fbd57caa2fdeab0bdf68e7919b1f65179634a9d
2024-11-25 12:40:09 -08:00
Jorge Cabiedes AcostaandFacebook GitHub Bot 81a94f4f14 Forward fix incorrect elliptical border radius (#47931)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47931

tsia

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D66388179

fbshipit-source-id: 5c614cf52e834f664bb9f59767b2e172c51af620
2024-11-25 11:10:02 -08:00
Mateo GuzmánandFacebook GitHub Bot 81cb166d10 fix(image): [android] cache control headers are being overwritten (#47922)
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
-4
View File
@@ -1,4 +0,0 @@
# Circle CI
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.
-13
View File
@@ -1,13 +0,0 @@
version: 2.1
workflows:
version: 2
stub:
jobs:
- circleci-stub
jobs:
circleci-stub:
docker:
- image: debian:bullseye
steps:
- run: echo "There is nothing here, just an empty job. Everything has been moved to GitHub Action"
+1
View File
@@ -3,6 +3,7 @@
docs/generatedComponentApiDocs.js
packages/react-native/flow/
packages/react-native/sdks/
packages/react-native/ReactAndroid/build
packages/react-native/ReactAndroid/hermes-engine/build/
packages/react-native/Libraries/Renderer/*
packages/react-native/Libraries/vendor/**/*
+10
View File
@@ -35,6 +35,16 @@ module.exports = {
'no-undef': 0,
},
},
{
files: [
'./packages/react-native/**/*.{js,flow}',
'./packages/assets/registry.js',
],
parser: 'hermes-eslint',
rules: {
'lint/no-commonjs-exports': 1,
},
},
{
files: ['package.json'],
parser: 'jsonc-eslint-parser',
+1 -1
View File
@@ -95,4 +95,4 @@ untyped-import
untyped-type-import
[version]
^0.254.2
^0.259.1
+1 -1
View File
@@ -16,7 +16,7 @@ runs:
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Install node dependencies
uses: ./.github/actions/yarn-install-with-cache
uses: ./.github/actions/yarn-install
- name: Set React Native Version
shell: bash
run: node ./scripts/releases/set-rn-artifacts-version.js --build-type ${{ inputs.release-type }}
@@ -47,7 +47,7 @@ runs:
fi
- name: Yarn- Install Dependencies
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
uses: ./.github/actions/yarn-install-with-cache
uses: ./.github/actions/yarn-install
- name: Slice cache macosx
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
uses: actions/download-artifact@v4
@@ -43,9 +43,6 @@ runs:
shell: powershell
run: |
if (-not(Test-Path -Path $Env:HERMES_WS_DIR\win64-bin\hermesc.exe)) {
choco install --no-progress cmake --version 3.14.7 --allow-downgrade
if (-not $?) { throw "Failed to install CMake" }
cd $Env:HERMES_WS_DIR\icu
# If Invoke-WebRequest shows a progress bar, it will fail with
# Win32 internal error "Access is denied" 0x5 occurred [...]
+1 -1
View File
@@ -103,7 +103,7 @@ runs:
- name: Setup gradle
uses: ./.github/actions/setup-gradle
- name: Install dependencies
uses: ./.github/actions/yarn-install-with-cache
uses: ./.github/actions/yarn-install
- name: Build packages
shell: bash
run: yarn build
+1 -1
View File
@@ -15,7 +15,7 @@ runs:
using: composite
steps:
- name: Yarn install
uses: ./.github/actions/yarn-install-with-cache
uses: ./.github/actions/yarn-install
- name: Configure Git
shell: bash
run: |
+8 -6
View File
@@ -15,9 +15,8 @@ runs:
uses: ./.github/actions/setup-node
with:
node-version: ${{ inputs.node-version }}
- name: Yarn install
shell: bash
run: yarn install --non-interactive --frozen-lockfile
- name: Run yarn install
uses: ./.github/actions/yarn-install
- name: Run linters against modified files (analysis-bot)
shell: bash
run: yarn lint-ci
@@ -26,10 +25,13 @@ runs:
GITHUB_PR_NUMBER: ${{ github.event.number }}
- name: Lint code
shell: bash
run: ./scripts/circleci/exec_swallow_error.sh yarn lint --format junit -o ./reports/junit/eslint/results.xml
run: ./.github/workflow-scripts/exec_swallow_error.sh yarn lint --format junit -o ./reports/junit/eslint/results.xml
- name: Lint java
shell: bash
run: ./scripts/circleci/exec_swallow_error.sh yarn lint-java --check
run: ./.github/workflow-scripts/exec_swallow_error.sh yarn lint-java --check
- name: Verify not committing repo after running build
shell: bash
run: yarn run build --check
- name: Run flowcheck
shell: bash
run: yarn flow-check
@@ -38,7 +40,7 @@ runs:
run: yarn test-typescript
- name: Check license
shell: bash
run: ./scripts/circleci/check_license.sh
run: ./.github/workflow-scripts/check_license.sh
- name: Check formatting
shell: bash
run: yarn run format-check
+13 -6
View File
@@ -25,13 +25,17 @@ inputs:
required: false
default: "."
description: The directory from which metro should be started
architecture:
required: false
default: "NewArch"
description: The react native architecture to test
runs:
using: composite
steps:
- name: Installing Maestro
shell: bash
run: export MAESTRO_VERSION=1.36.0; curl -Ls "https://get.maestro.mobile.dev" | bash
run: export MAESTRO_VERSION=1.39.7; curl -Ls "https://get.maestro.mobile.dev" | bash
- name: Set up JDK 17
if: ${{ inputs.install-java == 'true' }}
uses: actions/setup-java@v4
@@ -52,12 +56,15 @@ runs:
if: ${{ inputs.flavor == 'debug' }}
run: ./packages/react-native-codegen/scripts/oss/build.sh
- name: Run e2e tests
id: run-tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 24
arch: x86
ram-size: '4096M'
ram-size: '8192M'
heap-size: '4096M'
disk-size: '10G'
cores: '4'
disable-animations: false
avd-name: e2e_emulator
script: node .github/workflow-scripts/maestro-android.js ${{ inputs.app-path }} ${{ inputs.app-id }} ${{ inputs.maestro-flow }} ${{ inputs.flavor }} ${{ inputs.working-directory }}
@@ -69,16 +76,16 @@ runs:
NORM_APP_ID=$(echo "${{ inputs.app-id }}" | tr '.' '-')
echo "app-id=$NORM_APP_ID" >> $GITHUB_OUTPUT
- name: Store tests result
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4.3.4
if: always()
with:
name: e2e_android_${{ steps.normalize-app-id.outputs.app-id }}_report_${{ inputs.jsengine }}_${{ inputs.flavor }}
name: e2e_android_${{ steps.normalize-app-id.outputs.app-id }}_report_${{ inputs.jsengine }}_${{ inputs.flavor }}_${{ inputs.architecture }}
path: |
report.xml
screen.mp4
- name: Store Logs
if: failure() && steps.run-tests.outcome == 'failure'
if: steps.run-tests.outcome == 'failure'
uses: actions/upload-artifact@v4.3.4
with:
name: maestro-logs-android-${{ steps.normalize-app-id.outputs.app-id }}-${{ inputs.jsengine }}-${{ inputs.flavor }}
name: maestro-logs-android-${{ steps.normalize-app-id.outputs.app-id }}-${{ inputs.jsengine }}-${{ inputs.flavor }}-${{ inputs.architecture }}
path: /tmp/MaestroLogs
+25 -57
View File
@@ -21,27 +21,36 @@ inputs:
required: false
default: "."
description: The directory from which metro should be started
architecture:
required: false
default: "NewArch"
description: The react native architecture to test
runs:
using: composite
steps:
- name: Installing Maestro
shell: bash
run: export MAESTRO_VERSION=1.36.0; curl -Ls "https://get.maestro.mobile.dev" | bash
run: export MAESTRO_VERSION=1.39.7; curl -Ls "https://get.maestro.mobile.dev" | bash
- name: Installing Maestro dependencies
shell: bash
run: |
brew tap facebook/fb
brew install facebook/fb/idb-companion jq
brew install facebook/fb/idb-companion
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'zulu'
- name: Run yarn install
uses: ./.github/actions/yarn-install
- name: Start Metro in Debug
shell: bash
if: ${{ inputs.flavor == 'Debug' }}
run: |
# build codegen or we will see a redbox
./packages/react-native-codegen/scripts/oss/build.sh
cd ${{ inputs.working-directory }}
yarn start &
sleep 5 # to give metro time to load
@@ -53,69 +62,28 @@ runs:
# Maestro can fail in case of flakyness, we have some retry logic.
set +e
echo "Launching iOS Simulator: iPhone 15 Pro"
xcrun simctl boot "iPhone 15 Pro"
echo "Installing app on Simulator"
xcrun simctl install booted "${{ inputs.app-path }}"
echo "Retrieving device UDID"
UDID=$(xcrun simctl list devices booted -j | jq -r '[.devices[]] | add | first | .udid')
echo "UDID is $UDID"
echo "Bring simulator in foreground"
open -a simulator
echo "Launch the app"
xcrun simctl launch $UDID ${{ inputs.app-id }}
if [[ ${{ inputs.flavor }} == 'Debug' ]]; then
# To give the app time to warm the metro's cache
sleep 20
fi
echo "Running tests with Maestro"
export MAESTRO_DRIVER_STARTUP_TIMEOUT=1500000 # 25 min. CI is extremely slow
# Add retries for flakyness
MAX_ATTEMPTS=5
CURR_ATTEMPT=0
RESULT=1
while [[ $CURR_ATTEMPT -lt $MAX_ATTEMPTS ]] && [[ $RESULT -ne 0 ]]; do
CURR_ATTEMPT=$((CURR_ATTEMPT+1))
echo "Attempt number $CURR_ATTEMPT"
echo "Start video record using pid: video_record_${{ inputs.jsengine }}_$CURR_ATTEMPT.pid"
xcrun simctl io booted recordVideo video_record_$CURR_ATTEMPT.mov & echo $! > video_record_${{ inputs.jsengine }}_$CURR_ATTEMPT.pid
echo '$HOME/.maestro/bin/maestro --udid=$UDID test ${{ inputs.maestro-flow }} --format junit -e APP_ID=${{ inputs.app-id }}'
$HOME/.maestro/bin/maestro --udid=$UDID test ${{ inputs.maestro-flow }} --format junit -e APP_ID=${{ inputs.app-id }} --debug-output /tmp/MaestroLogs
RESULT=$?
# Stop video
kill -SIGINT $(cat video_record_${{ inputs.jsengine }}_$CURR_ATTEMPT.pid)
done
exit $RESULT
node .github/workflow-scripts/maestro-ios.js \
"${{ inputs.app-path }}" \
"${{ inputs.app-id }}" \
"${{ inputs.maestro-flow }}" \
"${{ inputs.jsengine }}" \
"${{ inputs.flavor }}" \
"${{ inputs.working-directory }}"
- name: Store video record
if: always()
uses: actions/upload-artifact@v4.3.4
with:
name: e2e_ios_${{ inputs.app-id }}_report_${{ inputs.jsengine }}_${{ inputs.flavor }}
name: e2e_ios_${{ inputs.app-id }}_report_${{ inputs.jsengine }}_${{ inputs.flavor }}_${{ inputs.architecture }}
path: |
video_record_1.mov
video_record_2.mov
video_record_3.mov
video_record_4.mov
video_record_5.mov
video_record_${{ inputs.jsengine }}_1.mov
video_record_${{ inputs.jsengine }}_2.mov
video_record_${{ inputs.jsengine }}_3.mov
video_record_${{ inputs.jsengine }}_4.mov
video_record_${{ inputs.jsengine }}_5.mov
report.xml
- name: Store Logs
if: failure() && steps.run-tests.outcome == 'failure'
uses: actions/upload-artifact@v4.3.4
with:
name: maestro-logs-${{ inputs.app-id }}-${{ inputs.jsengine }}-${{ inputs.flavor }}
name: maestro-logs-${{ inputs.app-id }}-${{ inputs.jsengine }}-${{ inputs.flavor }}-${{ inputs.architecture }}
path: /tmp/MaestroLogs
@@ -69,7 +69,7 @@ runs:
- name: Yarn- Install Dependencies
if: ${{ steps.meaningful-cache.outputs.HERMES_CACHED != 'true' }}
uses: ./.github/actions/yarn-install-with-cache
uses: ./.github/actions/yarn-install
- name: Download Hermes tarball
if: ${{ steps.meaningful-cache.outputs.HERMES_CACHED != 'true' }}
+1
View File
@@ -12,3 +12,4 @@ runs:
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
cache: yarn
@@ -41,7 +41,7 @@ runs:
shell: bash
run: ls -lR "$HERMES_WS_DIR"
- name: Run yarn
uses: ./.github/actions/yarn-install-with-cache
uses: ./.github/actions/yarn-install
- name: Setup ruby
uses: ruby/setup-ruby@v1.170.0
with:
+13 -13
View File
@@ -41,7 +41,7 @@ runs:
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Run yarn
uses: ./.github/actions/yarn-install-with-cache
uses: ./.github/actions/yarn-install
- name: Download Hermes
uses: actions/download-artifact@v4
with:
@@ -109,8 +109,8 @@ runs:
export USE_FRAMEWORKS=dynamic
fi
if [[ ${{ inputs.architecture }} == "NewArch" ]]; then
export RCT_NEW_ARCH_ENABLED=1
if [[ ${{ inputs.architecture }} == "OldArch" ]]; then
export RCT_NEW_ARCH_ENABLED=0
fi
cd packages/rn-tester
@@ -118,16 +118,7 @@ runs:
bundle install
bundle exec pod install
- name: Build RNTester
if: ${{ inputs.run-unit-tests != 'true' && inputs.run-e2e-tests == 'false' }}
shell: bash
run: |
xcodebuild build \
-workspace packages/rn-tester/RNTesterPods.xcworkspace \
-scheme RNTester \
-sdk iphonesimulator
- name: Build RNTester (E2E Tests)
shell: bash
if: ${{ inputs.run-e2e-tests == 'true' }}
run: |
xcodebuild \
-scheme "RNTester" \
@@ -138,7 +129,10 @@ runs:
-derivedDataPath "/tmp/RNTesterBuild"
echo "Print path to *.app file"
find "/tmp/RNTesterBuild" -type d -name "*.app"
APP_PATH=$(find "/tmp/RNTesterBuild" -type d -name "*.app")
echo "App found at $APP_PATH"
echo "app-path=$APP_PATH" >> $GITHUB_ENV
- name: "Run Tests: iOS Unit and Integration Tests"
if: ${{ inputs.run-unit-tests == 'true' }}
shell: bash
@@ -158,6 +152,12 @@ runs:
with:
name: xcresults
path: /Users/distiller/Library/Developer/Xcode/xcresults.tar.gz
- name: Upload RNTester App
if: ${{ inputs.use-frameworks == 'StaticLibraries' && inputs.ruby-version == '2.6.10' }} # This is needed to avoid conflicts with the artifacts
uses: actions/upload-artifact@v4.3.4
with:
name: RNTesterApp-${{ inputs.architecture }}-${{ inputs.jsengine }}-${{ inputs.flavor }}
path: ${{ env.app-path }}
- name: Store test results
if: ${{ inputs.run-unit-tests == 'true' }}
uses: actions/upload-artifact@v4.3.4
+1 -1
View File
@@ -13,7 +13,7 @@ runs:
with:
node-version: ${{ inputs.node-version }}
- name: Yarn install
uses: ./.github/actions/yarn-install-with-cache
uses: ./.github/actions/yarn-install
- name: Run Tests - JavaScript Tests
shell: bash
run: node ./scripts/run-ci-javascript-tests.js --maxWorkers 2
@@ -1,28 +0,0 @@
name: yarn-install-with-cache
inputs:
update-cache:
description: Update the cache, only do this if you are update-node-modules-cache.yml
default: "false"
description: Only update node_modules if on main
runs:
using: composite
steps:
- name: Load node_modules from cache
# Restore for all branches, but save for 'main'.
uses: actions/cache/restore@v4
with:
path: node_modules/
key: node-modules-${{ hashFiles('package.json') }}
- name: Install dependencies
shell: bash
run: yarn install --non-interactive
- name: Save node_modules to the cache
if: github.ref == 'refs/heads/main' && inputs.update-cache == 'true'
uses: actions/cache/save@v4
with:
path: node_modules/
# We're assuming that variations on branches will slightly vary from main,
# so it's always important to run yarn install --non-interactive after this
# cache is restored.
key: node-modules-v1-${{ hashFiles('package.json') }}
enableCrossOsArchive: true
+7
View File
@@ -0,0 +1,7 @@
name: yarn-install
runs:
using: composite
steps:
- name: Install dependencies
shell: bash
run: yarn install --non-interactive --frozen-lockfile
@@ -15,8 +15,7 @@ if [ -x "$(command -v shellcheck)" ]; then
if [ -n "$CIRCLE_CI" ]; then
results=( "$(find . -type f -not -path "*node_modules*" -not -path "*third-party*" -name '*.sh' -exec sh -c 'shellcheck "$1" -f json' -- {} \;)" )
cat <(echo shellcheck; printf '%s\n' "${results[@]}" | jq .,[] | jq -s . | jq --compact-output --raw-output '[ (.[] | .[] | . ) ]') | GITHUB_PR_NUMBER="$CIRCLE_PR_NUMBER" node scripts/circleci/code-analysis-bot.js
cat <(echo shellcheck; printf '%s\n' "${results[@]}" | jq .,[] | jq -s . | jq --compact-output --raw-output '[ (.[] | .[] | . ) ]') | GITHUB_PR_NUMBER="$GITHUB_PR_NUMBER" node packages/react-native-bots/code-analysis-bot.js
# check status
STATUS=$?
if [ $STATUS == 0 ]; then
@@ -38,4 +37,3 @@ else
echo 'shellcheck is not installed. See https://github.com/facebook/react-native/wiki/Development-Dependencies#shellcheck for instructions.'
exit 1
fi
@@ -7,7 +7,7 @@
set -e
# Make sure we don't introduce accidental references to PATENTS.
EXPECTED='scripts/circleci/check_license.sh'
EXPECTED='.github/workflow-scripts/check_license.sh'
ACTUAL=$(git grep -l PATENTS)
if [ "$EXPECTED" != "$ACTUAL" ]; then
+53 -9
View File
@@ -8,6 +8,7 @@
*/
const childProcess = require('child_process');
const fs = require('fs');
const usage = `
=== Usage ===
@@ -33,6 +34,38 @@ const MAESTRO_FLOW = args[2];
const IS_DEBUG = args[3] === 'debug';
const WORKING_DIRECTORY = args[4];
const MAX_ATTEMPTS = 3;
async function executeFlowWithRetries(flow, currentAttempt) {
try {
console.info(`Executing flow: ${flow}`);
const timeout = 1000 * 60 * 10; // 10 minutes
childProcess.execSync(
`MAESTRO_DRIVER_STARTUP_TIMEOUT=120000 $HOME/.maestro/bin/maestro test ${flow} --format junit -e APP_ID=${APP_ID} --debug-output /tmp/MaestroLogs`,
{stdio: 'inherit', timeout},
);
} catch (err) {
if (currentAttempt < MAX_ATTEMPTS) {
console.info(`Retrying...`);
await executeFlowWithRetries(flow, currentAttempt + 1);
} else {
throw err;
}
}
}
async function executeFlowInFolder(flowFolder) {
const files = fs.readdirSync(flowFolder);
for (const file of files) {
const filePath = `${flowFolder}/${file}`;
if (fs.lstatSync(filePath).isDirectory()) {
await executeFlowInFolder(filePath);
} else {
await executeFlowWithRetries(filePath, 0);
}
}
}
async function main() {
console.info('\n==============================');
console.info('Running tests for Android with the following parameters:');
@@ -55,15 +88,21 @@ async function main() {
stdio: 'ignore',
detached: true,
});
metroProcess.unref();
console.info(`- Metro PID: ${metroProcess.pid}`);
}
console.info('Wait For Metro to Start');
await sleep(5000);
console.info('Wait For Metro to Start');
await sleep(5000);
}
console.info('Start the app');
childProcess.execSync(`adb shell monkey -p ${APP_ID} 1`, {stdio: 'ignore'});
if (IS_DEBUG) {
console.info('Wait For App to warm from Metro');
await sleep(10000);
}
console.info('Start recording to /sdcard/screen.mp4');
childProcess
.exec('adb shell screenrecord /sdcard/screen.mp4', {
@@ -75,10 +114,15 @@ async function main() {
console.info(`Start testing ${MAESTRO_FLOW}`);
let error = null;
try {
childProcess.execSync(
`MAESTRO_DRIVER_STARTUP_TIMEOUT=120000 $HOME/.maestro/bin/maestro test ${MAESTRO_FLOW} --format junit -e APP_ID=${APP_ID} --debug-output /tmp/MaestroLogs`,
{stdio: 'inherit'},
);
//check if MAESTRO_FLOW is a folder
if (
fs.existsSync(MAESTRO_FLOW) &&
fs.lstatSync(MAESTRO_FLOW).isDirectory()
) {
await executeFlowInFolder(MAESTRO_FLOW);
} else {
await executeFlowWithRetries(MAESTRO_FLOW, 0);
}
} catch (err) {
error = err;
} finally {
@@ -88,15 +132,15 @@ async function main() {
if (IS_DEBUG && metroProcess != null) {
const pid = metroProcess.pid;
console.info(`Kill Metro. PID: ${pid}`);
process.kill(-pid);
process.kill(pid);
console.info(`Metro Killed`);
process.exit();
}
}
if (error) {
throw error;
}
process.exit();
}
function sleep(ms) {
+176
View File
@@ -0,0 +1,176 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*/
const childProcess = require('child_process');
const fs = require('fs');
const usage = `
=== Usage ===
node maestro-android.js <path to app> <app_id> <maestro_flow> <flavor> <working_directory>
@param {string} appPath - Path to the app APK
@param {string} appId - App ID that needs to be launched
@param {string} maestroFlow - Path to the maestro flow to be executed
@param {string} jsengine - The JSEngine to use for the test
@param {string} flavor - Flavor of the app to be launched. Can be 'Release' or 'Debug'
@param {string} workingDirectory - Working directory from where to run Metro
==============
`;
const args = process.argv.slice(2);
if (args.length !== 6) {
throw new Error(`Invalid number of arguments.\n${usage}`);
}
const APP_PATH = args[0];
const APP_ID = args[1];
const MAESTRO_FLOW = args[2];
const JS_ENGINE = args[3];
const IS_DEBUG = args[4] === 'Debug';
const WORKING_DIRECTORY = args[5];
const MAX_ATTEMPTS = 5;
function launchSimulator(simulatorName) {
console.log(`Launching simulator ${simulatorName}`);
try {
childProcess.execSync(`xcrun simctl boot "${simulatorName}"`);
} catch (error) {
if (
!error.message.includes('Unable to boot device in current state: Booted')
) {
throw error;
}
}
}
function installAppOnSimulator(appPath) {
console.log(`Installing app at path ${appPath}`);
childProcess.execSync(`xcrun simctl install booted "${appPath}"`);
}
function extractSimulatorUDID() {
console.log('Retrieving device UDID');
const command = `xcrun simctl list devices booted -j | jq -r '[.devices[]] | add | first | .udid'`;
const udid = String(childProcess.execSync(command)).trim();
console.log(`UDID is ${udid}`);
return udid;
}
function bringSimulatorInForeground() {
console.log('Bringing simulator in foreground');
childProcess.execSync('open -a simulator');
}
function sleep(ms) {
return new Promise(resolve => {
setTimeout(resolve, ms);
});
}
async function launchAppOnSimulator(appId, udid, isDebug) {
console.log('Launch the app');
childProcess.execSync(`xcrun simctl launch "${udid}" "${appId}"`);
if (isDebug) {
console.log('Wait for metro to warm');
await sleep(20 * 1000);
}
}
function startVideoRecording(jsengine, currentAttempt) {
console.log(
`Start video record using pid: video_record_${jsengine}_${currentAttempt}.pid`,
);
const recordingArgs =
`simctl io booted recordVideo video_record_${jsengine}_${currentAttempt}.mov`.split(
' ',
);
const recordingProcess = childProcess.spawn('xcrun', recordingArgs, {
detached: true,
stdio: 'ignore',
});
return recordingProcess;
}
function stopVideoRecording(recordingProcess) {
if (!recordingProcess) {
console.log("Passed a null recording process. Can't kill it");
return;
}
console.log(`Stop video record using pid: ${recordingProcess.pid}`);
recordingProcess.kill('SIGINT');
}
function executeTestsWithRetries(
appId,
udid,
maestroFlow,
jsengine,
currentAttempt,
) {
const recProcess = startVideoRecording(jsengine, currentAttempt);
try {
const timeout = 1000 * 60 * 10; // 10 minutes
const command = `$HOME/.maestro/bin/maestro --udid="${udid}" test "${maestroFlow}" --format junit -e APP_ID="${appId}"`;
console.log(command);
childProcess.execSync(`MAESTRO_DRIVER_STARTUP_TIMEOUT=1500000 ${command}`, {
stdio: 'inherit',
timeout,
});
stopVideoRecording(recProcess);
} catch (error) {
// Can't put this in the finally block because it will be executed after the
// recursive call of executeTestsWithRetries
stopVideoRecording(recProcess);
if (currentAttempt < MAX_ATTEMPTS) {
executeTestsWithRetries(
appId,
udid,
maestroFlow,
jsengine,
currentAttempt + 1,
);
} else {
console.error(`Failed to execute flow after ${MAX_ATTEMPTS} attempts.`);
throw error;
}
}
}
async function main() {
console.info('\n==============================');
console.info('Running tests for iOS with the following parameters:');
console.info(`APP_PATH: ${APP_PATH}`);
console.info(`APP_ID: ${APP_ID}`);
console.info(`MAESTRO_FLOW: ${MAESTRO_FLOW}`);
console.info(`JS_ENGINE: ${JS_ENGINE}`);
console.info(`IS_DEBUG: ${IS_DEBUG}`);
console.info(`WORKING_DIRECTORY: ${WORKING_DIRECTORY}`);
console.info('==============================\n');
const simulatorName = 'iPhone 15 Pro';
launchSimulator(simulatorName);
installAppOnSimulator(APP_PATH);
const udid = extractSimulatorUDID();
bringSimulatorInForeground();
await launchAppOnSimulator(APP_ID, udid, IS_DEBUG);
executeTestsWithRetries(APP_ID, udid, MAESTRO_FLOW, JS_ENGINE, 1);
console.log('Test finished');
process.exit(0);
}
main();
+2 -3
View File
@@ -18,9 +18,8 @@ jobs:
if: github.repository == 'facebook/react-native'
steps:
- uses: actions/checkout@v4
- name: Run Yarn Install on Root
run: yarn install
working-directory: .
- name: Run yarn install
uses: ./.github/actions/yarn-install
- name: Danger
run: yarn danger ci --use-github-checks --failOnErrors
working-directory: packages/react-native-bots
+1 -1
View File
@@ -170,7 +170,7 @@ jobs:
env:
TERM: "dumb"
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
# By default we only build ARM64 to save time/resources. For release/nightlies/prealpha, we override this value to build all archs.
# By default we only build ARM64 to save time/resources. For release/nightlies, we override this value to build all archs.
ORG_GRADLE_PROJECT_reactNativeArchitectures: "arm64-v8a"
env:
HERMES_WS_DIR: /tmp/hermes
@@ -17,7 +17,7 @@ jobs:
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Run Yarn Install
uses: ./.github/actions/yarn-install-with-cache
uses: ./.github/actions/yarn-install
- name: Build packages
run: yarn build
- name: Set NPM auth token
+1 -1
View File
@@ -167,7 +167,7 @@ jobs:
env:
TERM: "dumb"
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
# By default we only build ARM64 to save time/resources. For release/nightlies/prealpha, we override this value to build all archs.
# By default we only build ARM64 to save time/resources. For release/nightlies, we override this value to build all archs.
ORG_GRADLE_PROJECT_reactNativeArchitectures: "arm64-v8a"
env:
HERMES_WS_DIR: /tmp/hermes
+46 -22
View File
@@ -157,7 +157,7 @@ jobs:
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
test_ios_rntester:
runs-on: macos-13
runs-on: macos-13-large
needs:
[build_apple_slices_hermes, prepare_hermes_workspace, build_hermes_macos]
env:
@@ -169,6 +169,14 @@ jobs:
matrix:
jsengine: [Hermes, JSC]
architecture: [NewArch, OldArch]
flavor: [Debug, Release]
exclude: # We don't want to test the Old Arch in Release for E2E
- jsengine: Hermes
architecture: OldArch
flavor: Release
- jsengine: JSC
architecture: OldArch
flavor: Release
steps:
- name: Checkout
uses: actions/checkout@v4
@@ -181,12 +189,13 @@ jobs:
use-frameworks: StaticLibraries
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
flavor: ${{ matrix.flavor }}
test_e2e_ios_rntester:
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, 'stable') || inputs.run-e2e-tests }}
runs-on: macos-13-large
needs:
[build_apple_slices_hermes, prepare_hermes_workspace, build_hermes_macos]
[test_ios_rntester]
env:
HERMES_WS_DIR: /tmp/hermes
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
@@ -200,21 +209,17 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run it
uses: ./.github/actions/test-ios-rntester
- name: Download App
uses: actions/download-artifact@v4
with:
jsengine: ${{ matrix.jsengine }}
architecture: ${{ matrix.architecture }}
run-unit-tests: "false"
use-frameworks: StaticLibraries
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
run-e2e-tests: "true"
flavor: ${{ matrix.flavor }}
name: RNTesterApp-${{ matrix.architecture }}-${{ matrix.jsengine }}-${{ matrix.flavor }}
path: /tmp/RNTesterBuild/RNTester.app
- name: Check downloaded folder content
run: ls -lR /tmp/RNTesterBuild
- name: Run E2E Tests
uses: ./.github/actions/maestro-ios
with:
app-path: "/tmp/RNTesterBuild/Build/Products/${{ matrix.flavor }}-iphonesimulator/RNTester.app"
app-path: "/tmp/RNTesterBuild/RNTester.app"
app-id: com.meta.RNTester.localDevelopment
jsengine: ${{ matrix.jsengine }}
maestro-flow: ./packages/rn-tester/.maestro/
@@ -233,6 +238,7 @@ jobs:
matrix:
jsengine: [Hermes, JSC]
flavor: [Debug, Release]
architecture: [OldArch, NewArch]
steps:
- name: Checkout
uses: actions/checkout@v4
@@ -241,7 +247,7 @@ jobs:
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Run yarn
uses: ./.github/actions/yarn-install-with-cache
uses: ./.github/actions/yarn-install
- name: Setup ruby
uses: ruby/setup-ruby@v1.170.0
with:
@@ -277,7 +283,12 @@ jobs:
cd /tmp/RNTestProject/ios
bundle install
HERMES_ENGINE_TARBALL_PATH=$HERMES_PATH bundle exec pod install
NEW_ARCH_ENABLED=1
if [[ ${{ matrix.architecture }} == "OldArch" ]]; then
echo "Disable the New Architecture"
NEW_ARCH_ENABLED=0
fi
HERMES_ENGINE_TARBALL_PATH=$HERMES_PATH RCT_NEW_ARCH_ENABLED=$NEW_ARCH_ENABLED bundle exec pod install
xcodebuild \
-scheme "RNTestProject" \
@@ -295,6 +306,7 @@ jobs:
maestro-flow: ./scripts/e2e/.maestro/
flavor: ${{ matrix.flavor }}
working-directory: /tmp/RNTestProject
architecture: ${{ matrix.architecture }}
test_e2e_android_templateapp:
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, 'stable') || inputs.run-e2e-tests }}
@@ -306,13 +318,14 @@ jobs:
matrix:
jsengine: [Hermes, JSC]
flavor: [debug, release]
architecture: [OldArch, NewArch]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Run yarn
uses: ./.github/actions/yarn-install-with-cache
uses: ./.github/actions/yarn-install
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
@@ -351,6 +364,16 @@ jobs:
cd /tmp/RNTestProject
echo "react.internal.mavenLocalRepo=$MAVEN_LOCAL" >> android/gradle.properties
if [[ ${{matrix.architecture}} == "OldArch" ]]; then
echo "Disabling the New Architecture"
sed -i 's/newArchEnabled=true/newArchEnabled=false/' android/gradle.properties
fi
if [[ ${{matrix.jsengine}} == "JSC" ]]; then
echo "Using JSC instead of Hermes"
sed -i 's/hermesEnabled=true/hermesEnabled=false/' android/gradle.properties
fi
# Build
cd android
CAPITALIZED_FLAVOR=$(echo "${{ matrix.flavor }}" | awk '{print toupper(substr($0, 1, 1)) substr($0, 2)}')
@@ -358,6 +381,7 @@ jobs:
- name: Run E2E Tests
uses: ./.github/actions/maestro-android
timeout-minutes: 60
with:
app-path: /tmp/RNTestProject/android/app/build/outputs/apk/${{ matrix.flavor }}/app-${{ matrix.flavor }}.apk
app-id: com.rntestproject
@@ -366,6 +390,7 @@ jobs:
install-java: 'false'
flavor: ${{ matrix.flavor }}
working-directory: /tmp/RNTestProject
architecture: ${{ matrix.architecture }}
build_hermesc_linux:
runs-on: ubuntu-latest
@@ -421,10 +446,8 @@ jobs:
run-e2e-tests: ${{ github.ref == 'refs/heads/main' || contains(github.ref, 'stable') || inputs.run-e2e-tests }}
test_e2e_android_rntester:
# Temporarily disable RNTester tests on Android as they are quite flaky and they make CI always red
# if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, 'stable') || inputs.run-e2e-tests }}
if: ${{ contains(github.ref, 'stable') || inputs.run-e2e-tests }}
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, 'stable') || inputs.run-e2e-tests }}
runs-on: 4-core-ubuntu
needs: [build_android]
strategy:
fail-fast: false
@@ -437,7 +460,7 @@ jobs:
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Install node dependencies
uses: ./.github/actions/yarn-install-with-cache
uses: ./.github/actions/yarn-install
- name: Download APK
uses: actions/download-artifact@v4
with:
@@ -447,6 +470,7 @@ jobs:
run: ls -lR ./packages/rn-tester/android/app/build/outputs/apk/${{ matrix.jsengine }}/${{ matrix.flavor }}/
- name: Run E2E Tests
uses: ./.github/actions/maestro-android
timeout-minutes: 60
with:
app-path: ./packages/rn-tester/android/app/build/outputs/apk/${{ matrix.jsengine }}/${{ matrix.flavor }}/app-${{ matrix.jsengine }}-x86-${{ matrix.flavor }}.apk
app-id: com.facebook.react.uiapp
@@ -519,7 +543,7 @@ jobs:
- name: Setup gradle
uses: ./.github/actions/setup-gradle
- name: Run yarn install
uses: ./.github/actions/yarn-install-with-cache
uses: ./.github/actions/yarn-install
- name: Prepare the Helloworld application
shell: bash
run: node ./scripts/e2e/init-project-e2e.js --useHelloWorld --pathToLocalReactNative "$GITHUB_WORKSPACE/build/$(cat build/react-native-package-version)"
@@ -1,45 +0,0 @@
name: Trigger E2E Tests on Comment
# This workflow is used to automatically trigger E2E tests when a comment is made
# containing the text "/run-e2e-tests".
on:
issue_comment:
types: [created]
permissions:
contents: read
jobs:
trigger-e2e-tests:
name: Trigger E2E Tests
runs-on: ubuntu-latest
if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/test-e2e')
steps:
# This is needed because of https://github.com/actions/runner-images/issues/6283
# TL;DR: brew is not in the PATH anymore.
- name: Setup Homebrew
uses: Homebrew/actions/setup-homebrew@master
- name: Install jq
run: brew install jq
- name: Run E2E Tests
run: |
# Github does not provide the branch of a PR when a comment on a PR is made
# So, given the issue number, which is the PR number, we can retrieve the branch with
# a quick API call
echo "Retrieving branch"
BRANCH=$(curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $GITHUB_TOKEN" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/facebook/react-native/pulls/$PR_NUMBER | jq -r '.head.ref')
echo "Trigger Test All workflow for branch $BRANCH"
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $GITHUB_TOKEN" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/facebook/react-native/actions/workflows/test-all.yml/dispatches \
-d "{\"ref\": \"$BRANCH\", \"inputs\": {\"run-e2e-tests\": \"true\"}}"
env:
GITHUB_TOKEN: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.issue.number }}
@@ -1,18 +0,0 @@
name: Update node modules cache
on:
workflow_dispatch:
push:
branches:
- main
jobs:
update_node_modules_cache:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install yarn dependencies and update cache
uses: ./.github/actions/yarn-install-with-cache
with:
update-cache: "true"
+5 -4
View File
@@ -68,6 +68,7 @@ local.properties
*.iml
/packages/react-native/android/*
!/packages/react-native/android/README.md
.kotlin/
# Node
node_modules
@@ -153,8 +154,8 @@ vendor/
# Temporary files created by Metro to check the health of the file watcher
.metro-health-check*
# CircleCI
.circleci/generated_config.yml
# Jest Integration
/jest/integration/build/
/packages/react-native-fantom/build/
# [Experimental] Generated TS type definitions
/packages/react-native/types_generated/
+599
View File
@@ -1,5 +1,589 @@
# Changelog
## v0.78.0-rc.3
### Added
#### iOS specific
- 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:** Add overlapping radii resolution logic preventing incorrect rendering ([451ff70da4](https://github.com/facebook/react-native/commit/451ff70da422beefccfff5b87024145003bb49ff) by [@jorge-cab](https://github.com/jorge-cab))
- **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))
- **style:** Outline properties `outline-width`, `outline-color`, `outline-style` & `outline-offset` ([17faac4170](https://github.com/facebook/react-native/commit/17faac417035f2cc5f12ec60a46270991be0989a) by [@jorge-cab](https://github.com/jorge-cab))
- **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))
- **style:** Outline properties `outline-width`, `outline-color`, `outline-style` & `outline-offset` ([1288e38423](https://github.com/facebook/react-native/commit/1288e38423f93ed57737dd9b40ad55696494d6f4) by [@jorge-cab](https://github.com/jorge-cab))
- **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 legacy arch RTL horizontal ScrollView regression ([bfca7cfe7a](https://github.com/facebook/react-native/commit/bfca7cfe7a8e0da10fdb776100fbc706233c0d8d) by [@NickGerleman](https://github.com/NickGerleman))
- **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))
- **Yoga:** Fix YogaConfig getting garbage collected #1678 ([7dcb10b6e7](https://github.com/facebook/react-native/commit/7dcb10b6e7e226034a496eaed5351601ae0a1ae2) by [@michaeltroger](https://github.com/michaeltroger))
#### iOS specific
- **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))
- Fixes animations strict weak ordering sorted check failed ([60889e170c](https://github.com/facebook/react-native/commit/60889e170ca3f6187e15719a3d85da0bc7e974ff) by [@zhongwuzw](https://github.com/zhongwuzw))
## v0.74.6
### Added
+1
View File
@@ -6,3 +6,4 @@ ruby ">= 2.6.10"
gem 'cocoapods', '~> 1.13', '!= 1.15.0', '!= 1.15.1'
gem 'activesupport', '>= 6.1.7.5', '< 7.1.0'
gem 'xcodeproj', '< 1.26.0'
gem 'concurrent-ruby', '<= 1.3.4'
-393
View File
@@ -1,393 +0,0 @@
Attribution 4.0 International
=======================================================================
Creative Commons Corporation ("Creative Commons") is not a law firm and
does not provide legal services or legal advice. Distribution of
Creative Commons public licenses does not create a lawyer-client or
other relationship. Creative Commons makes its licenses and related
information available on an "as-is" basis. Creative Commons gives no
warranties regarding its licenses, any material licensed under their
terms and conditions, or any related information. Creative Commons
disclaims all liability for damages resulting from their use to the
fullest extent possible.
Using Creative Commons Public Licenses
Creative Commons public licenses provide a standard set of terms and
conditions that creators and other rights holders may use to share
original works of authorship and other material subject to copyright
and certain other rights specified in the public license below. The
following considerations are for informational purposes only, are not
exhaustive, and do not form part of our licenses.
Considerations for licensors: Our public licenses are
intended for use by those authorized to give the public
permission to use material in ways otherwise restricted by
copyright and certain other rights. Our licenses are
irrevocable. Licensors should read and understand the terms
and conditions of the license they choose before applying it.
Licensors should also secure all rights necessary before
applying our licenses so that the public can reuse the
material as expected. Licensors should clearly mark any
material not subject to the license. This includes other CC-
licensed material, or material used under an exception or
limitation to copyright. More considerations for licensors:
wiki.creativecommons.org/Considerations_for_licensors
Considerations for the public: By using one of our public
licenses, a licensor grants the public permission to use the
licensed material under specified terms and conditions. If
the licensor's permission is not necessary for any reason--for
example, because of any applicable exception or limitation to
copyright--then that use is not regulated by the license. Our
licenses grant only permissions under copyright and certain
other rights that a licensor has authority to grant. Use of
the licensed material may still be restricted for other
reasons, including because others have copyright or other
rights in the material. A licensor may make special requests,
such as asking that all changes be marked or described.
Although not required by our licenses, you are encouraged to
respect those requests where reasonable. More_considerations
for the public:
wiki.creativecommons.org/Considerations_for_licensees
=======================================================================
Creative Commons Attribution 4.0 International Public License
By exercising the Licensed Rights (defined below), You accept and agree
to be bound by the terms and conditions of this Creative Commons
Attribution 4.0 International Public License ("Public License"). To the
extent this Public License may be interpreted as a contract, You are
granted the Licensed Rights in consideration of Your acceptance of
these terms and conditions, and the Licensor grants You such rights in
consideration of benefits the Licensor receives from making the
Licensed Material available under these terms and conditions.
Section 1 -- Definitions.
a. Adapted Material means material subject to Copyright and Similar
Rights that is derived from or based upon the Licensed Material
and in which the Licensed Material is translated, altered,
arranged, transformed, or otherwise modified in a manner requiring
permission under the Copyright and Similar Rights held by the
Licensor. For purposes of this Public License, where the Licensed
Material is a musical work, performance, or sound recording,
Adapted Material is always produced where the Licensed Material is
synched in timed relation with a moving image.
b. Adapter's License means the license You apply to Your Copyright
and Similar Rights in Your contributions to Adapted Material in
accordance with the terms and conditions of this Public License.
c. Copyright and Similar Rights means copyright and/or similar rights
closely related to copyright including, without limitation,
performance, broadcast, sound recording, and Sui Generis Database
Rights, without regard to how the rights are labeled or
categorized. For purposes of this Public License, the rights
specified in Section 2(b)(1)-(2) are not Copyright and Similar
Rights.
d. Effective Technological Measures means those measures that, in the
absence of proper authority, may not be circumvented under laws
fulfilling obligations under Article 11 of the WIPO Copyright
Treaty adopted on December 20, 1996, and/or similar international
agreements.
e. Exceptions and Limitations means fair use, fair dealing, and/or
any other exception or limitation to Copyright and Similar Rights
that applies to Your use of the Licensed Material.
f. Licensed Material means the artistic or literary work, database,
or other material to which the Licensor applied this Public
License.
g. Licensed Rights means the rights granted to You subject to the
terms and conditions of this Public License, which are limited to
all Copyright and Similar Rights that apply to Your use of the
Licensed Material and that the Licensor has authority to license.
h. Licensor means the individual(s) or entity(ies) granting rights
under this Public License.
i. Share means to provide material to the public by any means or
process that requires permission under the Licensed Rights, such
as reproduction, public display, public performance, distribution,
dissemination, communication, or importation, and to make material
available to the public including in ways that members of the
public may access the material from a place and at a time
individually chosen by them.
j. Sui Generis Database Rights means rights other than copyright
resulting from Directive 96/9/EC of the European Parliament and of
the Council of 11 March 1996 on the legal protection of databases,
as amended and/or succeeded, as well as other essentially
equivalent rights anywhere in the world.
k. You means the individual or entity exercising the Licensed Rights
under this Public License. Your has a corresponding meaning.
Section 2 -- Scope.
a. License grant.
1. Subject to the terms and conditions of this Public License,
the Licensor hereby grants You a worldwide, royalty-free,
non-sublicensable, non-exclusive, irrevocable license to
exercise the Licensed Rights in the Licensed Material to:
a. reproduce and Share the Licensed Material, in whole or
in part; and
b. produce, reproduce, and Share Adapted Material.
2. Exceptions and Limitations. For the avoidance of doubt, where
Exceptions and Limitations apply to Your use, this Public
License does not apply, and You do not need to comply with
its terms and conditions.
3. Term. The term of this Public License is specified in Section
6(a).
4. Media and formats; technical modifications allowed. The
Licensor authorizes You to exercise the Licensed Rights in
all media and formats whether now known or hereafter created,
and to make technical modifications necessary to do so. The
Licensor waives and/or agrees not to assert any right or
authority to forbid You from making technical modifications
necessary to exercise the Licensed Rights, including
technical modifications necessary to circumvent Effective
Technological Measures. For purposes of this Public License,
simply making modifications authorized by this Section 2(a)
(4) never produces Adapted Material.
5. Downstream recipients.
a. Offer from the Licensor -- Licensed Material. Every
recipient of the Licensed Material automatically
receives an offer from the Licensor to exercise the
Licensed Rights under the terms and conditions of this
Public License.
b. No downstream restrictions. You may not offer or impose
any additional or different terms or conditions on, or
apply any Effective Technological Measures to, the
Licensed Material if doing so restricts exercise of the
Licensed Rights by any recipient of the Licensed
Material.
6. No endorsement. Nothing in this Public License constitutes or
may be construed as permission to assert or imply that You
are, or that Your use of the Licensed Material is, connected
with, or sponsored, endorsed, or granted official status by,
the Licensor or others designated to receive attribution as
provided in Section 3(a)(1)(A)(i).
b. Other rights.
1. Moral rights, such as the right of integrity, are not
licensed under this Public License, nor are publicity,
privacy, and/or other similar personality rights; however, to
the extent possible, the Licensor waives and/or agrees not to
assert any such rights held by the Licensor to the limited
extent necessary to allow You to exercise the Licensed
Rights, but not otherwise.
2. Patent and trademark rights are not licensed under this
Public License.
3. To the extent possible, the Licensor waives any right to
collect royalties from You for the exercise of the Licensed
Rights, whether directly or through a collecting society
under any voluntary or waivable statutory or compulsory
licensing scheme. In all other cases the Licensor expressly
reserves any right to collect such royalties.
Section 3 -- License Conditions.
Your exercise of the Licensed Rights is expressly made subject to the
following conditions.
a. Attribution.
1. If You Share the Licensed Material (including in modified
form), You must:
a. retain the following if it is supplied by the Licensor
with the Licensed Material:
i. identification of the creator(s) of the Licensed
Material and any others designated to receive
attribution, in any reasonable manner requested by
the Licensor (including by pseudonym if
designated);
ii. a copyright notice;
iii. a notice that refers to this Public License;
iv. a notice that refers to the disclaimer of
warranties;
v. a URI or hyperlink to the Licensed Material to the
extent reasonably practicable;
b. indicate if You modified the Licensed Material and
retain an indication of any previous modifications; and
c. indicate the Licensed Material is licensed under this
Public License, and include the text of, or the URI or
hyperlink to, this Public License.
2. You may satisfy the conditions in Section 3(a)(1) in any
reasonable manner based on the medium, means, and context in
which You Share the Licensed Material. For example, it may be
reasonable to satisfy the conditions by providing a URI or
hyperlink to a resource that includes the required
information.
3. If requested by the Licensor, You must remove any of the
information required by Section 3(a)(1)(A) to the extent
reasonably practicable.
4. If You Share Adapted Material You produce, the Adapter's
License You apply must not prevent recipients of the Adapted
Material from complying with this Public License.
Section 4 -- Sui Generis Database Rights.
Where the Licensed Rights include Sui Generis Database Rights that
apply to Your use of the Licensed Material:
a. for the avoidance of doubt, Section 2(a)(1) grants You the right
to extract, reuse, reproduce, and Share all or a substantial
portion of the contents of the database;
b. if You include all or a substantial portion of the database
contents in a database in which You have Sui Generis Database
Rights, then the database in which You have Sui Generis Database
Rights (but not its individual contents) is Adapted Material; and
c. You must comply with the conditions in Section 3(a) if You Share
all or a substantial portion of the contents of the database.
For the avoidance of doubt, this Section 4 supplements and does not
replace Your obligations under this Public License where the Licensed
Rights include other Copyright and Similar Rights.
Section 5 -- Disclaimer of Warranties and Limitation of Liability.
a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
c. The disclaimer of warranties and limitation of liability provided
above shall be interpreted in a manner that, to the extent
possible, most closely approximates an absolute disclaimer and
waiver of all liability.
Section 6 -- Term and Termination.
a. This Public License applies for the term of the Copyright and
Similar Rights licensed here. However, if You fail to comply with
this Public License, then Your rights under this Public License
terminate automatically.
b. Where Your right to use the Licensed Material has terminated under
Section 6(a), it reinstates:
1. automatically as of the date the violation is cured, provided
it is cured within 30 days of Your discovery of the
violation; or
2. upon express reinstatement by the Licensor.
For the avoidance of doubt, this Section 6(b) does not affect any
right the Licensor may have to seek remedies for Your violations
of this Public License.
c. For the avoidance of doubt, the Licensor may also offer the
Licensed Material under separate terms or conditions or stop
distributing the Licensed Material at any time; however, doing so
will not terminate this Public License.
d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
License.
Section 7 -- Other Terms and Conditions.
a. The Licensor shall not be bound by any additional or different
terms or conditions communicated by You unless expressly agreed.
b. Any arrangements, understandings, or agreements regarding the
Licensed Material not stated herein are separate from and
independent of the terms and conditions of this Public License.
Section 8 -- Interpretation.
a. For the avoidance of doubt, this Public License does not, and
shall not be interpreted to, reduce, limit, restrict, or impose
conditions on any use of the Licensed Material that could lawfully
be made without permission under this Public License.
b. To the extent possible, if any provision of this Public License is
deemed unenforceable, it shall be automatically reformed to the
minimum extent necessary to make it enforceable. If the provision
cannot be reformed, it shall be severed from this Public License
without affecting the enforceability of the remaining terms and
conditions.
c. No term or condition of this Public License will be waived and no
failure to comply consented to unless expressly agreed to by the
Licensor.
d. Nothing in this Public License constitutes or may be interpreted
as a limitation upon, or waiver of, any privileges and immunities
that apply to the Licensor or You, including from the legal
processes of any jurisdiction or authority.
=======================================================================
Creative Commons is not a party to its public licenses.
Notwithstanding, Creative Commons may elect to apply one of its public
licenses to material it publishes and in those instances will be
considered the "Licensor." Except for the limited purpose of indicating
that material is shared under a Creative Commons public license or as
otherwise permitted by the Creative Commons policies published at
creativecommons.org/policies, Creative Commons does not authorize the
use of the trademark "Creative Commons" or any other trademark or logo
of Creative Commons without its prior written consent including,
without limitation, in connection with any unauthorized modifications
to any of its public licenses or any other arrangements,
understandings, or agreements concerning use of licensed material. For
the avoidance of doubt, this paragraph does not form part of the public
licenses.
Creative Commons may be contacted at creativecommons.org.
+1 -4
View File
@@ -13,9 +13,6 @@
<a href="https://github.com/facebook/react-native/blob/HEAD/LICENSE">
<img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="React Native is released under the MIT license." />
</a>
<a href="https://circleci.com/gh/facebook/react-native">
<img src="https://circleci.com/gh/facebook/react-native.svg?style=shield" alt="Current CircleCI build status." />
</a>
<a href="https://www.npmjs.org/package/react-native">
<img src="https://img.shields.io/npm/v/react-native?color=brightgreen&label=npm%20package" alt="Current npm package version." />
</a>
@@ -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.
## 🎉 Building your first React Native app
+1 -1
View File
@@ -92,7 +92,7 @@ tasks.register("build") {
tasks.register("publishAllToMavenTempLocal") {
description = "Publish all the artifacts to be available inside a Maven Local repository on /tmp."
dependsOn(":packages:react-native:ReactAndroid:publishAllPublicationsToMavenTempLocalRepository")
// We don't publish the external-artifacts to Maven Local as CircleCI is using it via workspace.
// We don't publish the external-artifacts to Maven Local as ci is using it via workspace.
dependsOn(
":packages:react-native:ReactAndroid:hermes-engine:publishAllPublicationsToMavenTempLocalRepository")
}
+32
View File
@@ -0,0 +1,32 @@
/**
* (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
*
* @flow strict
* @format
*/
// Built to match the API @ 5.0.0
declare module 'ini' {
export type Options = {
whitespace?: boolean,
align?: boolean,
section?: string,
sort?: boolean,
newline?: boolean,
platform?: 'win32' | 'linux' | 'darwin',
bracketedArrays?: boolean,
};
declare type Ini = {
parse: <T>(string: string, options?: Options) => T,
decode: <T>(string: string) => T,
stringify: (
object: {[key: string]: string, ...},
section: string,
) => string,
safe: (string: string) => string,
unsafe: (string: string) => string,
};
declare module.exports: Ini;
}
+40
View File
@@ -0,0 +1,40 @@
/**
* (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
*
* @flow strict
* @format
* @oncall react_native
*/
declare module 'jest-diff' {
import type {CompareKeys} from 'pretty-format';
declare export type DiffOptionsColor = (arg: string) => string; // subset of Chalk type
declare export type DiffOptions = {
aAnnotation?: string,
aColor?: DiffOptionsColor,
aIndicator?: string,
bAnnotation?: string,
bColor?: DiffOptionsColor,
bIndicator?: string,
changeColor?: DiffOptionsColor,
changeLineTrailingSpaceColor?: DiffOptionsColor,
commonColor?: DiffOptionsColor,
commonIndicator?: string,
commonLineTrailingSpaceColor?: DiffOptionsColor,
contextLines?: number,
emptyFirstOrLastLinePlaceholder?: string,
expand?: boolean,
includeChangeCounts?: boolean,
omitAnnotationLines?: boolean,
patchColor?: DiffOptionsColor,
compareKeys?: CompareKeys,
};
declare export function diff(
a: mixed,
b: mixed,
options?: DiffOptions,
): string | null;
}
+77
View File
@@ -0,0 +1,77 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict
* @format
* @oncall react_native
*/
declare module 'jest-snapshot' {
type SnapshotFormat = {...};
type UpdateSnapshot = 'all' | 'new' | 'none';
type ProjectConfig = {
rootDir: string,
prettierPath: string,
snapshotFormat: SnapshotFormat,
...
};
type SnapshotResolver = {
/** Resolves from `testPath` to snapshot path. */
resolveSnapshotPath(testPath: string, snapshotExtension?: string): string,
/** Resolves from `snapshotPath` to test path. */
resolveTestPath(snapshotPath: string, snapshotExtension?: string): string,
/** Example test path, used for preflight consistency check of the implementation above. */
testPathForConsistencyCheck: string,
};
declare export var EXTENSION: 'snap';
declare export function isSnapshotPath(path: string): boolean;
type LocalRequire = (module: string) => mixed;
declare export function buildSnapshotResolver(
config: ProjectConfig,
localRequire?: Promise<LocalRequire> | LocalRequire,
): Promise<SnapshotResolver>;
type SnapshotStateOptions = {
updateSnapshot: UpdateSnapshot,
prettierPath?: string | null,
expand?: boolean,
snapshotFormat: SnapshotFormat,
rootDir: string,
};
type SnapshotData = Record<string, string>;
type SaveStatus = {
deleted: boolean,
saved: boolean,
};
declare export class SnapshotState {
_dirty: boolean;
_updateSnapshot: UpdateSnapshot;
_snapshotData: SnapshotData;
_initialData: SnapshotData;
_uncheckedKeys: Set<string>;
added: number;
expand: boolean;
matched: number;
unmatched: number;
updated: number;
constructor(testPath: string, options: SnapshotStateOptions): void;
save(): SaveStatus;
getUncheckedCount(): number;
getUncheckedKeys(): Array<string>;
removeUncheckedKeys(): void;
}
}
+4 -1
View File
@@ -19,7 +19,6 @@ declare type Colors = {
tag: {close: string, open: string},
value: {close: string, open: string},
};
declare type CompareKeys = ((a: string, b: string) => number) | null | void;
declare type PrettyFormatPlugin =
| {
@@ -38,6 +37,10 @@ declare type PrettyFormatPlugin =
};
declare module 'pretty-format' {
declare export type CompareKeys =
| ((a: string, b: string) => number)
| null
| void;
declare export function format(
value: mixed,
options?: ?{
+121
View File
@@ -0,0 +1,121 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict
* @format
* @oncall react_native
*/
declare module 'tinybench' {
declare export class Task extends EventTarget {
name: string;
result: void | $ReadOnly<TaskResult>;
runs: number;
reset(): void;
run(): Promise<Task>;
runSync(): Task;
warmup(): Promise<void>;
}
export type Hook = (
task: Task,
mode: 'run' | 'warmup',
) => Promise<void> | void;
export type BenchOptions = {
iterations?: number,
name?: string,
now?: () => number,
setup?: Hook,
signal?: AbortSignal,
teardown?: Hook,
throws?: boolean,
time?: number,
warmup?: boolean,
warmupIterations?: number,
warmupTime?: number,
};
export interface Statistics {
aad: void | number;
critical: number;
df: number;
mad: void | number;
max: number;
mean: number;
min: number;
moe: number;
p50: void | number;
p75: void | number;
p99: void | number;
p995: void | number;
p999: void | number;
rme: number;
samples: number[];
sd: number;
sem: number;
variance: number;
}
export interface TaskResult {
critical: number;
df: number;
error?: Error;
hz: number;
latency: Statistics;
max: number;
mean: number;
min: number;
moe: number;
p75: number;
p99: number;
p995: number;
p999: number;
period: number;
rme: number;
samples: number[];
sd: number;
sem: number;
throughput: Statistics;
totalTime: number;
variance: number;
}
export type FnOptions = {
afterAll?: (this: Task) => void | Promise<void>,
afterEach?: (this: Task) => void | Promise<void>,
beforeAll?: (this: Task) => void | Promise<void>,
beforeEach?: (this: Task) => void | Promise<void>,
};
export type Fn = () => Promise<mixed> | mixed;
declare export class Bench extends EventTarget {
concurrency: null | 'task' | 'bench';
name?: string;
opts: $ReadOnly<BenchOptions>;
threshold: number;
constructor(options?: BenchOptions): this;
// $FlowExpectedError[unsafe-getters-setters]
get results(): Array<$ReadOnly<TaskResult>>;
// $FlowExpectedError[unsafe-getters-setters]
get tasks(): Array<Task>;
add(name: string, fn: Fn, fnOpts?: FnOptions): this;
getTask(name: string): void | Task;
remove(name: string): this;
reset(): void;
run(): Promise<Array<Task>>;
runSync(): Array<Task>;
table(
convert?: (task: Task) => Record<string, void | string | number>,
): void | Array<Record<string, void | string | number>>;
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Vendored
+1 -2
View File
@@ -86,8 +86,7 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
-1
View File
@@ -37,7 +37,6 @@ module.exports = {
'/node_modules/',
'<rootDir>/packages/react-native/sdks',
'<rootDir>/packages/react-native/Libraries/Renderer',
'<rootDir>/packages/react-native-test-renderer/src',
'<rootDir>/packages/react-native/sdks/hermes/',
...PODS_LOCATIONS,
],
@@ -1,35 +0,0 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
* @oncall react_native
*/
module.exports = function entrypointTemplate({
testPath,
setupModulePath,
}: {
testPath: string,
setupModulePath: string,
}): string {
return `/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* ${'@'}generated
* @noformat
* @noflow
* @oncall react_native
*/
import {registerTest} from '${setupModulePath}';
registerTest(() => require('${testPath}'));
`;
};
-290
View File
@@ -1,290 +0,0 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
* @oncall react_native
*/
import type {TestSuiteResult} from '../runtime/setup';
import entrypointTemplate from './entrypoint-template';
import {spawnSync} from 'child_process';
import crypto from 'crypto';
import fs from 'fs';
// $FlowExpectedError[untyped-import]
import {formatResultsErrors} from 'jest-message-util';
import Metro from 'metro';
import nullthrows from 'nullthrows';
import os from 'os';
import path from 'path';
const BUILD_OUTPUT_PATH = path.resolve(__dirname, '..', 'build');
const ENABLE_OPTIMIZED_MODE: false = false;
const PRINT_FANTOM_OUTPUT: false = false;
function parseRNTesterCommandResult(
commandArgs: $ReadOnlyArray<string>,
result: ReturnType<typeof spawnSync>,
): {logs: string, testResult: TestSuiteResult} {
const stdout = result.stdout.toString();
const outputArray = stdout
.trim()
.split('\n')
.filter(log => !log.startsWith('Running "')); // remove AppRegistry logs.
// The last line should be the test output in JSON format
const testResultJSON = outputArray.pop();
let testResult;
try {
testResult = JSON.parse(nullthrows(testResultJSON));
} catch (error) {
throw new Error(
[
'Failed to parse test results from RN tester binary result. Full output:',
'buck2 ' + commandArgs.join(' '),
'stdout:',
stdout,
'stderr:',
result.stderr.toString(),
].join('\n'),
);
}
return {logs: outputArray.join('\n'), testResult};
}
function getBuckModeForPlatform() {
const mode = ENABLE_OPTIMIZED_MODE ? 'opt' : 'dev';
switch (os.platform()) {
case 'linux':
return `@//arvr/mode/linux/${mode}`;
case 'darwin':
return os.arch() === 'arm64'
? `@//arvr/mode/mac-arm/${mode}`
: `@//arvr/mode/mac/${mode}`;
case 'win32':
return `@//arvr/mode/win/${mode}`;
default:
throw new Error(`Unsupported platform: ${os.platform()}`);
}
}
function getShortHash(contents: string): string {
return crypto.createHash('md5').update(contents).digest('hex').slice(0, 8);
}
function generateBytecodeBundle({
sourcePath,
bytecodePath,
}: {
sourcePath: string,
bytecodePath: string,
}): void {
const hermesCompilerCommandArgs = [
'run',
getBuckModeForPlatform(),
'//xplat/hermes/tools/hermesc:hermesc',
'--',
'-emit-binary',
'-O',
'-max-diagnostic-width',
'80',
'-out',
bytecodePath,
sourcePath,
];
const hermesCompilerCommandResult = spawnSync(
'buck2',
hermesCompilerCommandArgs,
{
encoding: 'utf8',
env: {
...process.env,
PATH: `/usr/local/bin:${process.env.PATH ?? ''}`,
},
},
);
if (hermesCompilerCommandResult.status !== 0) {
throw new Error(
[
'Failed to run Hermes compiler. Full output:',
'buck2 ' + hermesCompilerCommandArgs.join(' '),
'stdout:',
hermesCompilerCommandResult.stdout,
'stderr:',
hermesCompilerCommandResult.stderr,
'error:',
hermesCompilerCommandResult.error,
].join('\n'),
);
}
}
module.exports = async function runTest(
globalConfig: {...},
config: {...},
environment: {...},
runtime: {...},
testPath: string,
): mixed {
const startTime = Date.now();
const isOptimizedMode = ENABLE_OPTIMIZED_MODE;
const metroConfig = await Metro.loadConfig({
config: path.resolve(__dirname, '..', 'config', 'metro.config.js'),
});
const setupModulePath = path.resolve(__dirname, '../runtime/setup.js');
const entrypointContents = entrypointTemplate({
testPath: `${path.relative(BUILD_OUTPUT_PATH, testPath)}`,
setupModulePath: `${path.relative(BUILD_OUTPUT_PATH, setupModulePath)}`,
});
const entrypointPath = path.join(
BUILD_OUTPUT_PATH,
`${getShortHash(entrypointContents)}-${path.basename(testPath)}`,
);
const testBundlePath = entrypointPath + '.bundle';
const testJSBundlePath = testBundlePath + '.js';
const testBytecodeBundlePath = testJSBundlePath + '.hbc';
fs.mkdirSync(path.dirname(entrypointPath), {recursive: true});
fs.writeFileSync(entrypointPath, entrypointContents, 'utf8');
await Metro.runBuild(metroConfig, {
entry: entrypointPath,
out: testJSBundlePath,
platform: 'android',
minify: isOptimizedMode,
dev: !isOptimizedMode,
});
if (isOptimizedMode) {
generateBytecodeBundle({
sourcePath: testJSBundlePath,
bytecodePath: testBytecodeBundlePath,
});
}
const rnTesterCommandArgs = [
'run',
getBuckModeForPlatform(),
'//xplat/ReactNative/react-native-cxx/samples/tester:tester',
'--',
'--bundlePath',
testBundlePath,
];
const rnTesterCommandResult = spawnSync('buck2', rnTesterCommandArgs, {
encoding: 'utf8',
env: {
...process.env,
PATH: `/usr/local/bin:${process.env.PATH ?? ''}`,
},
});
if (rnTesterCommandResult.status !== 0) {
throw new Error(
[
'Failed to run test in RN tester binary. Full output:',
'buck2 ' + rnTesterCommandArgs.join(' '),
'stdout:',
rnTesterCommandResult.stdout,
'stderr:',
rnTesterCommandResult.stderr,
'error:',
rnTesterCommandResult.error,
].join('\n'),
);
}
if (PRINT_FANTOM_OUTPUT) {
console.log(
[
'RN tester binary. Full output:',
'buck2 ' + rnTesterCommandArgs.join(' '),
'stdout:',
rnTesterCommandResult.stdout,
'stderr:',
rnTesterCommandResult.stderr,
'error:',
rnTesterCommandResult.error,
].join('\n'),
);
}
const rnTesterParsedOutput = parseRNTesterCommandResult(
rnTesterCommandArgs,
rnTesterCommandResult,
);
const testResultError = rnTesterParsedOutput.testResult.error;
if (testResultError) {
const error = new Error(testResultError.message);
error.stack = testResultError.stack;
throw error;
}
const endTime = Date.now();
if (process.env.SANDCASTLE == null) {
console.log(rnTesterParsedOutput.logs);
}
const testResults =
nullthrows(rnTesterParsedOutput.testResult.testResults).map(testResult => ({
ancestorTitles: [] as Array<string>,
failureDetails: [] as Array<string>,
testFilePath: testPath,
...testResult,
})) ?? [];
return {
testFilePath: testPath,
failureMessage: formatResultsErrors(
testResults,
config,
globalConfig,
testPath,
),
leaks: false,
openHandles: [],
perfStats: {
start: startTime,
end: endTime,
duration: endTime - startTime,
runtime: endTime - startTime,
slow: false,
},
snapshot: {
added: 0,
fileDeleted: false,
matched: 0,
unchecked: 0,
uncheckedKeys: [],
unmatched: 0,
updated: 0,
},
numTotalTests: testResults.length,
numPassingTests: testResults.filter(test => test.status === 'passed')
.length,
numFailingTests: testResults.filter(test => test.status === 'failed')
.length,
numPendingTests: testResults.filter(test => test.status === 'pending')
.length,
numTodoTests: 0,
skipped: false,
testResults,
};
};
-370
View File
@@ -1,370 +0,0 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
* @oncall react_native
*/
import deepEqual from 'deep-equal';
import nullthrows from 'nullthrows';
export type TestCaseResult = {
ancestorTitles: Array<string>,
title: string,
fullName: string,
status: 'passed' | 'failed' | 'pending',
duration: number,
failureMessages: Array<string>,
numPassingAsserts: number,
// location: string,
};
export type TestSuiteResult =
| {
testResults: Array<TestCaseResult>,
}
| {
error: {
message: string,
stack: string,
},
};
const tests: Array<{
title: string,
ancestorTitles: Array<string>,
implementation: () => mixed,
isFocused: boolean,
isSkipped: boolean,
result?: TestCaseResult,
}> = [];
const ancestorTitles: Array<string> = [];
const globalModifiers: Array<'focused' | 'skipped'> = [];
const globalDescribe = (global.describe = (
title: string,
implementation: () => mixed,
) => {
ancestorTitles.push(title);
implementation();
ancestorTitles.pop();
});
const globalIt =
(global.it =
global.test =
(title: string, implementation: () => mixed) =>
tests.push({
title,
implementation,
ancestorTitles: ancestorTitles.slice(),
isFocused:
globalModifiers.length > 0 &&
globalModifiers[globalModifiers.length - 1] === 'focused',
isSkipped:
globalModifiers.length > 0 &&
globalModifiers[globalModifiers.length - 1] === 'skipped',
}));
// $FlowExpectedError[prop-missing]
global.fdescribe = global.describe.only = (
title: string,
implementation: () => mixed,
) => {
globalModifiers.push('focused');
globalDescribe(title, implementation);
globalModifiers.pop();
};
// $FlowExpectedError[prop-missing]
global.it.only =
global.fit =
// $FlowExpectedError[prop-missing]
global.test.only =
(title: string, implementation: () => mixed) => {
globalModifiers.push('focused');
globalIt(title, implementation);
globalModifiers.pop();
};
// $FlowExpectedError[prop-missing]
global.xdescribe = global.describe.skip = (
title: string,
implementation: () => mixed,
) => {
globalModifiers.push('skipped');
globalDescribe(title, implementation);
globalModifiers.pop();
};
// $FlowExpectedError[prop-missing]
global.it.skip =
global.xit =
// $FlowExpectedError[prop-missing]
global.test.skip =
global.xtest =
(title: string, implementation: () => mixed) => {
globalModifiers.push('skipped');
globalIt(title, implementation);
globalModifiers.pop();
};
global.jest = {
fn: createMockFunction,
};
const MOCK_FN_TAG = Symbol('mock function');
function createMockFunction<TArgs: $ReadOnlyArray<mixed>, TReturn>(
initialImplementation?: (...TArgs) => TReturn,
): JestMockFn<TArgs, TReturn> {
let implementation: ?(...TArgs) => TReturn = initialImplementation;
const mock: JestMockFn<TArgs, TReturn>['mock'] = {
calls: [],
// $FlowExpectedError[incompatible-type]
lastCall: undefined,
instances: [],
contexts: [],
results: [],
};
const mockFunction = function (this: mixed, ...args: TArgs): TReturn {
let result: JestMockFn<TArgs, TReturn>['mock']['results'][number] = {
isThrow: false,
// $FlowExpectedError[incompatible-type]
value: undefined,
};
if (implementation != null) {
try {
result.value = implementation.apply(this, args);
} catch (error) {
result.isThrow = true;
result.value = error;
}
}
mock.calls.push(args);
mock.lastCall = args;
// $FlowExpectedError[incompatible-call]
mock.instances.push(new.target ? this : undefined);
mock.contexts.push(this);
mock.results.push(result);
if (result.isThrow) {
throw result.value;
}
return result.value;
};
mockFunction.mock = mock;
// $FlowExpectedError[invalid-computed-prop]
mockFunction[MOCK_FN_TAG] = true;
// $FlowExpectedError[prop-missing]
return mockFunction;
}
// flowlint unsafe-getters-setters:off
class Expect {
#received: mixed;
#isNot: boolean = false;
constructor(received: mixed) {
this.#received = received;
}
get not(): this {
this.#isNot = !this.#isNot;
return this;
}
toEqual(expected: mixed): void {
const pass = deepEqual(this.#received, expected, {strict: true});
if (!this.#isExpectedResult(pass)) {
throw new Error(
`Expected${this.#maybeNotLabel()} to equal ${String(expected)} but received ${String(this.#received)}.`,
);
}
}
toBe(expected: mixed): void {
const pass = this.#received === expected;
if (!this.#isExpectedResult(pass)) {
throw new Error(
`Expected${this.#maybeNotLabel()} ${String(expected)} but received ${String(this.#received)}.`,
);
}
}
toBeInstanceOf(expected: Class<mixed>): void {
const pass = this.#received instanceof expected;
if (!this.#isExpectedResult(pass)) {
throw new Error(
`expected ${String(this.#received)}${this.#maybeNotLabel()} to be an instance of ${String(expected)}`,
);
}
}
toBeCloseTo(expected: number, precision: number = 2): void {
const pass =
Math.abs(expected - Number(this.#received)) < Math.pow(10, -precision);
if (!this.#isExpectedResult(pass)) {
throw new Error(
`Expected ${String(this.#received)}${this.#maybeNotLabel()} to be close to ${expected}`,
);
}
}
toBeNull(): void {
const pass = this.#received == null;
if (!this.#isExpectedResult(pass)) {
throw new Error(
`Expected ${String(this.#received)}${this.#maybeNotLabel()} to be null`,
);
}
}
toThrow(expected?: string): void {
if (expected != null && typeof expected !== 'string') {
throw new Error(
'toThrow() implementation only accepts strings as arguments.',
);
}
let pass = false;
try {
// $FlowExpectedError[not-a-function]
this.#received();
} catch (error) {
pass = expected != null ? error.message === expected : true;
}
if (!this.#isExpectedResult(pass)) {
throw new Error(
`Expected ${String(this.#received)}${this.#maybeNotLabel()} to throw`,
);
}
}
toHaveBeenCalled(): void {
const mock = this.#requireMock();
const pass = mock.calls.length > 0;
if (!this.#isExpectedResult(pass)) {
throw new Error(
`Expected ${String(this.#received)}${this.#maybeNotLabel()} to have been called, but it was${this.#isNot ? '' : "n't"}`,
);
}
}
toHaveBeenCalledTimes(times: number): void {
const mock = this.#requireMock();
const pass = mock.calls.length === times;
if (!this.#isExpectedResult(pass)) {
throw new Error(
`Expected ${String(this.#received)}${this.#maybeNotLabel()} to have been called ${times} times, but it was called ${mock.calls.length} times`,
);
}
}
#isExpectedResult(pass: boolean): boolean {
return this.#isNot ? !pass : pass;
}
#maybeNotLabel(): string {
return this.#isNot ? ' not' : '';
}
#requireMock(): JestMockFn<$ReadOnlyArray<mixed>, mixed>['mock'] {
// $FlowExpectedError[incompatible-use]
if (!this.#received?.[MOCK_FN_TAG]) {
throw new Error(
`Expected ${String(this.#received)} to be a mock function, but it wasn't`,
);
}
// $FlowExpectedError[incompatible-use]
return this.#received.mock;
}
}
global.expect = (received: mixed) => new Expect(received);
function runWithGuard(fn: () => void) {
try {
fn();
} catch (error) {
let reportedError =
error instanceof Error ? error : new Error(String(error));
reportTestSuiteResult({
error: {
message: reportedError.message,
stack: reportedError.stack,
},
});
}
}
function executeTests() {
const hasFocusedTests = tests.some(test => test.isFocused);
for (const test of tests) {
const result: TestCaseResult = {
title: test.title,
fullName: [...test.ancestorTitles, test.title].join(' '),
ancestorTitles: test.ancestorTitles,
status: 'pending',
duration: 0,
failureMessages: [],
numPassingAsserts: 0,
};
test.result = result;
if (!test.isSkipped && (!hasFocusedTests || test.isFocused)) {
let status;
let error;
const start = Date.now();
try {
test.implementation();
status = 'passed';
} catch (e) {
error = e;
status = 'failed';
}
result.status = status;
result.duration = Date.now() - start;
result.failureMessages =
status === 'failed' && error ? [error.message] : [];
}
}
reportTestSuiteResult({
testResults: tests.map(test => nullthrows(test.result)),
});
}
function reportTestSuiteResult(testSuiteResult: TestSuiteResult): void {
console.log(JSON.stringify(testSuiteResult));
}
global.$$RunTests$$ = () => {
executeTests();
};
export function registerTest(setUpTest: () => void) {
runWithGuard(() => {
setUpTest();
});
}
+1 -1
View File
@@ -32,7 +32,7 @@ if (process.env.FBSOURCE_ENV === '1') {
require('@fb-tools/babel-register');
} else {
// Register Babel to allow local packages to be loaded from source
require('../scripts/build/babel-register').registerForMonorepo();
require('../scripts/babel-register').registerForMonorepo();
}
const transformer = require('@react-native/metro-babel-transformer');
+14 -10
View File
@@ -8,6 +8,7 @@
"android": "cd packages/rn-tester && npm run android",
"build-android": "./gradlew :packages:react-native:ReactAndroid:build",
"build": "node ./scripts/build/build.js",
"build-types": "node ./scripts/build/build-types.js",
"clang-format": "clang-format -i --glob=*/**/*.{h,cpp,m,mm}",
"clean": "node ./scripts/build/clean.js",
"flow-check": "flow check",
@@ -15,12 +16,12 @@
"format-check": "prettier --list-different \"./**/*.{js,md,yml,ts,tsx}\"",
"format": "npm run prettier && npm run clang-format",
"featureflags": "cd packages/react-native && yarn featureflags",
"lint-ci": "./scripts/circleci/analyze_code.sh && yarn shellcheck",
"lint-ci": "./.github/workflow-scripts/analyze_code.sh && yarn shellcheck",
"lint-java": "node ./scripts/lint-java.js",
"lint": "eslint .",
"prettier": "prettier --write \"./**/*.{js,md,yml,ts,tsx}\"",
"print-packages": "node ./scripts/monorepo/print",
"shellcheck": "./scripts/circleci/analyze_scripts.sh",
"shellcheck": "./.github/workflow-scripts/analyze_scripts.sh",
"start": "cd packages/rn-tester && npm run start",
"set-version": "node ./scripts/releases/set-version.js",
"test-android": "./gradlew :packages:react-native:ReactAndroid:test",
@@ -31,6 +32,7 @@
"test-typescript-offline": "dtslint --localTs node_modules/typescript/lib packages/react-native/types",
"test-typescript": "dtslint packages/react-native/types",
"test": "jest",
"fantom": "JS_DIR='..' yarn jest --config packages/react-native-fantom/config/jest.config.js",
"trigger-react-native-release": "node ./scripts/releases-local/trigger-react-native-release.js",
"update-lock": "npx yarn-deduplicate"
},
@@ -48,10 +50,10 @@
"@babel/preset-flow": "^7.24.7",
"@definitelytyped/dtslint": "^0.0.127",
"@jest/create-cache-key-function": "^29.6.3",
"@react-native/metro-babel-transformer": "0.77.0-main",
"@react-native/metro-config": "0.77.0-main",
"@react-native/metro-babel-transformer": "0.79.0-main",
"@react-native/metro-config": "0.79.0-main",
"@tsconfig/node18": "1.0.1",
"@types/react": "^18.2.6",
"@types/react": "^19.0.0",
"@typescript-eslint/parser": "^7.1.1",
"ansi-styles": "^4.2.1",
"babel-plugin-minify-dead-code-elimination": "^0.5.2",
@@ -70,20 +72,21 @@
"eslint-plugin-jest": "^27.9.0",
"eslint-plugin-jsx-a11y": "^6.6.0",
"eslint-plugin-lint": "^1.0.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.30.1",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-native": "^4.0.0",
"eslint-plugin-redundant-undefined": "^0.4.0",
"eslint-plugin-relay": "^1.8.3",
"flow-api-translator": "0.25.1",
"flow-bin": "^0.254.2",
"flow-bin": "^0.259.1",
"glob": "^7.1.1",
"hermes-eslint": "0.25.1",
"hermes-transform": "0.25.1",
"inquirer": "^7.1.0",
"jest": "^29.6.3",
"jest-diff": "^29.7.0",
"jest-junit": "^10.0.0",
"jest-snapshot": "^29.7.0",
"jscodeshift": "^0.14.0",
"metro-babel-register": "^0.81.0",
"metro-memory-fs": "^0.81.0",
@@ -93,16 +96,17 @@
"nullthrows": "^1.1.1",
"prettier": "2.8.8",
"prettier-plugin-hermes-parser": "0.25.1",
"react": "18.3.1",
"react-test-renderer": "18.3.1",
"react": "19.0.0",
"react-test-renderer": "19.0.0",
"rimraf": "^3.0.2",
"shelljs": "^0.8.5",
"signedsource": "^1.0.0",
"supports-color": "^7.1.0",
"tinybench": "^3.1.0",
"typescript": "5.0.4",
"ws": "^6.2.3"
},
"resolutions": {
"react-is": "18.3.1"
"react-is": "19.0.0"
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/assets-registry",
"version": "0.77.0-main",
"version": "0.79.0-main",
"description": "Asset support code for React Native.",
"license": "MIT",
"repository": {
+10 -8
View File
@@ -4,13 +4,13 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
* @flow strict
* @format
*/
'use strict';
import type {PackagerAsset} from './registry.js';
/*:: import type {PackagerAsset} from './registry.js'; */
const androidScaleSuffix = {
'0.75': 'ldpi',
@@ -27,7 +27,7 @@ const ANDROID_BASE_DENSITY = 160;
* FIXME: using number to represent discrete scale numbers is fragile in essence because of
* floating point numbers imprecision.
*/
function getAndroidAssetSuffix(scale: number): string {
function getAndroidAssetSuffix(scale /*: number */) /*: string */ {
if (scale.toString() in androidScaleSuffix) {
// $FlowFixMe[invalid-computed-prop]
return androidScaleSuffix[scale.toString()];
@@ -53,9 +53,9 @@ const drawableFileTypes = new Set([
]);
function getAndroidResourceFolderName(
asset: PackagerAsset,
scale: number,
): string {
asset /*: PackagerAsset */,
scale /*: number */,
) /*: string */ {
if (!drawableFileTypes.has(asset.type)) {
return 'raw';
}
@@ -73,7 +73,9 @@ function getAndroidResourceFolderName(
return 'drawable-' + suffix;
}
function getAndroidResourceIdentifier(asset: PackagerAsset): string {
function getAndroidResourceIdentifier(
asset /*: PackagerAsset */,
) /*: string */ {
return (getBasePath(asset) + '/' + asset.name)
.toLowerCase()
.replace(/\//g, '_') // Encode folder structure in file name
@@ -81,7 +83,7 @@ function getAndroidResourceIdentifier(asset: PackagerAsset): string {
.replace(/^(?:assets|assetsunstable_path)_/, ''); // Remove "assets_" or "assetsunstable_path_" prefix
}
function getBasePath(asset: PackagerAsset): string {
function getBasePath(asset /*: PackagerAsset */) /*: string */ {
const basePath = asset.httpServerLocation;
return basePath.startsWith('/') ? basePath.slice(1) : basePath;
}
+5 -3
View File
@@ -10,6 +10,7 @@
'use strict';
/*::
export type AssetDestPathResolver = 'android' | 'generic';
export type PackagerAsset = {
@@ -25,16 +26,17 @@ export type PackagerAsset = {
+resolver?: AssetDestPathResolver,
...
};
*/
const assets: Array<PackagerAsset> = [];
const assets /*: Array<PackagerAsset> */ = [];
function registerAsset(asset: PackagerAsset): number {
function registerAsset(asset /*: PackagerAsset */) /*: number */ {
// `push` returns new array length, so the first asset will
// get id 1 (not 0) to make the value truthy
return assets.push(asset);
}
function getAssetByID(assetId: number): PackagerAsset {
function getAssetByID(assetId /*: number */) /*: PackagerAsset */ {
return assets[assetId - 1];
}
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/babel-plugin-codegen",
"version": "0.77.0-main",
"version": "0.79.0-main",
"description": "Babel plugin to generate native module and view manager code for React Native.",
"license": "MIT",
"repository": {
@@ -26,7 +26,7 @@
],
"dependencies": {
"@babel/traverse": "^7.25.3",
"@react-native/codegen": "0.77.0-main"
"@react-native/codegen": "0.79.0-main"
},
"devDependencies": {
"@babel/core": "^7.25.2"
+3 -4
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/community-cli-plugin",
"version": "0.77.0-main",
"version": "0.79.0-main",
"description": "Core CLI commands for React Native",
"keywords": [
"react-native",
@@ -22,15 +22,14 @@
"dist"
],
"dependencies": {
"@react-native/dev-middleware": "0.77.0-main",
"@react-native/metro-babel-transformer": "0.77.0-main",
"@react-native/dev-middleware": "0.79.0-main",
"@react-native/metro-babel-transformer": "0.79.0-main",
"chalk": "^4.0.0",
"debug": "^2.2.0",
"invariant": "^2.2.4",
"metro": "^0.81.0",
"metro-config": "^0.81.0",
"metro-core": "^0.81.0",
"node-fetch": "^2.2.0",
"readline": "^1.3.0",
"semver": "^7.1.3"
},
@@ -12,7 +12,6 @@
import type TerminalReporter from 'metro/src/lib/TerminalReporter';
import chalk from 'chalk';
import fetch from 'node-fetch';
type PageDescription = $ReadOnly<{
id: string,
@@ -9,7 +9,7 @@
* @oncall react_native
*/
import type {NextHandleFunction, Server} from 'connect';
import type {Server} from 'connect';
import type {TerminalReportableEvent} from 'metro/src/lib/TerminalReporter';
const debug = require('debug')('ReactNative:CommunityCliPlugin');
@@ -30,10 +30,6 @@ type MiddlewareReturn = {
...
};
const noopNextHandle: NextHandleFunction = (req, res, next) => {
next();
};
// $FlowFixMe
const unusedStubWSServer: ws$WebSocketServer = {};
// $FlowFixMe
@@ -45,6 +41,12 @@ const communityMiddlewareFallback = {
port: number,
watchFolders: $ReadOnlyArray<string>,
}): MiddlewareReturn => ({
// FIXME: Several features will break without community middleware and
// should be migrated into core.
// e.g. used by Libraries/Core/Devtools:
// - /open-stack-frame
// - /open-url
// - /symbolicate
middleware: unusedMiddlewareStub,
websocketEndpoints: {},
messageSocketEndpoint: {
@@ -59,15 +61,12 @@ const communityMiddlewareFallback = {
reportEvent: (event: TerminalReportableEvent) => {},
},
}),
indexPageMiddleware: noopNextHandle,
};
// Attempt to use the community middleware if it exists, but fallback to
// the stubs if it doesn't.
try {
const community = require('@react-native-community/cli-server-api');
communityMiddlewareFallback.indexPageMiddleware =
community.indexPageMiddleware;
communityMiddlewareFallback.createDevServerMiddleware =
community.createDevServerMiddleware;
} catch {
@@ -77,5 +76,3 @@ Starting the server without the community middleware.`);
export const createDevServerMiddleware =
communityMiddlewareFallback.createDevServerMiddleware;
export const indexPageMiddleware =
communityMiddlewareFallback.indexPageMiddleware;
@@ -19,7 +19,7 @@ import isDevServerRunning from '../../utils/isDevServerRunning';
import loadMetroConfig from '../../utils/loadMetroConfig';
import * as version from '../../utils/version';
import attachKeyHandlers from './attachKeyHandlers';
import {createDevServerMiddleware, indexPageMiddleware} from './middleware';
import {createDevServerMiddleware} from './middleware';
import {createDevMiddleware} from '@react-native/dev-middleware';
import chalk from 'chalk';
import Metro from 'metro';
@@ -146,11 +146,7 @@ async function runServer(
secure: args.https,
secureCert: args.cert,
secureKey: args.key,
unstable_extraMiddleware: [
communityMiddleware,
indexPageMiddleware,
middleware,
],
unstable_extraMiddleware: [communityMiddleware, middleware],
websocketEndpoints: {
...communityWebsocketEndpoints,
...websocketEndpoints,
+1 -1
View File
@@ -14,7 +14,7 @@ export type * from './index.flow';
*/
if (!process.env.BUILD_EXCLUDE_BABEL_REGISTER) {
require('../../../scripts/build/babel-register').registerForMonorepo();
require('../../../scripts/babel-register').registerForMonorepo();
}
module.exports = require('./index.flow');
@@ -10,7 +10,6 @@
*/
import net from 'net';
import fetch from 'node-fetch';
/**
* Determine whether we can run the dev server.
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/core-cli-utils",
"version": "0.77.0-main",
"version": "0.79.0-main",
"description": "React Native CLI library for Frameworks to build on",
"license": "MIT",
"main": "./src/index.flow.js",
+1 -1
View File
@@ -14,7 +14,7 @@ export type * from './index.flow';
*/
if (process.env.BUILD_EXCLUDE_BABEL_REGISTER == null) {
require('../../../scripts/build/babel-register').registerForMonorepo();
require('../../../scripts/babel-register').registerForMonorepo();
}
module.exports = require('./index.flow');
+36 -4
View File
@@ -71,7 +71,14 @@ function checkPodfileInSyncWithManifest(
const FIRST = 1,
SECOND = 2,
THIRD = 3;
THIRD = 3,
FOURTH = 4,
FIFTH = 5;
function getNodePackagePath(packageName: string): string {
// $FlowIgnore[prop-missing] type definition is incomplete
return require.resolve(packageName, {cwd: [process.cwd(), ...module.paths]});
}
/* eslint sort-keys: "off" */
export const tasks = {
@@ -79,26 +86,51 @@ export const tasks = {
bootstrap: (
options: AppleBootstrapOption,
): {
cleanupBuildFolder: Task<void>,
runCodegen: Task<void>,
validate: Task<void>,
installRubyGems: Task<ExecaPromise>,
installDependencies: Task<ExecaPromise>,
} => ({
validate: task(FIRST, 'Check Cocoapods and bundle are available', () => {
cleanupBuildFolder: task(FIRST, 'Cleanup build folder', () => {
execa.sync('rm', ['-rf', 'build'], {
cwd: options.cwd,
});
}),
runCodegen: task(SECOND, 'Run codegen', () => {
const reactNativePath = path.dirname(getNodePackagePath('react-native'));
const codegenScript = path.join(
reactNativePath,
'scripts',
'generate-codegen-artifacts.js',
);
execa.sync('node', [
codegenScript,
'-p',
process.cwd(),
'-o',
options.cwd,
'-t',
'ios',
]);
}),
validate: task(THIRD, 'Check Cocoapods and bundle are available', () => {
assertDependencies(
isOnPath('pod', 'CocoaPods'),
isOnPath('bundle', "Bundler to manage Ruby's gems"),
);
}),
installRubyGems: task(SECOND, 'Install Ruby Gems', () =>
installRubyGems: task(FOURTH, 'Install Ruby Gems', () =>
execa('bundle', ['install'], {
cwd: options.cwd,
}),
),
installDependencies: task(THIRD, 'Install CocoaPods dependencies', () => {
installDependencies: task(FIFTH, 'Install CocoaPods dependencies', () => {
const env = {
RCT_NEW_ARCH_ENABLED: options.newArchitecture ? '1' : '0',
USE_FRAMEWORKS: options.frameworks,
USE_HERMES: options.hermes ? '1' : '0',
RCT_IGNORE_PODS_DEPRECATION: '1',
};
if (options.frameworks == null) {
delete env.USE_FRAMEWORKS;
@@ -14,7 +14,7 @@ export type * from './version.flow';
*/
if (process.env.BUILD_EXCLUDE_BABEL_REGISTER == null) {
require('../../../../scripts/build/babel-register').registerForMonorepo();
require('../../../../scripts/babel-register').registerForMonorepo();
}
module.exports = require('./version.flow');
+2 -2
View File
@@ -1,5 +1,5 @@
@generated SignedSource<<6b92b66e59525cef52902139f863f175>>
Git revision: b61aae3ccc6e2684dfbf1e2a06b0f985b459f11f
@generated SignedSource<<1c6d6775360a94a4112bd2340366bf25>>
Git revision: d126cc87f2b61e12e9579ddbfd4c0eb516bce881
Built with --nohooks: false
Is local checkout: false
Remote URL: https://github.com/facebookexperimental/rn-chrome-devtools-frontend
@@ -99,6 +99,7 @@ style.setProperty('--image-file-database', 'url(\"' + new URL(new URL('database.
style.setProperty('--image-file-deployed', 'url(\"' + new URL(new URL('deployed.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-device-fold', 'url(\"' + new URL(new URL('device-fold.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-devices', 'url(\"' + new URL(new URL('devices.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-devtools', 'url(\"' + new URL(new URL('devtools.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-dock-bottom', 'url(\"' + new URL(new URL('dock-bottom.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-dock-left', 'url(\"' + new URL(new URL('dock-left.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-dock-right', 'url(\"' + new URL(new URL('dock-right.svg', import.meta.url).href, import.meta.url).toString() + '\")');
@@ -151,6 +152,7 @@ style.setProperty('--image-file-help', 'url(\"' + new URL(new URL('help.svg', im
style.setProperty('--image-file-iframe-crossed', 'url(\"' + new URL(new URL('iframe-crossed.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-iframe', 'url(\"' + new URL(new URL('iframe.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-import', 'url(\"' + new URL(new URL('import.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-indeterminate-question-box', 'url(\"' + new URL(new URL('indeterminate-question-box.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-info-filled', 'url(\"' + new URL(new URL('info-filled.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-info', 'url(\"' + new URL(new URL('info.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-issue-cross-filled', 'url(\"' + new URL(new URL('issue-cross-filled.svg', import.meta.url).href, import.meta.url).toString() + '\")');
@@ -167,7 +169,9 @@ style.setProperty('--image-file-justify-items-center', 'url(\"' + new URL(new UR
style.setProperty('--image-file-justify-items-end', 'url(\"' + new URL(new URL('justify-items-end.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-justify-items-start', 'url(\"' + new URL(new URL('justify-items-start.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-justify-items-stretch', 'url(\"' + new URL(new URL('justify-items-stretch.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-keyboard-arrow-right', 'url(\"' + new URL(new URL('keyboard-arrow-right.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-keyboard-pen', 'url(\"' + new URL(new URL('keyboard-pen.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-keyboard', 'url(\"' + new URL(new URL('keyboard.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-large-arrow-right-filled', 'url(\"' + new URL(new URL('large-arrow-right-filled.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-layers-filled', 'url(\"' + new URL(new URL('layers-filled.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-layers', 'url(\"' + new URL(new URL('layers.svg', import.meta.url).href, import.meta.url).toString() + '\")');
@@ -176,6 +180,9 @@ style.setProperty('--image-file-left-panel-open', 'url(\"' + new URL(new URL('le
style.setProperty('--image-file-lightbulb-spark', 'url(\"' + new URL(new URL('lightbulb-spark.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-lighthouse_logo', 'url(\"' + new URL(new URL('lighthouse_logo.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-list', 'url(\"' + new URL(new URL('list.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-location-on', 'url(\"' + new URL(new URL('location-on.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-lock', 'url(\"' + new URL(new URL('lock.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-match-case', 'url(\"' + new URL(new URL('match-case.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-match-whole-word', 'url(\"' + new URL(new URL('match-whole-word.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-memory', 'url(\"' + new URL(new URL('memory.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-minus', 'url(\"' + new URL(new URL('minus.svg', import.meta.url).href, import.meta.url).toString() + '\")');
@@ -195,8 +202,10 @@ style.setProperty('--image-file-record-start', 'url(\"' + new URL(new URL('recor
style.setProperty('--image-file-record-stop', 'url(\"' + new URL(new URL('record-stop.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-redo', 'url(\"' + new URL(new URL('redo.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-refresh', 'url(\"' + new URL(new URL('refresh.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-regular-expression', 'url(\"' + new URL(new URL('regular-expression.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-replace', 'url(\"' + new URL(new URL('replace.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-replay', 'url(\"' + new URL(new URL('replay.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-report', 'url(\"' + new URL(new URL('report.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-resizeDiagonal', 'url(\"' + new URL(new URL('resizeDiagonal.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-resizeHorizontal', 'url(\"' + new URL(new URL('resizeHorizontal.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-resizeVertical', 'url(\"' + new URL(new URL('resizeVertical.svg', import.meta.url).href, import.meta.url).toString() + '\")');
@@ -207,7 +216,6 @@ style.setProperty('--image-file-right-panel-open', 'url(\"' + new URL(new URL('r
style.setProperty('--image-file-scissors', 'url(\"' + new URL(new URL('scissors.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-screen-rotation', 'url(\"' + new URL(new URL('screen-rotation.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-search', 'url(\"' + new URL(new URL('search.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-securityIcons', 'url(\"' + new URL(new URL('securityIcons.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-select-element', 'url(\"' + new URL(new URL('select-element.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-send', 'url(\"' + new URL(new URL('send.svg', import.meta.url).href, import.meta.url).toString() + '\")');
style.setProperty('--image-file-shadow', 'url(\"' + new URL(new URL('shadow.svg', import.meta.url).href, import.meta.url).toString() + '\")');
@@ -0,0 +1 @@
<svg width="20" height="21" fill="none" xmlns="http://www.w3.org/2000/svg"><mask id="a" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="20" height="21"><circle cx="10" cy="10.167" r="10" fill="#C4C4C4"/></mask><g mask="url(#a)"><circle cx="10" cy="10.167" r="10" fill="#1A73E8"/><path d="M10 18.061a7.894 7.894 0 1 0 0-15.789 7.894 7.894 0 0 0 0 15.79Z" stroke="#fff" stroke-width="1.042"/><path d="M9.966 13.643a3.613 3.613 0 1 0 0-7.226 3.613 3.613 0 0 0 0 7.226ZM13.114 11.795l-3.505 6.069M6.833 11.824l-3.504-6.07M10.003 6.417h7.009" stroke="#fff" stroke-width=".833"/></g></svg>

After

Width:  |  Height:  |  Size: 605 B

@@ -0,0 +1 @@
<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M4.5 17c-.417 0-.77-.146-1.063-.438A1.447 1.447 0 0 1 3 15.5V12h1.5v3.5H8V17H4.5Zm11 0H12v-1.5h3.5V12H17v3.5c0 .417-.146.77-.438 1.063A1.446 1.446 0 0 1 15.5 17ZM3 4.5c0-.417.146-.77.438-1.063A1.447 1.447 0 0 1 4.5 3H8v1.5H4.5V8H3V4.5Zm14 0V8h-1.5V4.5H12V3h3.5c.417 0 .77.146 1.063.438.291.291.437.645.437 1.062Zm-7 10c.264 0 .486-.09.667-.27a.977.977 0 0 0 .27-.688.84.84 0 0 0-.27-.646.906.906 0 0 0-.667-.271.906.906 0 0 0-.667.27.84.84 0 0 0-.27.647c0 .264.09.493.27.687.18.18.403.271.667.271Zm-.667-2.854h1.375c0-.472.035-.799.104-.98.084-.18.306-.444.667-.791.417-.403.702-.75.854-1.042.167-.305.25-.639.25-1 0-.68-.243-1.236-.729-1.666-.472-.445-1.09-.667-1.854-.667-.583 0-1.111.174-1.583.52a2.665 2.665 0 0 0-1 1.355l1.229.52c.11-.332.285-.603.52-.812A1.27 1.27 0 0 1 10 6.771c.347 0 .639.11.875.333.25.208.375.458.375.75 0 .222-.07.43-.208.625-.125.18-.39.472-.792.875-.403.403-.66.73-.77.98-.098.235-.147.673-.147 1.312Z" fill="#000"/></svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" height="20" viewBox="0 -960 960 960" width="20"><path d="M522-480 333-669l51-51 240 240-240 240-51-51 189-189Z"/></svg>

After

Width:  |  Height:  |  Size: 159 B

@@ -0,0 +1 @@
<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M3.5 15c-.417 0-.77-.146-1.063-.438A1.447 1.447 0 0 1 2 13.5v-7c0-.417.146-.77.438-1.063A1.447 1.447 0 0 1 3.5 5h13c.417 0 .77.146 1.063.438.291.291.437.645.437 1.062v7c0 .417-.146.77-.438 1.063A1.446 1.446 0 0 1 16.5 15h-13Zm0-1.5h13v-7h-13v7ZM7 13h6v-1.5H7V13Zm-2-2.5h1.5V9H5v1.5Zm2.125 0h1.5V9h-1.5v1.5Zm2.125 0h1.5V9h-1.5v1.5Zm2.125 0h1.5V9h-1.5v1.5Zm2.125 0H15V9h-1.5v1.5ZM5 8.5h1.5V7H5v1.5Zm2.125 0h1.5V7h-1.5v1.5Zm2.125 0h1.5V7h-1.5v1.5Zm2.125 0h1.5V7h-1.5v1.5Zm2.125 0H15V7h-1.5v1.5Zm-10 5v-7 7Z" fill="#000"/></svg>

After

Width:  |  Height:  |  Size: 608 B

@@ -0,0 +1 @@
<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10 18a.815.815 0 0 1-.48-.146.88.88 0 0 1-.29-.416 12.932 12.932 0 0 0-.96-2.084c-.36-.666-.888-1.444-1.582-2.333A17.87 17.87 0 0 1 5.02 10.5c-.417-.806-.625-1.77-.625-2.896 0-1.555.542-2.875 1.625-3.958C7.118 2.549 8.444 2 10 2s2.875.549 3.958 1.646c1.098 1.083 1.646 2.403 1.646 3.958 0 1.222-.236 2.236-.708 3.042a23.501 23.501 0 0 1-1.584 2.375c-.722.944-1.27 1.743-1.645 2.396-.361.639-.66 1.312-.896 2.02-.07.167-.174.306-.313.417A.724.724 0 0 1 10 18Zm0-2.646c.236-.472.5-.937.792-1.396.305-.472.75-1.09 1.333-1.854a17.386 17.386 0 0 0 1.417-2.083c.375-.653.562-1.459.562-2.417 0-1.125-.403-2.09-1.208-2.896C12.09 3.903 11.125 3.5 10 3.5c-1.139 0-2.111.403-2.917 1.208-.791.806-1.187 1.771-1.187 2.896 0 .958.187 1.764.562 2.417.375.639.848 1.333 1.417 2.083.583.764 1.02 1.382 1.313 1.854.305.459.576.924.812 1.396Zm0-5.729c.556 0 1.028-.194 1.417-.583.402-.403.604-.882.604-1.438 0-.555-.202-1.028-.604-1.417A1.896 1.896 0 0 0 10 5.583c-.556 0-1.035.202-1.437.604a1.929 1.929 0 0 0-.584 1.417c0 .556.195 1.035.584 1.438.402.389.881.583 1.437.583Z" fill="#000"/></svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

@@ -0,0 +1 @@
<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M5.5 18c-.417 0-.77-.146-1.062-.438A1.444 1.444 0 0 1 4 16.5v-8c0-.417.146-.77.438-1.062A1.444 1.444 0 0 1 5.5 7H6V5c0-1.111.389-2.056 1.167-2.833C7.944 1.389 8.889 1 10 1c1.111 0 2.056.389 2.833 1.167C13.611 2.944 14 3.889 14 5v2h.5c.417 0 .77.146 1.062.438.292.291.438.645.438 1.062v8c0 .417-.146.77-.438 1.062A1.444 1.444 0 0 1 14.5 18h-9Zm0-1.5h9v-8h-9v8ZM10 14c.417 0 .77-.146 1.062-.438.292-.291.438-.645.438-1.062 0-.417-.146-.77-.438-1.062A1.444 1.444 0 0 0 10 11c-.417 0-.77.146-1.062.438A1.444 1.444 0 0 0 8.5 12.5c0 .417.146.77.438 1.062.291.292.645.438 1.062.438ZM7.5 7h5V5c0-.695-.243-1.285-.729-1.771A2.411 2.411 0 0 0 10 2.5c-.695 0-1.285.243-1.771.729A2.411 2.411 0 0 0 7.5 5v2Z" fill="#000"/></svg>

After

Width:  |  Height:  |  Size: 799 B

@@ -0,0 +1 @@
<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="m3.042 14.146 3.02-8.084h1.959l3.041 8.084H9.23l-.646-1.854h-3l-.687 1.854H3.042Zm3.02-3.417h1.98l-.98-2.708h-.041l-.959 2.708Zm7.605 3.604c-.611 0-1.115-.184-1.51-.552-.397-.368-.595-.837-.595-1.406 0-.583.216-1.056.646-1.417.43-.36 1.014-.541 1.75-.541.264 0 .549.03.854.093.306.063.521.129.646.198v-.354c0-.208-.135-.406-.406-.594a1.523 1.523 0 0 0-.885-.28c-.278 0-.539.058-.782.176a4.352 4.352 0 0 0-.822.552l-.834-1.166c.25-.25.625-.473 1.125-.667a4.165 4.165 0 0 1 1.521-.292c.778 0 1.413.22 1.906.657.493.437.74 1.01.74 1.718v3.646h-1.584v-.541h-.062a1.92 1.92 0 0 1-.74.583 2.387 2.387 0 0 1-.968.187ZM14.083 13c.403 0 .73-.121.98-.365.25-.243.374-.538.374-.885a1.613 1.613 0 0 0-.447-.146 3.394 3.394 0 0 0-.573-.041c-.361 0-.65.072-.865.218-.215.146-.323.323-.323.531 0 .237.077.41.23.521.152.111.36.167.624.167Z" fill="#000"/></svg>

After

Width:  |  Height:  |  Size: 928 B

@@ -1 +1 @@
<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill="#000" d="M10 18.332c-1.61 0-2.984-.566-4.125-1.707-1.14-1.14-1.707-2.516-1.707-4.125v-5c0-1.61.566-2.984 1.707-4.125C7.015 2.235 8.391 1.668 10 1.668c1.61 0 2.984.566 4.125 1.707 1.14 1.14 1.707 2.516 1.707 4.125v5c0 1.61-.566 2.984-1.707 4.125-1.14 1.14-2.516 1.707-4.125 1.707ZM10.832 7.5h3.336c0-1-.316-1.883-.95-2.645-.632-.765-1.425-1.246-2.386-1.437Zm-5 0h3.336V3.418c-.961.191-1.754.672-2.387 1.437A4.019 4.019 0 0 0 5.832 7.5ZM10 16.668c1.152 0 2.137-.406 2.95-1.219.812-.812 1.218-1.797 1.218-2.949V9.168H5.832V12.5c0 1.152.406 2.137 1.219 2.95.812.812 1.797 1.218 2.949 1.218Zm0-7.5Zm.832-1.668Zm-1.664 0ZM10 9.168Zm0 0"/></svg>
<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill="#000" d="M10 18c-1.667 0-3.083-.583-4.25-1.75C4.583 15.083 4 13.667 4 12V8c0-1.667.583-3.083 1.75-4.25C6.917 2.583 8.333 2 10 2c1.667 0 3.083.583 4.25 1.75C15.417 4.917 16 6.333 16 8v4c0 1.667-.583 3.083-1.75 4.25C13.083 17.417 11.667 18 10 18Zm.75-10.5h3.708a4.372 4.372 0 0 0-1.187-2.583 4.352 4.352 0 0 0-2.521-1.334V7.5Zm-5.208 0H9.25V3.583c-1 .153-1.84.594-2.52 1.323A4.42 4.42 0 0 0 5.541 7.5Zm4.458 9c1.245 0 2.306-.439 3.184-1.316.877-.878 1.316-1.939 1.316-3.184V9h-9v3c0 1.245.439 2.306 1.316 3.184C7.694 16.06 8.755 16.5 10 16.5Z"/></svg>

Before

Width:  |  Height:  |  Size: 725 B

After

Width:  |  Height:  |  Size: 636 B

@@ -0,0 +1 @@
<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M4.333 15.646A7.923 7.923 0 0 1 2 10c0-1.07.201-2.09.604-3.063.403-.972.98-1.84 1.73-2.604l1.083 1.063A6.248 6.248 0 0 0 3.99 7.5 6.495 6.495 0 0 0 3.5 10c0 .861.163 1.684.49 2.469.326.785.795 1.49 1.406 2.114l-1.063 1.063ZM7.75 15c-.347 0-.642-.121-.885-.365a1.206 1.206 0 0 1-.365-.885c0-.347.122-.642.365-.885.243-.244.538-.365.885-.365s.642.121.885.365c.243.243.365.538.365.885s-.122.642-.365.885A1.205 1.205 0 0 1 7.75 15Zm2.75-4V9.292l-1.48.854-.75-1.292L9.75 8l-1.48-.854.75-1.292 1.48.854V5H12v1.708l1.48-.854.75 1.292L12.75 8l1.48.854-.75 1.292L12 9.292V11h-1.5Zm5.167 4.646-1.063-1.063A6.418 6.418 0 0 0 16.5 10c0-.875-.16-1.708-.48-2.5a6.119 6.119 0 0 0-1.416-2.104l1.063-1.063a8.127 8.127 0 0 1 1.729 2.604C17.799 7.91 18 8.931 18 10a7.923 7.923 0 0 1-2.333 5.646Z" fill="#000"/></svg>

After

Width:  |  Height:  |  Size: 881 B

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24" fill="#041E49"><path d="M480-280q17 0 28.5-11.5T520-320q0-17-11.5-28.5T480-360q-17 0-28.5 11.5T440-320q0 17 11.5 28.5T480-280Zm-40-160h80v-240h-80v240ZM330-120 120-330v-300l210-210h300l210 210v300L630-120H330Zm34-80h232l164-164v-232L596-760H364L200-596v232l164 164Zm116-280Z"/></svg>

After

Width:  |  Height:  |  Size: 371 B

@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" width="80" height="32"><g style="fill:none;stroke:none"><path d="M2 3.732A1.73 1.73 0 0 1 3.726 2h9.548C14.227 2 15 2.769 15 3.732v8.536A1.73 1.73 0 0 1 13.274 14H3.726A1.725 1.725 0 0 1 2 12.268V3.732zM8 6h1V5H8v1zm0 5h1V7H8v4z" transform="translate(48 16)" style="fill:#000"/><path d="M64 32V16h16v16z"/><path d="M67.719 18c-.952 0-1.719.762-1.719 1.719v8.562c0 .963.765 1.719 1.719 1.719h9.562c.952 0 1.719-.762 1.719-1.719V19.72c0-.963-.765-1.719-1.719-1.719H67.72zm4.781 2a2 2 0 0 1 2 2c0 .44-.184.84-.469 1.125l-.437.469c-.36.365-.594.656-.594 1.406h-1v-.25a2 2 0 0 1 .594-1.406l.625-.625A.998.998 0 0 0 73.5 22c0-.55-.45-1-1-1s-1 .45-1 1h-1a2 2 0 0 1 2-2zm-.5 6h1v1h-1v-1z" style="fill:#000"/><g transform="translate(0 16)"><path style="opacity:.2" d="M0 0h16v16H0z"/><rect style="fill:#000" rx="1" height="8" width="8" y="4" x="4"/></g><g transform="translate(16 16)"><path style="opacity:.2" d="M0 0h16v16H0z"/><rect style="fill:#000" rx="4" height="8" width="8" y="4" x="4"/></g><path style="opacity:.2" d="M0 0h16v16H0z" transform="translate(32 16)"/><path style="fill:#000" d="m3 12 5-9 5 9z" transform="translate(32 16)"/><path style="opacity:.2" d="M0 0h16v16H0z" transform="translate(32)"/><path style="fill:#000" d="M.5 14h15L8 1 .5 14zM9 12H7v-2h2v2zm0-3H7V6h2v3z" transform="translate(32)"/><path d="M32 0v16H16V0z"/><path style="fill:#000" d="M8 1C4.136 1 1 4.136 1 8s3.136 7 7 7 7-3.136 7-7-3.136-7-7-7zM2.5 8c0-3.032 2.468-5.5 5.5-5.5s5.5 2.468 5.5 5.5-2.468 5.5-5.5 5.5A5.507 5.507 0 0 1 2.5 8zM9 12V7H7v5h2zM7 6h2V4H7v2z" transform="translate(16)"/><path d="M16 0v16H0V0z"/><path style="fill:#000" d="M10.5 6.5v-1A2.5 2.5 0 0 0 8 3c-1.38.01-2.5 1.12-2.5 2.5v1H5c-.55 0-1 .45-1 .996V12.5c0 .55.45 1 1 1h6c.55 0 1-.45 1-1v-5c0-.528-.45-1-1-1h-.5zm-4 .01V5.5C6.5 4.67 7.17 4 8 4s1.5.67 1.5 1.5v1.01h-3z"/><path d="M160-32V0h-32v-32z"/><path style="opacity:.2" d="M0 0h32v32H0z" transform="translate(0 -32)"/><path style="opacity:.2" d="M0 0h32v32H0z" transform="translate(32 -32)"/><path style="opacity:.2" d="M0 0h32v32H0z" transform="translate(64 -32)"/><path style="opacity:.2" d="M0 0h32v32H0z" transform="translate(64 -64)"/><path d="M64-64v32H32v-32zM32-64v32H0v-32z"/></g></svg>

Before

Width:  |  Height:  |  Size: 2.2 KiB

@@ -942,7 +942,7 @@
function step1() {
testPreset(
MobileThrottling.networkPresets[2],
MobileThrottling.networkPresets[3],
[
'offline event: online = false', 'connection change event: type = none; downlinkMax = 0; effectiveType = 4g'
],
@@ -951,7 +951,7 @@
function step2() {
testPreset(
MobileThrottling.networkPresets[1],
MobileThrottling.networkPresets[2],
[
'online event: online = true',
'connection change event: type = cellular; downlinkMax = 0.3814697265625; effectiveType = 2g'
@@ -960,9 +960,15 @@
}
function step3() {
testPreset(
MobileThrottling.networkPresets[1],
['connection change event: type = cellular; downlinkMax = 1.373291015625; effectiveType = 3g'], step4);
}
function step4() {
testPreset(
MobileThrottling.networkPresets[0],
['connection change event: type = cellular; downlinkMax = 1.373291015625; effectiveType = 3g'],
['connection change event: type = cellular; downlinkMax = 7.724761962890625; effectiveType = 4g'],
test.releaseControl.bind(test));
}
};
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
import*as e from"../../third_party/i18n/i18n.js";import*as t from"../root/root.js";let o=null;class n{locale;lookupClosestDevToolsLocale;constructor(e){this.lookupClosestDevToolsLocale=e.lookupClosestDevToolsLocale,"browserLanguage"===e.settingLanguage?this.locale=e.navigatorLanguage||"en-US":this.locale=e.settingLanguage,this.locale=this.lookupClosestDevToolsLocale(this.locale)}static instance(e={create:!1}){if(!o&&!e.create)throw new Error("No LanguageSelector instance exists yet.");return e.create&&(o=new n(e.data)),o}static removeInstance(){o=null}forceFallbackLocale(){this.locale="en-US"}languageIsSupportedByDevTools(e){return r(e,this.lookupClosestDevToolsLocale(e))}}function r(e,t){const o=new Intl.Locale(e),n=new Intl.Locale(t);return o.language===n.language}var s=Object.freeze({__proto__:null,DevToolsLocale:n,localeLanguagesMatch:r});const i="@HOST@/remote/serve_file/@VERSION@/core/i18n/locales/@LOCALE@.json",l="./locales/@LOCALE@.json",a=new e.I18n.I18n(["af","am","ar","as","az","be","bg","bn","bs","ca","cs","cy","da","de","el","en-GB","es-419","es","et","eu","fa","fi","fil","fr-CA","fr","gl","gu","he","hi","hr","hu","hy","id","is","it","ja","ka","kk","km","kn","ko","ky","lo","lt","lv","mk","ml","mn","mr","ms","my","ne","nl","no","or","pa","pl","pt-PT","pt","ro","ru","si","sk","sl","sq","sr-Latn","sr","sv","sw","ta","te","th","tr","uk","ur","uz","vi","zh-HK","zh-TW","zu","en-US","zh"],"en-US"),c=new Set(["en-US","zh"]);function u(e,t,o={}){return e.getLocalizedStringSetFor(n.instance().locale).getLocalizedString(t,o)}function g(e,t){return a.registerFileStrings(e,t)}var f=Object.freeze({__proto__:null,lookupClosestSupportedDevToolsLocale:function(e){return a.lookupClosestSupportedLocale(e)},getAllSupportedDevToolsLocales:function(){return[...a.supportedLocales]},fetchAndRegisterLocaleData:async function(e,o=self.location.toString()){const n=fetch(function(e,o){const n=t.Runtime.getRemoteBase(o);if(n&&n.version&&!c.has(e))return i.replace("@HOST@","devtools://devtools").replace("@VERSION@",n.version).replace("@LOCALE@",e);const r=l.replace("@LOCALE@",e);return new URL(r,import.meta.url).toString()}(e,o)).then((e=>e.json())),r=new Promise(((e,t)=>window.setTimeout((()=>t(new Error("timed out fetching locale"))),5e3))),s=await Promise.race([r,n]);a.registerLocaleData(e,s)},getLazilyComputedLocalizedString:function(e,t,o={}){return()=>u(e,t,o)},getLocalizedString:u,registerUIStrings:g,getFormatLocalizedString:function(e,t,o){const r=e.getLocalizedStringSetFor(n.instance().locale).getMessageFormatterFor(t),s=document.createElement("span");for(const e of r.getAst())if(1===e.type){const t=o[e.value];t&&s.append(t)}else"value"in e&&s.append(String(e.value));return s},serializeUIString:function(e,t={}){const o={string:e,values:t};return JSON.stringify(o)},deserializeUIString:function(e){return e?JSON.parse(e):{string:"",values:{}}},lockedString:function(e){return e},lockedLazyString:function(e){return()=>e},getLocalizedLanguageRegion:function(e,t){const o=new Intl.Locale(e),{language:n,baseName:r}=o,s=n===new Intl.Locale(t.locale).language?"en":r,i=new Intl.DisplayNames([t.locale],{type:"language"}).of(n),l=new Intl.DisplayNames([s],{type:"language"}).of(n);let a="",c="";if(o.region){a=` (${new Intl.DisplayNames([t.locale],{type:"region",style:"short"}).of(o.region)})`,c=` (${new Intl.DisplayNames([s],{type:"region",style:"short"}).of(o.region)})`}return`${i}${a} - ${l}${c}`}});const p={fmms:"{PH1} μs",fms:"{PH1} ms",fs:"{PH1} s",fmin:"{PH1} min",fhrs:"{PH1} hrs",fdays:"{PH1} days"},m=g("core/i18n/time-utilities.ts",p),L=u.bind(void 0,m),d=function(e,t){if(!isFinite(e))return"-";if(0===e)return"0";if(t&&e<.1)return L(p.fmms,{PH1:(1e3*e).toFixed(0)});if(t&&e<1e3)return L(p.fms,{PH1:e.toFixed(2)});if(e<1e3)return L(p.fms,{PH1:e.toFixed(0)});const o=e/1e3;if(o<60)return L(p.fs,{PH1:o.toFixed(2)});const n=o/60;if(n<60)return L(p.fmin,{PH1:n.toFixed(1)});const r=n/60;if(r<24)return L(p.fhrs,{PH1:r.toFixed(1)});return L(p.fdays,{PH1:(r/24).toFixed(1)})};var S=Object.freeze({__proto__:null,preciseMillisToString:function(e,t){return t=t||0,L(p.fms,{PH1:e.toFixed(t)})},millisToString:d,secondsToString:function(e,t){return isFinite(e)?d(1e3*e,t):"-"}});export{s as DevToolsLocale,S as TimeUtilities,f as i18n};
import*as e from"../../third_party/i18n/i18n.js";import*as t from"../root/root.js";import*as o from"../platform/platform.js";let n=null;class r{locale;lookupClosestDevToolsLocale;constructor(e){this.lookupClosestDevToolsLocale=e.lookupClosestDevToolsLocale,"browserLanguage"===e.settingLanguage?this.locale=e.navigatorLanguage||"en-US":this.locale=e.settingLanguage,this.locale=this.lookupClosestDevToolsLocale(this.locale)}static instance(e={create:!1}){if(!n&&!e.create)throw new Error("No LanguageSelector instance exists yet.");return e.create&&(n=new r(e.data)),n}static removeInstance(){n=null}forceFallbackLocale(){this.locale="en-US"}languageIsSupportedByDevTools(e){return s(e,this.lookupClosestDevToolsLocale(e))}}function s(e,t){const o=new Intl.Locale(e),n=new Intl.Locale(t);return o.language===n.language}var i=Object.freeze({__proto__:null,DevToolsLocale:r,localeLanguagesMatch:s});const a="@HOST@/remote/serve_file/@VERSION@/core/i18n/locales/@LOCALE@.json",l="./locales/@LOCALE@.json",c=new e.I18n.I18n(["af","am","ar","as","az","be","bg","bn","bs","ca","cs","cy","da","de","el","en-GB","es-419","es","et","eu","fa","fi","fil","fr-CA","fr","gl","gu","he","hi","hr","hu","hy","id","is","it","ja","ka","kk","km","kn","ko","ky","lo","lt","lv","mk","ml","mn","mr","ms","my","ne","nl","no","or","pa","pl","pt-PT","pt","ro","ru","si","sk","sl","sq","sr-Latn","sr","sv","sw","ta","te","th","tr","uk","ur","uz","vi","zh-HK","zh-TW","zu","en-US","zh"],"en-US"),u=new Set(["en-US","zh"]);function g(e,t,o={}){return e.getLocalizedStringSetFor(r.instance().locale).getLocalizedString(t,o)}function f(e,t){return c.registerFileStrings(e,t)}var m=Object.freeze({__proto__:null,lookupClosestSupportedDevToolsLocale:function(e){return c.lookupClosestSupportedLocale(e)},getAllSupportedDevToolsLocales:function(){return[...c.supportedLocales]},fetchAndRegisterLocaleData:async function(e,o=self.location.toString()){const n=fetch(function(e,o){const n=t.Runtime.getRemoteBase(o);if(n&&n.version&&!u.has(e))return a.replace("@HOST@","devtools://devtools").replace("@VERSION@",n.version).replace("@LOCALE@",e);const r=l.replace("@LOCALE@",e);return new URL(r,import.meta.url).toString()}(e,o)).then((e=>e.json())),r=new Promise(((e,t)=>window.setTimeout((()=>t(new Error("timed out fetching locale"))),5e3))),s=await Promise.race([r,n]);c.registerLocaleData(e,s)},hasLocaleDataForTest:function(e){return c.hasLocaleDataForTest(e)},resetLocaleDataForTest:function(){c.resetLocaleDataForTest()},getLazilyComputedLocalizedString:function(e,t,o={}){return()=>g(e,t,o)},getLocalizedString:g,registerUIStrings:f,getFormatLocalizedString:function(e,t,o){const n=e.getLocalizedStringSetFor(r.instance().locale).getMessageFormatterFor(t),s=document.createElement("span");for(const e of n.getAst())if(1===e.type){const t=o[e.value];t&&s.append(t)}else"value"in e&&s.append(String(e.value));return s},serializeUIString:function(e,t={}){const o={string:e,values:t};return JSON.stringify(o)},deserializeUIString:function(e){return e?JSON.parse(e):{string:"",values:{}}},lockedString:function(e){return e},lockedLazyString:function(e){return()=>e},getLocalizedLanguageRegion:function(e,t){const o=new Intl.Locale(e),{language:n,baseName:r}=o,s=n===new Intl.Locale(t.locale).language?"en":r,i=new Intl.DisplayNames([t.locale],{type:"language"}).of(n),a=new Intl.DisplayNames([s],{type:"language"}).of(n);let l="",c="";if(o.region){l=` (${new Intl.DisplayNames([t.locale],{type:"region",style:"short"}).of(o.region)})`,c=` (${new Intl.DisplayNames([s],{type:"region",style:"short"}).of(o.region)})`}return`${i}${l} - ${a}${c}`}});const d={fmms:"{PH1} μs",fms:"{PH1} ms",fs:"{PH1} s",fmin:"{PH1} min",fhrs:"{PH1} hrs",fdays:"{PH1} days"},p=f("core/i18n/time-utilities.ts",d),L=g.bind(void 0,p);const S=function(e,t){if(!isFinite(e))return"-";if(0===e)return"0";if(t&&e<.1)return L(d.fmms,{PH1:(1e3*e).toFixed(0)});if(t&&e<1e3)return L(d.fms,{PH1:e.toFixed(2)});if(e<1e3)return L(d.fms,{PH1:e.toFixed(0)});const o=e/1e3;if(o<60)return L(d.fs,{PH1:o.toFixed(2)});const n=o/60;if(n<60)return L(d.fmin,{PH1:n.toFixed(1)});const r=n/60;if(r<24)return L(d.fhrs,{PH1:r.toFixed(1)});return L(d.fdays,{PH1:(r/24).toFixed(1)})};var h=Object.freeze({__proto__:null,preciseMillisToString:function(e,t){return t=t||0,L(d.fms,{PH1:e.toFixed(t)})},formatMicroSecondsTime:function(e){return S(o.Timing.microSecondsToMilliSeconds(e),!0)},formatMicroSecondsAsSeconds:function(e){const t=o.Timing.microSecondsToMilliSeconds(e),n=o.Timing.milliSecondsToSeconds(t);return L(d.fs,{PH1:n.toFixed(2)})},millisToString:S,secondsToString:function(e,t){return isFinite(e)?S(1e3*e,t):"-"}});export{i as DevToolsLocale,h as TimeUtilities,m as i18n};
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
import*as e from"../platform/platform.js";const t=new URLSearchParams(location.search);let n,s="";class r{constructor(){}static instance(e={forceNew:null}){const{forceNew:t}=e;return n&&!t||(n=new r),n}static removeInstance(){n=void 0}static queryParam(e){return t.get(e)}static setQueryParamForTesting(e,n){t.set(e,n)}static experimentsSetting(){try{return e.StringUtilities.toKebabCaseKeys(JSON.parse(self.localStorage&&self.localStorage.experiments?self.localStorage.experiments:"{}"))}catch(e){return console.error("Failed to parse localStorage['experiments']"),{}}}static setPlatform(e){s=e}static platform(){return s}static isDescriptorEnabled(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){return import(`../../${e}`)}}class i{#e;#t;#n;#s;#r;constructor(){this.#e=[],this.#t=new Set,this.#n=new Set,this.#s=new Set,this.#r=new Set}allConfigurableExperiments(){const e=[];for(const t of this.#e)this.#n.has(t.name)||e.push(t);return e}setExperimentsSetting(e){self.localStorage&&(self.localStorage.experiments=JSON.stringify(e))}register(t,n,s,r,i){if(this.#t.has(t))throw new Error(`Duplicate registraction of experiment '${t}'`);this.#t.add(t),this.#e.push(new a(this,t,n,Boolean(s),r??e.DevToolsPath.EmptyUrlString,i??e.DevToolsPath.EmptyUrlString))}isEnabled(e){return this.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);const n=r.experimentsSetting();n[e]=t,this.setExperimentsSetting(n)}enableExperimentsTransiently(e){for(const t of e)this.checkExperiment(t),this.#n.add(t)}enableExperimentsByDefault(e){for(const t of e)this.checkExperiment(t),this.#s.add(t)}setServerEnabledExperiments(e){for(const t of e)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(){const e=r.experimentsSetting(),t={};for(const{name:n}of this.#e)if(e.hasOwnProperty(n)){const s=e[n];(s||this.#s.has(n))&&(t[n]=s)}this.setExperimentsSetting(t)}checkExperiment(e){if(!this.#t.has(e))throw new Error(`Unknown experiment '${e}'`)}}class a{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(){return this.#e.isEnabled(this.name)}setEnabled(e){this.#e.setEnabled(this.name,e)}}const o=new i;var l,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={}));const m={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))};var h=Object.freeze({__proto__:null,getRemoteBase:function(e=self.location.toString()){const t=new URL(e).searchParams.get("remoteBase");if(!t)return null;const n=/\/serve_file\/(@[0-9a-zA-Z]+)\/?$/.exec(t);return n?{base:`devtools://devtools/remote/serve_file/${n[1]}/`,version:n[1]}:null},Runtime:r,ExperimentsSupport:i,Experiment:a,experiments:o,get RNExperimentName(){return l},get ConditionName(){return c},conditions:m});export{h as Runtime};
import*as e from"../platform/platform.js";const t=new URLSearchParams(location.search);let n,r="";class s{constructor(){}static instance(e={forceNew:null}){const{forceNew:t}=e;return n&&!t||(n=new s),n}static removeInstance(){n=void 0}static queryParam(e){return t.get(e)}static setQueryParamForTesting(e,n){t.set(e,n)}static experimentsSetting(){try{return e.StringUtilities.toKebabCaseKeys(JSON.parse(self.localStorage&&self.localStorage.experiments?self.localStorage.experiments:"{}"))}catch(e){return console.error("Failed to parse localStorage['experiments']"),{}}}static setPlatform(e){r=e}static platform(){return r}static isDescriptorEnabled(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){return import(`../../${e}`)}}class i{#e;#t;#n;#r;#s;constructor(){this.#e=[],this.#t=new Set,this.#n=new Set,this.#r=new Set,this.#s=new Set}allConfigurableExperiments(){const e=[];for(const t of this.#e)this.#n.has(t.name)||e.push(t);return e}setExperimentsSetting(e){self.localStorage&&(self.localStorage.experiments=JSON.stringify(e))}register(t,n,r,s,i){if(this.#t.has(t))throw new Error(`Duplicate registraction of experiment '${t}'`);this.#t.add(t),this.#e.push(new a(this,t,n,Boolean(r),s??e.DevToolsPath.EmptyUrlString,i??e.DevToolsPath.EmptyUrlString))}isEnabled(e){return this.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);const n=s.experimentsSetting();n[e]=t,this.setExperimentsSetting(n)}enableExperimentsTransiently(e){for(const t of e)this.checkExperiment(t),this.#n.add(t)}enableExperimentsByDefault(e){for(const t of e)this.checkExperiment(t),this.#r.add(t)}setServerEnabledExperiments(e){for(const t of e)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(){const e=s.experimentsSetting(),t={};for(const{name:n}of this.#e)if(e.hasOwnProperty(n)){const r=e[n];(r||this.#r.has(n))&&(t[n]=r)}this.setExperimentsSetting(t)}checkExperiment(e){if(!this.#t.has(e))throw new Error(`Unknown experiment '${e}'`)}}class a{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(){return this.#e.isEnabled(this.name)}setEnabled(e){this.#e.setEnabled(this.name,e)}}const o=new i;var l,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={}));const m={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))};var h=Object.freeze({__proto__:null,getRemoteBase:function(e=self.location.toString()){const t=new URL(e).searchParams.get("remoteBase");if(!t)return null;const n=/\/serve_file\/(@[0-9a-zA-Z]+)\/?$/.exec(t);return n?{base:`devtools://devtools/remote/serve_file/${n[1]}/`,version:n[1]}:null},getPathName:function(){return window.location.pathname},Runtime:s,ExperimentsSupport:i,Experiment:a,experiments:o,get RNExperimentName(){return l},get ConditionName(){return c},conditions:m});export{h as Runtime};
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -82,6 +82,12 @@ const DevToolsAPIImpl = class {
*/
_dispatchOnInspectorFrontendAPI(method, args) {
const inspectorFrontendAPI = /** @type {!Object<string, function()>} */ (window['InspectorFrontendAPI']);
if (!inspectorFrontendAPI) {
// This is the case for device_mode_emulation_frame entrypoint. It's created via `window.open` from
// the DevTools window, so it shares a context with DevTools but has a separate DevToolsUIBinding and `window` object.
// We can safely ignore the events since they also arrive on the DevTools `window` object.
return;
}
inspectorFrontendAPI[method].apply(inspectorFrontendAPI, args);
}
@@ -282,10 +288,6 @@ const DevToolsAPIImpl = class {
}
}
reattachMainTarget() {
this._dispatchOnInspectorFrontendAPI('reattachMainTarget', []);
}
/**
* @param {boolean} hard
*/
@@ -405,12 +407,9 @@ window.DevToolsAPI = DevToolsAPI;
*/
const EnumeratedHistogram = {
ActionTaken: 'DevTools.ActionTaken',
BreakpointWithConditionAdded: 'DevTools.BreakpointWithConditionAdded',
BreakpointEditDialogRevealedFrom: 'DevTools.BreakpointEditDialogRevealedFrom',
CSSHintShown: 'DevTools.CSSHintShown',
DeveloperResourceLoaded: 'DevTools.DeveloperResourceLoaded',
DeveloperResourceScheme: 'DevTools.DeveloperResourceScheme',
ElementsSidebarTabShown: 'DevTools.Elements.SidebarTabShown',
ExperimentDisabled: 'DevTools.ExperimentDisabled',
ExperimentDisabledAtLaunch: 'DevTools.ExperimentDisabledAtLaunch',
ExperimentEnabled: 'DevTools.ExperimentEnabled',
@@ -425,7 +424,6 @@ const EnumeratedHistogram = {
LighthouseModeRun: 'DevTools.LighthouseModeRun',
LighthouseCategoryUsed: 'DevTools.LighthouseCategoryUsed',
ManifestSectionSelected: 'DevTools.ManifestSectionSelected',
PanelClosed: 'DevTools.PanelClosed',
PanelShown: 'DevTools.PanelShown',
PanelShownInLocation: 'DevTools.PanelShownInLocation',
RecordingAssertion: 'DevTools.RecordingAssertion',
@@ -447,11 +445,7 @@ const EnumeratedHistogram = {
ColorConvertedFrom: 'DevTools.ColorConvertedFrom',
ColorPickerOpenedFrom: 'DevTools.ColorPickerOpenedFrom',
CSSPropertyDocumentation: 'DevTools.CSSPropertyDocumentation',
InlineScriptParsed: 'DevTools.InlineScriptParsed',
VMInlineScriptTypeShown: 'DevTools.VMInlineScriptShown',
BreakpointsRestoredFromStorageCount: 'DevTools.BreakpointsRestoredFromStorageCount',
SwatchActivated: 'DevTools.SwatchActivated',
BadgeActivated: 'DevTools.BadgeActivated',
AnimationPlaybackRateChanged: 'DevTools.AnimationPlaybackRateChanged',
AnimationPointDragged: 'DevTools.AnimationPointDragged',
LegacyResourceTypeFilterNumberOfSelectedChanged: 'DevTools.LegacyResourceTypeFilterNumberOfSelectedChanged',
@@ -643,6 +637,14 @@ const InspectorFrontendHostImpl = class {
DevToolsAPI.sendMessageToEmbedder('getSyncInformation', [], callback);
}
/**
* @override
* @param {function(Object<string, Object<string, string|boolean>>):void} callback
*/
getHostConfig(callback) {
DevToolsAPI.sendMessageToEmbedder('getHostConfig', [], /** @type {function(?Object)} */ (callback));
}
/**
* @override
* @param {string} origin
@@ -697,9 +699,10 @@ const InspectorFrontendHostImpl = class {
* @param {string} url
* @param {string} content
* @param {boolean} forceSaveAs
* @param {boolean} isBase64
*/
save(url, content, forceSaveAs) {
DevToolsAPI.sendMessageToEmbedder('save', [url, content, forceSaveAs], null);
save(url, content, forceSaveAs, isBase64) {
DevToolsAPI.sendMessageToEmbedder('save', [url, content, forceSaveAs, isBase64], null);
}
/**
@@ -1143,10 +1146,10 @@ const InspectorFrontendHostImpl = class {
/**
* @param {string} request
* @param {function(!InspectorFrontendHostAPI.DoAidaConversationResult): void} cb
* @param {function(!InspectorFrontendHostAPI.AidaClientResult): void} cb
*/
registerAidaClientEvent(request) {
DevToolsAPI.sendMessageToEmbedder('registerAidaClientEvent', [request]);
registerAidaClientEvent(request, cb) {
DevToolsAPI.sendMessageToEmbedder('registerAidaClientEvent', [request], cb);
}
};
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
import*as e from"./heap_snapshot_worker.js";const s=self,a=new e.HeapSnapshotWorkerDispatcher.HeapSnapshotWorkerDispatcher(s,(e=>self.postMessage(e)));var r;r=a.dispatchMessage.bind(a),s.addEventListener("message",r,!1),self.postMessage("workerReady");
import*as e from"./heap_snapshot_worker.js";const s=new e.HeapSnapshotWorkerDispatcher.HeapSnapshotWorkerDispatcher(self.postMessage.bind(self));self.addEventListener("message",s.dispatchMessage.bind(s),!1),self.postMessage("workerReady");
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
import*as e from"../../core/root/root.js";import*as t from"../../services/puppeteer/puppeteer.js";import"../../third_party/lighthouse/lighthouse-dt-bundle.js";class s{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(){return this.onDisconnect}getSessionId(){return this.sessionId}sendRawMessage(e){i("sendProtocolMessage",{message:e})}async disconnect(){this.onDisconnect?.("force disconnect"),this.onDisconnect=null,this.onMessage=null}}let n,o;async function a(a,r){let c;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)throw new Error("Cannot end a timespan before starting one");const e=await o();return o=void 0,e}const i=await async function(t){const s=self.lookupLocale(t);if("en-US"===s||"en"===s)return;try{const t=e.Runtime.getRemoteBase();let n;n=t&&t.base?`${t.base}third_party/lighthouse/locales/${s}.json`:new URL(`../../third_party/lighthouse/locales/${s}.json`,import.meta.url).toString();const o=new Promise(((e,t)=>setTimeout((()=>t(new Error("timed out fetching locale"))),5e3))),a=await Promise.race([o,fetch(n).then((e=>e.json()))]);return self.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)));const g=r.config||self.createConfig(r.categoryIDs,l.formFactor),p=r.url,{rootTargetId:u,mainSessionId:f}=r;n=new s(f),c=await t.PuppeteerConnection.PuppeteerConnectionHelper.connectPuppeteerToConnectionViaTab({connection:n,rootTargetId:u,isPageTargetCallback:e=>"page"===e.type});const{page:h}=c;if(!h)throw new Error("Could not create page handle for the target page");if("snapshot"===a)return await self.snapshot(h,{config:g,flags:l});if("startTimespan"===a){const e=await self.startTimespan(h,{config:g,flags:l});return void(o=e.endTimespan)}return await self.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())}}function i(e,t){self.postMessage({action:e,args:t})}self.onmessage=async function(e){const t=e.data;switch(t.action){case"startTimespan":case"endTimespan":case"snapshot":case"navigation":{const e=await a(t.action,t.args);e&&"object"==typeof e&&("report"in e&&delete e.report,"artifacts"in e&&(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:throw new Error(`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*as e from"../../core/root/root.js";import*as t from"../../services/puppeteer/puppeteer.js";import"../../third_party/lighthouse/lighthouse-dt-bundle.js";class s{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(){return this.onDisconnect}getSessionId(){return this.sessionId}sendRawMessage(e){i("sendProtocolMessage",{message:e})}async disconnect(){this.onDisconnect?.("force disconnect"),this.onDisconnect=null,this.onMessage=null}}let n,o;async function a(a,r){let c;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)throw new Error("Cannot end a timespan before starting one");const e=await o();return o=void 0,e}const i=await async function(t){const s=self.lookupLocale(t);if("en-US"===s||"en"===s)return;try{const t=e.Runtime.getRemoteBase();let n;n=t&&t.base?`${t.base}third_party/lighthouse/locales/${s}.json`:new URL(`../../third_party/lighthouse/locales/${s}.json`,import.meta.url).toString();const o=new Promise(((e,t)=>setTimeout((()=>t(new Error("timed out fetching locale"))),5e3))),a=await Promise.race([o,fetch(n).then((e=>e.json()))]);return self.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;const g=r.config||self.createConfig(r.categoryIDs,l.formFactor),p=r.url,{rootTargetId:f,mainSessionId:u}=r;n=new s(u),c=await t.PuppeteerConnection.PuppeteerConnectionHelper.connectPuppeteerToConnectionViaTab({connection:n,rootTargetId:f,isPageTargetCallback:e=>"page"===e.type});const{page:d}=c;if(!d)throw new Error("Could not create page handle for the target page");if("snapshot"===a)return await self.snapshot(d,{config:g,flags:l});if("startTimespan"===a){const e=await self.startTimespan(d,{config:g,flags:l});return void(o=e.endTimespan)}return await self.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())}}function i(e,t){self.postMessage({action:e,args:t})}self.onmessage=async function(e){const t=e.data;switch(t.action){case"startTimespan":case"endTimespan":case"snapshot":case"navigation":{const e=await a(t.action,t.args);e&&"object"==typeof e&&("report"in e&&delete e.report,"artifacts"in e&&(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:throw new Error(`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