Commit Graph
36581 Commits
Author SHA1 Message Date
Nicola Corti 614dadbd01 [LOCAL] Use REACT_NATIVE_BOT_GITHUB_TOKEN token for changelog and bump lockfiles 2025-09-17 11:45:48 +01:00
React Native Bot c996b9a031 [LOCAL] Bump Podfile.lock 2025-07-24 15:36:51 +00:00
React Native Bot 99d714c22d Release 0.80.2
#publish-packages-to-npm&latest
v0.80.2
2025-07-24 13:59:34 +00:00
Nick GerlemanandRiccardo Cipolleschi 95007080ff Fix build_android GHA Job (#52694)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52694

build_android job is always failing, with this assertion. Seems like find/replace in D78484060 gone wrong?

Changelog: [Internal]

Reviewed By: sbuggay

Differential Revision: D78534334

fbshipit-source-id: 291bdd01b41fa6efea00ed63a0dee8bdb14cbc3a
2025-07-24 10:19:14 +01:00
Riccardo Cipolleschi cf48e47982 [LOCAL] Bump Hermes 2025-07-24 08:54:27 +01:00
Riccardo Cipolleschi 183be8e12c Add the ENTERPRISE_REPOSITORY env var to let user consume artifacts from their personal maven mirror 2025-07-24 08:50:21 +01:00
Nicola CortiandRiccardo Cipolleschi 8e47e5486f RNGP - Add support for exclusiveEnterpriseRepository (#52378)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52378

This adds a Gradle property called `exclusiveEnterpriseRepository`
that users can set in their `android/gradle.properties` as such:

```diff
# Use this property to enable or disable the Hermes JS engine.
# If set to false, you will be using JSC instead.
hermesEnabled=true

+exclusiveEnterpriseRepository=https://my.internal.proxy.net/
```

This will remove all the existing Maven repositories and only use the internal mirror they have.

Changelog:
[Android] [Added] - RNGP - Add support for `exclusiveEnterpriseRepository` to specify an internal Maven mirror.

Reviewed By: mdvacca

Differential Revision: D77667573

fbshipit-source-id: 835004d2ae7aa4e250b6f7a88a41918b573f5bd5
2025-07-24 08:41:14 +01:00
Jay KoutavasandRiccardo Cipolleschi d8b5a5570e Fix ConcurrentModificationException in InteropUIBlockListener (#51631)
Summary:
This React Native Android fix hardens the Fabric `InteropUiBlockListener` against `ConcurrentModificationException` crashes in `willMountItems` and `didMountItems`. By iterating over a shallow copy of the UI‐block lists and catching any mid‐iteration mutations, we ensure the listener never throws during a UI frame and always clears its pending blocks.

The issue was first reported in [React Native Issue https://github.com/facebook/react-native/issues/49783](https://github.com/facebook/react-native/issues/49783), and although [React Native PR#50091](https://github.com/facebook/react-native/pull/50091) was closed and not merged, the work in that PR did make it to React Native in [commit 17da3cb](https://github.com/facebook/react-native/commit/17da3cbbf4687f86226c4a80297c4d8abfc9c4f5). However, the fix didn't go far enough. We saw intermittent examples of this exception being thrown when swiping through a carousel from `react-native-reanimated-carousel`. This fix goes right to the exception site itself.

## Changelog:

[ANDROID] [FIXED] -  Hardened the Fabric `InteropUiBlockListener` against `ConcurrentModificationException` crashes in `willMountItems` and `didMountItems`

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

Test Plan:
The only way to test this is to develop a standalone app that emulates what we've been seeing in our commercially available RN app. We have done extensive testing of before (intermittent crashes) and after the fix (no crashes) and things have been standing up very well for us.

Here is a the Red Box we see right at the time of the crash, before this fix:

<img width="414" alt="image" src="https://github.com/user-attachments/assets/8d1b6c6d-42f7-48a0-9574-2f05436547d4" />

And here is the beginning of the logcat crash log:

```
2025-05-07 16:01:49.212 unknown:BridgelessReact com.aura.suite                       W  ReactHost{0}.handleHostException(message = "null")
2025-05-07 16:01:49.212 unknown:ReactNative     com.aura.suite                       E  Exception in native call
                                                                                        java.util.ConcurrentModificationException
                                                                                        	at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:1111)
                                                                                        	at java.util.ArrayList$Itr.next(ArrayList.java:1064)
                                                                                        	at com.facebook.react.fabric.internal.interop.InteropUIBlockListener.willMountItems(InteropUiBlockListener.kt:72)
                                                                                        	at com.facebook.react.fabric.FabricUIManager$MountItemDispatchListener.willMountItems(FabricUIManager.java:1235)
                                                                                        	at com.facebook.react.fabric.mounting.MountItemDispatcher.dispatchMountItems(MountItemDispatcher.java:184)
                                                                                        	at com.facebook.react.fabric.mounting.MountItemDispatcher.tryDispatchMountItems(MountItemDispatcher.java:122)
                                                                                        	at com.facebook.react.fabric.FabricUIManager$3.runGuarded(FabricUIManager.java:820)
                                                                                        	at com.facebook.react.bridge.GuardedRunnable.run(GuardedRunnable.java:29)
                                                                                        	at com.facebook.react.fabric.FabricUIManager.scheduleMountItem(FabricUIManager.java:824)
                                                                                        	at com.facebook.react.fabric.FabricUIManagerBinding.reportMount(Native Method)
                                                                                        	at com.facebook.react.fabric.FabricUIManager$MountItemDispatchListener$1.run(FabricUIManager.java:1282)
                                                                                        	at android.os.Handler.handleCallback(Handler.java:959)
                                                                                        	at android.os.Handler.dispatchMessage(Handler.java:100)
                                                                                        	at android.os.Looper.loopOnce(Looper.java:232)
                                                                                        	at android.os.Looper.loop(Looper.java:317)
                                                                                        	at android.app.ActivityThread.main(ActivityThread.java:8592)
                                                                                        	at java.lang.reflect.Method.invoke(Native Method)
                                                                                        	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580)
                                                                                        	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:878)
```

All of this goes away with this fix. We're using React Native 0.79.2 and this is the first time we've open a PR for react-native. I hope this is enough info as far as testing goes.

Can we see a 0.79.x release with this fix, please?

Reviewed By: Abbondanzo, cortinico

Differential Revision: D75594791

Pulled By: javache

fbshipit-source-id: 982ae27e89756fdb290a24b0bdfa67c2e47c04e3
2025-07-24 08:40:33 +01:00
Riccardo Cipolleschi f40fd43c00 Fix Windows CI (#52666)
Summary:
As per [this issue](https://github.com/actions/runner-images/issues/12416), Windows machine doesn't have access to D: drive anymore

## Changelog:
[Internal] -

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

Test Plan: GHA

Reviewed By: huntie

Differential Revision: D78484060

Pulled By: cipolleschi

fbshipit-source-id: 36d844f9d7d69f1d74a154b019307cc1e269ad66
2025-07-24 08:39:58 +01:00
Fabrizio Cucci fd8a0f323b Update Podfile.lock
Changelog: [Internal]
2025-07-03 11:30:27 +01:00
React Native Bot d0843bd53c Release 0.80.1
#publish-packages-to-npm&latest
v0.80.1
2025-06-30 16:04:24 +00:00
buschcoandReact Native Bot b2cc82ba31 publish index.js.flow instead of index.flow.js (#52179)
Summary:
I think in https://github.com/facebook/react-native/commit/50667eceb1be4771375d6a3cc2f4e42d4d8aad3a the file name was mixed up. Instead of `index.flow.js` it should be `index.js.flow` (see https://github.com/facebook/react-native/blob/main/packages/react-native/index.js.flow)

Should fix https://github.com/facebook/react-native/issues/51885

## Changelog:

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

[General][Added] Publish top-level Flow types for `react-native`

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

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

Test Plan:
Steps to reproduce

1. Setup a react-native project with flow (or clone https://github.com/buschco/react-native-flow + `cd ReproducerApp && npm i`)
2. `import {Alert} from 'react-native'` -> `Alert` has type `any`
3. add `index.js.flow` File (https://github.com/facebook/react-native/blob/v0.79.3/packages/react-native/index.js.flow) to `node_modules/react-native/index.js.flow` -> `Alert` no longer `any`

Reviewed By: christophpurrer

Differential Revision: D77052871

Pulled By: robhogan

fbshipit-source-id: 32b0052a9d96486aff66a1f6e4577ff62cbcd97e
2025-06-23 17:59:31 +00:00
Aswin AndroandReact Native Bot 2cb1f8e4e3 Publish top-level Flow types for react-native (#51908)
Summary:
FIXED Add index.js.flow to npm package files for Flow support

Currently, the distributed npm package for react-native does not include the index.js.flow file, which causes all exports to be typed as any when using Flow. This commit adds index.js.flow to the "files" array in package.json, ensuring Flow users receive proper type definitions out of the box. This addresses issues where type checking with Flow fails in React Native projects.

## Changelog:

[General][Added] Publish top-level Flow types for `react-native`

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

Reviewed By: huntie, necolas

Differential Revision: D76292301

Pulled By: robhogan

fbshipit-source-id: e56360d3f35af30ef160470181349aac1812e7c1
2025-06-23 16:10:27 +00:00
Riccardo CipolleschiandFabrizio Cucci 1c39b2abc3 Bump windows to latests as GH will remove windows-2019 EOM (#51798)
Summary:
As per title, GH is [removing windows-2019](https://github.com/facebook/react-native/actions/runs/15421451006/job/43403215354) at the end of the month. We need to migrate away from them.

## Changelog:
[Internal] - Bump windows runners

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

Test Plan: GHA

Reviewed By: cortinico

Differential Revision: D75946994

Pulled By: cipolleschi

fbshipit-source-id: 972b60300c918c0eae0403ed4149347a4ffa8bd0
2025-06-23 16:47:51 +01:00
Nicola CortiandReact Native Bot 4d346e2b2d Fix crash on ReactInstance due to null returned for getViewManagerNames (#52035)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52035

Fixes https://github.com/facebook/react-native/issues/52014

Some OSS library is still returning null for `getViewManagerNames` especially if they're
implementing the `ViewManagerOnDemandReactPackage` in Java.
I'm adding a try-catch here so that we prevent the NPE for those scenarios.

Changelog:
[Android] [Fixed] - Fix crash on ReactInstance due to null returned for getViewManagerNames

Reviewed By: javache

Differential Revision: D76723826

fbshipit-source-id: cc159dee389257c6877b03a67840a45ee5bec165
2025-06-23 15:46:14 +00:00
Vladimir IlievandReact Native Bot 69a5ad5d8c Fix emitting event from turbo module crashes on 32bit android (#51695)
Summary:
After testing the latest RC and nighly builds, crash appeared when emitting events from turbo modules on 32bit Android devices. The crash is always reproducible only on 32bit devices on signed production builds. Fore more details and the crash log, check the [related issue](https://github.com/facebook/react-native/issues/51628#issue-3094045077).

From what I found, the variadic functions like CallVoidMethod are unsafe on 32bit due to not type checking the passed arguments at compile time. As far as I understand the 64bit cpus and ABIs are more forgiving with alignment and calling conventions. On 32bit the ABIs are strict as arguments are passed on the stack and if there is type/size/alignment issue it reads the wrong memory, which causes the SIGEGV crashes.

## Changelog:
[ANDROID] [FIXED]  - emitting event from turbo module crashes on 32bit android

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

Test Plan:
1. Pull the [reproduction demo](https://github.com/vladimirivanoviliev/rn079eventcrash), install the dependencies (v `0.80` is on PR)
2. Run codegen on android
3. Build signed apk. To create it you will need to create new demo key-store.
4. To install the build apk in 32bit mode you can use `adb -s YOURDEVICE install --abi armeabi-v7a android/app/release/app-release.apk`
5. Run the app, create key, save it. Than update the key and save it again. The app crashes when try to emit event from the turbo module.
6. Patch the related `JavaTurboModule.cpp` file with the changes from this PR and enable build from source.
7. Rebuild and reinstall the apk and test again - the issue is now fixed

## Additional notes:
I have tested the app on android using the `rn-tester` demo app, everything works as expected. I also patched our production app and tested more complex scenarios and they works as expected. I have run the tests and linter and they passed.

One thing that I didn't able to setup and run is the iOS `rn-tester` app, due to Hermes engine error `Command PhaseScriptExecution failed with a nonzero exit code`. I haven't found any information how to fix it. I have followed [this guide](https://github.com/facebook/react-native/blob/main/packages/rn-tester/README.md) and installed node modules using yarn and started the `yarn prepare-ios`. I also haven't found any information with what node version and ruby version the react native package is build on CI so I use the same versions locally. If you provide me with updated instructions for those I can contribute by updating the related guides and including `.npmrc`, `.ruby-version` files.

Reviewed By: cortinico

Differential Revision: D75782377

Pulled By: javache

fbshipit-source-id: b94998be6dd51e90ad4137b1d2e38a6850bc3cb2
2025-06-23 15:44:40 +00:00
Alex HuntandFabrizio Cucci aeab69a744 Move RefreshControlMock into Jest preset files (#51530)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51530

Alternative to https://github.com/facebook/react-native/pull/50784.

`__mocks__` (and other underscored dirs) are correctly excluded from our npm package via `package.json#files`. But in this instance, this is a source file for the `jest/` directory (Jest preset within `react-native`), and should be included — fix by relocating.

Changelog:
[General][Fixed] - Fix missing RefreshControlMock source in Jest preset

Reviewed By: rshest

Differential Revision: D75215731

fbshipit-source-id: 1240344c4236288f31b16513f4df16766ad1e571
2025-06-23 13:51:07 +01:00
Nicola Corti 6f3948fc48 Publish, Close and Release the Maven repository during build_npm_package
Summary:
Due to us moving to central.sonatype.com for publishing, we cannot publish and release the Maven repository in 2 distinct invocations.
This consolidates all the publishing job to happen during build_npm_package

Changelog:
[Internal] [Changed] -

Reviewed By: fabriziocucci

Differential Revision: D76888543

fbshipit-source-id: 3cb0db6176ed2221a12b4f3f1f575232aa006a6c
2025-06-18 13:58:52 +01:00
Nicola Corti 9fe0c1a2b7 Update Nightly URL for newly published versions on central.sonatype.com (#52004)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52004

This is necessary because the snapshots are now going to be published on a different repository:
central.sonatype.com.

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D76596802

fbshipit-source-id: 424fb1134e41502d53b76209fba325c895c79ba8
2025-06-16 10:41:23 +01:00
Nicola Corti bff874e7c7 Move React Native publishing URLs to Central Portal (#51693)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51693

This moves React Native to use the Central Portal URLs rather than the legacy OSSRH ones.
See https://github.com/gradle-nexus/publish-plugin for more context.

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D75673984

fbshipit-source-id: 1de6746809eed72f232eac0c3fb4d809c2046620
2025-06-16 10:41:23 +01:00
React Native Bot 6c92459434 [LOCAL] Bump Podfile.lock 2025-06-12 17:00:57 +00:00
React Native Bot 84ebbb54f5 Release 0.80.0
#publish-packages-to-npm&latest
v0.80.0
2025-06-12 15:27:37 +00:00
React Native Bot effe3fd9e0 [LOCAL] Bump Podfile.lock 2025-06-09 17:51:31 +00:00
React Native Bot 6e8aa89830 Release 0.80.0-rc.5
#publish-packages-to-npm&next
v0.80.0-rc.5
2025-06-09 16:23:01 +00:00
Kacper KafaraandReact Native Bot 4b65d0ee34 Fix new codegen API disabling behaviour of the old one (#51867)
Summary:
Hey, I'm bumping `react-native-screens` to 0.80.0-rc.4 right now & noticed that codegen does not work as expected. It crawls whole library, file by file (when working on a library it also includes nodemodules etc), despite `componentProvider` field being defined in `codegenConfig` in `package.json`.

Namely https://github.com/facebook/react-native/issues/49941 introduced a regression for libraries that stick to the old codegen config format due to compatibility reasons. Take a look at [this code](https://github.com/facebook/react-native/blob/78caa07ff867255724e4b0ce3557ff5793b6ce1b/packages/react-native/scripts/codegen/generate-artifacts-executor/generateRCTThirdPartyComponents.js#L60-L103). We first do a pass for "old API", [removing libraries with `componentProvider` in their codegen config from `librariesToCrawl`](https://github.com/facebook/react-native/blob/78caa07ff867255724e4b0ce3557ff5793b6ce1b/packages/react-native/scripts/codegen/generate-artifacts-executor/generateRCTThirdPartyComponents.js#L66-L75), just to later [add **ALL** libraries](https://github.com/facebook/react-native/blob/78caa07ff867255724e4b0ce3557ff5793b6ce1b/packages/react-native/scripts/codegen/generate-artifacts-executor/generateRCTThirdPartyComponents.js#L86-L89) that do not support new codegen config format back again to `librariesToCrawl`.

This PR improves the filtering condition, to parse codegen annotations only for libraries that have defined any of the fields from the new config format (opted in for new system).

I want to emphasise that this is a significant regression, because it ruins experience of library maintenance, vastly increasing pods installation time.

## Changelog:

[IOS] [FIXED] - Fix codegen crawling all library code with `componentProvider` defined in config

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

Test Plan:
1. Setup an application with any third party library, that uses "old" codegen config format, e.g. `react-native-screens@4.11.1`
2. `cd ios && bundle exec pod install`
3. Observe the codegen logs - it crawles the library instead of using provided information.

Reviewed By: cortinico

Differential Revision: D76126649

Pulled By: cipolleschi

fbshipit-source-id: 6f9c9dffcdca7204a78b4b55db10249240146141
2025-06-09 14:02:39 +00:00
Leevi AattolaandReact Native Bot a1bad641bc fix: exclusion of selectively disabled libraries from codegen generation (#51838)
Summary:
PR https://github.com/facebook/react-native/issues/51078 Implemented finding disabled libraries but the code (below) didn't actually filter any libraries out because destructured name is `undefined`. This pr adds the name to codegenEnabledLibraries so filtering would work.

```js
const libraries = codegenEnabledLibraries.filter(
  ({name}) => !disabledLibraries.includes(name),
);
```

## Changelog:

[IOS] [FIXED] - Skip codegen for selectively disabled libraries in react-native.config.js

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

Test Plan:
1. Install a library that has the componentProvider field set in the codegen config (for example: react-native-safe-area-context and react-native-screens or see [reproducer](https://github.com/aattola/rn-codegen-exclude))
2. Exclude library with react-native.config.js
3. install pods / run codegen
4. Check that codegen actually excluded the specified dependencies from: `ios/build/generated/ios/RCTThirdPartyComponentsProvider.mm`

Rollback Plan:

Reviewed By: cortinico

Differential Revision: D76044622

Pulled By: cipolleschi

fbshipit-source-id: 9e70c2a263c750edb1ea95305c9e5e178e2ce8d8
2025-06-09 14:00:47 +00:00
Gabriel DonadelandReact Native Bot 4c9490c702 generate-artifacts-executor: fix parsing .class in complex classes (#51813)
Summary:
There is an edge case in the codegen `findRCTComponentViewProtocolClass` function where the parsing of the Component Class will fail if there is another `.class` call in the same file after the `Class<RCTComponentViewProtocol>` function. This ends up resulting in a `RCTThirdPartyComponentsProvider.mm` file that looks like the image bellow

<img width="1052" alt="image" src="https://github.com/user-attachments/assets/26ce93be-0370-4852-a949-9da21762ff7f" />

You can reproduce this with the following

```
Class<RCTComponentViewProtocol> XYZCls(void)
{
  return XYZ.class;
}
// this comment breaks codegen .class
```

## Changelog:

[IOS] [FIXED] - Fix codegen extracting `.class` from complex component classes

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

Test Plan: Run codegen locally, use this patch in the expo/expo repo and CI should be green

Reviewed By: cipolleschi

Differential Revision: D75964424

Pulled By: cortinico

fbshipit-source-id: 50e45aa2ac6e43c75ee6fdd76791c591d81d4df7
2025-06-09 13:59:33 +00:00
Tomasz ŻelawskiandReact Native Bot 0a9ea3932a fix: ignore build/ and DerivedData/ dirs in when reading infoPlistFiles (#51833)
Summary:
https://github.com/facebook/react-native/pull/49927 introduced a regression where a Ruby script would read compilation artifacts and fail, when the user has relative build directories set in XCode.

After successful compilation `build/` dir and `DerivedData/` dir have `.plist` files that aren't in UTF-8 encoding and shouldn't be read by the script. If the user tries to reinstall pods at this point, he gets the following error:

![image](https://github.com/user-attachments/assets/6bd31907-66af-4ea5-b2a6-2847e0ee18e1)

This is how you enable relative build directories in XCode.

![Screenshot 2025-06-05 at 11 08 31](https://github.com/user-attachments/assets/22a555b4-a468-481d-8492-02c3b36bfa25)

## Changelog:

[IOS] [FIXED] - Ignore `build/` and `DerivedData/` directories when reading `.plist` files.

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

Test Plan: After applying this patch the problem doesn't occur anymore on my machine.

Reviewed By: cortinico

Differential Revision: D76030133

Pulled By: cipolleschi

fbshipit-source-id: 7ae8c2d0ce28b6925245a9172154e3dcafee126f
2025-06-09 13:57:31 +00:00
Nicola CortiandReact Native Bot 3d06f9e449 Back out "Override updateRuntimeShadowNodeReferencesOnCommit for OSS" (#51839)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51839

Original commit changeset: 4394a2370d9e

Original Phabricator Diff: D73771648

Changelog:
[Internal] -

Reviewed By: lenaic, sammy-SC

Differential Revision: D76038710

fbshipit-source-id: b4d61bef476e8b903432511939cce65e881689c5
2025-06-09 13:55:22 +00:00
React Native Bot c72f490766 [LOCAL] Bump Podfile.lock 2025-06-02 17:53:41 +00:00
React Native Bot dffb675e70 Release 0.80.0-rc.4
#publish-packages-to-npm&next
v0.80.0-rc.4
2025-06-02 16:25:27 +00:00
Jakub PiaseckiandReact Native Bot 302f3a4e5a Update types of Animated FlatList and SectionList (#51602)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51602

Changelog: [GENERAL][FIXED] - Fixed the generated type definitions for `Animated.FlatList` and `Animated.SectionList` to correctly infer item types.

Current definitions for animated list components cast away their generic definitions, preventing the types to be inferred from usage. This diff addresses that.

Reviewed By: huntie

Differential Revision: D75407762

fbshipit-source-id: c86f20298ded707971c05a78d025a63e82fe2a64
2025-06-02 14:15:53 +00:00
Alex HuntandReact Native Bot 5cc63aa9ea Re-expose src/ paths via exports (default) (#51699)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51699

Re-expose **all `"./src/*"` paths via `package.json#exports`.

Follows D72228547 — as we'd attempted to be proactive with hiding `src/`, but are now reverting — essentially reducing this change as much as possible (read: most defensive/safer effect on OSS).

**Motivation**

Mitigates a warning emitted by Metro that may surface in new bare React Native template projects.

{F1978757796}

This is due to a 1P reference to `'react-native/src/private/featureflags/ReactNativeFeatureFlags` in `react-native/virtualized-lists`.

This is enough motivation to undo part of our change with introducing `"exports"` on `react-native` in 0.80.

**Especially**, to avoid confusion with other warnings we've intentionally introduced in 0.80 around subpath imports.

- The key difference is the above screenshot is from Metro and covers **any** import from any `node_modules` file — as opposed to just the immediate project.

Changelog:
[General][Changed] - Re-expose `src/*` subpaths when not using the Strict TypeScript API

The net breaking change for 0.80, once picked, is simply the presence of `"exports"` (only very edge case effects on expanding per-platform extensions, which we've mitigated). **All exported paths equivalent**.

Reviewed By: robhogan

Differential Revision: D75682566

fbshipit-source-id: f90c7298279c6be3a4eab70f2dfdc618ffcf1124
2025-06-02 14:10:39 +00:00
React Native Bot baa421decc [LOCAL] Bump Podfile.lock 2025-05-26 17:22:43 +00:00
React Native Bot e7901a720b Release 0.80.0-rc.3
#publish-packages-to-npm&next
v0.80.0-rc.3
2025-05-26 15:55:04 +00:00
Nicola CortiandReact Native Bot cd8dec00a9 Gradle to 8.14.1 (#51597)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51597

Bumping Gradle patch version to address this problem:
https://github.com/facebook/react-native/pull/50960#issuecomment-2906368364

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

Reviewed By: fabriziocucci

Differential Revision: D75401634

fbshipit-source-id: 07726f4d882a5f447cbaea11c4d159ef85fd7636
2025-05-26 14:16:54 +00:00
Alex HuntandGitHub 647af1c4ca Update debugger-frontend from bc635fa...343405b (S523384 mitigation) (#51564) 2025-05-26 08:56:43 +01:00
Tomasz ZawadzkiandReact Native Bot 0dd583f40d Restore the possibility to extend LayoutAnimationController (#51479)
Summary:
In https://github.com/facebook/react-native/pull/50734, `LayoutAnimationController` was migrated to Kotlin and all of its methods are now marked as final.

However, this class is used and extended by `react-native-reanimated` in order to provide Layout Animations for Android on the Old Architecture. With all its methods being marked as final, the builds are failing.

This PR restores the possibility to extend `LayoutAnimationController`.

## Changelog:

[ANDROID] [FIXED] - Restored the possibility to extend `LayoutAnimationController`

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

Test Plan: I've checked that this PR fixes build errors caused by `LayoutAnimationController` in react-native-reanimated.

Reviewed By: cipolleschi, mdvacca

Differential Revision: D75079557

Pulled By: cortinico

fbshipit-source-id: beeb700cbad87362dda4b60941124562c4753815
2025-05-23 09:57:15 +00:00
Dawid MałeckiandReact Native Bot 869c03e923 Fix VirtualizeSectionList generic arguments (#51496)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51496

Fixes problem with generics passed to `VirtualizedSectionList` in generated types. The `flow-api-translator` creates a re-declaration for `export default` variables which shadows generics.

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D75141051

fbshipit-source-id: 260ef066038320eee3ffa93692f77f1eff5c9205
2025-05-23 09:55:22 +00:00
Phil PluckthunandReact Native Bot 24131c6812 fix: Align TimerManager sequential ids and function error handling with web standard (#51500)
Summary:
Calls to create timers should return sequential ids (integers greater than zero in the spec's words). This regressed in the `TimerManager` implementation, which instead starts at zero inclusively.

This has two side-effects for code assuming a spec-compliant implementation of `setTimeout` and `setInterval`:
- Calls to `clearTimeout(0)` or `clearInterval(0)` will potentially cancel scheduled timers, although it's supposed to be a noop
- Predicates like `if (timeoutId)` will fail since they assume non-negative ids

The change in this PR is to align with WHATWG HTML 8.6.2 (Timers): https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#timers

> otherwise, let id be an [implementation-defined](https://infra.spec.whatwg.org/#implementation-defined) integer that is **greater than zero** and does not already [exist](https://infra.spec.whatwg.org/#map-exists) in global's [map of setTimeout and setInterval IDs](https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#map-of-settimeout-and-setinterval-ids).

Specifically,
- we should return `0` to indicate that no timer was scheduled
- we should start generating timer IDs at `1` instead of `0`

This was previously raised in review comments here: https://github.com/facebook/react-native/pull/45092/files#r1650790008

The spec-incompliant behaviour was raised in an issue here: https://github.com/apollographql/apollo-client/issues/12632#issue-3075269978

This PR does not,
- add bounds checking on `timerIndex_` and add a search of an available id that isn't in the unordered map
- exclude `0` from being an accepted `TimerHandle` in `TimerManager::createTimer` or `TimerManager::deleteTimer` since the above bounds checking hasn't been added either

## Changelog:

[GENERAL] [FIXED] - Align timer IDs and timer function argument error handling with web standards.

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

Test Plan:
- Run `setTimeout` / `setInterval`; before applied changes the timeout for the first timer will be `0`
- Run `setTimeout(null)`; before applied changes the timer ID will be non-zero
- Run `setInterval(null)`; before applied changes an error will be thrown rather than `0` being returned

Reviewed By: cipolleschi

Differential Revision: D75145909

Pulled By: rshest

fbshipit-source-id: 6646439abd29cf3cfa9e5cf0a57448e3b7cd1b48
2025-05-23 09:53:20 +00:00
Krystof WoldrichandReact Native Bot ad1ce87b93 fix(types): Reference global.d.ts using path not types (#51104)
Summary:
After https://github.com/facebook/react-native/pull/49516 TSC would not find the global types.

Types reference expect a package name but was given a path to a declaration.

TS doc: https://www.typescriptlang.org/docs/handbook/triple-slash-directives.html#-reference-path-

This PR changes `types` to `path` to fix the issue.

`dtslint` fails with `no-bad-reference` rule, but the `../src` lives in the same package in `react-native` package.

## 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] - Reference `global.d.ts` using `path` so they can be resolved by TSC

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

Test Plan:
Before the change with current RN 0.79.2 TSC would fail on resolving the global types (example from [Sentry RN SDK build](https://github.com/getsentry/sentry-react-native/commit/134d810cf95416091779806e00d3a3cc6cbace89)):

![Screenshot 2025-05-05 at 17 18 04](https://github.com/user-attachments/assets/b264c8da-aa21-49d8-9597-82586291a01a)

After the change to path TSC finds the global types.

Using TSC Version 4.9.5

Reviewed By: huntie

Differential Revision: D74208815

Pulled By: coado

fbshipit-source-id: 2fd51d79061ffb356c047604213cff7a425f167e
2025-05-23 09:51:15 +00:00
Joe VilchesandGitHub fb62355555 Remove useEditTextStockAndroidBehavior and resolve old android blur issue (#51338) (#51462)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51338

There was some problems removing this feature flag earlier in that, on older android versions, we would try to focus the top most text input whenever any other text input would try to blur. This was ultimately and issue with how Android implements `clearFocus`. To fix this, lets block the focusability of all views while we clear the focus, then re-enable.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D74760594

fbshipit-source-id: 2811c08ad6ed0855da0a4d7fca89fb08f84905c2
2025-05-23 10:47:49 +01:00
riteshshukla04andReact Native Bot 068a6ba0fd Correct Link for Networking (#51396)
Summary:
I noticed the link to networking in new app screen is wrong. So correcting it here

## Changelog:
[GENERAL][FIXED] - Fix Networking URL in New app screen

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

Test Plan: Click on the link to open

Reviewed By: arushikesarwani94

Differential Revision: D74886240

Pulled By: cortinico

fbshipit-source-id: 19ccf63e64f0e40df4a0ab4082299c654926e35d
2025-05-23 09:42:16 +00:00
Dawid MałeckiandRiccardo Cipolleschi f9a851fc31 Remove dtslint from type tests (#51382)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51382

This diff replaces `dtslint` which is obsolete and [It is not intended to be used on its own, but as part of the definitelytyped set of packages](https://github.com/microsoft/dtslint) in favor of `tsc` type tests.

It's probably not necessary to have `test-typescript-offline` as tsc does that out of the box but doesn't test with multiple TS versions.

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D74804967

fbshipit-source-id: 4c581ba5debf6fd0bb8dcddbb95f3c85b05082d4
2025-05-20 14:00:19 +01:00
React Native Bot d1b5793c1b [LOCAL] Bump Podfile.lock 2025-05-19 20:09:16 +00:00
React Native Bot b35291cbb8 Release 0.80.0-rc.2
#publish-packages-to-npm&next
v0.80.0-rc.2
2025-05-19 18:06:14 +00:00
Dawid MałeckiandJorge Cohen 1cc46014d6 Fix generated types base on __typetests__ (#51383)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51383

This diff is a set of alignments/improvements in generated TS types. It includes:
- extending `AppStateStatus` with `extension` and `unknown`,
- exporting `AnimatedProps` under `Animated` namespace,
- resolving issue with discriminated unions in `ProgressBarAndroidTypes`,
- fixing `StyleSheet.create` type to accept only specified style properties,
- extending `TextProps` with `AccessibilityProps`,
extending Fn Args generic with `$ReadOnlyArray` in `ErrorUtils`,
- small `__typetests__` adjustments,
- removing type test `styleDimensionValueValidAnimated` as `DimensionValue` no longer accepts `AnimatedNode`,
- removing `styleDimensionValueInvalid` as `DimensionValue` accepts any string now - template literal types in Flow are not supported,
- changing `overlayColor` type to `ColorValue` to align with manual types,
- fixing `AnimatedPropsAllowList` type which wasn't correct in TS because index signature type was different from style type,
- using `DeviceEventEmitter` instead of `DeviceEventEmitterStatic` in type tests which is equivalent in both new and old types - `DeviceEventEmitterStatic` was only a type of `DeviceEventEmitter`,
- removing type test for checking forwarded key type - doesn't work with new types and that shouldn't be supported,
- removing `Animated.legacyRef` type test - not included in new types,
- adding `DOMRect` from "dom" lib to `globals.d.ts` to not include "dom" lib in the tsconfig - tries to compare globals with `lib.dom.d.ts` and produces many errors,
- exporting `SectionListData`,

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D74807552

fbshipit-source-id: c5254ea0f701f3602b9d716faeb50ca1ab21b013
2025-05-19 16:59:19 +01:00
Alan LeeandReact Native Bot 5b630d224a migrate deprecated KEYCODE_BACK in Modal (#51097)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51097

**Problem:** `Event.KEYCODE_BACK`has been deprecated with targetSdk 36, predictive back will be enforced and KEYCODE_BACK no longer triggered. We need to migrate to backward compatible `OnBackPressedCallback`.
- https://developer.android.com/about/versions/16/behavior-changes-16#predictive-back.

**Solution:**
Use `OnBackPressedCallback` to handle BACK. Logic for ESC key handling still remains.
To support the callback mechanism, we are using AndroidX ComponentDialog ([src](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:activity/activity/src/main/java/androidx/activity/ComponentDialog.kt)) which is a thin wrapper on the existing Dialog.

Changelog:
[Internal]

Reviewed By: mdvacca

Differential Revision: D74162844

fbshipit-source-id: ebd0e89c29999d3dd99431a4359c442e42d23911
2025-05-19 15:52:23 +00:00
Christian FalchandReact Native Bot a49bf3722b adding accessor for backing map (#51386)
Summary:
Expo is using the backingmap to be able to update properties in a fast and performant way in two overridden view manager subclasses (ViewGroupManager subclass is one of them).

This diff exposes the backing field via JvmName using the `internal_` prefix.

So Expo can keep on accessing the field as they were doing before. In the long run we should prevent them from accessing this property altogether but this would require a different API.

## Changelog:

[INTERNAL] -

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

Test Plan: Build with Expo modules

Reviewed By: cipolleschi

Differential Revision: D74884533

Pulled By: cortinico

fbshipit-source-id: e76673c794a6a125059633d29445d991d867b770
2025-05-19 15:43:31 +00:00
Dawid MałeckiandReact Native Bot 9858e1e1dc Align ImageStyle overflow prop type and compose function type (#51285)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51285

The `composeStyles` function should correctly determine the type of the input styles (`ViewStyle`, `ImageStyle`, `TextStyle`) base on the output type:

```ts
const combinedStyle8: StyleProp<ImageStyle> = StyleSheet.compose(
  // ts-expect-error
  composeTextStyle,
  composeTextStyle,
);
```

This diff adds generic type checking for `compose` function and fixes `ImageStyle` overflow prop type which accepted `scroll` property (which wasn't previously accepted in manual types) and which enables type system to distinguish `ImageStyle` from `ViewStyle` and `TextStyle`:

previous:
```ts
overflow?: 'visible' | 'hidden' | 'scroll'
```

current:
```t
overflow?: 'visible' | 'hidden'
```

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D74574293

fbshipit-source-id: 751a44f2d3cd43055d93031343995f16ef87b185
2025-05-19 15:41:17 +00:00