Commit Graph

12270 Commits

Author SHA1 Message Date
Shawn Dempsey 19c41f1dbd Use apple platform name for macOS instead of hardcoding iOS (#49542)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49542

When fusebox loads, we display this static message on apple platforms:
```
Debugger integration: iOS Bridgeless (RCTHost)
```
We are running RN MacOS using the xplat `RCTHost` and want to show the correct platform

[Changelog] [Internal] - Use current apple platform name instead of hardcoding 'iOS'

Reviewed By: robhogan

Differential Revision: D69867335

fbshipit-source-id: 5973882c710447fdb7ef18e82ff304e4cd16a85c
2025-02-19 17:24:17 -08:00
Samuel Susla 46ce79b08a move RCTInitializeUIKitProxies to RCTFabricSurface init (#49541)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49541

changelog: [internal]

`RCTSurfacePresenter` may be initialised from a background thread. This breaks the requirement of `RCTInitializeUIKitProxies`, which must be always called on the main thread.

Differential Revision: D69874923

fbshipit-source-id: 098f543bd3a849ee9ee1b63b567290f67c0109cd
2025-02-19 15:24:41 -08:00
Mateo Guzmán e137a5280f Reland of: Make RCTLog & ExceptionDataHelper internal (#49536)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49536

This is a re-land of a previous diff D69836482 which was reverted due to a build failure.

As part of the initiative to reduce the public API surface, this classes can be internalized. I've checked there are no relevant OSS usages:

- [RCTLog](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+NOT+repo%3AMaxdev18%2Fpowersync_app+NOT+repo%3Acarter-0%2Finstagram-decompiled+NOT+repo%3Am0mosenpai%2Finstadamn+NOT+repo%3AA-Star100%2FA-Star100-AUG2-2024+NOT+repo%3Alclnrd%2Fdetox-scrollview-reproductible+NOT+repo%3ADionisisChytiris%2FWorldWiseTrivia_Main+NOT+repo%3Apast3l%2Fhi2+NOT+repo%3AoneDotpy%2FCaribouQuest+NOT+repo%3Abejayoharen%2Fdailytodo+NOT+repo%3Amolangning%2Freversing-discord+NOT+repo%3AScottPrzy%2Freact-native+NOT+repo%3Agabrieldonadel%2Freact-native-visionos+NOT+repo%3AGabriel2308%2FTestes-Soft+NOT+repo%3Adawnzs03%2FflakyBuild+NOT+repo%3Acga2351%2Fcode+NOT+repo%3Astreeg%2Ftcc+NOT+repo%3Asoftware-mansion-labs%2Freact-native-swiftui+com.facebook.react.util.RCTLog)
- [ExceptionDataHelper](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+NOT+repo%3AMaxdev18%2Fpowersync_app+NOT+repo%3Acarter-0%2Finstagram-decompiled+NOT+repo%3Am0mosenpai%2Finstadamn+NOT+repo%3AA-Star100%2FA-Star100-AUG2-2024+NOT+repo%3Alclnrd%2Fdetox-scrollview-reproductible+NOT+repo%3ADionisisChytiris%2FWorldWiseTrivia_Main+NOT+repo%3Apast3l%2Fhi2+NOT+repo%3AoneDotpy%2FCaribouQuest+NOT+repo%3Abejayoharen%2Fdailytodo+NOT+repo%3Amolangning%2Freversing-discord+NOT+repo%3AScottPrzy%2Freact-native+NOT+repo%3Agabrieldonadel%2Freact-native-visionos+NOT+repo%3AGabriel2308%2FTestes-Soft+NOT+repo%3Adawnzs03%2FflakyBuild+NOT+repo%3Acga2351%2Fcode+NOT+repo%3Astreeg%2Ftcc+NOT+repo%3Asoftware-mansion-labs%2Freact-native-swiftui+com.facebook.react.util.ExceptionDataHelper)

## Changelog:

[INTERNAL] - Make RCTLog & ExceptionDataHelper internal

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

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

Reviewed By: mdvacca

Differential Revision: D69863875

Pulled By: cortinico

fbshipit-source-id: 59f0ccbcbeba6e75b776d3bb8fd7c672f1b50994
2025-02-19 15:15:10 -08:00
chrsmys 36f29beac4 Fix force RTL support on new architecture. (#49455)
Summary:
This fixes an issue in Fabric where changing the layout direction and then reloading the JS bundle did not honor the layout direction until the app was restarted on iOS. This now calls  `_updateLayoutContext` whenever RCTSurfaceView is recreated which happens on bundle reload. This is not an issue on the old architecture because the layout direction is determined within the [SurfaceViews](https://github.com/facebook/react-native/blob/acdddef48eb60b002c954d7d2447cb9c2883c8b3/packages/react-native/React/Views/RCTRootShadowView.m#L18) which were recreated on bundle reload.

## Related Issues:
- https://github.com/react-native-community/discussions-and-proposals/issues/847
- https://github.com/facebook/react-native/issues/49451
- https://github.com/facebook/react-native/issues/48311
- https://github.com/facebook/react-native/issues/45661

## How can we take this further?
If we want to make it so that it doesn't require an entire bundle reload for RTL to take effect I believe these are the steps that would need to be taken:
- Make it so [RCTI18nManager](https://github.com/facebook/react-native/blob/acdddef48eb60b002c954d7d2447cb9c2883c8b3/packages/react-native/React/CoreModules/RCTI18nManager.mm#L52) exports isRTL as a method instead of consts
- Send Notification Center notif when RTL is forced on or off
- Listen for that notification RCTSurfaceView and call _updateLayoutContext similar to UIContentSizeCategoryDidChangeNotification.

## Changelog:

[iOS] [FIXED] - Layout direction changes are now honored on bundle reload.

<!-- 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

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

Test Plan:
On the new architecture change force the layout direction and reload the bundle:
```
import React, { useCallback } from "react";
import { Button, I18nManager, StyleSheet, Text, View } from "react-native";
import RNRestart from "react-native-restart";

export default function Explore() {
    const onApplyRTL = useCallback(() => {
        if (!I18nManager.isRTL) {
            I18nManager.forceRTL(true);
            RNRestart.restart();
        }
    }, []);

    const onApplyLTR = useCallback(() => {
        if (I18nManager.isRTL) {
            I18nManager.forceRTL(false);
            RNRestart.restart();
        }
    }, []);

    return (
        <View style={styles.area}>
            <Text>Test Block</Text>
            <View style={styles.testBlock}>
                <Text>Leading</Text>
                <Text>Trailing</Text>
            </View>
            <Button title={"Apply RTL"} onPress={onApplyRTL} />
            <Button title={"Apply LTR"} onPress={onApplyLTR} />
        </View>
    );
}

const styles = StyleSheet.create({
    area: {
        marginVertical: 50,
        paddingHorizontal: 24,
    },
    testBlock: {
        paddingVertical: 10,
        flexDirection: "row",
        justifyContent: "space-between",
    },
});

```

https://github.com/user-attachments/assets/0eab0d79-de3f-4eeb-abd0-439ba4fe25c0

Reviewed By: cortinico, cipolleschi

Differential Revision: D69797645

Pulled By: NickGerleman

fbshipit-source-id: 97499621f3dd735d466f5119e0f2a0eccf1c3c05
2025-02-19 14:51:19 -08:00
Samuel Susla d50a3b4433 do not call RCTUnsafeExecuteOnMainQueueSync with a lock in RCTWindowSafeAreaProxy (#49540)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49540

changelog: [internal]

it is dangerous to call RCTUnsafeExecuteOnMainQueueSync while holding a lock. We can avoid that by keeping only the checks into shared state under a lock and rest is without lock.

This also aligns implementation with other proxy objects.

Reviewed By: javache

Differential Revision: D69856171

fbshipit-source-id: 5f7fd1ebeb642796169d77a437fbc215c3c59795
2025-02-19 14:47:18 -08:00
Dark Knight a1952b6fb7 Revert D69836482: Multisect successfully blamed "D69836482: [react-native][PR] Make RCTLog & ExceptionDataHelper internal" for one build failure
Summary:
This diff reverts D69836482
D69836482: [react-native][PR] Make `RCTLog` & `ExceptionDataHelper` internal by cortinico causes the following build failure:

Tests affected:
- [automation_twilight_x86_debug](https://www.internalfb.com/intern/test/562950071241129/)

Here's the Multisect link:
https://www.internalfb.com/multisect/21397772
Here are the tasks that are relevant to this breakage:
T215694436: Some CI signals failing for oculus_twilight

The backout may land if someone accepts it.

If this diff has been generated in error, you can Commandeer and Abandon it.

bypass-github-export-checks

Reviewed By: cortinico

Differential Revision: D69860031

fbshipit-source-id: dedaba77f77467eebad279076add13bfcde45ef0
2025-02-19 11:47:35 -08:00
Mateo Guzmán 0c1e9ea983 Make DefaultDevSupportManagerFactory, InspectorFlags & JSDebuggerWebSocketClient internal (#49506)
Summary:
As part of the initiative to reduce the public API surface, this classes can be internalized. I've checked there are no relevant OSS usages:

- [DefaultDevSupportManagerFactory](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+NOT+repo%3AMaxdev18%2Fpowersync_app+NOT+repo%3Acarter-0%2Finstagram-decompiled+NOT+repo%3Am0mosenpai%2Finstadamn+NOT+repo%3AA-Star100%2FA-Star100-AUG2-2024+NOT+repo%3Alclnrd%2Fdetox-scrollview-reproductible+NOT+repo%3ADionisisChytiris%2FWorldWiseTrivia_Main+NOT+repo%3Apast3l%2Fhi2+NOT+repo%3AoneDotpy%2FCaribouQuest+NOT+repo%3Abejayoharen%2Fdailytodo+NOT+repo%3Amolangning%2Freversing-discord+NOT+repo%3AScottPrzy%2Freact-native+NOT+repo%3Agabrieldonadel%2Freact-native-visionos+NOT+repo%3AGabriel2308%2FTestes-Soft+NOT+repo%3Adawnzs03%2FflakyBuild+NOT+repo%3Acga2351%2Fcode+NOT+repo%3Astreeg%2Ftcc+NOT+repo%3Asoftware-mansion-labs%2Freact-native-swiftui+com.facebook.react.devsupport.DefaultDevSupportManagerFactory)
- [InspectorFlags](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+NOT+repo%3AMaxdev18%2Fpowersync_app+NOT+repo%3Acarter-0%2Finstagram-decompiled+NOT+repo%3Am0mosenpai%2Finstadamn+NOT+repo%3AA-Star100%2FA-Star100-AUG2-2024+NOT+repo%3Alclnrd%2Fdetox-scrollview-reproductible+NOT+repo%3ADionisisChytiris%2FWorldWiseTrivia_Main+NOT+repo%3Apast3l%2Fhi2+NOT+repo%3AoneDotpy%2FCaribouQuest+NOT+repo%3Abejayoharen%2Fdailytodo+NOT+repo%3Amolangning%2Freversing-discord+NOT+repo%3AScottPrzy%2Freact-native+NOT+repo%3Agabrieldonadel%2Freact-native-visionos+NOT+repo%3AGabriel2308%2FTestes-Soft+NOT+repo%3Adawnzs03%2FflakyBuild+NOT+repo%3Acga2351%2Fcode+NOT+repo%3Astreeg%2Ftcc+NOT+repo%3Asoftware-mansion-labs%2Freact-native-swiftui+com.facebook.react.devsupport.InspectorFlags)
- [JSDebuggerWebSocketClient](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+NOT+repo%3AMaxdev18%2Fpowersync_app+NOT+repo%3Acarter-0%2Finstagram-decompiled+NOT+repo%3Am0mosenpai%2Finstadamn+NOT+repo%3AA-Star100%2FA-Star100-AUG2-2024+NOT+repo%3Alclnrd%2Fdetox-scrollview-reproductible+NOT+repo%3ADionisisChytiris%2FWorldWiseTrivia_Main+NOT+repo%3Apast3l%2Fhi2+NOT+repo%3AoneDotpy%2FCaribouQuest+NOT+repo%3Abejayoharen%2Fdailytodo+NOT+repo%3Amolangning%2Freversing-discord+NOT+repo%3AScottPrzy%2Freact-native+NOT+repo%3Agabrieldonadel%2Freact-native-visionos+NOT+repo%3AGabriel2308%2FTestes-Soft+NOT+repo%3Adawnzs03%2FflakyBuild+NOT+repo%3Acga2351%2Fcode+NOT+repo%3Astreeg%2Ftcc+NOT+repo%3Asoftware-mansion-labs%2Freact-native-swiftui+com.facebook.react.devsupport.JSDebuggerWebSocketClient)

## Changelog:

[INTERNAL] - Make DefaultDevSupportManagerFactory, InspectorFlags & JSDebuggerWebSocketClient internal

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

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

Reviewed By: cortinico

Differential Revision: D69811993

Pulled By: mdvacca

fbshipit-source-id: fef52de8c9c0d15b8efd3c5dd785be4e045d2d63
2025-02-19 11:32:31 -08:00
Samuel Susla 470bc40889 remove use of RCTUnsafeExecuteOnMainQueueSync and main thread setup from RCTDeviceInfo (#49478)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49478

changelog: [internal]

Move all main thread resources that RCTDeviceInfo needs to RCTKeyWindowValuesProxy class. That way, RCTDeviceInfo does not needs to use RCTUnsafeExecuteOnMainQueueSync and doesn't require main thread setup.

Reviewed By: javache

Differential Revision: D69747829

fbshipit-source-id: e8280d2f50258ee59043b5c3865b8a95496be8b6
2025-02-19 10:29:24 -08:00
Samuel Susla c5b926b57b move RCTAccessibilityManager away from main thread initialization (#49477)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49477

changelog: [internal]

Move all main thread resources from RCTAccessibilityManager to a proxy object: RCTInitialAccessibilityValuesProxy

Reviewed By: javache

Differential Revision: D69747648

fbshipit-source-id: 5ac717b397985545c5ce2cc92ad98d69b95f52ea
2025-02-19 10:29:24 -08:00
Rob Hogan cdaa1aa9aa community-cli-plugin: resolve cli-server-api via peer dependency on cli (#49518)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49518

`react-native/community-cli-plugin` depends on `createDevServerMiddleware` from `react-native-community/cli-server-api`.

`react-native/community-cli-plugin` currently [declares an optional peer dependency](https://github.com/facebook/react-native/blob/bae895500052bda2f55e1832b0c8a63a1b449de3/packages/community-cli-plugin/package.json#L39-L45) on `react-native-community/cli-server-api`, however because the latter isn't a dependency of `react-native` or the community template, the peer dependency is not available to package managers that enforce isolated node_modules - see https://github.com/facebook/react-native/issues/47309.

Rather than add an unnecessary dependency to the template (like [this](https://github.com/react-native-community/template/pull/105)), my proposal is to switch to a peer dependency on only `react-native-community/cli`, because that *is* a dependency of the community template and therefore will be resolvable.

Because `react-native-community/cli` doesn't re-export `createDevServerMiddleware` from its dependency on `cli-server-api`, we need to resolve the latter through the former. This can be cleaned up once a re-export lands - https://github.com/react-native-community/cli/pull/2605.

Changelog:
[GENERAL][FIXED] Fix registering of `start` and `bundle` commands with community CLI and isolated node_modules.

Reviewed By: huntie

Differential Revision: D69848688

fbshipit-source-id: 009b8ffd43b2ab2d84fcc71e9e48382eb8950bb1
2025-02-19 10:11:03 -08:00
Samuel Susla 0f8ef32830 initialise RN proxy object in bridge (#49527)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49527

changelog: [internal]

fix a deadlock when app that doesn't use bridgeless uses UIKit proxy objects.

Reviewed By: jeffreyporter, Dawn-Top

Differential Revision: D69855097

fbshipit-source-id: a158daa2a6de1a0aebfb9fbf3d758ffa3afec7be
2025-02-19 09:29:26 -08:00
Andrew Datsenko e85d70c8ac Create a CMake executable target (#49526)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49526

Changelog: [Internal]

Introduce a binary tester for Fantom that will be used in runner when ready so OSS can run integration tests.

Here:
- Add BUCK target
- Add CMake target

Reviewed By: cortinico

Differential Revision: D69800975

fbshipit-source-id: 57e135e2a1cbfb88e0141ddc7859b9a29365ee1f
2025-02-19 09:15:07 -08:00
Dawid Małecki 3f9e474d23 Align Flow to TS types in Modal (#49521)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49521

Changelog:
[Internal] - Aligned types of the Modal between Flow and iOS

Reviewed By: huntie

Differential Revision: D69786560

fbshipit-source-id: 3bf0999db5ad57a1b9b9dd95f2b77c994fe3af6e
2025-02-19 09:12:45 -08:00
Vitali Zaidman 1a9ec07477 warn when user tries to open DevTools, when not in debug mode (#49499)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49499

Changelog:
[General][Internal] - warn when user tries to open DevTools, when not in debug mode

Reviewed By: huntie

Differential Revision: D69784836

fbshipit-source-id: aa60762f08f5dea1f91f4fd1ffc86eeb7f94e2fc
2025-02-19 08:52:05 -08:00
Mateo Guzmán 4bafd4734e Migrate ViewManagerResolver & UIManagerModuleListener to Kotlin (#49501)
Summary:
Migrate two more `com.facebook.react.uimanager` interfaces to Kotlin

## Changelog:

[INTERNAL] - Migrate ViewManagerResolver & UIManagerModuleListener to Kotlin

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

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

Reviewed By: rshest

Differential Revision: D69836273

Pulled By: cortinico

fbshipit-source-id: cbdddc1ecf432127426fc07a9df6ed824db63e73
2025-02-19 07:30:31 -08:00
Samuel Susla 236db59a26 Introduce EventBeat::unstable_setInduceCallback to batch sync state updates (#49520)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49520

changelog: [internal]

Adds a new callback to EventBeat that is triggered in EventBeat::induce (that is when the UI thread is about to go IDLE). This will make state updates applied synchronously before the OS has a chance to paint but they will be batched. If two state updates happen in single UI tick, the will be executed at the end of UI's run loop.

The state updates are still not batched into a single commit. If two state updates happen on the same component, they are coalesced. If two state updates happen on two different components, they will generate two transactions. This is a follow up optimisation.

This feature is hidden behind `ReactNativeFeatureFlags::enableSynchronousStateUpdates` which is a preexisting feature flag. The feature flag was not rolled out yet and is not being used in any QEs at the moment.

Reviewed By: rubennorte

Differential Revision: D69848997

fbshipit-source-id: 870fd21f1d9d73d84861ddeac95b932a7fe1f5fe
2025-02-19 07:10:22 -08:00
Mateo Guzmán e5f08c7ae0 Make RCTLog & ExceptionDataHelper internal (#49502)
Summary:
As part of the initiative to reduce the public API surface, this classes can be internalized. I've checked there are no relevant OSS usages:

- [RCTLog](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+NOT+repo%3AMaxdev18%2Fpowersync_app+NOT+repo%3Acarter-0%2Finstagram-decompiled+NOT+repo%3Am0mosenpai%2Finstadamn+NOT+repo%3AA-Star100%2FA-Star100-AUG2-2024+NOT+repo%3Alclnrd%2Fdetox-scrollview-reproductible+NOT+repo%3ADionisisChytiris%2FWorldWiseTrivia_Main+NOT+repo%3Apast3l%2Fhi2+NOT+repo%3AoneDotpy%2FCaribouQuest+NOT+repo%3Abejayoharen%2Fdailytodo+NOT+repo%3Amolangning%2Freversing-discord+NOT+repo%3AScottPrzy%2Freact-native+NOT+repo%3Agabrieldonadel%2Freact-native-visionos+NOT+repo%3AGabriel2308%2FTestes-Soft+NOT+repo%3Adawnzs03%2FflakyBuild+NOT+repo%3Acga2351%2Fcode+NOT+repo%3Astreeg%2Ftcc+NOT+repo%3Asoftware-mansion-labs%2Freact-native-swiftui+com.facebook.react.util.RCTLog)
- [ExceptionDataHelper](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+NOT+repo%3AMaxdev18%2Fpowersync_app+NOT+repo%3Acarter-0%2Finstagram-decompiled+NOT+repo%3Am0mosenpai%2Finstadamn+NOT+repo%3AA-Star100%2FA-Star100-AUG2-2024+NOT+repo%3Alclnrd%2Fdetox-scrollview-reproductible+NOT+repo%3ADionisisChytiris%2FWorldWiseTrivia_Main+NOT+repo%3Apast3l%2Fhi2+NOT+repo%3AoneDotpy%2FCaribouQuest+NOT+repo%3Abejayoharen%2Fdailytodo+NOT+repo%3Amolangning%2Freversing-discord+NOT+repo%3AScottPrzy%2Freact-native+NOT+repo%3Agabrieldonadel%2Freact-native-visionos+NOT+repo%3AGabriel2308%2FTestes-Soft+NOT+repo%3Adawnzs03%2FflakyBuild+NOT+repo%3Acga2351%2Fcode+NOT+repo%3Astreeg%2Ftcc+NOT+repo%3Asoftware-mansion-labs%2Freact-native-swiftui+com.facebook.react.util.ExceptionDataHelper)

## Changelog:

[INTERNAL] - Make RCTLog & ExceptionDataHelper internal

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

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

Reviewed By: rshest

Differential Revision: D69836482

Pulled By: cortinico

fbshipit-source-id: 16f37acbd77bf151126bff22a6010201d8174bea
2025-02-19 06:56:03 -08:00
Pieter De Baets 6c8ace9b05 Simplify MapBuffer constructor (#49492)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49492

Was looking at more places we could be using `HybridClassBase`, and figured out how to simplify ReadableMapBuffer constructors to remove the need for explicit soloading.

Changelog: [Android][Removed] `RuntimeExecutor` and `RuntimeScheduler` constructors are now private, `MapBufferSoLoader` was removed as no longer required.

Reviewed By: cortinico

Differential Revision: D69776110

fbshipit-source-id: 11eac4c59897a02283e021ac1457ef8299b6f480
2025-02-19 06:11:31 -08:00
Samuel Susla f4927fc03c migrate RCTAppState away from main thread initialization (#49476)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49476

changelog: [internal]

Introduce RCTInitialAppStateProxy to access app initial state in thread safe way.

Reviewed By: javache

Differential Revision: D69745459

fbshipit-source-id: f88a04774e064bf13904183aa3334f93cbcc5283
2025-02-19 05:37:54 -08:00
Samuel Susla 0e540298ae remove requirement for main queue setup for RCTPlatform (#49474)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49474

changelog: [internal]

Can move setup to the background setup:
1. Use RCTTraitCollectionProxy to access current trait collection to check if force touch is available.
2. UIDevice.currentDevice is thread safe and can be read safely from a background thread.

Reviewed By: rshest

Differential Revision: D69744257

fbshipit-source-id: 8857a827c3d3e03a9b2ced15e6970d728693a043
2025-02-19 05:37:54 -08:00
Samuel Susla 29114dd914 migrate RCTAppearance away from RCTUnsafeExecuteOnMainQueueSync and main thread setup (#49473)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49473

changelog: [internal]

Add RCTTraitCollectionProxy which synchronises access to current trait collection. This way, RCTAppearance does not need main thread setup and RCTUnsafeExecuteOnMainQueueSync

Reviewed By: javache

Differential Revision: D69750211

fbshipit-source-id: 8457904fa1672d4bf811c04ef69969a8f8f4d87f
2025-02-19 05:37:54 -08:00
Jakub Piasecki bae8955000 Align press and scroll events with OSS (#49424)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49424

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D69655561

fbshipit-source-id: c36036a2abb43dd75c41582f2a27e7f9d3509044
2025-02-19 03:43:07 -08:00
Samuel Susla 1705f96322 RCTNetworking does not require main thread setup (#49475)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49475

changelog: [internal]

RCTNetworking does not need main thread setup, it doesn't access any main thread only resources.

Reviewed By: rshest

Differential Revision: D69744400

fbshipit-source-id: 25652c28d178a9e26fa0ede9b03fb87072094fb0
2025-02-19 03:37:26 -08:00
Samuel Susla d69874fa31 reset transformation when crossing ScrollView in Fabric View Culling (#49500)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49500

changelog: [internal]

When crossing ScrollView boundary, cullingContext.transform must be reset to Transform.identity. Views are only culled within scroll view.

Reviewed By: NickGerleman

Differential Revision: D69787820

fbshipit-source-id: 5d502f764a2b1885ee4b49fc0c9ebb9d27de65dd
2025-02-19 03:20:02 -08:00
Nick Gerleman 4fa516987c Filter and Box Shadow Conversion Tests and Fixes (#49418)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49418

This adds some missing validation for negative blurs which should be considered parse error. Unit tests added for the forked props parsing code to validate more generally.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D69628917

fbshipit-source-id: 1451b53cfa673443f01d38bd0097c4e85c83db8b
2025-02-18 18:56:12 -08:00
Nick Gerleman 05856b4681 Wire up native filter parsing (#49505)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49505

I want to go home 😭.

This is not very pretty, while we are both keeping the old path, and trying to keep the props data types undisturbed for now, and support some of the stranger syntax we ended up supporting as inputs to filters.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D69562718

fbshipit-source-id: db8ff2c240b66e93a52ce2ac98e4a9ff2e7aeb4b
2025-02-18 18:56:12 -08:00
Nick Gerleman b91565dc5d Add box shadow examples which use objects and PlatformColor (#49504)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49504

We didn't have these cases before.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D69433955

fbshipit-source-id: 3915b63ec6972412f1882d796ae60035bb5192f3
2025-02-18 18:56:12 -08:00
Nick Gerleman 8a2602fd69 Reland 2: Wire up native box shadow parsing (#49503)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49503

Relanding this change, now checking for the existing of FeatureFlags native module before checking it, with the assumption when the native module is unavailable (legacy arch) we will never do native processing, or even use the SVC.

This aligns with the approach taken in `setupTimers` for the event loop, but is probably not the right long term solution for flags API.

This also inlines a couple fixes originally up the stack, of missing propagation of inline state, and missing the gating in ReactNativeStyleAttributes.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D69804412

fbshipit-source-id: 1f285994132cff75b6845b64cf26fceae37d4c92
2025-02-18 18:56:12 -08:00
David Vacca 3442b3885a Implement getDelegateMethod on ReactPopupMenuManager (#49507)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49507

Implement getDelegateMethod on ReactPopupMenuManager

changelog: [internal] internal

Reviewed By: shwanton

Differential Revision: D69807880

fbshipit-source-id: b0168454b24a1af4e99a46e8c70ebb70162c19d0
2025-02-18 16:43:13 -08:00
Joe Vilches a3b29e1441 Fix inset shadows when blur < spread (#49448)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49448

I noticed that when inset shadows have a smaller blur radius than spread its wrong and there is a gap between the edge of the box and the shadow. I think the outer rect is just defined incorrectly and we should be adjusting the paddingBox as opposed to the innerRect. The innerRect is just the padding box insetted by the spread, so that is why we see gaps if blur < spread

Changelog: [Android][Fixed] - Fix inset boxShadow when blur < spread

Reviewed By: jorge-cab

Differential Revision: D69688508

fbshipit-source-id: 911258edd9a8403c70992800c3e1a5ea044e1f3b
2025-02-18 13:11:53 -08:00
Samuel Susla 7f6fe61299 migrate RCTSafeArea away from RCTUnsafeExecuteOnMainQueueSync (#49440)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49440

changelog: [internal]

move away from RCTUnsafeExecuteOnMainQueueSync in RCTSafeArea.

Reviewed By: javache, lenaic

Differential Revision: D69662510

fbshipit-source-id: c68e42d6787b1a60ecba46d774ada40163de83fe
2025-02-18 10:05:42 -08:00
Pieter De Baets 1954f166c9 Consolidate mode files in xplat/mode/react-native (#49463)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49463

We've started accumulating mode-files in many different directories, group them all under xplat/mode/react-native for consistency

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D69658995

fbshipit-source-id: 70c842d24886b9b0ef8432d105ca64cac68078db
2025-02-18 09:40:15 -08:00
Dawid Małecki 8beae3ba52 Align types of the Libraries/PushNotificationIOS between Flow and TS (#49266)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49266

Changelog:
[Internal] - Aligned types of the PushNotificationIOS between Flow and TS

Reviewed By: huntie

Differential Revision: D69309391

fbshipit-source-id: 1e99f6aa6805c25db7ede6c65305b309590ebd6a
2025-02-18 09:03:55 -08:00
Nicola Corti e41887e62f Add support for Gradle Configuration caching (#49484)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49484

This is the last diff to add support for Gradle Configuration caching.
The last missing part here was the execution of the `config` command during Gradle configuration time.
Using Java processes API is not supported as the correct way to do external commands that are CC-friendly
is through the `.providers.exec` API which I'm using here.

Closes https://github.com/facebook/react-native/issues/45154

Changelog:
[Android] [Added] - Add support for Gradle Configuration caching

Reviewed By: cipolleschi

Differential Revision: D69753889

fbshipit-source-id: af1e844b38444659a908abce4029d43ad899c03d
2025-02-18 08:26:34 -08:00
Nicola Corti db679f7a20 Remove unused Gradle task packageReactNdkLibsForBuck (#49493)
Summary:
This task is unused, so we can safely remove it here.

## Changelog:

[INTERNAL] - Remove unused Gradle task `packageReactNdkLibsForBuck`

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

Test Plan: N/A

Reviewed By: cipolleschi

Differential Revision: D69781945

Pulled By: cortinico

fbshipit-source-id: cd6487faf1d169f44590a26c18a9f35eef803617
2025-02-18 08:23:59 -08:00
Jakub Piasecki ce84922236 Convert DevMenu to use exports syntax (#49491)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49491

Changelog: [General][Breaking] Deep imports to modules inside `Libraries/DevMenu` using `require` may need to be appended with `.default`

Reviewed By: cortinico

Differential Revision: D69778671

fbshipit-source-id: 19362fbb003e53609881fc19e8d2cb96677b3006
2025-02-18 08:18:58 -08:00
Mateo Guzmán 7f1edbdcb5 Migrate ReactClippingViewGroup to Kotlin (#49413)
Summary:
Migrate com.facebook.react.uimanager.ReactClippingViewGroup to Kotlin

## Changelog:

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

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

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

Reviewed By: rshest

Differential Revision: D69750532

Pulled By: cortinico

fbshipit-source-id: 50ec87a71b3bd523e1a9518b8bd683a027a4b422
2025-02-18 07:57:24 -08:00
Jakub Piasecki ebbb241bf8 Align layout event names with OSS (#49423)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49423

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D69655570

fbshipit-source-id: bd9b3dbc70b93c5be49e6a2b1b0487d11bf5b3f1
2025-02-18 07:26:13 -08:00
Samuel Susla b586f35292 ship fix for view commands race everywhere (#49465)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49465

changelog: [internal]

Reviewed By: rubennorte

Differential Revision: D69744911

fbshipit-source-id: 27e24bb8f16ed4dd3f72bb9125332d208f39ad67
2025-02-18 05:22:17 -08:00
Zhi Zhou 789ed7d5ad fix: iOS app crash caused by the request operation canceling (#48350)
Summary:
Currently we observed many iOS app crashes caused by the `[RCTFileRequestHanlder invalidate]` method, just as the below screenshot.
<img width="1008" alt="image" src="https://github.com/user-attachments/assets/d2d6714f-63d9-40ae-8de5-742cfe718a36" />

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[IOS] [FIXED] - app crash caused by the `[RCTFileRequestHanlder invalidate]` method

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[IOS] [FIXED] - app crash caused by the `[RCTFileRequestHanlder invalidate]` method

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

Test Plan: I am not able to reproduce this issue locally either, so the changes in this PR are totally from my inference, I am not sure if it really makes sense, so please help take a deeper look, thanks.

Reviewed By: javache

Differential Revision: D69751695

Pulled By: cipolleschi

fbshipit-source-id: aa4654a30f5dfac99b72ed1bda0dae1e0dc881c9
2025-02-18 05:03:27 -08:00
Samuel Susla 944d8e6f3c remove redundant main thread dispatch in RCTDeviceInfo (#49479)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49479

changelog: [internal]

Notification UIApplicationDidBecomeActiveNotification is always delivered on the main thread, no need for dispatch.

Reviewed By: javache

Differential Revision: D69750103

fbshipit-source-id: 070fa7f95d8ecddff5d56ba317c8ed4f0ad880f8
2025-02-18 05:01:03 -08:00
Mateo Guzmán 0c4855afae Migrate RuntimeScheduler & RuntimeExecutor to Kotlin (#49485)
Summary:
Converting to Kotlin two classes from `com.facebook.react.bridge`

## Changelog:

[INTERNAL] - Migrate RuntimeScheduler & RuntimeExecutor to Kotlin

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

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

Reviewed By: sammy-SC

Differential Revision: D69775060

Pulled By: javache

fbshipit-source-id: 93f352be8b56876f99f86119e4c6a9636017a581
2025-02-18 04:00:05 -08:00
Dawid Małecki 71bd096136 Add PermissionsAndroid to buildTypes and align Flow with TS types (#49352)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49352

Changelog:
[Internal] - Added PermissionsAndroid to buildTypes and align Flow with TS types.

Reviewed By: huntie

Differential Revision: D69464744

fbshipit-source-id: 31591b2069d25a20bff569b296dcbda88d9f2148
2025-02-18 01:20:26 -08:00
Jakub Piasecki 91edb9c184 Align LayoutAnimation types with OSS (#49467)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49467

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D69745571

fbshipit-source-id: 4c27b6c22126a2c8b0965e1a88f9dc310e5ff77c
2025-02-18 01:10:02 -08:00
Alex Hunt cda2d11c16 Split index.js types into index.js.flow (#49470)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49470

Adds a `packages/react-native/index.js.flow` file.

**Motivation**

This is on the critical path to generating TypeScript types, and a full API snapshot, from `index.js.flow`.

As we iterate, this new file will move to closely matching `types/index.d.ts` by adding type exports (missing today) — giving us an equivalent public API in both languages.

**Motivation for this pattern**

Having a type index file:

- Will become the entry point for `yarn build-types`.
- Enables us to bypass the `module.exports` pattern in `index.js` without a runtime breaking change.
    - This pattern is preferable because:
        - 1/ Aligns with existing manual TypeScript definitions (i.e. these are **already restricted** to `import` syntax in user code)
        - 2/ Allows doc comments on original types to propagate to IDEs/users.

**Implementation notes**

NOTE: This diff has **no effect** on compiled code at runtime, and **no effect** on the current manual TypeScript API of `react-native`. It only has an effect on Flow usage in fbsource — most of which are deep type imports today.

- Exports are grouped and sorted identically to each pre-existing getter in `index.js`.

Changelog: [Internal] - Redefine root `react-native` type exports, affecting Flow usages only

Reviewed By: rubennorte

Differential Revision: D69659837

fbshipit-source-id: c65e30d1ac5c4f322cfde9335dbee80a8c9efda8
2025-02-17 13:57:48 -08:00
Rubén Norte e57cd0916c ] Fix native module check when not using batched bridge (#49483)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49483

Changelog: [internal]

Reviewed By: fabriziocucci

Differential Revision: D69753755

fbshipit-source-id: fe267ed60b5f7d6baac7dee5d7be0f733b34e9e9
2025-02-17 12:49:32 -08:00
Sunny Luo 3a4798cc30 fix: Inconsistency SVG Handling between bundle command and Image.resolveAssetSource (#49452)
Summary:
ref: https://github.com/facebook/react-native/pull/28266

Currently, SVG is not recognized as an image in the CLI bundle command, as defined in [assetPathUtils.js](https://github.com/facebook/react-native/blob/main/packages/community-cli-plugin/src/commands/bundle/assetPathUtils.js#L43-L50) . This is the correct behavior, as it ensures that SVG files are copied to the raw folder for Android resources.

However, there is an inconsistency with Image.resolveAssetSource, which does not follow the same classification. Instead, it resolves SVG assets to the drawable folder, leading to blank svg rendering errors in some scenario (codepush).

## Changelog

[Android][Fixed] - getAndroidResourceFolderName() should return raw folder for svg file

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

Test Plan:
1. Use svg file this way `<LocalSvg asset={require('./react-logo.svg')} />`
2. Use `react-native bundle` command to make a bundle and sideload that bundle from sdcard. The svg file should render correctly.

Reviewed By: cortinico

Differential Revision: D69750779

Pulled By: Abbondanzo

fbshipit-source-id: 3af8d4a5da07213cdbb968b070d2507ed897d194
2025-02-17 11:04:39 -08:00
Ruslan Lesiutin 13dae0601d Record React Native process (#49370)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49370

# Changelog: [Internal]

When we start tracing, we will record metadata event for current process.

We will base it off the assumption that the thread where we handle `Tracing.start` event is the main one.

We can't register the main thread yet:
1. We can't assume that CDP messages are handled on it - this is not the case for Windows and in a long term Inspector will be moved to its own thread
2. We don't have any similar mechanism as Runtime Executor, but for Main thread. This will require Host providing an executor for it.

I've validated at the top of the stack that not registering the main thread should not affect how trace is displayed in CDT.

Reviewed By: rozele

Differential Revision: D69465926

fbshipit-source-id: 103de1da9d00564bf201456ad04a465387c1d542
2025-02-17 09:34:33 -08:00
Ruslan Lesiutin acebebfd21 Expose API for registering processes and threads (#49083)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49083

# Changelog: [Internal]

> NOTE: Some CI jobs are expected to fail, because changes in Hermes D67353585 should be landed first, and then grafted to Static Hermes.

Added 2 new public methods to `PerformanceTracer` instance for registering metadata Trace Events for processes and threads.

Reviewed By: huntie

Differential Revision: D68439733

fbshipit-source-id: dd9f0e72e2414b8c665c57a542cbbfe7df34a516
2025-02-17 09:34:33 -08:00
Ruslan Lesiutin 71f0b4d5a0 Use real process id and thread ids (#49309)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49309

# Changelog: [Internal]

Use newly added module to get real OS-level process and thread ids.

We will keep process id on an instance, because I don't think it could change over time? For thread id, we will get it at the time of event registration.

Reviewed By: rozele

Differential Revision: D69316094

fbshipit-source-id: e12f2ea147ee8bf5a0a13ef293b8d85a0b64fc02
2025-02-17 09:34:33 -08:00