Commit Graph

9174 Commits

Author SHA1 Message Date
Iwo Plaza 7aef81b984 Migrate Utilities/infoLog, Utilities/logError, Utilities/mapWithSeparator & Utilities/warnOnce to use export syntax (#49406)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49406

## Motivation
Modernising the RN codebase to allow for modern Flow tooling to process it.

## This diff
- Migrates Utilities/infoLog, Utilities/logError, Utilities/mapWithSeparator & Utilities/warnOnce 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 `Utilities/infoLog`, `Utilities/logError`, `Utilities/mapWithSeparator` or `Utilities/warnOnce` with `require` syntax need to be appended with '.default'.

Reviewed By: huntie

Differential Revision: D69601174

fbshipit-source-id: 821f9ae59d4f898c95631eb7a9aeed138ace3567
2025-02-13 11:16:27 -08:00
Iwo Plaza 152587cda0 Migrate Utilities/binaryToBase64, Utilities/DevSettings, Utilities/PolyfillFunctions & Utilities/RCTLog to use export syntax (#49403)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49403

## Motivation
Modernising the RN codebase to allow for modern Flow tooling to process it.

## This diff
- Migrates `Utilities/binaryToBase64`, `Utilities/DevSettings`, `Utilities/PolyfillFunctions` & `Utilities/RCTLog` 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 `Utilities/binaryToBase64`, `Utilities/DevSettings`, `Utilities/PolyfillFunctions` or `Utilities/RCTLog` with `require` syntax need to be appended with '.default'.

Reviewed By: huntie

Differential Revision: D69600476

fbshipit-source-id: 3f8ac3a35031e8b20446abc8f52a2817cb31b6d2
2025-02-13 11:13:25 -08:00
Iwo Plaza 827a847791 Migrate Utilities/BackHandler.*.js, Utilities/DevLoadingView.js and Utilities/HMRClient*.js to use export syntax (#49369)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49369

## Motivation
Modernising the RN codebase to allow for modern Flow tooling to process it.

## This diff
- Migrates `Libraries/Utilities/BackHandler.*.js`, `Utilities/DevLoadingView.js` and `Utilities/HMRClient*.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 `Libraries/Utilities/BackHandler`, `Utilities/DevLoadingView.js` or `Utilities/HMRClient*.js` with `require` syntax needs to be appended with '.default'.

Reviewed By: huntie

Differential Revision: D69539527

fbshipit-source-id: c10b3523bbcc52bba5b6c27721c33b1e0d9d5104
2025-02-13 10:41:17 -08:00
David Vacca 6632d30678 Remove legacy codegen of $PropSetter classes for ShadowNode classes on apps running on new architecture by default (#49405)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49405

This diff removes legacy codegen of $PropSetter classes for ShadowNode classes when the app has UNSTABLE_ENABLE_MINIFY_LEGACY_ARCHITECTURE enabled

These classes are not used in the new architecture, let's just remove them from the apk.

This change won't affect OSS

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D69569205

fbshipit-source-id: 178051b9f10576226fd746f9eab1b56b2934ea0b
2025-02-13 10:31:42 -08:00
David Vacca a43c6b15bb Remove legacy codegen of $PropSetter classes for ViewManagers that are migrated to new architecture (#49404)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49404

This diff disables codegen of legacy $PropSetter for viewManagers that implement the interface com.facebook.react.uimanager.ViewManagerWithGeneratedInterface.

This logic will only be enabled for apps that are configured with BuildConfig.UNSTABLE_ENABLE_MINIFY_LEGACY_ARCHITECTURE = true

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D67412734

fbshipit-source-id: 682725714dc41f5f34d95d4d9a13ab09726b28f7
2025-02-13 10:31:42 -08:00
Alan Lee 141fb23bba fix Modal crash when calling syncSystemBarsVisibility() (#49386)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49386

It appears that `currentActivity.decorView` sometime is not attached to a window during the process of creating a Dialog for currently unknown reasons causing a crash.
Add check to skip call to `syncSystemBarsVisibility()` in such case as current code cannot function without valid RootWindowInsets.

Changelog:
[Android][Fixed] - fixed crash with Modal when trying to call syncSystemBarsVisibility()

Reviewed By: cortinico

Differential Revision: D69578581

fbshipit-source-id: de23e2ba9f485e38b7014dd7151253e56976ad43
2025-02-13 10:25:42 -08:00
Dawid 6b2c40c64f Fix(iOS): onPress fails for Text with nested View (#49393)
Summary:
On the new architecture the `RCTParagraphTextView` is used to draw text on iOS but React doesn't know about it. The hit test stops propagation on the first encountered  UIView of this type. The suggested solution is to add a dummy hit test for `RCTParagraphTextView` that returns always `null`, allowing further search of the touch target.

## 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 onPress for Text with nested View.

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

Test Plan:
| Before       | After        |
|--------------|--------------|
|<video src="https://github.com/user-attachments/assets/745f555a-d4b6-4285-91a7-0e9ea9f43d84"> | <video src="https://github.com/user-attachments/assets/9896848f-13ca-4b57-bcc9-bead478ab078">  |

<details>
 <summary>code</summary>

```ts
import {SafeAreaView, StyleSheet, Text, View, findNodeHandle} from 'react-native';

function App() {
  return (
    <SafeAreaView style={styles.container}>
      <Text
        ref={e => console.log(`Outer Text: ${findNodeHandle(e)}`)}
      >
        With Nested View
        <View ref={e => console.log(`View: ${findNodeHandle(e)}`)}>
          <Text
            ref={e => console.log(`Inner Text: ${findNodeHandle(e)}`)}
            onPress={() => {
              console.log('1. text pressed');
            }}
            style={styles.pressableText}
          >
            Pressable Text
          </Text>
        </View>
      </Text>
      <Text>
        Without Nested View
        <Text
          onPress={() => {
            console.log('2. text pressed');
          }}
          style={styles.pressableText}
        >
          Pressable Text
        </Text>
      </Text>
    </SafeAreaView>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    gap: 10,
  },
  pressableText: {
    fontSize: 18,
    color: 'blue',
    backgroundColor: 'transparent',
  },
  nestedView: {
    backgroundColor: 'red',
    height: 100,
  },
  pressable: {
    backgroundColor: 'blue',
    height: 100,
    width: 100,
  },
});

export default App;

```

</details>

Reviewed By: cipolleschi

Differential Revision: D69591520

Pulled By: coado

fbshipit-source-id: eb75c2d8a01a82d4493a1a982e98ca74efc9d94f
2025-02-13 10:17:40 -08:00
Oskar Kwaśniewski 31a8bb386d feat: add jsitooling package (#49348)
Summary:
> [!NOTE]
> This PR is part of JavaScriptCore Extraction to this repository: https://github.com/react-native-community/javascriptcore

This PR adds `jsitooling` package that third party JS engines can use (in that case javascriptcore). It's required because React-Runtime needs to depend on third-party engine on iOS, and the third-party engine needed to depend on React-Runtime to get access to the `JSRuntimeFactory` and Cocoapods doesn't support circular dependencies...

Now third-party engine can depenend on jsitooling package and provide JSRuntimeFactory

## Changelog:

[INTERNAL] [ADDED] - jsitooling package

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

Test Plan: CI Green

Reviewed By: cortinico

Differential Revision: D69535475

Pulled By: cipolleschi

fbshipit-source-id: f8d68b7957b7d69c13246ce3040a08256f2ebcd6
2025-02-13 08:49:42 -08:00
Nicola Corti d8b95044d2 Cleanup react-native-info package (#49364)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49364

We're not actively using/maintaining this package. Let's clean it up.
We can still restore if necessary.

Changelog:
[Internal] [Changed] -

bypass-github-export-checks

Reviewed By: cipolleschi

Differential Revision: D69533629

fbshipit-source-id: 940057df9a5fffa738435c92136e95a764ec98ff
2025-02-13 06:54:50 -08:00
Oskar Kwaśniewski 7dc85d0e97 feat(ios): encapsulate device info listeners (#49162)
Summary:
This PR encapsulates device info listeners removing additional logic from RCTAppDelegate which is a prerequisite for https://github.com/facebook/react-native/pull/49078

Now we use KVO (Key Value Observation) to listen to window size changes making this module's logic encapsulated + allows to use it in brownfield scenarios.

To keep backward compatibility RCTDeviceInfo still emits `RCTWindowFrameDidChangeNotification`

## Changelog:

[IOS] [ADDED] - encapsulate device info listeners

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

Test Plan: Check if window size change listener is fired

Reviewed By: sammy-SC

Differential Revision: D69116660

Pulled By: cipolleschi

fbshipit-source-id: b9a57c70826b10cd27d102337eb1e35da1b365c9
2025-02-13 06:28:44 -08:00
Alex Hunt f9bffef6c7 Remove Remote Debugging logs check (#49391)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49391

Further cleanup of Remote JS Debugging.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D69589296

fbshipit-source-id: 78c916d9419d839f01b8f31726d59fe9b7c970b7
2025-02-13 05:11:35 -08:00
Jakub Piasecki 88fc9a3415 Align AppState types with TypeScript definitions (#49248)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49248

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D69176965

fbshipit-source-id: ffc82068dcf1451b858c3465c40f22427d4dd158
2025-02-13 04:14:15 -08:00
Jakub Piasecki 4f20362b07 Migrate files in Libraries/StyleSheet to use export syntax (#49303)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49303

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

Reviewed By: huntie

Differential Revision: D69400980

fbshipit-source-id: 053f40a8677ac877b93c27e87422ea0ef540c272
2025-02-13 03:45:13 -08:00
Mateo Guzmán 04b40852fa Make BlackHoleEventDispatcher & InterpolatorType internal (#49380)
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:

- [BlackHoleEventDispatcher](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+com.facebook.react.uimanager.events.BlackHoleEventDispatcher)
- [InterpolatorType](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+com.facebook.react.uimanager.layoutanimation.InterpolatorType)

## Changelog:

[INTERNAL] - Make BlackHoleEventDispatcher & InterpolatorType internal

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

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

Reviewed By: cortinico

Differential Revision: D69558346

Pulled By: arushikesarwani94

fbshipit-source-id: 48b2f267f3efb78c6d66a67fb94c2d3271558df0
2025-02-13 02:46:39 -08:00
Vitali Zaidman b0974135bf increase ping-pong timeout before killing WS connection to DevTools (#49358)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49358

When the network is under strain, the code responsible for detecting if the inspector proxy's connection to the client has been lost may incorrectly assume the connection is dead. This false positive occurs because the system assumes that if a pong is not received within 5 seconds of a ping, the other side has disconnected. However, I was able to consistently reproduce scenarios where a delay of more than 5 seconds (even more than 20 seconds) was followed by a return to normal ping-pong communication without any issues.

Since I can't think of any issues with increasing this number, I'm increasing it to 60s.

Changelog:
[General][Fixed] - Disconnections of DevTools when the network is under significant strain.

Reviewed By: robhogan, huntie

Differential Revision: D69523906

fbshipit-source-id: 50db1e7bbe690b42421bc226aa30fd6571ba2257
2025-02-12 23:45:01 -08:00
Panos Vekris 413730ecb3 Back out "Deploy 0.261.0 to xplat"
Summary:
Original commit changeset: cf5953b1afc2

Original Phabricator Diff: D69562137

Reviewed By: SamChou19815

Differential Revision: D69570236

fbshipit-source-id: 7cfa9cf51aa3662d4339e020f8ae5065c8f5c358
2025-02-12 19:14:21 -08:00
Sam Zhou 9a401c8103 Deploy 0.261.0 to xplat
Summary: Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D69562137

fbshipit-source-id: cf5953b1afc242bf2571ad7c4362ef9485d8e846
2025-02-12 18:12:54 -08:00
Nick Gerleman 1663dc1978 Back out "Back out "[RN][CSS] Wire up native box shadow parsing"" (#49376)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49376

We can reland this now that D69520832 update feature flags infra.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D69548370

fbshipit-source-id: ec1187dffdca4d9d4064235e9ef6336e66521d26
2025-02-12 16:59:44 -08:00
Mateo Guzmán 1d8021d821 Fix up KDoc annotations post Kotlin migrations (#49375)
Summary:
When generating documentation using dokka, I found out that some references to classes in the comments were not linking correctly anymore after the files were migrated to Kotlin. In this PR I'm migrating the JavaDoc `link` references to Kotlin KDoc `[]` syntax.

## Changelog:

[INTERNAL] - Fix up KDoc annotations post Kotlin migrations

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

Test Plan: Manually review that the references link correctly in the Kotlin files

Reviewed By: arushikesarwani94

Differential Revision: D69549229

Pulled By: mdvacca

fbshipit-source-id: 6b7727f00a28ecfe2fca86948245d1f4e88e935c
2025-02-12 15:37:46 -08:00
David Vacca a0088d9f2b Migrate ReactStage to kotlin (#49378)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49378

Migrate ReactStage to kotlin

changelog: [internal] internal

Reviewed By: arushikesarwani94

Differential Revision: D69544706

fbshipit-source-id: 2c9ddae499f1110a3ed60e9cc02cddc19f4b306f
2025-02-12 15:26:23 -08:00
Jan Kassens 14fcaf9791 cleanup feature flag enableFabricCompleteRootInCommitPhase (#49372)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49372

Changelog: [Internal]

Reviewed By: poteto

Differential Revision: D69473992

fbshipit-source-id: 6ed54f0fab45b95e47afa3ff343de061e7c40ce7
2025-02-12 13:12:07 -08:00
Mateo Guzmán 1b066bac9a Migrate BlobCollector to Kotlin (#49148)
Summary:
Migrate com.facebook.react.modules.blob.BlobCollector to Kotlin

## Changelog:

[INTERNAL] - Migrate com.facebook.react.modules.blob.BlobCollector to Kotlin

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

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

Reviewed By: cortinico, fabriziocucci

Differential Revision: D69522998

Pulled By: javache

fbshipit-source-id: a0255d1cdb51ee1f8aa73a07419e228871e56538
2025-02-12 09:04:48 -08:00
Mateo Guzmán c5b9e8e7d4 Migrate OkHttpClientProvider to Kotlin (#49108)
Summary:
Migrate com.facebook.react.modules.network.OkHttpClientProvider to Kotlin. Also, as follow up from https://github.com/facebook/react-native/pull/48958 I'm cleaning up the reflection on `OkHttpClientProviderTest` as we can make `sClient` and `sFactory` internal.

## Changelog:

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

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

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

Reviewed By: cortinico

Differential Revision: D69050956

Pulled By: javache

fbshipit-source-id: 62dcf8e8f999f3b687c57ed02e9ac1f2db8183ea
2025-02-12 09:04:48 -08:00
Eli White 60e3921f9c Initial Open Sourcing of React Native Compatibility Check (#49340)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49340

This tool enables checking the boundary between JavaScript and Native for
backwards incompatible changes to protect against crashes.

This is useful for:

- Local Development
- Over the Air updates on platforms that support it
- Theoretically: Server Components with React Native

Check out the Readme for more information

Changelog: [General][Added] Open Sourcing React Native's Compatibility Check

Reviewed By: panagosg7

Differential Revision: D69476742

fbshipit-source-id: 8af6039839c5475c1258fa82d9750a9320cf0751
2025-02-12 08:24:13 -08:00
Alex Hunt 0d66c524cf Restore Metro log streaming via CLI flag (#49353)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49353

This change adds an opt-in to restore JavaScript log streaming via the Metro dev server, [removed from React Native core in 0.77](https://reactnative.dev/blog/2025/01/21/version-0.77#removal-of-consolelog-streaming-in-metro).

Users can opt into this legacy behaviour by adding the `--client-logs` flag to `npx react-native-community/cli start`.

- The default experience remains without streamed JS logs.
- The existing "JavaScript logs have moved! ..." notice is printed in all cases, and we do not advertise the new flag for new users.
- Under non-Community CLI dev servers (i.e. Expo), log streaming is restored implicitly.

We will clean up this functionality again when we eventually remove JS log streaming over `HMRClient`, tasked in T214991636.

**Implementation notes**

- Logs are always sent over `HMRClient` (previous status quo), even with log streaming off in the dev server. This is a necessary evil to be able to flag this functionality in a user-accessible place, and to move fast for 0.78.
- Necessarily, emitting `fusebox_console_notice` moves to the dev server itself, on first device (Fusebox) connection.

Changelog:
[General][Added] - Add opt in for legacy Metro log streaming via `--client-logs` flag

Reviewed By: robhogan

Differential Revision: D69469039

fbshipit-source-id: be99d02a3b1c977a59bf7d2726f0e6cf2e60b28a
2025-02-12 07:17:15 -08:00
Pieter De Baets 403719c371 Remove CountingOutputStream (#49275)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49275

This is a copied guava class and is only used in one spot.  Remove it and just count directly in ProgressRequestBody.

Changelog: [Internal]

Reviewed By: Abbondanzo

Differential Revision: D69323277

fbshipit-source-id: 5260004a4431f03733882b6ee83a341d8bf29bb0
2025-02-12 06:21:45 -08:00
Iwo Plaza 2b30aa5cc8 Migrate Libraries/Utilities/differ/*.js to export syntax (#49332)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49332

## Motivation
Modernising the RN codebase to allow for modern Flow tooling to process it.

## This diff
- Migrates `Libraries/Utilities/differ/*.js` to use the export syntax.
- Updates deep-imports of these files to use `.default`
- Updates codegen with a compat layer
- Updates the current iteration of API snapshots (intended).

Changelog:
[General][Breaking] - Deep imports to `Libraries/Utilities/differ/...` with `require` syntax need to be appended with '.default'.

Reviewed By: yungsters

Differential Revision: D69467423

fbshipit-source-id: 2e58a0b9711e9bdf5ca907a5b2252584f6fec9bc
2025-02-12 05:30:20 -08:00
Pieter De Baets 9073817925 Add more test coverage for $ReadOnlyArray<UnsafeMixed> in component codegen (#49349)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49349

Follow-up on D69454101 to add more test coverage for `$ReadOnlyArray<UnsafeMixed>` as a component prop. The new type was missing from the CodegenSchema, which revealed some gaps in tests.

Changelog: [Internal]

Reviewed By: fabriziocucci

Differential Revision: D69488035

fbshipit-source-id: 19895e55e5ec4d89a790f1c388de9eea025a316c
2025-02-12 04:20:08 -08:00
Rubén Norte 96a8a3da48 Only log errors accessing feature flags in JS if the native module itself is not defined (#49350)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49350

Changelog: [internal]

Reviewed By: GijsWeterings

Differential Revision: D69520832

fbshipit-source-id: fb72103705c930eb5f0944c931b4fdeabde841ae
2025-02-12 04:07:10 -08:00
Dawid Małecki bf282146b6 Add UIManager to build-types and align Flow with TS defs (#49322)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49322

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D69241595

fbshipit-source-id: 00dafa499fe70f47395ab363f6565619e1877bae
2025-02-12 02:00:10 -08:00
Tommy Nguyen 7926d656b3 fix: fix @react-native-community/cli-platform-* packages not being found in monorepos (#47308)
Summary:
Fix `react-native-community/cli-platform-*` packages not being found in monorepos.

Note that we are making the assumption that `process.cwd()` returns the project root. This is the same assumption that `react-native-community/cli` makes. Specifically, `findProjectRoot()` has an optional argument that defaults to `process.cwd()`:

- [`findProjectRoot()`](https://github.com/react-native-community/cli/blob/14.x/packages/cli-tools/src/findProjectRoot.ts)
- Which gets called without arguments in [`loadConfig()`](https://github.com/react-native-community/cli/blob/14.x/packages/cli-config/src/loadConfig.ts#L89)
- `loadConfig()` gets called from [`setupAndRun()`](https://github.com/react-native-community/cli/blob/14.x/packages/cli/src/index.ts#L196), also without project root set

As far as I can see, the project root argument is only ever used in tests.

## Changelog:

[GENERAL] [FIXED] - Fix `react-native-community/cli-platform-*` packages not being found in monorepos

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

Test Plan:
1. Clone/check out this branch: https://github.com/microsoft/rnx-kit/pull/3409
2. Cherry-pick https://github.com/facebook/react-native/pull/47304
3. Cherry-pick https://github.com/facebook/react-native/pull/47308
4. Run `react-native config` inside `packages/test-app`
5. Verify that `projects` is populated

**Before:**

```js
  "healthChecks": [],
  "platforms": {},
  "assets": [],
  "project": {}
}
```

**After:**

```js
  "healthChecks": [],
  "platforms": {
    "ios": {},
    "android": {}
  },
  "assets": [],
  "project": {
    "ios": {
      "sourceDir": "/~/packages/test-app/ios",
      "xcodeProject": {
        "name": "SampleCrossApp.xcworkspace",
        "path": ".",
        "isWorkspace": true
      },
      "automaticPodsInstallation": false,
      "assets": []
    },
    "android": {
      "sourceDir": "/~/packages/test-app/android",
      "appName": "app",
      "packageName": "com.msft.identity.client.sample.local",
      "applicationId": "com.msft.identity.client.sample.local",
      "mainActivity": "com.microsoft.reacttestapp.MainActivity",
      "assets": []
    }
  }
}
```

Reviewed By: cortinico

Differential Revision: D69465533

Pulled By: robhogan

fbshipit-source-id: 3d6cf32752a7a41d9c7e84f35b0f26ae7d7a971f
2025-02-12 00:34:32 -08:00
Nick Gerleman d08f9accf0 Back out "Wire up native box shadow parsing" (#49345)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49345

This diff is causing an error to be logged for every user. Even if it's noise, its more trouble than its worth. Let's revert until feature flags check fixed.

Changelog: [Internal]

Reviewed By: makovkastar

Differential Revision: D69504966

fbshipit-source-id: 13caf715cef9a4cc6c9b7c68d3003fbced870d34
2025-02-12 00:11:32 -08:00
Rick Hanlon 578e99a013 Add a healthy number of inital e2e tests (#49338)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49338

This doesn't cover all cases, but is a good start.

Where relevant, I call out inline places where there are KPs with LogBox that will be fixed separately.

## Changelog

Changelog: [internal]

Reviewed By: rubennorte

Differential Revision: D69443040

fbshipit-source-id: 7281f30aa705ae812d5b5f5f9ad03b37358de059
2025-02-11 19:33:07 -08:00
Rick Hanlon 1aa0ddd88b Update fantom test, add helpers (#49337)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49337

*Note: This diff adds helpers and updates the one test we have. The next diff adds a bunch of tests, see that diff for how these helpers are used to scale to a large number of tests.*

-----

## Overview

Adds helpers for the LogBox e2e test to make it easier to write simple, readable, tests with a healthy level of abstraction over the e2e APIs.

## API
The helpers expose an ability to render a component, and return methods to get the UI state:

```
// Returns the LogBox inspector UI as an object.
getInspectorUI: () => ?InspectorUI,

// Returns the LogBox notification UI as an object.
getNotificationUI: () => ?NotificationUI,
```

These return objects that represent the main text elements in the UI like `title` and `message`.

The helpers also provide methods for interacting with the LogBox UI:

```
// True if the LogBox inspector is open.
isOpen: () => boolean,

// Tap the notification to open the LogBox inspector.
openNotification: () => void,

// Tap to close the notification.
dimissNotification: () => void,

// Tap the minimize button to collapse the LogBox inspector.
mimimizeInspector: () => void,

// Tap the dismiss button to close the LogBox inspector.
dismissInspector: () => void,

// Tap the next button to go to the next log.
nextLog: () => void,

// Tap the previous button to go to the previous log.
previousLog: () => void,
```

## Example test
This allows writing tests like:

```
test('should log error', () => {
  const logBox = renderLogBox(<ComponentThatErrors />);

  // Should show notification
  expect(logBox.isOpen()).toBe(false);
  expect(logBox.getNotifciationUI()).toEqual({
    count: '!',
    message: 'error message',
  });

  // Tap the notification
  logBox.openNotification();

  // Should show log
  expect(logBox.isOpen()).toBe(true);
  expect(logBox.getInspectorUI()).toEqual({
    header: 'Log 1 of 1',
    title: 'Console Error',
    message: 'error message',
    stackFrames: [
      'ComponentThatErrors'
    ],
    componentStackFrames: [
      '<ComponentThatErrors />',
    ],
    isDismissable: true,
  });
})
```

## Changelog

Changelog: [internal]

Reviewed By: rubennorte

Differential Revision: D69443041

fbshipit-source-id: c81ccd56a39d01d61814d29515b587096c0509c0
2025-02-11 19:33:07 -08:00
Samuel Susla 00abe54707 account for tunnelled components like Modal in view culling (#49344)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49344

changelog: [internal]

restart culling context when coming across a component like Modal.

Reviewed By: alanleedev

Differential Revision: D69490655

fbshipit-source-id: bda67fd271134dceb2669d9d71c9de3041d085a9
2025-02-11 18:59:28 -08:00
David Vacca 46653fa548 Raise java source and target versions for ReactModuleSpecProcessor from 8 -> 11 (#49342)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49342

Raise java source and target versions for ReactModuleSpecProcessor from 8 -> 11

changelog: [internal] internal

Reviewed By: NickGerleman

Differential Revision: D69478204

fbshipit-source-id: 4059391041443d0418c363c1e627b6d4c38b9ff0
2025-02-11 18:53:05 -08:00
David Vacca 5cb71ef181 Raise source and target version of Prop annotation processor from 7 to 11 (#49343)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49343

Raise source and target version of annotation processor from 7 to 11

This is unused in OSS

changelog: [internal] internal

Reviewed By: NickGerleman

Differential Revision: D69478025

fbshipit-source-id: 28c6ed5889db423c43a36ccee396083ae7e78e5f
2025-02-11 18:53:05 -08:00
Joe Vilches a733930017 Add e2e tests for fixed transform cases (#49318)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49318

tsia see previous diffs for fix. Added more tests to box shadow, filter, and borders

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D69416675

fbshipit-source-id: ae1e33750b56c1a4720e04e29fc110f1e11c0b3d
2025-02-11 15:44:59 -08:00
Nick Gerleman ba4a0cc23e Wire up native box shadow parsing (#49317)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49317

This hooks into `enableNativeCSSParsing()` to optionally bypass viewconfig processor, and lets us parse the raw strings (or objects composed of string) in native.

Right now, to not disturb too much while this is in experimentation, this is  just a facade over existing types and props storage, and we ignore any non-px lengths.

Also need to prepend

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D69337482

fbshipit-source-id: 6093e312e0d1dc1855713da20b72bf75b98af3ea
2025-02-11 13:20:32 -08:00
Nick Gerleman b1bd540045 <react/renderer/css> OSS build logic (#49316)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49316

This hooks up some build logic for `react/renderer/css`. A bit funky right now since header only, and might need to change later (it isn't neccesarily guaranteed to be header only in the future).

Changelog: [Internal]

Reviewed By: cortinico, cipolleschi

Differential Revision: D69426450

fbshipit-source-id: 77e0ef409f34daf003d28a5cd70de935bd180440
2025-02-11 13:20:32 -08:00
Andrew Datsenko 6ec1d9d843 Add .toMatch API (#49328)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49328

Changelog: [Internal]
Add missing `.toMatch` expect API

Reviewed By: rubennorte

Differential Revision: D69462225

fbshipit-source-id: aefe02e6a1f8f15c8c30c26492fa926e7d6e4e8e
2025-02-11 11:21:33 -08:00
Wu Zhong 6a3e275d14 Reland RNTester: Fixes turbo module examples error in bridgeless mode (#49329)
Summary:
Reland https://github.com/facebook/react-native/issues/48362.

## Changelog:

[IOS] [FIXED] - RNTester: Fixes turbo module examples error in bridgeless mode

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

Test Plan: RNTester turbomodule examples in bridgeless can work as expected.

Reviewed By: christophpurrer

Differential Revision: D69463612

Pulled By: cortinico

fbshipit-source-id: 8613b001ebbe64ce0d505f5515bb7a4b6a64dbe7
2025-02-11 10:56:19 -08:00
Qian Wu df3a60293c Revert D69277991: Initial Open Sourcing of React Native Compatibility Check
Differential Revision:
D69277991

Original commit changeset: 886a983d4b17

Original Phabricator Diff: D69277991

fbshipit-source-id: f69d528d87c22d03b0c3e654733c8efa89104df0
2025-02-11 10:35:55 -08:00
Andrew Datsenko 9799e34211 Add .toHaveLength (#49327)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49327

Changelog: [Internal]
Add missing `.toHaveLength` expect API

Reviewed By: rubennorte

Differential Revision: D69241817

fbshipit-source-id: 11c7f314a30fd1db3c00b8665b613d290d50ad81
2025-02-11 10:32:27 -08:00
David Vacca 5444c76433 Configure all feature flags of NewArchitecture on canary (#49333)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49333

The rollout of "new architecture everywhere" should be enabled in OSS canary releases. This diff updates the ReactNativeFeatureFlags.config.js to reflect that all of the feature flags used by the new architecture are enabled by default in experimental and canary releases. Note that these feature flags were already enabled in OSS when new architecture was enabled.

changelog: [internal] internal

Reviewed By: rubennorte, NickGerleman

Differential Revision: D69419662

fbshipit-source-id: 6ecf9e38bb2fd0d3c0f7129ae16fcef8755b5da2
2025-02-11 10:14:02 -08:00
Oskar Kwaśniewski e7de582798 feat(iOS): centralize JS engine dependency configuration (#49297)
Summary:
> [!NOTE]
> This PR is part of JavaScriptCore Extraction to this repository: https://github.com/react-native-community/javascriptcore

This PR centralizes the setup of js engine dependencies which need to be defined when building with dynamic frameworks. This will allow us to change linked framework if using a third party one in the future

## Changelog:

[INTERNAL] [CHANGED] - centralize JS engine dependency configuration

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

Test Plan: CI Green (Build needs to go properly)

Reviewed By: javache

Differential Revision: D69396641

Pulled By: cipolleschi

fbshipit-source-id: deedd12084f563f73f12f8617fdca0a6d680bf5a
2025-02-11 10:03:07 -08:00
Alex Taylor (alta) 32fcd2733e Deploy 0.260.0 to xplat (#49319)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49319

Changelog: [Internal]

Reviewed By: panagosg7

Differential Revision: D69438322

fbshipit-source-id: 1906cfc76125e1bb7244b2a40536c3268a914ecf
2025-02-11 09:34:17 -08:00
Jakub Piasecki aedf8c1dba Update virtualized-lists types to align them closer to TS definitions (#49264)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49264

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D69308531

fbshipit-source-id: 29f1726026aa55e4e17616e7880c7d30eae13b8f
2025-02-11 09:25:22 -08:00
Jakub Piasecki b8e2bcd60d Update types in virtualized-lists so that they produce valid TS output (#49263)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49263

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D69308533

fbshipit-source-id: 36dd38a5bfce3b19eabcf04ef5f14e006d581bcd
2025-02-11 09:25:22 -08:00
Jakub Piasecki 1cf4c84ba0 Update files in packages/virtualized-lists to use export syntax (#49262)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49262

Changelog: [General][Breaking] Deep imports into `react-native/virtualized-lists` with require syntax may need to be appended with `.default`

Reviewed By: huntie

Differential Revision: D69308532

fbshipit-source-id: 6de15d46e0931616bc9849edbccb7cf745e15dd5
2025-02-11 09:25:22 -08:00