Commit Graph

38536 Commits

Author SHA1 Message Date
Nicola Corti c6be72a28d Cleanup changelog for a specific breaking change
Summary:
As discussed with huntie, this is not a breaking change.

Changelog:
[Internal] [Changed] -

bypass-github-export-checks

Reviewed By: huntie

Differential Revision: D71201094

fbshipit-source-id: 3a27e621ac7718e4574c7981e5d64802e36e74cd
2025-03-14 11:44:01 -07:00
Samuel Susla 9d19992088 add documentation for Fantom public APIs (#50034)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50034

changelog: [internal]

add documentation for Fantom public APIs.

Reviewed By: rubennorte

Differential Revision: D71197744

fbshipit-source-id: dc7f97732eb6437bc0a33dec9fe2430e38c49e66
2025-03-14 11:12:15 -07:00
Samuel Susla 0f45d332d4 move Fantom's API to regular functions (#50035)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50035

changelog: [internal]

to make it easier to write JSDocs, let's export functions directly from index.js instead of using proxy object.

Reviewed By: rubennorte

Differential Revision: D71200977

fbshipit-source-id: 0b53c0d3f73577c19253537b9e884459a4920643
2025-03-14 11:12:15 -07:00
Danny Su 827db0a88b Explicitly include hermes.h in RCTHostTests.mm (#50022)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50022

RCTHostTests.mm calls `makeHermesRuntime`, which is from `hermes.h`. Explicitly include the header so that RCTHostTests isn't getting it indirectly.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D71146426

fbshipit-source-id: 5a5f5a466e1920797c4531773ca23f53eb1203b7
2025-03-14 11:08:25 -07:00
Mateo Guzmán 8eaa8f5adb Migrate JSPackagerClient to Kotlin (#50018)
Summary:
Migrate com.facebook.react.packagerconnection.JSPackagerClient to Kotlin.

## Changelog:

[INTERNAL] - Migrate com.facebook.react.packagerconnection.JSPackagerClient to Kotlin

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

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

Reviewed By: cortinico, rshest

Differential Revision: D71153096

Pulled By: arushikesarwani94

fbshipit-source-id: c9a15bb0d45c381b6897842a35dc5ccd712ee3a1
2025-03-14 10:49:29 -07:00
Vitali Zaidman c07334ca03 logging- log socket connection uptime in dev middleware (#50016)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50016

Changelog:
[General][Internal] logging- log socket connection uptime in dev middleware

Reviewed By: robhogan

Differential Revision: D71126344

fbshipit-source-id: 026bac9620ffb933d90db255b59fbf79bfed902b
2025-03-14 09:16:30 -07:00
Samuel Susla 6e6e2ea0ca add tests for Fantom.scheduleTask (#50033)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50033

changelog: [internal]

All public APIs should be covered with tests, this diff adds tests for Fantom.scheduleTask.

Reviewed By: rubennorte

Differential Revision: D71195921

fbshipit-source-id: dc7f0f889b9633b1e641dc8887fd506bc4753fe5
2025-03-14 09:03:12 -07:00
Zeya Peng 01eafef8b4 Add updateShadowTree to UIManager (#50020)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50020

Changelog: [Internal]
[General][Added] - Add `updateShadowTree` to UIManager

We have an internal method `updateShadowTree` that does similar thing as `ReanimatedModuleProxy::cloneShadowTreeWithNewProps` in reanimated (https://github.com/software-mansion/react-native-reanimated/blob/6516b2e4e12c0186cdf00e7f85b8fef820b97088/packages/react-native-reanimated/Common/cpp/reanimated/Fabric/ShadowTreeCloner.cpp#L67 it's logically similar but not copied over), with which we can efficiently commit props for multiple shadowNodes onto ShadowTree. it guarantees every ShadowNode that needs to be updated in this commit is only cloned once.

Reviewed By: javache

Differential Revision: D71129150

fbshipit-source-id: 92156114ec6c2694e1639cf2ecf153d243ade769
2025-03-14 08:42:23 -07:00
Riccardo Cipolleschi 54b22211dc Remove CGFLOAT_IS_DOUBLE macro (#50017)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50017

[From iOS 11 onwards and from MacOS 10.15](https://developer.apple.com/documentation/uikit/updating-your-app-from-32-bit-to-64-bit-architecture?language=objc), Apple only supports 64 bit architectures.

Hence, [`CGFloat` is now always mapped to a Double](https://developer.apple.com/documentation/corefoundation/cgfloat-swift.struct?language=objc#overview) and it is now safe to remove the macro.

## Changelog
[Internal] - Remove usages of `CGFLOAT_IS_DOUBLE`

Reviewed By: javache

Differential Revision: D71128583

fbshipit-source-id: bad805b941451ab84a68912f6d72149bfd7753ec
2025-03-14 06:46:00 -07:00
Vitali Zaidman a6e854efe9 extract heartbeat mechanics from inspector proxy to its own file (#49993)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49993

Changelog:
[General][Internal] extract heartbeat mechanics from inspector proxy to its own file

Reviewed By: robhogan

Differential Revision: D70970405

fbshipit-source-id: 22565853a426f3156c9eed0dfd22492dd8e31407
2025-03-14 06:38:16 -07:00
Ritesh Kumar Shukla 3dac90006f Implementing url Methods (#49955)
Summary:
Implemented Methods in URL which were not implemented yet
The methods output are identical to outputs of window.url .

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

## 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][Added] URL accessors for unimplemented Methods

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

Test Plan:
Code:-
<img width="558" alt="image" src="https://github.com/user-attachments/assets/a75e5429-0e03-4392-9fde-138c63b96ce5" />

Tested with Hermes
![image](https://github.com/user-attachments/assets/0075826a-df3a-4eae-a8f2-bec26be42fbf)

Tested with JSC
![image](https://github.com/user-attachments/assets/bcdbd430-5ee3-48a2-873f-7d823c9072f6)

Reviewed By: rshest

Differential Revision: D71113046

Pulled By: cortinico

fbshipit-source-id: 58093c61d2e7bb732d2f1af6b19508a100c86333
2025-03-14 05:22:48 -07:00
Dawid Małecki ef0de0e848 Move event-target-shim types to react-native package (#50013)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50013

The diff incorporates event-target-shim types that will be referenced by generated TS types to make sure that the public API does not change unexpectedly. The generated tsconfig contains path property which tells Typescript to use copied types instead of the downloaded event-target-shims types.

Changelog:
[internal] - Moved event-target-shim types to react-native package.

Reviewed By: huntie

Differential Revision: D71044389

fbshipit-source-id: b2837cc880a2161f7ff716470fd6eb4644d514e2
2025-03-14 01:54:14 -07:00
Pieter Vanderwerff 934c4465ae Deploy 0.265.0 to fbsource (#50025)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50025

Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D71158296

fbshipit-source-id: db3e5678c97536517cdb0375843f2c882d5213f9
2025-03-13 17:18:45 -07:00
David Vacca 920f0f8fbe Avoid debug crash when SendAccessibilityEventMountItem fails due to view dissapearing (#50021)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50021

Avoid debug crash when SendAccessibilityEventMountItem fails due to view dissapearing

changelog: [internal] internal

Reviewed By: makovkastar

Differential Revision: D71135286

fbshipit-source-id: b75f048ac241d2001eade8f0dd19234bdd55178f
2025-03-13 13:28:08 -07:00
Rubén Norte 5d10012106 Add Fantom test for requestIdleCallback (#50019)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50019

Changelog: [internal]

This adds some basic tests for the API to show that it's working correctly.

This was in response to https://github.com/facebook/react-native/issues/49684. If there are use cases that we think are incorrectly handled, we should add them to this test.

Reviewed By: cortinico

Differential Revision: D71128943

fbshipit-source-id: 73876ba514c23ec8f829723500fa408512b90222
2025-03-13 12:09:12 -07:00
Eric Rozell 8673294806 Add option for deterministic Animated batching on iOS (#49942)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49942

iOS flushes NativeAnimated operations to the UI thread in one of two ways:
1. Some operations flush immediately when the operation is queued, namely startAnimation, stopAnimation, and setValue.
2. Other operations rely on flushing from one of the previous operation types, or a UIManager mount callback.

This behavior leads to non-determinism in flushing of some operations like `setOffset` or `startListeningToAnimatedNodeValue`, where if these operations are created, out-of-band from "flushed" operations, they will not take affect until the next React commit.

This change wires up the `animatedShouldSignalBatch` feature flag to queue operations on the JS thread, and flush them after `NativeAnimated.finishOperationBatch` is called.

## Changelog

[Internal]

Reviewed By: javache

Differential Revision: D70904592

fbshipit-source-id: 6bc7a8614cbe5e275d4d7bf5310da9f0090c0e10
2025-03-13 11:52:26 -07:00
Rubén Norte 6838d46b70 Clean up feature flag for TextInput state synchronization (#49989)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49989

Changelog: [internal]

This experiment didn't yield any significant wins and there are some failing e2e tests which seem suspicious, so better be safe and keep the current version.

Reviewed By: javache

Differential Revision: D71050517

fbshipit-source-id: da14fdd49e8d39cdcdc1dd579a50af3bf894d08a
2025-03-13 11:11:05 -07:00
Pieter De Baets 2196597e2b Makes TouchesHelper internal (#50014)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50014

This was unintentionally made public during the Kotlin migration (D67791375), revert back to internal visibility, and update some of the deprecation comments.

Changelog: [Android][Removed] TouchesHelper is no longer part of the public API

Reviewed By: Abbondanzo

Differential Revision: D71114176

fbshipit-source-id: 2bd8882039fb972e1c2632a503292080c56a2f22
2025-03-13 09:48:01 -07:00
Joseph Nields 86911003dc Add compact option (#49979)
Summary:
If you use this preset to create library code, it is often helpful to be able to still read the transpiled code, even when sourcemaps are available.

This change adds a compact option which allows for disabling the default behavior that removes whitespace from the transpiled files.

## Changelog:

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

Pick one each for the category and type tags:

[GENERAL] [ADDED] - Add `compact` option to `react-native/babel-preset` to allow disabling whitespace removal

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

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

Reviewed By: rshest

Differential Revision: D71109024

Pulled By: robhogan

fbshipit-source-id: ab205cca2a82b56955d1e1c55e288dcbe7754f8f
2025-03-13 09:22:23 -07:00
Tim Yung 2a40010215 Animated: Avoid Invalidation of Ref Callback (#50002)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50002

Creates a new feature flag, `avoidAnimatedRefInvalidation`, to experiment with changing `useAnimatedProps`, so that the returned ref callback is no longer invalidated when `props` changes.

When we introduced `useAnimatedPropsMemo` and stabilized `AnimatedProps` (which is only invalidated when `AnimatedValue` and shallow `AnimatedEvent` instances are changed in an update), we should have also made this change. It was an oversight that we did not do this.

Avoiding unnecessary invalidation of the ref callback is important to reduce extra work and unpredictable semantics associated with unnecessary detaching and re-attaching of refs.

Changelog:
[Internal]

Reviewed By: lunaleaps, jbrown215

Differential Revision: D71074781

fbshipit-source-id: 82386a79b8e9bed0b74d9b85978af66f453a7ad0
2025-03-13 08:52:50 -07:00
Riccardo Cipolleschi dd7dccd88b Add Nightly support for prebuilds (#49991)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49991

This change adds nightly support for prebuilds.

t works the same way hermes works: if the react native version contains nightly, we try to use that version to download the right tarball.

To work, it needs to use the `RCT_USE_RN_DEP` env variable.

## Changelog
[Internal] - Add Nightly support to consume ReactNativeDependencies

Reviewed By: cortinico

Differential Revision: D71050926

fbshipit-source-id: 9f461b5f17fde960d92b4082bc60f76959e82cdf
2025-03-13 08:40:14 -07:00
Riccardo Cipolleschi b8ab4c8d96 Connect ReactNativeDependencies with ios jobs (#49978)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49978

This change connects the RNDependencies we prebuild in CI with the other iOS jobs we have.

By doing so, we aim to speed up the build time in CI, saving time and money.

## Changelog:
[Internal] - Connect the ReactNativeDependencies in CI

Reviewed By: cortinico

Differential Revision: D71034587

fbshipit-source-id: 14f1237f4fb57ee103a80be1718042d66ff7b0d7
2025-03-13 08:40:14 -07:00
Riccardo Cipolleschi a663731ddd Add Support for local tarball to ReactNativeDependencies (#49970)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49970

This change add supports to pass a tarball from a local file to the ReactNativeDependencies podspec, so that we can build React Native using a local copy or the RNDependencies and we can use it also in CI.

## Changelog:

[INTERNAL] - Add support for local tarballs

Reviewed By: cortinico

Differential Revision: D71032641

fbshipit-source-id: d83c96c8c12f3add45f8f5ea15fa0eac06d0bedf
2025-03-13 08:40:14 -07:00
Christian Falch 4c9431adda Update podspecs to use the ReactNativeDependencies or build from source (#49968)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49968

Updates all the core podspec to use the new `ReactNativeDependencies` podspec

## Changelog:

[INTERNAL] - Updates Modules in core to use the new dependencies.

Test Plan:
 Run Rn-Tester and  verify that it works as expected both building deps from source and using prebuilt tarballs
 Add third-party library (react-native-reanimated) and perform the same tests to verify that it works with the changed podspec and utilities

Reviewed By: cortinico

Differential Revision: D71032639

Pulled By: cipolleschi

fbshipit-source-id: e53179a8c1b47ee2b945f5cb5dfaf3f6f2755af2
2025-03-13 08:40:14 -07:00
Christian Falch 1e13ad64d8 Configure the Cocoapods infrastructure to use the ReactNativeDependencies.podspec (#49971)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49971

Updated the Cocoapods infrastructure to use the new  the `ReactNativeDependencies.podspec`

## Changelog:

[INTERNAL] - Configured the Cocoapods infra to use the new `ReactNativeDependencies.podspec`

Test Plan:
 Run Rn-Tester and  verify that it works as expected both building deps from source and using prebuilt tarballs
 Add third-party library (react-native-reanimated) and perform the same tests to verify that it works with the changed podspec and utilities

Reviewed By: javache, cortinico

Differential Revision: D71032638

Pulled By: cipolleschi

fbshipit-source-id: 154c8891d5b8b4b84952274c169479122a4800b1
2025-03-13 08:40:14 -07:00
Christian Falch 6bde3ce715 Add ReactNativeDependencies.podspec and replace script. (#49812)
Summary:
There are two environment variables that is related to ReactNativeDependencies:
- `RCT_USE_DEP_PREBUILD `: If set to 1, ReactNativeDependencies will be built from source.
- `RCT_DEPS_VERSION`: If set to 1, it will override the version of ReactNativeDependencies to be used.
bypass-github-export-checks
## Changelog:

[INTERNAL] - Introduced functions to configure ReactNativeDependencies in Cocoapods

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

Test Plan:
 Run Rn-Tester and  verify that it works as expected both building deps from source and using prebuilt tarballs
 Add third-party library (react-native-reanimated) and perform the same tests to verify that it works with the changed podspec and utilities

Reviewed By: javache

Differential Revision: D70968672

Pulled By: cipolleschi

fbshipit-source-id: bb93e763bd71cec7314565b5a751b226735b404e
2025-03-13 08:40:14 -07:00
Christian Falch e876e4926f Improve RCT-Folly so that other dependencies don't have to specify the folly flags (#49969)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49969

Improved RCT-Folly podspec by configuring it as a prepare step, so that we don't need to forward the folly flags to all the others pods and to 3rd party dependencies.

## Changelog:

[INTERNAL] - Configure folly in a prepare step

Test Plan:
 Run Rn-Tester and  verify that it works as expected both building deps from source and using prebuilt tarballs
 Add third-party library (react-native-reanimated) and perform the same tests to verify that it works with the changed podspec and utilities

Reviewed By: javache

Differential Revision: D71032640

Pulled By: cipolleschi

fbshipit-source-id: a34a9b38fa5d5b37a0a193a73659f0d45dd3d660
2025-03-13 08:40:14 -07:00
Dawid Małecki c50465c637 Add support for triple-slash directives in generated .d.ts files (#50008)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50008

The diff adds extraction of triple-slash directives using regex to match and retrieve following reference.

Changelog:
[internal] - Added support for triple-slash directives in generated .d.ts files

Reviewed By: huntie

Differential Revision: D71113674

fbshipit-source-id: 2207d5b455515c44ba585ffecc063914e0818e58
2025-03-13 08:00:59 -07:00
Samuel Susla 65ffc588fb introduce convenience method Fantom.scrollTo (#50011)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50011

changelog: [internal]

Majority of time, you want to simply scroll. This diff introduces a convenience method Fantom.scrollTo.

Previously, you would have to write:
```
  Fantom.runOnUIThread(() => {
    Fantom.enqueueScrollEvent(element, {
      x: 0,
      y: 60,
    });
  });
  Fantom.runWorkLoop();
```

Now, you can just do:
```
 Fantom.scrollTo(element, {
    x: 0,
    y: 60,
  });
```

Reviewed By: rubennorte

Differential Revision: D71113680

fbshipit-source-id: aed49a2f12be8ab30be549235cc7a2b3e35faadb
2025-03-13 07:42:32 -07:00
Samuel Susla b275a318a6 rename fantom.scrollTo to fantom.enqueueScrollEvent (#50009)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50009

changelog: [internal]

rename method `scrollTo` to `enqueueOnScrollEvent` to make it obvious that event is only enqueued and not executed.

Reviewed By: rubennorte

Differential Revision: D71027761

fbshipit-source-id: 8a22babc2f5e86196c0b0af75ab65d539048dc72
2025-03-13 07:42:32 -07:00
Alex Hunt bf35a00ba2 Align organisation of index exports (#49975)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49975

Removes the "Plugins" category from the non-structural grouping of exports in `index.js`, `index.js.flow`, aligning these with the "APIs" and "Components" categories in our docs.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D71033295

fbshipit-source-id: bd39bb6ff5e30c1ed0a8d56d1ed61d52120fb776
2025-03-13 06:53:17 -07:00
Jakub Piasecki e4721332a8 Align AppRegistry namespace with Animated (#49928)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49928

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D70894716

fbshipit-source-id: cb0d2f6405a1ceabdd1f0fb89bf936e2e8c83e3c
2025-03-13 06:26:44 -07:00
Rubén Norte 1e38964e91 Clean up enableDOMDocumentAPI feature flag (#49990)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49990

Changelog: [internal]

This cleans up the flag and makes the Document API essentially part of the DOM APIs flag, after we've verified this is stable in a production experiment.

Reviewed By: sammy-SC

Differential Revision: D68772174

fbshipit-source-id: 3b3d0c4369a648faab3dc7caed8eec2c95fa05b3
2025-03-13 05:50:59 -07:00
Mateo Guzmán a9babf9bc9 Migrate ViewAtIndex to Kotlin (#49963)
Summary:
Migrate com.facebook.react.uimanager.ViewAtIndex to Kotlin.

## Changelog:

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

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

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

Reviewed By: cortinico

Differential Revision: D71031245

Pulled By: javache

fbshipit-source-id: eb9d4fd59a6017b9ef65b239ee73697b476df8f2
2025-03-13 05:28:50 -07:00
Vitali Zaidman b226049a4a Update tests to support new didOpen delegate fn (#50006)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50006

Changelog: [Internal]

Reviewed By: robhogan, huntie

Differential Revision: D71111802

fbshipit-source-id: 733a601007125b6aed4411ba95a41845823a26da
2025-03-13 04:22:14 -07:00
Andrew Knapp 313d7d79d4 Fix 49958: Close a view leak due to lossy onAnimationEnd callback (#49959)
Summary:
Android's onAnimationEnd callback is lossy and ocasionally just does not fire.  However the LayoutAnimationController maintains a sparse array of animations (with Strong View refs) that is only cleaned when the onAnimationEnd callback is invoked.  This results in a leak of Android View objects over time.

To avoid this, the Strong View refs are migrated to WeakReference's and the associated sparse array is cleaned of any invalid layout animations in response to the reset() call.

This closes two leaks:
1. Unbound growth in LayoutAnimationController::mLayoutHandlers
2. Pinning View objects into memory as the sole remaining GC root

## Changelog:

1. Made OpacityAnimation and PositionAndSizeAnimation classes hold weak refs to views only
2. Added a method to LayoutHandlingAnimation to surface if their view ref is gone
3. Added cleanup for Animation with bad view refs

Pick one each for the category and type tags:

[ANDROID] [Fixed]- Fixes memory leak

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

Test Plan: * Primarily code inspection and regression given the intermittent nature of Android's failure to execute the callback.

Reviewed By: alanleedev

Differential Revision: D71037262

Pulled By: javache

fbshipit-source-id: 1fa4eaa2ca839f347a55cb37e2648db972748586
2025-03-13 04:17:17 -07:00
Vitali Zaidman e2eed3984e update the npm package "debug" flow types to v4.4.x (#49980)
Summary:
X-link: https://github.com/facebook/metro/pull/1462

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

Changelog:
[General][Internal] update the npm package "debug" flow types to v4.4.x

Reviewed By: robhogan

Differential Revision: D70976838

fbshipit-source-id: 7ca7daf5e7677721b0464c66dd482a40cea3ae61
2025-03-13 04:10:38 -07:00
Tim Yung 1bb7446993 RN: Set react.runtime=automatic in Flow Config (#50001)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50001

Updates `react-native/.flowconfig` with the following option:

```
react.runtime=automatic
```

This adjusts Flow to model the current behavior of React and JSX, relaxing the requirement that JSX elements have `React` within scope.

Changelog:
[General][Changed] - Changed Flow for the React Native monorepo, so that `React` no longer has to be in scope when using JSX.

Reviewed By: javache

Differential Revision: D71096283

fbshipit-source-id: 65762ac39206c682b7be5d3f512b2b83f7eb1b49
2025-03-13 04:09:43 -07:00
Nick Gerleman 5e7c0d2096 Add Jest E2E Tests for S462299 (#50000)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50000

This adds some tests that verify that controlled textinput, via text prop, or children creating attributedstring, does not jumble text, so long as JS side does not mutate underlying text content.

The rewriting/max length example does still run into problems here.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D71076703

fbshipit-source-id: 85995e8cc087533b1115f158ba5dad67ed008289
2025-03-12 19:45:29 -07:00
Luna Wei da3b98bbcd Call RCTScreenSize early (#49999)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49999

Changelog: [Internal]

Early initialize call to RCTScreenSize which is used by Modal and will read screen size off the UI Thread to avoid main thread deadlocks

Reviewed By: sammy-SC

Differential Revision: D70999156

fbshipit-source-id: 47fb8666c3330ee67cbcb430060f0cec37ec3c7c
2025-03-12 18:26:48 -07:00
Jorge Cabiedes Acosta 7583897b9f Add nullptr checks for findNextFocusableView
Summary:
We were missing some null checks that could cause a crash.

There seems to be some cases where either the parent or the currently focused View are present on Android's hierarchy but not present on the Shadow Tree, in this cases we can just return a nullptr to fall back to default focusing behavior on Android.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D71050870

fbshipit-source-id: a4b4e533c4e9a59c53190feb4b23db4b436b8ae9
2025-03-12 18:14:52 -07:00
Nicola Corti e69f829a3f Beautify Changelog for 0.79 (#49987)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49987

I went through the whole changelog for 0.79 and applied categories to all the entries + did some significant cleanup (remove some entries that were actually internals, grouped and sorted various items)..

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D71003373

fbshipit-source-id: 5a95e619f1cf2ffc84263b92104efee16fd74e53
2025-03-12 15:45:34 -07:00
Arushi Kesarwani d8b0e050c4 Making RN Codegen generate ComponentDescriptors.cpp (#49939)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49939

Making RNCodegen.js generate the ComponentDesciptors.cpp and https://github.com/facebook/react-native/pull/42962 adds all entries, just missed this one.

Changelog:
[Android] [Fixed] - Fix RNCodegen.js for generating ComponentDescriptors.cpp

Reviewed By: shwanton

Differential Revision: D70925850

fbshipit-source-id: 2e2eae64f5371b0bc5a452d4bd0c9269e9253bb1
2025-03-12 15:44:46 -07:00
Ramanpreet Nara 76436d35c7 package.json: Introduce annotations as a way to declare modules/components (#49941)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49941

This diff introduces annotations into the ios codegen config!

## Before
In the new architecture, people can declare module/component codegen config in [package.json](https://reactnative.dev/docs/the-new-architecture/using-codegen#configuring-codegen)

This config contains the following maps:
- modulesConformingToProtocol
- modulesProvider
- componentProvider

```
"codegenConfig": {
    "name": "HelloWorldSampleModule",
    "type": "all",
    "jsSrcsDir": "specs",
    "android": {
      "javaPackageName": "com.helloworld"
    },
    "ios": {
      "modulesConformingToProtocol": {
        "RCTImageURLLoader": [
          "RCTHelloWorldImageURLLoader"
        ],
        "RCTURLRequestHandler": [
          "RCTHelloWorldURLRequestHandler"
        ],
        "RCTImageDataDecoder": [
          "RCTHelloWorldImageDataDecoder"
        ]
      },
      "modulesProvider": {
        "HelloWorldImageURLLoader": "RCTHelloWorldImageURLLoader",
        "HelloWorldURLRequestHandler": "RCTHelloWorldURLRequestHandler",
        "HelloWorldImageDataDecoder": "RCTHelloWorldImageDataDecoder"
      },
      "componentProvider": {
        "FooComponent": "RCTFooComponentClass"
      }
    }

```

## After
This information is a little bit easier to understand if we group it by module/component (into **annotations**):

(that's what this diff does!)

```
"codegenConfig": {
    "name": "HelloWorldSampleModule",
    "type": "all",
    "jsSrcsDir": "specs",
    "android": {
      "javaPackageName": "com.helloworld"
    },
    "ios": {
      "modules": {
        "HelloWorldImageURLLoader": {
          "conformsToProtocols": ["RCTImageURLLoader"],
          "className": "RCTHelloWorldImageURLLoader"
        },
        "HelloWorldURLRequestHandler": {
          "conformsToProtocols": ["RCTURLRequestHandler"],
          "className": "RCTHelloWorldURLRequestHandler"
        },
        "HelloWorldImageDataDecoder": {
          "conformsToProtocols": ["RCTImageDataDecoder"],
          "className": "RCTHelloWorldImageDataDecoder"
        }
      },
      "components": {
        "FooComponent": {
          "className": "RCTFooComponent"
        }
      },
    }

```

## Migration
The old way is still supported (for now). We will deprecate it soon, and eventually remove it from react native!

Changelog: [iOS][Added] - Codegen: Introduce module/component annotations inside package.json

Reviewed By: mdvacca

Differential Revision: D70822061

fbshipit-source-id: 87ec5664a551c54b9300ba92987f237a601ccfbf
2025-03-12 14:55:13 -07:00
Ramanpreet Nara 9ea07cfb02 generate-artifacts-executor: decompose into smaller files (#49905)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49905

This diff breaks down generate-artifacts-executor into smaller files.

Changelog: [Internal]

Reviewed By: alanleedev

Differential Revision: D70795042

fbshipit-source-id: 1235f4ecf5f87c320719b622e546780823920fd3
2025-03-12 14:55:13 -07:00
Ramanpreet Nara 8afdbebf9d Add snapshot tests for generate-artifacts-executor (#49940)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49940

This will just make sure that we don't unintentionally break this script.

Changelog: [Internal]

Reviewed By: alanleedev

Differential Revision: D70919549

fbshipit-source-id: 6d9f2acca46486f1c920afed69609c70f53e6b18
2025-03-12 14:55:13 -07:00
Vitali Zaidman b899a0013b track maximum cdp proxy messages from device queue size (#49945)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49945

Changelog:
[General][Internal] track maximum cdp messages from device queue size

Reviewed By: robhogan

Differential Revision: D70404011

fbshipit-source-id: 0191301b27f25ab91b2e9549dd14fd9e40bd825e
2025-03-12 13:43:43 -07:00
Samuel Susla 2aeccf2b90 fix crash in view culling when unflattening ScrollView's contents (#49992)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49992

changelog: [internal]

View culling does not play along with view flattening/unflattening. This diff adds a test case for it + fix. Previously, view culling would crash.

There are still untested branches of view flattening/unflattening where I am trying to come up with test cases.

Reviewed By: rubennorte

Differential Revision: D71047032

fbshipit-source-id: 9f52473743755e49e4bfda0783803cb79591ca27
2025-03-12 13:28:00 -07:00
Vitali Zaidman 9783e65122 extract event loop perf tracking to its own file (#49985)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49985

Changelog:
[General][Internal] extract event loop perf tracking to its own file

Reviewed By: robhogan

Differential Revision: D70970397

fbshipit-source-id: 2b944bf07f32b0bdb68187c77ce19fb4738a8dc5
2025-03-12 12:52:18 -07:00
Eric Rozell 05e720adfb Add feature flag for universal calls to start|finishOperationBatch (#49908)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49908

There are various batching mechanisms across react-native platforms. The NativeAnimated startOperationBatch and finishOperationBatch methods are a useful way to signal that complete animation graphs are established for atomic flushes to the UI thread.

Setting up this feature flag for use across non-Android React Native platforms.

## Changelog

[Internal]

Reviewed By: javache

Differential Revision: D70827938

fbshipit-source-id: 4c4a74e9a11f75090152637d6195092f5af866a0
2025-03-12 11:55:15 -07:00