Commit Graph

303 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
Nicola Corti 625f69f284 @DeprecatedInNewArchitecture -> @Deprecated (#52399)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52399

I'm raising the deprecation warnings for those methods that are using legacy arch.
Previously the `DeprecatedInNewArchitecture` was not generating warnings for user in their builds, while now the Kotlin's/Java's `DeprecatedInNewArchitecture` it will.

Changelog:
[Android] [Changed] - Introduce more deprecation warnings for Legacy Arch classes

Reviewed By: mdvacca

Differential Revision: D77736713

fbshipit-source-id: bc21729ed8253d3ec6b6a40577bcd76622c3f8a6
2025-07-07 10:20:43 -07:00
Soe Lynn faef2b1252 Back out "Back out "[react-native][PR] Migrate ReactDelegate to Kotlin"" (#52322)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52322

Original commit changeset: 4a366205ea9c

Original Phabricator Diff: D77388940

Reverting the revert since it did not fix our javascript crash problem for v270 https://fburl.com/scuba/errorreporting_system_vros_javascripterrors/mtexik9e

Original diff stack: D76908041
Revert diff stack: D77388940

Changelog[Internal]:
Puting back the Kotlin Migration for ReactDelegate file

Reviewed By: cortinico

Differential Revision: D77448238

fbshipit-source-id: f41faa19f6761b7ed644e804019f5ec4738326a7
2025-06-27 11:55:44 -07:00
Mathieu Acthernoene 09ef774ff6 Add edge-to-edge opt-in support (#52088)
Summary:
This follows https://github.com/facebook/react-native/pull/47554

Compared to the initial proposal, I had to remove the `edgeToEdgeEnabled` property from the root `gradle.properties` and put it in the app `gradle.properties` instead (explaining the `AgpConfiguratorUtils.kt` / `GenerateEntryPointTask.kt` / `ProjectUtils.kt` / `PropertyUtils.kt` changes)

This PR:
- Enable edge-to-edge for `MainActivity` (when `edgeToEdgeEnabled` is set to `true`)
- Disable `StatusBar` `backgroundColor` and `translucent` (when `edgeToEdgeEnabled` is set to `true`)
- Enforce `statusBarTranslucent` and `navigationBarTranslucent` on `Modal` when edge-to-edge is enabled
- Add an `isEdgeToEdge` constant to `DeviceInfoModule` for [`react-native-is-edge-to-edge`](https://github.com/zoontek/react-native-edge-to-edge/tree/main/react-native-is-edge-to-edge) detection

## Changelog:

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

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

- [Android] [Added] - Add edge-to-edge opt-in support

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

Test Plan:
- Update `enableEdgeToEdge` value in `packages/rn-tester/android/app/gradle.properties`
- Recompile

https://github.com/user-attachments/assets/4c6beb98-fa88-427c-b62d-a42ffe5330f0

Rollback Plan:

Reviewed By: cortinico

Differential Revision: D76834213

Pulled By: alanleedev

fbshipit-source-id: c39b2cff1a5e94e31306e3b35651aa2de83d2fe6
2025-06-27 06:16:23 -07:00
Soe Lynn fbd8281ab2 Back out "Migrate ReactDelegate to Kotlin" (#52304)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52304

Investigating javascript crash regression between Store APK v269 and v270 T228736366 with mid https://www.internalfb.com/logview/system_vros_javascripterrors/4a0131b8b79e3994b639c7ca212db717?ds=%7B%22start%22%3A%221750796919%22%2C%22constraints%22%3A[]%2C%22end%22%3A%22now%22%7D&ds_nux_type=task

We suspect that this diff stack may be causing the issue could be caused by this Kotlin migration diff stack D76908041

Changelog: [Internal]
Reverting Kotlin migration for `ReactDelegate`

Reviewed By: gorodscy, mullender

Differential Revision: D77388940

fbshipit-source-id: 4a366205ea9c515a1561a4624b8d29e81ab9bae9
2025-06-26 14:44:36 -07:00
Mo Javad 35dba09724 Add explicit Build Tools Version to RN Tester Android App Benchmark (#52216)
Summary:
After bumping to SDK version 36, the build process for Android was still pulling in SDK v35 unnecessarily. This PR fixes that issue.

## Changelog:

[ANDROID] [FIXED] - Added explicit build tool version to RN Tester build.gradle to avoid automatic installation of Android SDK Build Tools.

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

Test Plan:
Tested in fork pipeline to ensure it's working correctly.

This is the logs from the pipeline before:
![image](https://github.com/user-attachments/assets/9dc7f158-8dea-437e-836e-e5f500b3d5ff)

And this is after the fix:
![image](https://github.com/user-attachments/assets/c6cc1c0a-5823-41cb-ba32-027b69d6eaa6)

Reviewed By: rshest

Differential Revision: D77219569

Pulled By: cortinico

fbshipit-source-id: 7a0ca462d00bfc4b015a30807aaef999ff60c719
2025-06-24 04:34:46 -07:00
Mateo Guzmán 50ea5b4380 Migrate ReactDelegate to Kotlin (#52024)
Summary:
Migrate com.facebook.react.ReactDelegate to Kotlin.

## Changelog:

[ANDROID][BREAKING] - Migrate com.facebook.react.ReactDelegate to Kotlin. Some users implementing this class in Kotlin could have breakages.

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

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

Reviewed By: javache

Differential Revision: D76740335

Pulled By: cortinico

fbshipit-source-id: d9ad948a71438070500685042c067f621fd3ea26
2025-06-19 04:33:53 -07:00
Mathieu Acthernoene b5be57cb76 Fix RNTester system bars background when edge-to-edge is enforced (#51929)
Summary:
This PR fixes RNTester system bars background color to match the app one (not solid black).

## Changelog:

- [Internal] [Changed] - Fix RNTester app system bars color when edge-to-edge is enforced

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

Test Plan:
https://github.com/user-attachments/assets/8be0b721-6514-408f-81cd-2106ae7a17c4

Rollback Plan:

Reviewed By: javache

Differential Revision: D76352950

Pulled By: alanleedev

fbshipit-source-id: 474a81564570764a597aa995a0677617263338be
2025-06-13 11:05:35 -07:00
Nicola Corti 0954c1db45 Remove and cleanup JSEngineResolutionAlgorithm (#51931)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51931

This cleans up the whole `JSEngineResolutionAlgorithm` and all the API related to it.
As now we offer support only for Hermes and JSC is provided via a community package.

This is breaking as it affects Expo, but I'll reach out to Kudo to make sure this is integrated properly.
No other breakages other than this.

Changelog:
[Android] [Removed] - Remove and cleanup JSEngineResolutionAlgorithm

Reviewed By: mdvacca

Differential Revision: D76337620

fbshipit-source-id: e43d5d1164f368f5fa395971bca9c05821492dfe
2025-06-11 03:09:32 -07:00
Pieter De Baets 85498ad46f Remove unnecessary receiveCommand overrides (#51844)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51844

These just redefine the existing `receiveCommand` from the ViewManagerDelegate which already has this codegen'ed

Changelog: [Internal]

Reviewed By: cortinico, rshest

Differential Revision: D75869325

fbshipit-source-id: c8ba482075c2586caf33f46a871b5b5e16fda213
2025-06-09 05:49:45 -07:00
Pieter De Baets 198c6fc81c Make receiveCommand args non-nullable (#51806)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51806

Correct the type of args, which is always non-null. This is backwards-compatible as subclasses can override this method with a more permissive nullable type and still be substitutable.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D75869317

fbshipit-source-id: 8f6c9119140794447eca55be24483a35450d7bb6
2025-06-06 22:07:09 -07:00
Nicola Corti be113b4406 Stop building JSC inside RN-Tester (#51865)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51865

As in 0.81 we're stopping 1st party support for JSC, we can now cleanup the RNTester
flavor for JSC and simplify the setup here.

Changelog:
[Internal] [Changed] -

Reviewed By: rshest

Differential Revision: D76051319

fbshipit-source-id: 79b01cc64af2466a0be47ceaa0cd211cb6b02f53
2025-06-06 04:54:44 -07:00
Pieter De Baets 95ed8a6123 Merge all core codegen into FBReactNativeSpec (#50317)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50317

`rncore`, `FBReactNativeSpec` and `FBReactNativeComponentSpec` contain the same symbols, which leads to conflicts when we try to merge them into a single shared library. Cleanup the duplication and standardize on `FBReactNativeSpec` everywhere. I've left the Android OSS targets names as is, to avoid breaking deps.

This aligns react-native's package.json with the codegen tooling supported across iOS and Android, which is a single target for all all type-derived codegen.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D55037569

fbshipit-source-id: dbf3c0a427c9d0df96e439b04e5b123cd1069c51
2025-06-02 08:47:05 -07:00
Nicola Corti c6685d29ad Fix RNTester SampleLegacyModule not rendering in Old Arch (#51073)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51073

Currently the SampleLegacyModule screen is not loading in OldArch for RNTester.

That's because we gate adding a `SampleLegacyModule` to the BaseReactPackage
only if NewArch is enabled.

This shouldn't be the case as we can still build RNTester in oldarch and we
should be able to visualize the SampleLegacyModule example.

Changelog:
[Internal] [Changed] -

Reviewed By: mdvacca

Differential Revision: D74009245

fbshipit-source-id: 55eae3dc6063343f57261af2742e643a8e5c2b50
2025-05-02 03:59:10 -07:00
Nicola Corti 0abd5d63e1 Back out "Migrate ReactActivity" (#50998)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50998

I'm reverting this as this change is too disruptive for the OSS ecosystem.
It will break ALL the apps written in Kotlin and it's coming too close to the branch cut which is in less than one week.

We need to re-do this migration in a non breaking manner after the branch cut as this is highly disruptive for little benefit at this point

Changelog
[Android][Changed] - Back out "[RN][Kotlin] Migrate ReactActivity"

Original commit changeset: 936263100ca9

Original Phabricator Diff: D73507044

Reviewed By: mdvacca

Differential Revision: D73864144

fbshipit-source-id: 264921b1f1cd38301e66364de4b619807272bd27
2025-04-29 21:50:25 -07:00
Ruslan Shestopalyuk 403feb9bc2 Migrate ReactActivity (#50871)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50871

# Changelog:
[Android][Changed] - ReactActivity has been migrated to Kotlin.

Reviewed By: cortinico

Differential Revision: D73507044

fbshipit-source-id: 936263100ca93dafd643a53e5cb799fd5ed7e584
2025-04-28 01:53:11 -07:00
Nicola Corti 1c920d305d RNTester - Do not explicitely enable legacyWarningsEnabled (#50930)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50930

Due to D73591315, we don't need to specify the `legacyWarningsEnabled` for RNTester anymore as it's effectively ignored.

Changelog:
[Internal] [Changed] -

Reviewed By: rshest, cipolleschi

Differential Revision: D73654270

fbshipit-source-id: 9428634fb8374024940e4041de60d679b6f352a2
2025-04-25 07:49:59 -07:00
Jakub Piasecki c008604e0a Fix changing font scale breaking text (#45978)
Summary:
Fixes https://github.com/facebook/react-native/issues/45857

The general idea behind this PR is the same for both platforms: dirty all nodes with `MeasurableYogaNode` trait when the layout is constrained with a new `fontSizeMultiplier`. There were a few caveats:
- `ParagraphShadowNode` marks its layout as clean in the constructor in most cases. To prevent that from using a stale measurement I'm using the font scale multiplier stored in `content_` property of the node. That value is then compared with the scale used to create the attributed string kept in the node's state. If those differ, the layout is not cleared.
- On Android, font scale wasn't passed down to the `SurfaceHandler`
- On Android, text measurement relies on cached `DisplayMetrics` which were not updated when the system font scale changed.
- `AndroidTextInputShadowNode` wasn't using `fontSizeMultiplier` at all. I needed to add it in all places where an `AttributedString` is constructed.

## Changelog:

[GENERAL] [FIXED] - Fixed text not updating correctly after changing font scale in settings

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

Test Plan:
So far tested on the following code:

```jsx
function App() {
  const [counter,setCounter] = useState(0);
  const [text,setText] = useState('TextInput');
  const [flag,setFlag] = useState(true);

  return (
    <SafeAreaView
        style={{
          flex: 1,
          backgroundColor: '#fff',
          alignItems: 'center',
          justifyContent: 'center',
        }}
    >
      <Text style={{fontSize: 24}}>RN 24 Label Testing {flag ? 'A' : 'B'}</Text>
      <TextInput value={text} onChangeText={setText} style={{fontSize: 24, borderWidth: 1}} placeholder="Placeholder" />
      <Pressable onPress={() => setCounter(prevState => prevState + 1)} style={{backgroundColor: counter % 2 === 0 ? 'red' : 'blue', width: 200, height: 50}} />
      <Pressable onPress={() => setFlag(!flag)} style={{backgroundColor: 'green', width: 200, height: 50}} />
    </SafeAreaView>
  );
}
```

Reviewed By: NickGerleman

Differential Revision: D71727907

Pulled By: j-piasecki

fbshipit-source-id: 240fb5fa4967a9182bce7e885798b233d1e25aea
2025-04-14 08:57:05 -07:00
Nicola Corti 7ca2811750 Add a legacyWarningsEnabled property to enable Legacy Warnings on NewArch (#50470)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50470

This diff introduces a new property called `legacyWarningsEnabled` for `gradle.properties` that
toggles the Legacy Arch warnings for users.

I've also introduced a new `ReactNativeApplicationEntryPoint` that is generated by RNGP. This class
effectively wrap `DefaultNewArchitectureEntryPoint` by setting warnings and also invoking SoLoader.
It will reduce the errors in the user space.

As of now warnigns appear in Logcat, but I'm looking into adding some UI in a subsequent diff.

Changelog:
[Android] [Added] - Add a `legacyWarningsEnabled` property to enable Legacy Warnings on NewArch

Reviewed By: mdvacca

Differential Revision: D72383907

fbshipit-source-id: bcd659a23ec5b468958124f0f6650ff72d01ce81
2025-04-04 08:17:07 -07:00
Janic Duplessis b614c966ab Setup a Macrobenchmark for RNTester (#49486)
Summary:
Benchmark to test changes from https://github.com/facebook/react-native/issues/49449

Might be nice to have some version of this in the repo.

## Changelog:

[INTERNAL] [ADDED] - Setup a Macrobenchmark for RNTester

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

Test Plan:
### Methodology

Picked various JS file from websites (facebook, instagram) to artificially grow RN tester bundle somewhat realistically. The files are required lazily from a button press callback to simulate the code being included, but not executed, as it would be in a large app that uses lazy requires for the different screens.

I've also made the RN tester screens lazy so all their code is not loaded initially. This is more representative of real apps. Note this is implemented in a hacky way just for the purpose of this test. It would actually be nice to implement this properly.

The tests were made using low end device Samsung Galaxy A03s.

### Compression ON with 10.5 mb bundle

#### Peak allocated memory

60.9 mb

#### ReactInstance.loadJSBundler

148.64 ms

#### Benchmark

timeToFullDisplayMs      min 1,825.0,   median 1,911.1,   max 1,994.8
timeToInitialDisplayMs   min   834.9,   median   860.9,   max   903.9

#### APK

Size: 22.9 mb
Download size: 14.5 mb

### Compression OFF with 10.5 mb bundle

#### Peak allocated memory

51.5 mb

#### ReactInstance.loadJSBundler

946 us

#### Benchmark

timeToFullDisplayMs      min 1,752.8,   median 1,827.2,   max 1,977.5
timeToInitialDisplayMs   min   837.7,   median   881.3,   max   937.2

#### APK

Size: 28 mb
Download size: 14.5 mb

Reviewed By: rshest

Differential Revision: D70002286

Pulled By: cortinico

fbshipit-source-id: 436597f439ba244649373870c1facefdb12297d9
2025-03-04 12:56:07 -08:00
Peter Abbondanzo 071506fa61 Add tinted vector drawable example to RNTester (#48541)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48541

Shows how to use tintColor in conjunction with new XML file format, and serves as a good E2E test bench to ensure that drawables don't accidentally reuse the same state (if the underlying implementation isn't careful enough to call `buildCopy`, both icons will render red)

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D64136753

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

## Changelog:

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

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

Test Plan: CI passed

Reviewed By: cipolleschi

Differential Revision: D66772407

Pulled By: cortinico

fbshipit-source-id: e34d2d138996e394763ef67d7aad65bb3e7b13dc
2024-12-06 12:50:34 -08:00
Pieter De Baets aec7a66ae8 Remove deprecated ReactModuleInfo constructor (#47681)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47681

These were deprecated back in D49262824, so should be safe to remove now.

Changelog: [Android][Removed] Removed hasConstants constructor from ReactModuleInfo

Reviewed By: mdvacca

Differential Revision: D66127070

fbshipit-source-id: 3bd441c96597598470f16c7770c4dfa4ada563a0
2024-11-22 08:05:41 -08:00
Pieter De Baets 145c72f816 Convert com.facebook.react.bridge.ReadableNativeArray to Kotlin (#47484)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47484

Small change to types in the base class: all non-primitives return optional from ReadableArray, which matches the semantics in ReadableMap. We already rely on this in some cases, but the current nullability annotations were incorrect, and null values from the array would be passed through from `getMap` and `getArray`.

Changelog: [Android][Breaking] ReadableArray non-primitive getters are now correctly typed as optional

Reviewed By: Abbondanzo

Differential Revision: D65596278

fbshipit-source-id: 5574e9000b07de292bd0da5f1b071aac0eb331d6
2024-11-22 01:53:48 -08:00
Nicola Corti 972c2c864c Bump Kotlin 1.9.x to 2.0.x (#46955)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46955

This is a major bump of Kotlin. It comes with no breaking changes for the Kotlin API, but there are several new warnigns that I had to fix.
Most importantly several `override` methods that are overriding Deprecated API, also need to be deprecated as well in Kotlin.

Changelog:
[Android] [Changed] - Bump Kotlin 1.9.x to 2.0.x

Reviewed By: tdn120

Differential Revision: D64179842

fbshipit-source-id: 295ab2636ce9f9bb04e9d8c7ed27d9f8a1a64338
2024-10-11 05:34:02 -07:00
Nicola Corti a268b2bf53 Enable warningAsErrors for RN-Tester (#46817)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46817

As I've cleaned up all the RN Tester warnings, I'm enable warningAsErrors for RNTester to make
sure we keep up with our warning count.

Changelog:
[Internal] [Changed] - Enable warningAsErrors for RN-Tester

Reviewed By: cipolleschi

Differential Revision: D63837633

fbshipit-source-id: f83273dadc7aa10ce7ae52ae790279819fb88345
2024-10-09 03:12:27 -07:00
Nick Gerleman 0b0ac81fbe Fix some cases where we override setBackgroundColor on View-level instead of VM level (#46846)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46846

As of D61658739, BaseViewManager setting color now goes through BackgroundStyleApplicator, which gives a default implementation of setting a background color, while storing information in a way where we can impement things like border radii and shadows on background for out of the box views.

I knew this could lead to breaks where we previously overrode view-level `setBackgroundColor` to do something custom, but didn't override on VM level, but didn't see any external usages so I assumed it should be relatively safe. Turns out we have some internal usages which run into this pattern (D63913128 already fixed one), including a usage in RN itself! Let's override the view managers in these to delegate to the view's custom drawing.

Changelog:
[Android][Fixed] - Fix some cases where we override setBackgroundColor on View-level instead of VM level

Reviewed By: Abbondanzo

Differential Revision: D63922722

fbshipit-source-id: af988d1436c790be97b2be1325541aa418bf43a3
2024-10-04 18:43:49 -07:00
Nicola Corti 7bb12ebbea Convert react/nativemodule/samples/ to Kotlin (#46816)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46816

This converts the same native module from Java to Kotlin.
I've converted the whole module as it was quite simple + I've fixed some of the warnings.

Changelog:
[Internal] [Changed] - Convert react/nativemodule/samples/ to Kotlin

bypass-github-export-checks

Reviewed By: javache

Differential Revision: D63837631

fbshipit-source-id: bb126d7649a6e8a36510bf2b252ecdfae91fe09f
2024-10-04 07:57:46 -07:00
Nicola Corti 2136c19944 Bump SoLoader to 0.12.1 and remove unnecessary extra manifest metadata. (#46461)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46461

This bumps SoLoader to 0.12.1 inside React Native and cleans up the extra
`com.facebook.soloader.enabled` metadata which are not necessary anymore.

Changelog:
[Internal] [Changed] - Bump SoLoader to 0.12.1 and remove unnecessary extra manifest metadata

Reviewed By: cipolleschi

Differential Revision: D62581188

fbshipit-source-id: ff990c0af1f0f51070037fcb4c7c13fbe6bae234
2024-09-13 03:51:58 -07:00
Nicola Corti d7c1e5b989 Unblock RNTester instacrashing due to SoLoader not being enabled (#46459)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46459

After the SoLoader 0.12.0 bump I've noticed RNTester is instacrashing due to us not having enabled it
explicitely in the Manifest:

Changelog:
[Internal] [Changed] - Unblock RNTester instacrashing due to SoLoader not being enabled

Reviewed By: cipolleschi

Differential Revision: D62580751

fbshipit-source-id: 3b291e7f82daf1a6bd61bc9588c2d49a389801ef
2024-09-12 14:16:33 -07:00
Vladimir Makaev 3949d9b5ba Update ktfmt component on FBS:master
Reviewed By: zertosh

Differential Revision: D62584126

fbshipit-source-id: 46170730dd7cabfa5e366a3139a9119c319592cc
2024-09-12 14:06:06 -07:00
Nicola Corti 81e8c39f0a Do not stub SoLoader and use version 0.12.0 (#46422)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46422

Stubbing SoLoader comes with a couple of breaking changes (e.g. users in OSS are using `com.facebook.common.logging.FLog` which is exposed by Fresco).

In order to reduce those breaking changes, here I'm moving React Native to use SoLoader 0.12.0.
This new version comes with a constructor that accepts a MergedSoMapping implementation which we provide only for OSS apps.

Please note that the CI on this Diff will be red till SoLoader 0.12.0 releases.

Changelog:
[Internal] [Changed] - Do not stub SoLoader and use version 0.12.0

Reviewed By: cipolleschi

Differential Revision: D62447566

fbshipit-source-id: 6ff38799ed0c9f40cf3ab84be8a05979def63dc2
2024-09-12 07:17:22 -07:00
Thomas Nardone c942469700 Re-enable ktfmt on RN (#46441)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46441

Changelog: [Internal]

Reviewed By: zertosh

Differential Revision: D62518893

fbshipit-source-id: ca2ff83018716a4dc1e2dcfb8596138d088ce9f4
2024-09-11 19:06:25 -07:00
Alan Lee f7479e6a1c set inset based padding to RNTester (#46354)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46354

**Issue:**
With forced edge-to-edge on Android 15, RNTester title at top overlaps with the status bar and bottom tab bar overlaps with bottom nav bar

**Solution:**
Add margins based on inset values to the ReactRootView which is the contentView for RNTesterActivity which acts as global padding within RNTester

Changelog:
[Android][Changed] - Adding padding for RNTester on Android 15 forced edge-to-edge

Reviewed By: mdvacca

Differential Revision: D62247910

fbshipit-source-id: 7b35d0c2016b6897b5de436a4245c9e910559541
2024-09-05 15:56:54 -07:00
Phillip Pan e881a1184c convert TurboReactPackage to BaseReactPackage in oss (#46055)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46055

Changelog: [Android][Breaking]

BaseReactPackage is a 1:1 replacement for the deprecated TurboReactPackage. TurboReactPackage has been deprecated since 0.74. let's move the codebase to the recommended standard.

Reviewed By: cortinico

Differential Revision: D61329022

fbshipit-source-id: cef69e37bb2be7f6dccbab70d0996c33a8abf091
2024-08-16 17:41:32 -07:00
Nicola Corti 6dc01dad09 Do not depend on OSS SoLoader anymore (#45873)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45873

I'm removing the Gradle dependency on OSS SoLoader and stubbing it with our own implementation.
This will allow us to implement merging of further .so libraries and

As Fresco also depends on SoLoader, I had to stub the `NativeLoader` dependency as well.

Changelog:
[Android] [Breaking] - Do not depend on OSS SoLoader anymore and do not expose Fresco `api` dependency.

Reviewed By: mdvacca

Differential Revision: D60652007

fbshipit-source-id: 6e70a5c37ba9337fbe8772e192b886ba4693c7f1
2024-08-14 05:07:56 -07:00
Alex Hunt e9e5fb0141 Remove unstable_fuseboxEnabled API (#45926)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45926

Removes the temporary `unstable_fuseboxEnabled` API on both platforms. Fusebox is enabled by default on `main` since https://github.com/facebook/react-native/pull/45469.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D60893243

fbshipit-source-id: 7ca4550eafb979730c0c5829df4c200f11e0df30
2024-08-07 06:40:13 -07:00
Thomas Nardone a696d2ed6b Deprecate MapBuilder and remove Kotlin usages (#45743)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45743

This is a Java-centric class that can be replaced by Kotlin's map extensions.

Changelog:
[Android][Deprecated] Deprecate MapBuilder

Reviewed By: cortinico

Differential Revision: D60309106

fbshipit-source-id: 4a764fa1d59993dc735b2181a2270dc79a0e0396
2024-08-02 13:58:32 -07:00
Nicola Corti bd4aec869b RNGP - Do not attempt to load JSC from other repositories (#45598)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45598

I've noticed we attempt to load JSC from the Sonatype Snapshot repository.
That is inefficient as we already know that JSC is available only inside node modules.
This change makes the repository resolution stricter by better specifying which
repo can download which dependency.

Changelog:
[Internal] [Changed] - Do not attempt to load JSC from other repositories

Reviewed By: cipolleschi

Differential Revision: D60116002

fbshipit-source-id: 21a2213708f5b0103860a59f3342f1bc0f59cdb9
2024-07-23 08:12:42 -07:00