Commit Graph

1706 Commits

Author SHA1 Message Date
nishan (o^▽^o) b365e26593 feat(iOS) - blur filter using SwiftUI (#52495)
Summary:
As per the discussion on the previous [PR thread](https://github.com/facebook/react-native/pull/52028#issuecomment-2979481948), this PR uses `SwiftUI` to implement blur filter on iOS.

## Approach:

To implement blur filter on iOS, we have two options:

1. Use `CAFilter` (private API, app can get rejected/API can break). Earlier [PR](https://github.com/facebook/react-native/pull/52028) was using that approach. Thanks to Nick for suggesting SwiftUI API.

2. Use `SwiftUI`. Wrap the view in a SwiftUI view and apply [blur](https://developer.apple.com/documentation/swiftui/view/blur(radius:opaque:)). This PR builds on top of that approach. This also enables a way to add `SwiftUI` only features like this one. Additional filters (grayscale, saturate, contrast, hueRotate) can also be added.

There are a few ways we can implement the SwiftUI approach:

1. Create a new `RCTSwiftUIComponentView` -> do style flattening in View -> check if `filter` is present and conditionally render the `RCTSwiftUIComponentView` on iOS, wrap children with a `SwiftUI` view. Tradeoff with this approach is that it adds `StyleSheet.flatten` overhead on JS side.
2. Add a `SwiftUI` container view inside of `RCTViewComponentView`. Tradeoff with this approach is that it complicates `RCTViewComponentView` a bit.

I decided to go with **2** to avoid the flattening tradeoff and try to minimize complicating `RCTViewComponentView`. it only adds the wrapper if it's required and removes if not (in this PR, blur filter style will add the wrapper, it will get removed if blur filter styling gets removed). It uses the existing container view pattern.

## Changelog:
[IOS][ADDED] - Filter blur

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

Test Plan:
Test filter blur example on iOS. SwiftUI view should be added to the hierarchy.

<img src="https://github.com/user-attachments/assets/742539f4-a96d-45f4-94ba-5eb588d0ad5a" width="300px" />

## Aside:

- This PR also adds a new swift podspec. Creating a new podspec felt the right approach as adding swift in existing ones were adding some complexity. But open for changes here. Also, need some eyes on the podspec configs. cc - chrfalch  🙏   this might also affect the SPM migration.
- Unrelated: Existing brightness filter has some inconsistency compared to android and web, it uses [self.layer.opacity](https://github.com/facebook/react-native/blob/6892dde36373bbef2d0afe535ae818b1a7164f08/packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm#L1008) so transparent background color do not blend well unless the view has an opacity. One solution would be to calculate true background color by using brightness or else use the `SwiftUI`'s [brightness](https://developer.apple.com/documentation/swiftui/view/brightness(_:)), which would be cleaner imo (tested and it works).

Reviewed By: cipolleschi

Differential Revision: D79666764

Pulled By: joevilches

fbshipit-source-id: 05e43d75ce7b6f25b67b4eed632524a559ea1c2e
2025-09-15 15:04:54 -07:00
ismarbesic 07da2ff3e1 feat(ios): support condensed system font on fabric (#52259)
Summary:
This PR adds support for using the condensed system font on iOS when passing "SystemCondensed" as fontFamily. This behavior existed in the old architecture but was never ported to the new one, see [RCTFont.mm](https://github.com/facebook/react-native/blob/main/packages/react-native/React/Views/RCTFont.mm#L434) as reference. Fixes https://github.com/facebook/react-native/issues/52258.

## Changelog:

[IOS] [ADDED] - Add support for condensed system font when using the new react native architecture.

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

Test Plan:
Before:
<img width="275" src="https://github.com/user-attachments/assets/8744a5ae-252c-46db-b5f9-b803f3e1c671" />

After:
<img width="275" src="https://github.com/user-attachments/assets/69ec27a3-5c9a-46e3-a80a-0e02b76d8813" />

Reviewed By: cortinico

Differential Revision: D82208140

Pulled By: javache

fbshipit-source-id: b23a97c94bf45144c3f0860c30e35cae88c7dc2f
2025-09-15 11:31:30 -07:00
Rubén Norte 9962add377 Remove redudant fields from ReactNativeStartupTiming (#53711)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53711

Changelog: [internal]

This removes some fields that contain the same time as `endTime`, which is confusing when documenting them.

Reviewed By: christophpurrer

Differential Revision: D82112473

fbshipit-source-id: 461e2b4b495ae641dcb3233874360a4f7b90dabf
2025-09-11 06:09:29 -07:00
Rubén Norte a16c6c9477 Add feature flag to enable Web Performance APIs by default (#53547)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53547

Changelog: [internal]

This creates a new feature flag to enable the modern Web performance APIs in RN by default. It's disabled by default so it shouldn't have any effect at the moment.

Reviewed By: rshest

Differential Revision: D80811430

fbshipit-source-id: 47d5fd12ac8809aa3c5ad37cdd31c0d9e3ed5912
2025-09-09 08:07:31 -07:00
generatedunixname89002005287564 4553f87489 Fix CQS signal readability-implicit-bool-conversion in xplat/js/react-native-github/packages (#53591)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53591

Reviewed By: rshest

Differential Revision: D81571883

fbshipit-source-id: 479a0764eabeac968028814ec6aafa32687b0905
2025-09-04 03:13:49 -07:00
Sam Zhou 4365c1c9f7 Cleanup codeless suppressions in xplat/js (#53573)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53573

Changelog: [Internal]

Reviewed By: marcoww6

Differential Revision: D81552699

fbshipit-source-id: 71b104174a8ad7fbf360cdd87109ce034f49ec70
2025-09-02 21:56:09 -07:00
Maciej Jastrzębski 0f39fc3000 fix(a11y): aria-hidden support for Text, non-editable TextInput and Image (#53364)
Summary:
Fixes https://github.com/facebook/react-native/issues/53350

This PR adds support for missing `aria-hidden` prop handling on:
- `Text`
- non-editable `TextInput`
- `Image`

The changes are pretty simple and analogous to `View` logic:
- iOS: setting `accessibilityElementsHidden`, `accessible` (for `Image`)
- Android: setting `importantForAccessibility="no-hide-descendents"

Note: [according to MDN](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Attributes/aria-hidden) `aria-hidden` should not be used on focusable elements, which excludes editable `TextInput`

## Changelog:

[GENERAL] [FIXED] `aria-hidden` support for `Text`, non-editable `TextInput` and `Image`

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

Test Plan:
Added new section to RN Tester (APIs => Accessibility => aria-hidden

### After (iOS/Android)

https://github.com/user-attachments/assets/c62f8beb-7cb1-4919-833d-3fb906309cac

https://github.com/user-attachments/assets/78ca5e28-a858-4fd6-ac1c-5ec87872f3fc

### Before (iOS/Android)

https://github.com/user-attachments/assets/84560373-4b31-4793-8997-ee14daa77990

https://github.com/user-attachments/assets/b20074c9-f021-4a90-bce5-75e440a4bbc3

Reviewed By: rshest

Differential Revision: D81043503

Pulled By: javache

fbshipit-source-id: 26b2660a75afcdedba07bee980d8c7f154087ae2
2025-09-01 06:05:43 -07:00
Alex Hunt a4581ecd8b Fix/simplify invariant for ColorSchemeName, align manual typedef (#53397)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53397

This is a runtime behaviour fix and an API change to `Appearance.setColorScheme`, motivated by a user report where providing `'unspecified'` (valid) to this function would trigger an incorrect invariant throw. Furthermore, there is already a [first party use](https://github.com/facebook/react-native/blob/aec35b896053d9372ccdaf67c939b2eb216d3455/packages/react-native/Libraries/Utilities/Appearance.js#L101) where we call `Appearance.setColorScheme('unspecified')`.

**Changes**

- `Appearance.d.ts` (current public API, manual types): Fix `ColorSchemeName` type to include `'unspecified'` value, and narrow to remove nullability — aligning with existing Flow source for this type in `NativeAppearance`.
- `Appearance.js` (implementation): Fix the invariant throw by **removing it**, and instead narrowing the input type to non-nullable. Redundant work in `getState` and `getColorScheme` is removed.

Changelog: [General][Breaking] `Appearance.setColorScheme` no longer accepts a nullable value

Reviewed By: andrewdacenko

Differential Revision: D80705652

fbshipit-source-id: cf221a33447606653050d471ca2d0347ab30db81
2025-08-29 11:42:14 -07:00
Sam Zhou 6c7c518d42 Turn on experimental.natural_inference.local_object_literals.followup_fix in xplat (#53528)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53528

Changelog: [Internal]

Reviewed By: marcoww6

Differential Revision: D81289138

fbshipit-source-id: 05e2f5ad337f616a92df97ea52af8891448e122f
2025-08-29 06:25:57 -07:00
Alex Hunt 63948350e0 Clear XHRExampleFetch interval on unmount (#53481)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53481

Small fix to this RNTester example to clean up hanging `setInterval` side effect making repeat network fetches.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D81127809

fbshipit-source-id: 6036dd254888eb6160d2b1e116bbce63e5fd9328
2025-08-27 09:46:15 -07:00
Sam Zhou 0530ea3349 Migrate to suppression with error code in xplat: 1/n (#53439)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53439

Changelog: [Internal]

Reviewed By: panagosg7

Differential Revision: D80809220

fbshipit-source-id: 6f432d8302934b9fee9780ac1d6ba6c87c0b3899
2025-08-22 10:35:39 -07:00
generatedunixname89002005287564 e60ddf0adb Fix CQS signal modernize-use-designated-initializers in xplat/js/react-native-github/packages [B] [B] (#53425)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53425

Reviewed By: javache

Differential Revision: D80619000

fbshipit-source-id: d012c170ed366904b39ef335fea5241b604461ec
2025-08-22 05:52:14 -07:00
Marco Wang da9136f587 Turn on null strict comparison check for xplat js (#53379)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53379

X-link: https://github.com/facebook/react/pull/34240

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D80648362

fbshipit-source-id: cc47ae207f29a3ddb68bc0e029b8773f89503c52
2025-08-21 16:46:23 -07:00
Nicola Corti 2689d4d372 RNTester should not use ReactNativeHost (#53398)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53398

ReactNativeHost is a legacy architecture class.
This migrates the app away from it and converts it to use DefaultReactHost instead.

Changelog:
[Internal] [Changed] -

Reviewed By: mdvacca

Differential Revision: D80708460

fbshipit-source-id: 7d88c440414c979a2968fc9c910e828f5851195c
2025-08-21 11:16:20 -07:00
Nivaldo Bondança d1a1020a4a Codemod format for trailing commas change
Reviewed By: VladimirMakaev

Differential Revision: D80576929

fbshipit-source-id: 1310f77f5d9d489b780b14875454ebda7f7adfc9
2025-08-19 18:15:18 -07:00
Marco Wang 8351a5d186 Pre-Suppress errors for xplat/js for general strict comparison in non-generated files (#53342)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53342

Commands

```
scripts/flow/tool add-comments --comment 'Error discovered during Constant Condition roll out. See https://fburl.com/workplace/4oq3zi07.' .
```
```
arc f
```

drop-conflicts

Reviewed By: SamChou19815

Differential Revision: D80487235

fbshipit-source-id: 9e7c1a2641ddc0da0400fa1aff598b112a0434d5
2025-08-19 01:09:22 -07:00
Sam Zhou cf664c65e2 Standardize subtyping error code into incompatible-type in react native and metro (#53312)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53312

Changelog: [Internal]

Reviewed By: jbrown215

Differential Revision: D80400976

fbshipit-source-id: 196af69c0b9621b2a2675b232406639773e04933
2025-08-18 09:04:31 -07:00
Christoph Purrer 9f2fbc23e4 Fix memory leak in TestCallInvoker (#53287)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53287

Changelog: [General][Fixed] Fix memory leak in TestCallInvoker

This fixes leaks in TestCallInvoker holding onto the jsi::Runtime

Reviewed By: lenaic

Differential Revision: D80295420

fbshipit-source-id: b14368ccfa86b3bf24b1f84613ec07931bd71a43
2025-08-15 11:43:41 -07:00
zhongwuzw f936780cd5 Expose NativeComponentRegistry API as JavaScript root export (#52999)
Summary:
Resolves https://github.com/react-native-community/discussions-and-proposals/discussions/893#discussioncomment-13449739

Expose NativeComponentRegistry as a root export on index.js.

## Changelog:

[General][Added] - Expose NativeComponentRegistry API as JavaScript root export

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

Test Plan: Can import NativeComponentRegistry from root exort

Reviewed By: cortinico, cipolleschi

Differential Revision: D79721243

Pulled By: huntie

fbshipit-source-id: 77d94fb22255de020009ffe0e54d5030213519e2
2025-08-15 04:02:26 -07:00
Nivaldo Bondança 2ab6f22f26 Codemod format for trailing commas incoming change [5/n] (#53260)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53260

X-link: https://github.com/facebook/yoga/pull/1847

Adding trailing commas.

Reviewed By: cortinico

Differential Revision: D80174965

fbshipit-source-id: 5438fa9ebce13525b1286dd30704138ef99703cb
2025-08-14 07:24:42 -07:00
Nicola Corti f1d014adbb Simplify RNTester Autolinking (#53095)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53095

This change simplifies the RNTesterApplication so that it's looking closer to the template MainApplication file.
In order to do so, I had to create 2 files inside the `metainternal/` folder as those files are
generated as part of the CLI Autolinking

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D79722917

fbshipit-source-id: 06852c72ae1e1abed9952b1637515123977bc7b4
2025-08-12 05:49:49 -07:00
Michał Pierzchała fc6d7d4f0f Update RNC CLI in RNTester to v20.0.0 (#53206)
Summary:
Bump CLI to stable v20 for RNTester

## Changelog:

[INTERNAL] [CHANGED] - Update RNC CLI in RNTester to v20.0.0

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

Reviewed By: cortinico

Differential Revision: D79997077

Pulled By: rshest

fbshipit-source-id: 7264d942967fbfbc7fa5704f1089c0e7dbd3eb4b
2025-08-11 09:37:54 -07:00
Maciej Jastrzębski 6965d57e75 fix(a11y): TextInput aria-label handling (#53051)
Summary:
The `aria-label` prop was ignored on `TextInput` component. Which resulted in screen reader not able to read it.

This PR forwards `aria-label` to `accessibilityLabel` in a manner similar to e.g. `View` and `Text`

## 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] - a11y: fix `aria-label` on `TextInput`

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

Test Plan:
Run RNTester => TextInput => Accessibility section under Accessibility Inspector or screen reader.

iOS fixed:
https://github.com/user-attachments/assets/68c3a2ef-7dfe-479c-97fc-cbe72108c45c

iOS baseline:
https://github.com/user-attachments/assets/2e8372ba-10dc-47d2-b6b1-9f664000de7d

Reviewed By: andrewdacenko

Differential Revision: D79635413

Pulled By: rshest

fbshipit-source-id: dd2f583d67c6c6c6393e02c5fe534308e1e2f921
2025-08-06 09:36:35 -07:00
Sam Zhou af1bcb6d44 Mass replace $FlowIgnore with $FlowFixMe in react-native (#53076)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53076

Changelog: [Internal]

Reviewed By: marcoww6

Differential Revision: D79672242

fbshipit-source-id: 560f057d8658ed602cf7241e584bade70d8f3a99
2025-08-05 15:44:41 -07:00
Riccardo Cipolleschi 83e6eaf693 Prevent users from opting-out of the New Architecture (#53026)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53026

This change prevents users from opting out of the New Architecure.

The change is non breaking with respect to building an app: all the functions are still there, even if they are unreachable, in case users will still call them explicitly.
We hardcoded all the values to enable the New Architecture, so there is no way to disable it.

This is a behavioral breaking change, though.

## Changelog:
[iOS][Removed] - Removed the opt-out from the New Architecture.

Reviewed By: cortinico

Differential Revision: D79090048

fbshipit-source-id: 9779bfedf50748d7adbef5f7ef038f469e30efc2
2025-08-05 11:37:24 -07:00
Sam Zhou 6b354155ed Replace $FlowFixMe(Props|State|Empty) with just $FlowFixMe (#53002)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53002

Changelog: [Internal]

Reviewed By: marcoww6

Differential Revision: D79524515

fbshipit-source-id: 18b96538a62c7ae5912b1e89d2b50c1420c7eaf5
2025-08-04 11:43:00 -07:00
Mateo Guzmán 77be1a3dc4 Kotlin: accessor call can be replaced with property access syntax (#52950)
Summary:
Fixing a few warnings from static code analysis regarding the [accessor call can be replaced with property access](https://www.jetbrains.com/help/inspectopedia/UsePropertyAccessSyntax.html) rule

## Changelog:

[INTERNAL] - Kotlin: accessor call can be replaced with property access syntax

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

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

Reviewed By: cortinico

Differential Revision: D79431292

Pulled By: rshest

fbshipit-source-id: 09ad40c09512def9ab33eaeb70da057f742ae4a1
2025-08-01 04:33:29 -07:00
Alex Hunt a3bf989450 Implement reporting InteractionEntry live metrics to runtime (#52839)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52839

**Context**

Experimental V2 Performance Monitor prototype, beginning by bringing the [Interaction to Next Paint (INP)](https://web.dev/articles/inp) metric to React Native.

**This diff**

Adds and configures a `CdpMetricsReporter` class to report `InteractionEntry` live metrics over CDP via the `"__chromium_devtools_metrics_reporter"` runtime binding.

**Notes**

- Introduces a new `react/performance/cdpmetrics` package, and a listener API on `PerformanceEntryReporter` (both to avoid a `jni` dependency in `react/performance/timeline`).

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D78904748

fbshipit-source-id: c75971aba43d9929912b3d1dba7576c2a2342214
2025-07-30 07:13:58 -07:00
Riccardo Cipolleschi ec5a98b1f5 Sync React 19.1.1 into React Native (#52887)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52887

Syncs Reac 19.1.1 into React Native.

This commit should contains the fix for:
- React owner stack in React Native
- An issue with React holding shadow node for longer than it needed
- An issue that made `startTransition` not working with React Native.

## Changelog:
[General][Changed] - Bumped React to 19.1.1

bypass-github-export-checks

Reviewed By: cortinico

Differential Revision: D79096406

fbshipit-source-id: cbb2f846b1f08ba5ff482cfed5aaddc16df075cc
2025-07-29 08:05:38 -07:00
Nicola Corti 48bf59c85e Use by lazy(LazyThreadSafetyMode.NONE) for RNTester (#52886)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52886

RNTester was using just a plain `by lazy{}` which gets flagged by our internal linter over and over.
This fixes it.

Changelog:
[Internal] [Changed] -

Reviewed By: mdvacca

Differential Revision: D79094496

fbshipit-source-id: 856864bf8b5e4ec1254d1793dba9e97377696408
2025-07-28 15:11:35 -07:00
Nick Lefever 5e80759994 Add disabled paragraph prop (#52846)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52846

Adding the Paragraph `disabled` property for RN Android.

This diff also adds a new Text example to RNTester for disabled text.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D78990840

fbshipit-source-id: dd25b890597bc9f728f929b38c2f680631b7f476
2025-07-27 17:20:44 -07:00
Christoph Purrer c7c8ce0cad Update TurboModuleTestFixture to handle Promise types (#52801)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52801

Changelog: [Internal]

This adds utility functions and sample test cases to verify AsyncPromises in GTests

Reviewed By: lenaic

Differential Revision: D78871865

fbshipit-source-id: 41a7bebee94f40ec2d1d84b3ceae561dc503b421
2025-07-25 09:56:37 -07:00
Christoph Purrer 2c683c5787 Apply clang-tidy setting; RN Android (#52774)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52774

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D78634966

fbshipit-source-id: daee3ed21b6f2229049e6a09e2b9c48dfb7e0264
2025-07-24 17:50:27 -07:00
Dawid Małecki fb4587780e Move ReactNativeFeatureFlags to src/private (#52610)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52610

This diff removes `ReactNativeFeatureFlags` from `react-native/Libraries/ReactNative` and migrates
`shouldPressibilityUseW3CPointerEventsForHover` to common `ReactNativeFeatureFlags` in `src/private/featureflags`. The `shouldEmitW3CPointerEvents is removed as it is used in `rn-tester` to hide some examples.

Changelog:
[General][Breaking] - Migrate `shouldPressibilityUseW3CPointerEventsForHover` to common private feature flags and remove `shouldEmitW3CPointerEvents` flag.

Reviewed By: robhogan

Differential Revision: D75448698

fbshipit-source-id: 03942c9504b855f2054c9a5948c0521ce17365b5
2025-07-23 01:43:05 -07:00
Nicola Corti 59101d6809 Remove unnecessary OSSLibraryExample (#52705)
Summary:
This module is currently unused, so we can clean it up.

## Changelog:

[INTERNAL] -

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

Test Plan: CI

Reviewed By: cipolleschi

Differential Revision: D78555763

Pulled By: cortinico

fbshipit-source-id: 0a6152ab3d357cac0c6d7669f292680af7b87074
2025-07-22 03:16:48 -07:00
Christoph Purrer c0eeebbd9d Apply clang-tidy setting: fantorm/rntester (#52731)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52731

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D78634903

fbshipit-source-id: f4ad862061630a098e80a125e25ae3af17b9eb60
2025-07-22 00:48:40 -07:00
Christoph Purrer ff85e2f6dd Add NativeCxxModuleExampleTests (#52653)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52653

Changelog: [Internal]

This adds an example of Unit Testing a C++ Turbo Module with Google GTest and also adds necessary and useful utility classes for testings

This is GTEST / C++ version of the same tests added in  https://github.com/facebook/react-native/pull/52477

Reviewed By: alanleedev

Differential Revision: D78250302

fbshipit-source-id: 278655779dd17550be9c579d84cc1f7b6e45230d
2025-07-18 22:46:21 -07:00
Nicola Corti 9f0903780b Bump monorepo packages to 0.82.0-main (#52706)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52706

This just prepares the repo for the next branch cut.

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D78558445

fbshipit-source-id: 2132d560dad447b3685874438387a519587f8554
2025-07-18 09:23:10 -07:00
Nicola Corti 5e3edafec6 Migrate RNTester to use {usesCleartextTraffic} Manifest Placeholder (#52620)
Summary:
This creates a `debugOptimized` build type for React Native Android, meaning that we can run C++ optimization on the debug build, while still having the debugger enabled. This is aimed at improving the developer experience for folks developing on low-end devices or emulators.

Users that intend to debug can still use the `debug` variant where the full debug symbols are shipped.

## Changelog:

[ANDROID] [ADDED] - Create a debugOptimized buildType for Android

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

Test Plan:
Tested locally with RNTester by doing:

```
./gradlew installDebugOptimized
```

This is the output of the 3 generated .aar. The size difference is a proof that we're correctly stripping out the C++ debug symbols:

<img width="193" height="54" alt="Screenshot 2025-07-15 at 17 49 50" src="https://github.com/user-attachments/assets/584a0e8d-2d17-40d4-ac29-da09049d6554" />
<img width="235" height="51" alt="Screenshot 2025-07-15 at 17 49 39" src="https://github.com/user-attachments/assets/eda8f9e7-3509-4334-8c16-990e55caa04d" />
<img width="184" height="52" alt="Screenshot 2025-07-15 at 17 49 32" src="https://github.com/user-attachments/assets/a5c94385-bc00-4484-b43e-088ee039827f" />

Rollback Plan:

Reviewed By: cipolleschi

Differential Revision: D78351347

Pulled By: cortinico

fbshipit-source-id: 568a484ba8d2ee6e089cabc95451938e853fbc54
2025-07-18 08:07:54 -07:00
Alex Hunt e247be793c Lower minimum Node.js version to 20.19.4 (#52678)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52678

From partner feedback, there's still appetite to support Node 20.x for the next <1y of life. Lower min version to `20.19.4` (Jul 2025) and widen test matrix in CI.

Changelog:
[General][Breaking] - Our new minimum Node version is Node.js 20 (Overrides #51840)

Reviewed By: cortinico

Differential Revision: D78494491

fbshipit-source-id: c8d9dc6250cb11f8a12ca7e761b65f4a8dae9265
2025-07-18 03:32:13 -07:00
Sam Zhou 23c8787fe2 Add annotations to fix future errors after fix for unsound array types (#52691)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52691

Unannotated array literals are unsound in Flow right now. This diff adds in annotations and makes a few things readonly, to reduce future errors.

Changelog: [Internal]

Reviewed By: marcoww6

Differential Revision: D78519638

fbshipit-source-id: d98a7668ecf97bcc87dcb3fad25ade736d885d9a
2025-07-17 17:30:43 -07:00
Andrew Datsenko 46f3e32019 Add support for meta only code & oss only code (#52583)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52583
Changelog: [Internal]
OSS build is broken atm as there is rn-tester dep in Fantom, needed for Meta only purposes.
Platformizing code to allow for Meta only implementation here and also for OSS only. Using this approach over ifdef.

Reviewed By: christophpurrer

Differential Revision: D78275698

fbshipit-source-id: c3234bb61b4591c0a5045fdb84aa0316f6382ecc
2025-07-15 14:16:06 -07:00
David Vacca c2f39cfdd8 Revert Refactor ViewManagerInterfaces codegen to generate kotlin classes (#52593)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52593

Revert Refactor ViewManagerInterfaces codegen to generate kotlin classes since commands are not respecting nullability

changelog: [internal] internal

Reviewed By: bvanderhoof

Differential Revision: D78308183

fbshipit-source-id: f3d8017d4bc6473deef0fd49c000543913905cd9
2025-07-14 21:22:21 -07:00
Nick Gerleman 7cd0b42ca0 Add text examples combining textAlign, attachments, script direction, and layout direction (#52445)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52445

This shows some broken stuff (TM), but also asserts current behaviors

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D77702743

fbshipit-source-id: a20d5b09e84d86a16e2443726ac82416b13796a8
2025-07-14 19:43:12 -07:00
David Vacca 79ca9036d3 Refactor ViewManagerInterfaces codegen to generate kotlin classes (#52545)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52545

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

This diff refactors the ViewManagerInterfaces codegen to generate kotlin classes,

As a consequence of this change, there are some ViewManagerInterfaces that have changed their APIs

## Changelog: [Android][Breaking] - Migrate ViewManagerInterfaces to kotlin. Some types in code generated ViewManagerInterfaces might differ. e.g. this will start enforcing nullability in parameters of viewManagerInterface methods (e.g. String commands parameters are not nullable, view params are not nullable in any method, etc)

Reviewed By: cortinico

Differential Revision: D78118738

fbshipit-source-id: cdd9e660e55397bd0936efce1c5aaf90c2946b7a
2025-07-13 19:18:26 -07:00
Christian Falch 40e45f5366 add support for USE_FRAMEWORKS when using prebuilt React Native Core (#52489)
Summary:
When using prebuilts the USE_FRAMEWORKS setting is not really relevant for the React Native code, since there will not be any source code to build frameworks for - and because we already have a framework for the code in React.XCFramework.

This commit adds a new command to the React Native podspecs like we did with the ReactNativeDependencies framework. The method is called `add_rncore_dependency` and it does nothing when building from source - but when linking with the React.XCFramework it explicitly adds linking with the framework.

In addition there are a few places in the ruby code where we check for the USE_FRAMEWORK value and changes some settings - where needed this commit will add a separate check to ensure we're building from source when making these changes.

bypass-github-export-checks

## Changelog:

[IOS] [ADDED] - Added support for using USE_FRAMEWORKS with prebuilt React Native Core

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

Test Plan:
RNTester:

- Builds without USE_FRAMEWORKS as before with/without prebuilt
- Builds with USE_FRAMEWORKS=dynamic as before with source - and now also with prebuilt code.
- Same goes for the static variant.

Reviewed By: mdvacca

Differential Revision: D78012332

Pulled By: cipolleschi

fbshipit-source-id: ea942738ae52b9dceae48fb78a5026f04b7545b8
2025-07-10 03:04:07 -07:00
generatedunixname89002005287564 7725a0aee3 Fix CQS signal modernize-concat-nested-namespaces in xplat/js/react-native-github/packages/rn-tester/android/app/src/main/jni (#52501)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52501

Reviewed By: javache, cortinico

Differential Revision: D77990137

fbshipit-source-id: 1fe4b7a0a821cf9bff5b21d38b6e78a3b164211d
2025-07-09 03:03:48 -07:00
Christoph Purrer b5329ecd6d NativeCxxModuleExample test for testing C++ TM E2E (#52477)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52477

Changelog: [Internal]

This adds a Fantom test for

https://github.com/facebook/react-native/blob/main/packages/rn-tester/NativeCxxModuleExample/NativeCxxModuleExample.js

to test a C++ Turbo Module End 2 End (loading the C++ implementation in native code, accessing in JavaScript via Hermes VM and verifying the results of the API calls)

Reviewed By: rshest

Differential Revision: D77848654

fbshipit-source-id: 48a4ab88a330e9282ae8dab589743eaace62d124
2025-07-08 21:10:36 -07:00
Alex Hunt fc5e33b582 Reorganise shared script utils (#52473)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52473

Shared utils that were located in the root of `scripts/` are now colocated closer to their dependencies or moved to `scripts/shared/` — simplifying the root directory layout.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D77873875

fbshipit-source-id: e04dba41a1ef811d32793931033fdfa93afad0cd
2025-07-08 06:10:36 -07:00
Marco Wang 68650badd2 Pre-suppress errors for null_void for xplat js (#52480)
Summary:
Changelog: [Internal]

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

Reviewed By: SamChou19815

Differential Revision: D77890434

fbshipit-source-id: cc0571e0ff1c7cec3fff8614f688d46e46970cc4
2025-07-07 20:35:08 -07:00