Commit Graph

38536 Commits

Author SHA1 Message Date
Riccardo Cipolleschi d6c90cf7ed Make sure to pass the BridgeProxy to view managers in the interop layer (#45329)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45329

Thanks to [#45232](https://github.com/facebook/react-native/issues/45232) we found a bug in the interop layer, where we were not passing the BridgeProxy in bridgeless mode to the view managers.

This Change should fix that issue.

## Changelog:
[iOS][Fixed] - Make sure to pass the RCTBridgeProxy to  ViewManagers

Reviewed By: dmytrorykun

Differential Revision: D59468292

fbshipit-source-id: 00666be21385a735878eb567c4b8a0986c609c5f
2024-07-08 11:07:29 -07:00
Pieter De Baets 6b7076e923 Move assertion about invalidated ReactInstanceManager to UI thread (#45328)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45328

This assertion is currently not actionable since the stack trace will always be just `mCreateReactContextThread`. Moving this assert is safe, as the only other place we write it is also the UI thread.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D59467576

fbshipit-source-id: c4606672255149a202f99a8f787230e2a23a868a
2024-07-08 09:49:28 -07:00
Rubén Norte ef9b2baa9a Create test to move parts of TextInput state to refs to avoid unnecessary updates in effects (#45321)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45321

Changelog: [internal]

This creates a variant of the internal hook in `TextInput` that handles the synchronization of the state between native and JS. The new variant moves everything that's not needed for rendering to refs instead of state.

One of the reasons for this change is that by not setting state in layout effects, we're not forcing passive effects to be flushed synchronously, which can improve perceived performance (as we can start painting before passive effects are executed).

Reviewed By: sammy-SC

Differential Revision: D59400624

fbshipit-source-id: 540c20daf49919fbfabd357a1a057ca126ec6b03
2024-07-08 09:42:46 -07:00
Rubén Norte 1265958d52 Extract TextInput synchronization mechanism to a custom hook (#45315)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45315

Changelog: [internal]

This moves some logic from the `TextInput` component to its own hook. It's just a refactor in preparation for a following change were we're going to test replacing this hook with an alternative version that relies less on state (using refs for some things instead).

Reviewed By: sammy-SC

Differential Revision: D59400614

fbshipit-source-id: ea37b8514f89e94be1386774ad70d56389878886
2024-07-08 09:42:46 -07:00
Nicola Corti ca17d87ed1 Upstream CLI autolinking changes to RNGP (#45314)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45314

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

I'm ustreaming two changes that happened inside the CLI/Autolinking logic that are
missing inside core autolinking.

Changelog:
[Internal] [Changed] - Upstream CLI autolinking changes to RNGP

Reviewed By: blakef

Differential Revision: D59460504

fbshipit-source-id: a6e7ab6a46fec26620dc965e77b13fdeba84fae3
2024-07-08 09:38:29 -07:00
Nicola Corti 40582d5b24 Attempt to limit the Gradle cache size (#45318)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45318

I'm setting the Gradle cache to write-only for build_android on main/stable branches.
This is so we start from a fresh cache on those jobs (as they're not on the critical path for developers).

Changelog:
[Internal] [Changed] - Attempt to limit the Gradle cache size

Reviewed By: cipolleschi

Differential Revision: D59466459

fbshipit-source-id: 8b7936ebe053ae06256f8506093eb17c07219de9
2024-07-08 08:40:56 -07:00
shubhamguptadream11 ead50d6b11 fix: added showSoftInputFocus handling for iOS new architecture (#45298)
Summary:
Fixes: https://github.com/facebook/react-native/issues/45297

In iOS New Architecture When we are passing `showSoftInputOnFocus` prop to TextInput as false it should prevent soft keyboard from showing.
Here, the problem is in Fabric counterpart of TextInput, there we are not handling `showSoftInputOnFocus` props anywhere.

## Changelog:

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

Pick one each for the category and type tags:

[iOS] [ADDED] - Added handling of `showSoftInputOnFocus` props for new arch.

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

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

Test Plan:
Below is the screen recording of fix made.

https://github.com/facebook/react-native/assets/85783070/de94877a-f684-4f8d-9ec4-a16f9755663e

Reviewed By: cipolleschi

Differential Revision: D59447432

Pulled By: dmytrorykun

fbshipit-source-id: 240854bc1101bdf0b04d7978c557215ff3f8a449
2024-07-08 07:19:38 -07:00
Samuel Susla 83392a9cd9 do not call [super loadView] in RN's UIViewController (#45312)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45312

changelog: [internal]

loadview shouldn't call its super method. Even though it isn't broken now, the official docs recommend against it.

https://developer.apple.com/documentation/uikit/uiviewcontroller/1621454-loadview

Reviewed By: christophpurrer

Differential Revision: D59376105

fbshipit-source-id: ee04020c008a3f208aafc79991c6ff24a71b226f
2024-07-08 06:08:58 -07:00
Kacper Rozniata 258f41a30f fix(iOS): remove deprecated method from RCTPerfMonitor & fix position (#43058)
Summary:
This PR removes usage of deprecated `statusBarFrame` method in `RCTPerfMonitor` . Instead `RCTPerfMonitor` now uses `safeAreaInsets` which also fixes issue causing Perf Monitor to appear under corner in landscape mode on e.g. `iPhone 15 Pro`. It also fixes initial position of expanded state which was causing it to render under notch.

Also removed duplicate background color setting

## Changelog:
[IOS] [REMOVED] - Remove usage of deprecated statusBarFrame method
[IOS] [FIXED] - Fix position of RCTPerfMonitor in landscape mode & expanded mode

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

Test Plan: `RNTester` builds and runs successfully, `RCTPerfMonitor` works and displays correctly

Reviewed By: dmytrorykun

Differential Revision: D59116913

Pulled By: cipolleschi

fbshipit-source-id: 0ff61f61b206c530cfb9e471bc2dc33a0a43c833
2024-07-08 04:04:06 -07:00
Damian Stasik 8c8c77b974 Remove unreachable if-condition in refresh logic (#45296)
Summary:
The `hasUnrecoverableErrors` function has been [hardcoded](https://github.com/facebook/react/blob/f38c22b244086f62ae5ed851b6ed17029ec44be5/packages/react-refresh/src/ReactFreshRuntime.js#L602) to always return false for the past 5 years, since React Refresh [can recover from all errors](https://github.com/facebook/react/pull/17438). This hardcoding was introduced in react-refresh v0.7.1, and RN currently uses v0.14.2.

## Changelog:

[INTERNAL] [REMOVED] - Remove unreachable if-condition in refresh logic

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

Test Plan: Fast Refresh should still work as expected.

Reviewed By: NickGerleman

Differential Revision: D59405648

Pulled By: arushikesarwani94

fbshipit-source-id: 6fefedb484eeab032028d738b48ac936a9044cb0
2024-07-05 15:53:43 -07:00
Deepanshu.shukla 820a88418c fix: get all bytes from the text in native event key in fabric (#45274)
Summary:
Fixes https://github.com/facebook/react-native/issues/45199.

Problem was whenever you type in TextInput **onKeypress** callback called and  event key was returned as
**keyPressMetrics.text.front();**
which basically fetch the first byte from text .
But in case of non-ascii character text  is coming like ' \804'(in octal) which means first byte was empty string .
So solution was the return whole text as it is i.e.
**keyPressMetrics.text**

## Changelog:

[IOS][FIXED]  - nativeEvent key returning empty in case any non-ascii character entered , in IOS fabric

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

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

Test Plan:
Below are the screenrecording for solution in new arch

https://github.com/facebook/react-native/assets/111736628/ea9034d3-3105-44e2-9998-4264d218ab93

Reviewed By: NickGerleman

Differential Revision: D59405313

Pulled By: arushikesarwani94

fbshipit-source-id: 65e153b933f345e3ec66a691aa8a4ab15d651440
2024-07-05 15:38:00 -07:00
Christoph Purrer 85dc2e393f Allow map type objects in Java/ObjC TM EventEmitter (#45271)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45271

Changelog: [Internal] Allow map type objects in Java/ObjC TM EventEmitter

Reviewed By: rshest

Differential Revision: D59360044

fbshipit-source-id: 6fce094586ed2ad55a0d83a8a83ff554e2ba000e
2024-07-05 12:37:47 -07:00
Pieter De Baets 504240caad Fix crash in ViewManagerPropertyProcessor on older android devices (#45303)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45303

`ViewManagersPropertyCache` uses reflection to find all ReactProp but fails when any symbols in the method refer to classes not available in the current build.

Work around this by extracting this helper to a separate private inner class.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D59397865

fbshipit-source-id: e77d3167698e4311e8778ebab28a0c8a0d2666c2
2024-07-05 10:56:53 -07:00
fannnzhang 0847384a45 Fix Memory Leak in LogBoxModule (#45261)
Summary:
To fix [The Memory Leak Issue](https://github.com/facebook/react-native/issues/45080) This change modifies the timing of view creation in the LogModule. The motivation behind this update is to address a potential memory leak issue. Previously, views were being created and held onto, which could lead to references to the Activity being retained even when they were no longer needed. By creating the view only when the show method is called and ensuring it is removed in the hide method, we can prevent these memory leaks and improve the overall memory management and stability of the LogModule.

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

- Adjusted the timing of view creation to occur when the `show` method is called.
- Ensured that the created view can be removed in the `hide` method.
- This update addresses potential memory leaks by preventing the view from holding a reference to the Activity.

These changes improve memory management and stability within the LogModule.

Modify the timing of view creation in LogModule. The view is now created when the show method is called, and it can be removed in the hide method. This change resolves potential memory leaks caused by the view holding a reference to the Activity.

## Changelog:

[ANDROID] [FIXED] - Fix LogModule to create view when show is called

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

Reviewed By: dmytrorykun

Differential Revision: D59372962

Pulled By: cortinico

fbshipit-source-id: 6693afdb279c7164ff0f68c93f8ca8a54b1c2077
2024-07-05 08:54:25 -07:00
huzhanbo.luc b8ab0fe703 fix: on iOS not getting 304 from If-None-Match request (#45263)
Summary:
In https://github.com/facebook/react-native/issues/44483 `If-None-Match` request failed to get a 304 after a 200 response. This is caused by NSRequest's
cachePolicy which prevents sending a request to server to check 304 state and return directly a 200 response.

## Changelog:

[IOS] [FIXED] - fix: on iOS not getting 304 from `If-None-Match` request

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

Test Plan: repeat request given in https://github.com/facebook/react-native/issues/44483

Reviewed By: cortinico

Differential Revision: D59364609

Pulled By: dmytrorykun

fbshipit-source-id: 2a8b86c526320a1e9c1c58e41aa9c74beeeac2ce
2024-07-05 08:48:31 -07:00
Nicola Corti fd4531fe23 Fix NPE in FileReaderModule (#45287)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45287

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

This fixes an NPE reported in OSS if you do this call in JavaScript:

```
 const fr = new FileReader();
 fr.readAsText({});
```

Changelog:
[Android] [Fixed] - Fix NPE in FileReaderModule

Reviewed By: dmytrorykun

Differential Revision: D59372620

fbshipit-source-id: ad5073376eaa26852c8277bdbb7d76b1aa480b3c
2024-07-05 08:47:30 -07:00
Rob Hogan 06fc6f2beb Use metro-babel-register for additive Babel registration (#45295)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45295

When registering Babel to run RN from source, we currently call `babel/register` directly from `scripts/babel-register.js`.

This has the effect of overwriting any previous registration, which causes problems in the FB monorepo because RN also loads other projects that lie outside this registration (like Metro) from source - possibly requiring different configurations.

Moreover, if Metro is subsequently loaded from source, its own registration clobbers RN's.

Instead, this diff runs the registration through `metro-babel-register`, which maintains a cumulative list of registration directories and applies a uniform transform.

Note that this means we're not using exactly the same transform at build/publish time as for running from source - to fix that, we ought to move everything to a central `babel.config.js`, but that's a much bigger change, and this gets us close enough to unblock.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D59376984

fbshipit-source-id: 0dbb00970ac87dbe40ec8904bf51ef4b1fee5e0f
2024-07-05 04:48:30 -07:00
Pieter De Baets 42f1adf49f Address lint feedback in ReactInstance (#45284)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45284

Lint suggestions by Android Studio

Changelog: [Internal]

Reviewed By: fabriziocucci

Differential Revision: D59370240

fbshipit-source-id: fb57511704ad667fc152826e33e0e67719f0899c
2024-07-05 04:06:39 -07:00
Nicola Corti aeaa939793 Cleanup exports for PressableExample in RN-Tester (#45294)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45294

Just doing some cleanup here as those exports are scattered around this file.

Changelog:
[Internal] [Changed] - Cleanup exports for PressableExample in RN-Tester

Reviewed By: yungsters

Differential Revision: D59376617

fbshipit-source-id: 0f6f81fca7b5cbcdc05bbb6a1f87d3ad74c20b50
2024-07-05 01:53:08 -07:00
Nicola Corti d2edc71619 Add reproducer to RN-Tester for #44610 (#45293)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45293

I'm justing adding a repro to RN-Tester to further investigate:
https://github.com/facebook/react-native/issues/44610

Changelog:
[Internal] [Changed] - Add reproducer to RN-Tester for #44610

Reviewed By: yungsters

Differential Revision: D59375787

fbshipit-source-id: 3bc4f45e3686109bf731008bc27e47c4eb314e48
2024-07-05 01:53:08 -07:00
Ruslan Lesiutin 62cca7accc upgrade[react-devtools-*]: v.5.3.1 (#45291)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45291

Changelog: [Internal]

Same as D59001348, via `js1 upgrade react-devtools -v ^5.3.1`
allow-large-files

Reviewed By: vzaidman

Differential Revision: D59374023

fbshipit-source-id: 7493000bff24a5e21cb77a9a5992c501ed282a92
2024-07-04 16:02:07 -07:00
Nicolas Gallagher 8f548be91c RSD sync (#45270)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45270

This sync includes the following changes:
- **[499d5d3](https://github.com/facebook/react-strict-dom/commit/499d5d3)**: Skip animation setup if no style transitions //<Nicolas Gallagher>//
- **[8a98c5d](https://github.com/facebook/react-strict-dom/commit/8a98c5d)**: Remove invalid style properties from shortforms set //<Nicolas Gallagher>//
- **[ccb00ff](https://github.com/facebook/react-strict-dom/commit/ccb00ff)**: 0.0.17 //<Nicolas Gallagher>//
- **[8cd0eb0](https://github.com/facebook/react-strict-dom/commit/8cd0eb0)**: Reorganize benchmark test and mock files //<Nicolas Gallagher>//
- **[ce88e44](https://github.com/facebook/react-strict-dom/commit/ce88e44)**: Add support for experimental React Native style implementations //<Nicolas Gallagher>//
- **[111f6b1](https://github.com/facebook/react-strict-dom/commit/111f6b1)**: Install StyleX 0.7.0 //<Nicolas Gallagher>//

Reviewed By: amyogit

Differential Revision: D59343139

fbshipit-source-id: 672c7db98fd6676edfe42e818d04a96203e1c827
2024-07-04 13:04:52 -07:00
Vitali Zaidman 6565706232 Update debugger-frontend from 601b272...a4fff8a (#45292)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45292

Changelog: [Internal] - Update `react-native/debugger-frontend` from 601b272...a4fff8a

Resyncs `react-native/debugger-frontend` from GitHub - see `rn-chrome-devtools-frontend` [changelog](https://github.com/facebookexperimental/rn-chrome-devtools-frontend/compare/601b2724b9f765e413b4ccc15d972f5a28fd4f4d...a4fff8a0b4d44cb1dea89ffeac1b7cb4da8b151b).

Reviewed By: hoxyq

Differential Revision: D59376660

fbshipit-source-id: b5c9782493875ede573a61211886f0f32e9f7360
2024-07-04 10:22:26 -07:00
Tomek Zawadzki ea958c69f6 Fix dynamic_cast (RTTI) by adding key function to ShadowNodeWrapper again (#45290)
Summary:
This PR restores the virtual destructor for `ShadowNodeWrapper` which was added in https://github.com/facebook/react-native/pull/33500 and unfortunately removed in https://github.com/facebook/react-native/pull/40864.

The virtual destructor here serves as a key function. Without a key function, `obj.hasNativeState<ShadowNodeWrapper>(rt)` **does not** work correctly between shared library boundaries on Android and always returns false.

We need this pretty badly in third-party libraries like react-native-reanimated or react-native-gesture-handler.

## 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] [FIXED] - Fix dynamic_cast (RTTI) for ShadowNodeWrapper when accessed by third-party libraries again

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

Test Plan: This patch fixes an issue in Reanimated's fabric-example app.

Reviewed By: fabriziocucci

Differential Revision: D59375554

Pulled By: javache

fbshipit-source-id: 09f3eda89a67c26d6dacca3428e08d1b7138d350
2024-07-04 10:10:13 -07:00
szymonrybczak d1bf828398 fix(cli): replace querystring with URLSearchParam (#45125)
Summary:
[`querystring`](https://www.npmjs.com/package/querystring) package is deprecated. In this Pull Request I've replaced usage of `querystring` with `URLSearchParam` what is recommended by Node.js.

It's also causing a warning when installing dependencies inside a React Native app:
```
warning react-native > react-native/community-cli-plugin > querystring@0.2.1: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
```

## Changelog:

[INTERNAL] [FIXED] - Replace `querystring` package with `URLSearchParam`

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

Test Plan:
Params should be parsed in the same way and warning shouldn't be presented.

js1 jest xplat/js/tools/metro/packages/metro/src/cli/__tests__/parseKeyValueParamArray-test.js

Reviewed By: cipolleschi

Differential Revision: D58948498

Pulled By: GijsWeterings

fbshipit-source-id: 79b1f7b3feae230d2d3641205c513b98b3fda511
2024-07-04 08:04:56 -07:00
Nicola Corti b34b694f8e Move all custom actions to kebab-case (#45286)
Summary:
We do have a mixture of casing in the custom GH actions in our repo.
This aligns them all to be `kebab-case`

## Changelog:

[INTERNAL] - Aling all custom actions to kebab-case

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

Test Plan: CI

Reviewed By: blakef

Differential Revision: D59374046

Pulled By: cortinico

fbshipit-source-id: 030a9323e501e375585e90f10a3b29c3bb671b28
2024-07-04 07:57:03 -07:00
Pieter De Baets a7f5963377 Cleanup ReactQueueConfiguration (#45281)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45281

There's a lot of unnecessary complexity here, likely from experiments long expired.

Changelog: [Internal]

Reviewed By: fabriziocucci

Differential Revision: D59369955

fbshipit-source-id: beb80de2b1a9ef650db4ed59231c6b25bf6e626b
2024-07-04 06:59:26 -07:00
Jakub Piasecki b2898540c9 Update ignore file to include ReactBuildConfig in the npm package (#45279)
Summary:
Changes `.npmignore` file to only exclude the `ReactAndroid/build` directory instead of all `build` directories under `ReactAndroid` (which included the `ReactAndroid/src/main/java/com/facebook/react/common/build` package). This problem was caused by the newer version of NPM being used.

Closes https://github.com/facebook/react-native/issues/45204

## Changelog:

[ANDROID] [FIXED] - Fixed build from source failing due to a missing file

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

Test Plan:
Run `npm pack` or `npm publish -dry-run`.

Before this change it includes 3774 files in the package and `ReactBuildConfig` isn't included. After this change it includes 3775 files in the package and `ReactBuildConfig` is included.

Reviewed By: javache

Differential Revision: D59371555

Pulled By: cortinico

fbshipit-source-id: f54f1e88e30429d538b9e160e6ce20d994c5d1b8
2024-07-04 05:48:40 -07:00
Pieter De Baets f1b6218608 Remove unreferenced JSEngineResolutionAlgorithm from ReactHost API (#45269)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45269

There's no callers to this property, and we already create a `jsRuntimeFactory` above in DefaultReactHost, which will actually decide which VM to use.

Changelog: [Android][Removed] Unused jsEngineResolutionAlgorithm from ReactHost

Reviewed By: cortinico

Differential Revision: D59333435

fbshipit-source-id: 21be4d138bca64c0cb78de366bf2e247b4f37650
2024-07-04 05:27:41 -07:00
Alex Hunt bf11d1efcd Update debugger-frontend from 7cd81c1...601b272 (#45282)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45282

Changelog: [Internal] - Update `react-native/debugger-frontend` from 7cd81c1...601b272

Resyncs `react-native/debugger-frontend` from GitHub - see `rn-chrome-devtools-frontend` [changelog](https://github.com/facebookexperimental/rn-chrome-devtools-frontend/compare/7cd81c1548a4bca19732037dcf82662a6ed9ca39...601b2724b9f765e413b4ccc15d972f5a28fd4f4d).

Reviewed By: EdmondChuiHW

Differential Revision: D59370791

fbshipit-source-id: efee17f3646a32a71f7aa8a16bba7af2bfd6ed34
2024-07-04 05:12:30 -07:00
Jorge Cabiedes Acosta 261f82e897 RN tester example for mix-blend-mode (#45052)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45052

tsia

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D58760458

fbshipit-source-id: 1aadfb000d94b827ed779170254438ed4c469a52
2024-07-03 20:55:27 -07:00
Jorge Cabiedes Acosta fd94033dc1 JS Pumbing to get mix-blend-mode into native (#45051)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45051

tsia

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D58753970

fbshipit-source-id: df3cf8852fbc5f2a95f442c9067358608321ed20
2024-07-03 20:55:27 -07:00
Jorge Cabiedes Acosta ec95533609 Add mix-blend-mode effects to Android (#45053)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45053

Add support for most keyword values of mix-blend-mode on Android

Missing compositing operators and global values

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D58752052

fbshipit-source-id: e63e01d45a7e0924f3853f08dff5cec7e2f1ceaf
2024-07-03 20:55:27 -07:00
Christoph Purrer 70bacfe098 Turbo Module EventEmitter registration must return void or Promise<void> (#45267)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45267

Changelog: [Internal] Turbo Module EventEmitter registration must return void or Promise<void>

Differential Revision: D59333197

fbshipit-source-id: 461dbcb23e0ebb1c145123bf785587b06a3d6c34
2024-07-03 20:51:14 -07:00
Sam Zhou af506372ba Deploy 0.239.0 to xplat
Summary:
Changelog: [Internal]

allow-large-files

Reviewed By: alexmckenley

Differential Revision: D59348364

fbshipit-source-id: e3d56ebb78fa19b70f2a689f85882fbe3071223f
2024-07-03 16:24:35 -07:00
Nick Gerleman 95d9cdf228 Fix "Platform.constants.reactNativeVersion.prerelease" Flow and TypeScript types (#45256)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45256

The actual stamped versions here are all strings.

Android interface for constants is untyped, and we always return a string here. iOS, we will try to parse the string into a double, which will fail for every prerelease version RN has ever published.

Platform on Windows seems to uniquely be doing the right thing.

Changelog:
[General][Fixed] - Fix Platform.constants.reactNativeVersion type

Reviewed By: robhogan, necolas

Differential Revision: D59141948

fbshipit-source-id: 9c758e5eb8796b03197258d87ec06b31018e211c
2024-07-03 13:51:59 -07:00
Andrew Coates 2939dfc208 Add config version, and invalidate layout on config change (#45259)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45259

This is a continuation of the previous PR: https://github.com/facebook/react-native/pull/45047

I made the change more generic for allowing any kind of config change to invalidate layout.

Changelog: [Internal]

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

Reviewed By: rozele

Differential Revision: D59286992

Pulled By: NickGerleman

fbshipit-source-id: f46f35b03d5d9a743b798844ee3e1a02c271ccde
2024-07-03 12:46:18 -07:00
Alex Hunt 47bff1f49b Fix reactNativeVersion string in inspector metadata on iOS (#45266)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45266

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D59279156

fbshipit-source-id: b1ef0273b14e964a7413724f6d382f7a00be103e
2024-07-03 11:12:31 -07:00
Alex Hunt 09bfb68a39 Add appDisplayName to inspector host metadata (#45250)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45250

Adds and implements a new `appDisplayName` field as part of `HostTargetMetadata` and the `ReactNativeApplication.metadataUpdated` CDP event.

This will be used to display the app display name in the debugger frontend.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D59273360

fbshipit-source-id: d770cccadb520b9c13c7288cd690df21683d2cc1
2024-07-03 11:12:31 -07:00
Alex Hunt 9da07d70dc Implement new HostTargetMetadata fields (Android Bridgeless) (#45249)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45249

Follows D58288489, D58415181.

Implements the remaining `HostTargetMetadata` fields, sent by the debugger on `ReactNativeApplication.metadataUpdated`, on **Android Bridgeless**.

This will be used to display details such as the app name and React Native version in the debugger frontend.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D59271755

fbshipit-source-id: a2488fed98df0800ec0a611d2317cd40cd809aac
2024-07-03 11:12:31 -07:00
Alex Hunt 297ccf325f Implement new HostTargetMetadata fields (Android Bridge) (#45234)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45234

Follows D58288489.

Implements the remaining `HostTargetMetadata` fields, sent by the debugger on `ReactNativeApplication.metadataUpdated`, on **Android Bridge** (Bridgeless to follow).

This will be used to display details such as the app name and React Native version in the debugger frontend.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D58415181

fbshipit-source-id: 8aca707c0b9f6e933ac5e5b4ac47ba8d48e99241
2024-07-03 11:12:31 -07:00
Nick Gerleman 3af01a8a44 Fix default for showsHorizontalScrollIndicator and showsVerticalScrollIndicator (#45258)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45258

Setting this to false, then removing, will not reset back to default state of `true`. Add explicit defaults so that the absence of the prop will lead to scroll indicators always being shown.

Changelog:
[Android][Fixed] - Fix default for `showsHorizontalScrollIndicator` and `showsVerticalScrollIndicator`

Reviewed By: javache

Differential Revision: D59285745

fbshipit-source-id: 6a7c204cfe9c4ab9e4efbbda300cdfdaf57e8f37
2024-07-03 10:05:13 -07:00
Nick Gerleman d028a68026 Ship set_android_layout_direction by default (#45257)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45257

This doesn't seem to be regressing anything, so let's ship it!

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D58959236

fbshipit-source-id: af6ae5d9145160f5a567e99b5d8db2a4d19a080b
2024-07-03 09:28:27 -07:00
Cedric van Putten 30a3e6e8df refactor(dev-middleware): drop node-fetch in favor of Node built-in fetch (#45227)
Summary:
Node 22 doesn't work well with `node-fetch@2`, as one of their polyfills is using the deprecated `punycode` module. This causes unnecessary warnings like:

<img width="986" alt="image" src="https://github.com/facebook/react-native/assets/1203991/13f66c5b-b6f4-4894-8576-ca9631d93f77">

Instead of upgrading to the [much larger `node-fetch@3`](https://packagephobia.com/result?p=node-fetch%403.3.2), this change drops `node-fetch` in favor of Node's own built-in `fetch` implementation (using [undici](https://github.com/nodejs/undici#readme)).

> Note, `react-native/dev-middleware` [already has the `engines.node >= 18`](https://github.com/facebook/react-native/blob/c7988c9c82793b6b41d4c9190a28ce1202410fa0/packages/dev-middleware/package.json#L38-L40) (which is required for fetch).

## Changelog:

[GENERAL] [CHANGED] - Drop `node-fetch` in favor of Node's built-in fetch from `undici` in `react-native/dev-middleware`

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

Test Plan: See CI for passing tests

Reviewed By: NickGerleman

Differential Revision: D59202017

Pulled By: robhogan

fbshipit-source-id: 15da5d5602e63958b8a3dc581dc1512649f16c12
2024-07-03 09:14:02 -07:00
Håkon Knutzen b1ec698dc4 Fix data race related to RCTNetworkTask.status (#44694)
Summary:
Fix entails using non-synthesized getter, such that underlying backing is an std::atomic<RCTNetworkTaskStatus>.

In the greater scheme of things, I believe `RCTNetworkTask` should be improved as it has several `nonatomic` properties that are read and written to on different threads. Thread safety of this class seems to have been addressed on a per property basis, judging from the employment of `std::mutex` elsewhere in the implementation.

This is an attempt at fixing https://github.com/facebook/react-native/issues/44687.

## Changelog:

[iOS][FIXED] - Fix data race related to access on `RCTNetworkTask.status`.

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

Test Plan: Added unit test in class `RCTNetworkTaskTests`.

Reviewed By: cortinico

Differential Revision: D59217353

Pulled By: javache

fbshipit-source-id: 1af77238ddd99db21e2e53f174a81e207d5832b2
2024-07-03 08:22:26 -07:00
Nicola Corti c0977c39b9 Migrate analyse_code to GHA (#45247)
Summary:
This migrates `analyse_code` to GHA into a single job called `lint`.

## Changelog:

[INTERNAL] - Migrate analyse_code to GHA

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

Test Plan: CI

Reviewed By: NickGerleman

Differential Revision: D59283393

Pulled By: cortinico

fbshipit-source-id: dcdc4828a551062b3706e6450614b8c94e1a7e81
2024-07-03 05:49:47 -07:00
Rubén Norte 8db2995934 Add missing invocation of item dispatch listeners when forcing batching of mount items on Android (#45264)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45264

Changelog: [internal]

We added a flag to fix some issues when committing state updates synchronously from the main thread in https://github.com/facebook/react-native/pull/44015 but that implementation was incorrectly not invoking item dispatch listeners after mount.

This adds the missing logic so we can unblock shipping sync state updates.

Reviewed By: javache

Differential Revision: D59319230

fbshipit-source-id: b0ab7e7c79a3315ef29dbb024e62c10444192509
2024-07-03 05:01:02 -07:00
Sam Zhou 3c6762a5f8 Pre-suppress errors ahead of v0.239 release
Summary: Changelog: [Internal]

Reviewed By: mvitousek

Differential Revision: D59308716

fbshipit-source-id: d741ee004e153810fc913da96505706e43814ec1
2024-07-02 23:37:15 -07:00
Joe Vilches c247e8c8c9 Fix case where absolute nodes would sometimes not be cloned (#45240)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45240

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

There was a bug where some crash would happen if a tree was cloned that had static/absolute parent/child pair inside it. This was because we were no longer calling `cloneChildrenIfNeeded` on the static parent, but would still layout the absolute child. So that child's owner would be stale and have new layout. In React Native this would lead to a failed assert which causes the crash.

The fix here is to clone the children of static nodes during `layoutAbsoluteDescendants` so that we guarantee the node is either cloned if it is going to have new layout.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D59175629

fbshipit-source-id: 4d110a08ba5368704327d5ab69a8695b28e746f4
2024-07-02 15:14:33 -07:00
Thomas Nardone 0ba2e9adf2 Prevent View Preallocation (#45163)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45163

Avoid view preallocation when rendering on the main thread

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D58833983

fbshipit-source-id: a942d1fac684be5a8073941dbf043ba1d738e3a0
2024-07-02 14:16:32 -07:00