Commit Graph

34033 Commits

Author SHA1 Message Date
Andrew Datsenko b27bd00a38 add jest-diff to dependencies (#47990)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47990

Changelog:
[General][Added] - add `jest-diff v29.7.0` to devDependencies

Reviewed By: NickGerleman

Differential Revision: D66541001

fbshipit-source-id: 01c59a936b66f85ce034b59c7928df3c3f8c2a01
2024-11-28 10:04:46 -08:00
lihaitao 2aa79979d3 fix:setColorScheme exception when activity recreate (#47955)
Summary:
solve the exception  on android when `Appearance.setColorScheme` and activity recreate()
Fixes https://github.com/facebook/react-native/issues/47954

## Changelog:

[Android][Fixed] setColorScheme should be called on the UI thread

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

Reviewed By: cortinico

Differential Revision: D66573373

Pulled By: javache

fbshipit-source-id: 97808e163e1c53bb94f4be7269d9cb9e212f2e95
2024-11-28 09:37:07 -08:00
Alex Hunt 2fcf7b1f49 Allow fuseboxClientType_ detection from ReactNativeApplication.enable method (#47962)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47962

Updates `HostAgent` to respond equivalently if either `FuseboxClient.setClientMetadata` (outgoing) or `ReactNativeApplication.enable` (incoming) are sent by the CDP frontend.

This is a partial migration, to be followed by removing the `FuseboxClient.setClientMetadata` method later.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D66501027

fbshipit-source-id: 1ff669c24667f51d240311e75f95747efe577e2d
2024-11-28 09:26:03 -08:00
Rubén Norte 7ccc5934d0 Implement symbolication of error stack traces (#48006)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48006

Changelog: [internal]

This implements symbolication of error stack traces in Fantom tests. We just needed to ask Metro to generate source maps and use the `source-map` package to process the stack traces that we get back from the runtime.

Reviewed By: sammy-SC

Differential Revision: D66577818

fbshipit-source-id: 672c66c246ad8646646d5ed31cabca39eb4f7aca
2024-11-28 07:59:26 -08:00
Pieter De Baets bc9e4db9e9 Demonstrate bug in differentiator where reparented nodes reference non-existent nodes (#48002)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48002

Demonstrates the issue identified in https://github.com/facebook/react-native/issues/47960 and a crash we've been seeing internally around `getViewState` referencing a view that does not exist.

When reparenting unflattened nodes, Differentiator may emit an `update` with a `parentShadowView` that does not exist on the native side yet, thereby crashing Android.

Landing the test-case first (with some test cleanup), so the diff for the actual fix is clearer.

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D66557919

fbshipit-source-id: 5428c32e5f0200a8e98568cabeedb0c61aafbe23
2024-11-28 06:06:59 -08:00
Kudo Chien 24fee29f7a Add useColorScheme mock test (#47988)
Summary:
add a jest test to test when `useColorScheme` is not mocked. following up https://github.com/facebook/react-native/pull/47629#issuecomment-2491534678

## Changelog:

[GENERAL] [ADDED] - Add useColorScheme mock test

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

Test Plan: ci passed

Reviewed By: javache

Differential Revision: D66573172

Pulled By: blakef

fbshipit-source-id: 820227f6fc4e18a968b3181fad8f534a716f1e9e
2024-11-28 05:05:31 -08:00
Rubén Norte 6ae49ee9e3 Improve error messages in tests (#47994)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47994

Changelog: [internal]

This adds a few hacks to improve errors messages in Fantom tests. Before, we were only logging the error message. After this, we log the message and the full (unsymbolicated for now) stack, including a pretty print of the exact location of the error.

For errors thrown from `expect` functions, the stack trace is modified to remove the "infra" lines from the stack.

The next step is symbolicating the errors using source maps generated by metro.

Reviewed By: javache

Differential Revision: D66555063

fbshipit-source-id: 17bd23cb30429a17e99f13f934c45e001120bbb3
2024-11-28 04:31:20 -08:00
Jorge Cabiedes Acosta ce9f5345e3 Fix Android ensureNoOverlap function and revise implementation (#47989)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47989

- Fixing Android's ensureNoOverlap algorithm. (For real this time)
- Improve verbiage for `ensureNoOverlap` function.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D66514729

fbshipit-source-id: 99908deee2232cc125bb0998ae7acd636a1f7e10
2024-11-27 19:57:55 -08:00
Arushi Kesarwani 5da7089e35 NIT: Updating docstring for DefaultReactHost for missing arguments (#47992)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47992

TSIA

Changelog: [Internal]

Reviewed By: shwanton

Differential Revision: D66552119

fbshipit-source-id: 6dcd461fcea1444a58db4f98316bf8878ae98781
2024-11-27 17:26:19 -08:00
Arushi Kesarwani 762bcc6073 NIT: Updating docstring for DefaultReactHost to match the arguments. (#47991)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47991

TSIA

Changelog: [Internal]

Reviewed By: shwanton

Differential Revision: D66550256

fbshipit-source-id: b3c18032a421fd9f0bd69c142e72d884f96340f8
2024-11-27 17:26:19 -08:00
Alex Hunt 7f57018e25 Add profiling_target_registered event, log to terminal (#47968)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47968

Updates the Inspector Proxy to report + log when a profiling build target (experimental) is registered. This notifies the developer that debugging is available for these app(s), which will not otherwise fetch development bundles from Metro.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D66501771

fbshipit-source-id: e06dee279158094ad5c70bf8e6a90e7c983de48a
2024-11-27 11:42:31 -08:00
Alex Hunt b95631ed7f Enable identifying profiling builds on proxy registration (#47967)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47967

(Android only) Updates `jsinspector-modern` to enable identifying profiling builds (experimental) when registering the debug target with the Inspector Proxy.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D66501768

fbshipit-source-id: bbe2b9a2c7c014c952ef5ee49284a161dbeefb09
2024-11-27 11:42:31 -08:00
Alex Hunt b9762d568a Enable identifying profiling builds over CDP (#47966)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47966

Updates `jsinspector-modern` to enable identifying profiling builds (experimental) to the frontend over CDP.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D66501770

fbshipit-source-id: 9d079da862a59d5e2dc6f970e7418339620e1451
2024-11-27 11:42:31 -08:00
Rubén Norte a36dbae486 Optimize performance of ReactNativeElement constructor (#47983)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47983

Changelog: [internal]

This mitigates some performance regressions caused by the migration from `ReactFabricHostComponent` to `ReactNativeElement` (enabling the DOM APIs).

Those regressions were caused by 2 main things:
1. By the use of a class hierarchy and having to call `super()`, which we transpile to a very complex code to ensure it's spec compliant.
2. By the use of private fields (`#viewConfig`) which are significantly slower than a regular field with the `_` naming convention (`_viewConfig`) processed by our custom transform.

This mitigates those problems by using the `_` convention and refactoring the class hierarchy to avoid the use of `super()` while preserving the Flow typing and most of the existing implementation.

Reviewed By: javache, andrewdacenko

Differential Revision: D66540756

fbshipit-source-id: db6aa18c12194b18e3a69e9979621d0feae6186a
2024-11-27 11:24:31 -08:00
Jakub Romanczyk 881d8a720f refactor(community-cli-plugin): use node builtin fetch (#47397)
Summary:
Removed `node-fetch` in favour of node builtin fetch to get rid of the deprecated `punycode` warning when using Node 22.

`react-native/community-cli-plugin` already requires Node >= 18 where it was made available by default (without `--experimental-fetch` flag).

This change is similar to the one made in https://github.com/facebook/react-native/pull/45227

## Changelog:

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

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

Test Plan: tests pass

Reviewed By: blakef

Differential Revision: D66512595

Pulled By: NickGerleman

fbshipit-source-id: c4e01baf388f9fae8cea7b4bfe25034bff28b461
2024-11-27 10:39:39 -08:00
Joe Vilches 1d909efa23 Align order of params between calculateLayoutInternal and calculateLayoutImpl (#47975)
Summary:
X-link: https://github.com/facebook/yoga/pull/1755

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

I've been working with callsites here and its annoying if you switch these that you need to move these params around too. Let's just make them the same order

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D66519836

fbshipit-source-id: 2e98e671270a053c6e62372e2003f1ca67774ec9
2024-11-26 22:48:24 -08:00
Phillip Pan 3c09d6bfce allow bindings installer to be passed down to DefaultReactHost (#47944)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47944

Changelog: [Internal]

adding an option to pass down bindings installer from product layer

Reviewed By: mlord93

Differential Revision: D66477349

fbshipit-source-id: 9462cbe0b1fcee875c18de0426c0c1b02f086ff1
2024-11-26 19:20:56 -08:00
Joe Vilches 40c194cf47 Camel case LengthValue in Node.cpp (#47971)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47971

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

This was annoying me

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D66510734

fbshipit-source-id: d1b952f2e82e7018b16dc0c572d9b98aec18c0e5
2024-11-26 15:23:08 -08:00
Alex Hunt 24f010d5b5 Update unstable-react-profiling to use PerftestDevSupportManager (#47715)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47715

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D66167302

fbshipit-source-id: 23e6154eedd36c2011062de3195887cba7af8a72
2024-11-26 12:48:37 -08:00
Andrei Marchenko df7b6ae092 fix item disappearing with scroll in VirtualizedList (#47965)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47965

Changelog: [General] [Changed] - fix item disappearing with scroll in VirtualizedList

It was caused because the function `computeWindowedRenderLimits` collapsed the current window size to just 1 element. So, users start scroll current window increase from {left:0, right:5 } -> {left:0, right:6 } and after some edge cases the window collapsed to `{left:6, right:6 }` which cause to remove all elements and recreate them later. As a result users have a lot of lags and blank pages.

The diff fixes the collapsing window size to 1 element. Also fix other decreasing `left` position even if windowSize more than current amount of elements.

Reviewed By: NickGerleman

Differential Revision: D66334188

fbshipit-source-id: 2162d00d03d64ab6325c0492d87449051e68a4e9
2024-11-26 10:44:30 -08:00
Rob Hogan 016f44518e Changelog for 0.77.0-rc.0 (#47958)
Summary:
Changelog as generated by rnx-kit + manual fixes.

Changelog: [Internal]

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

Reviewed By: rshest, blakef

Differential Revision: D66498590

Pulled By: robhogan

fbshipit-source-id: 81efda2615f8e61be5f5922511362946f3ba3c6b
2024-11-26 08:06:18 -08:00
Dmitry Rykun 69356b7f21 Introduce ImageRequestParams (#47723)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47723

Identity of `ImageRequest` is based on `ImageSource` and a subset of `ImageProps`. If any of those change, the request must be recreated and resubmitted.

Currently, the relevant subset of ImageProps is represented by a single `blurRadius` prop. This list will grow in the future. In order to simplify adding new props to the image request, we introduce the `ImageRequestParams` type that will wrap all the relevant props.

The alternative approach to pass `ImageProps` directly to `ImageManager` is worse because it would introduce dependency cycle between `ImageManager` and the `Image` component, and also it would require to store the props in State, which is bad.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D66172570

fbshipit-source-id: d6853bf8dcecd6e76ac90ccb2079d102a3015988
2024-11-26 07:27:02 -08:00
Dmitry Rykun a6b2355b8d Introduce Android ImageManger (#47721)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47721

This diff splits Cxx ImageManger into Cxx and Android variants. They both are currently no-op, but the Android one will be used for image prefetching, just as `RCTImageManager.mm` for iOS.
Changelog: [Internal]

Reviewed By: javache

Differential Revision: D65753319

fbshipit-source-id: 774ff09b6b397facee7f645706dd97ba6d1177d7
2024-11-26 04:22:09 -08:00
Pieter De Baets 8869fa4c2c Fix stale reference to ReactViewGroup#mAllChildren (#47950)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47950

`addInArray` may reallocate `mAllChildren` so it's not correct to store this reference.

Changelog: [Internal]

Reviewed By: tdn120

Differential Revision: D66474532

fbshipit-source-id: 90ce2fcbf8ff236501ed47b2acc413e54ef8b82a
2024-11-26 04:00:14 -08:00
Pieter De Baets 84adf268e1 Add more diagnostics for subview clipping crash (#47937)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47937

Changelog: [Internal]

Reviewed By: tdn120

Differential Revision: D66469161

fbshipit-source-id: d32f0592787ecae850854b2ff04d7c703ee8ec2e
2024-11-26 04:00:14 -08:00
Sam Zhou d86412dcc6 prepare for primitive literal changes (#47943)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47943

Changelog: [Internal]

Reviewed By: panagosg7

Differential Revision: D66461724

fbshipit-source-id: b526ed1617667b70337472f4dad4e19f152a266b
2024-11-26 00:07:32 -08:00
Jorge Cabiedes Acosta f70c3cae5b Fix border disappearing when only one edge is transparent (#47940)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47940

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

Border was disappearing when only one edge had an alpha of 0. This was due to clipping conditional

Changelog: [Internal]

Reviewed By: shwanton, NickGerleman

Differential Revision: D66397736

fbshipit-source-id: 8937323ad16e0c6e98a55051f244c08ef54c96eb
2024-11-25 18:15:25 -08:00
Jorge Cabiedes Acosta 96e66e7b48 Add unit tests for CompositeBackgroundDrawable layer ordering optimization (#47913)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47913

CompositeBackgroundDrawable has some logic for inserting the layers that are not set through the constructor. This unit test makes sure they are being properly ordered.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D66381515

fbshipit-source-id: 514979a4a97fa159c1d1c3c923afe969eafc21c3
2024-11-25 16:48:39 -08:00
Sam Zhou cb7cd89a10 Deploy 0.255.0 to xplat (#47941)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47941

Changelog: [Internal]

Reviewed By: pieterv

Differential Revision: D66477998

fbshipit-source-id: f4d1dbe506d6c42751fade897637031f0a43aa29
2024-11-25 16:06:09 -08:00
Brett Lavalla f363b43856 Make color value of ShadowStyleSpan public (#47934)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47934

This property needs to be made public for later diffs in this stack.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D66338915

fbshipit-source-id: f4896f8404e3d7eed7255e0f923ab5eec9a1291e
2024-11-25 15:45:57 -08:00
dan fe7e97a2fd Fix ScrollView centerContent losing taps and causing jitter on iOS (#47591)
Summary:
The React Native `<ScrollView>` has a peculiar `centerContent` prop. It solves a common need — keeping the image "centered" while it's not fully zoomed in (but then allowing full panning after it's sufficiently zoomed in).

This prop sort of works but it has a few wonky behaviors:

- If you start tapping immediately after pinch (and don't stop), the taps will not be recognized until a second after you stop tapping. I suspect this is because the existing `centerContent` implementation hijacks the `contentOffset` setter, but the calling UIKit code _does not know_ it's being hijacked, and so the calling UIKit code _thinks_ it needs to do a momentum animation. This (invisible) momentum animation causes the scroll view to keep eating the tap touches.
- While you're zooming in, once you cross the threshold where `contentOffset` hijacking stops adjusting values, there will be a sudden visual jump during the pinch. This is because the "real" `contentOffset` tracks the accumulated translation from the pinch gesture, and once it gets taken into account with no "correction", the new offset snaps into place.
- While not sufficiently pinched in, the vertical axis is completely rigid. It does not have the natural rubber banding.

The solution to all of these issues is described [here](https://petersteinberger.com/blog/2013/how-to-center-uiscrollview/). Instead of hijacking `contentOffset`, it is more reliable to track zooming, child view, and frame changes, and adjust `contentInsets` instead. This solves all three issues:

- UIKit isn't confused by the content offset changing from under it so it doesn't mistrigger a faux momentum animation.
- There is no sudden jump because it's the insets that are being adjusted.
- Rubber banding just works.

## 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
-->

[IOS] [FIXED] - Fixed centerContent losing taps and causing jitter

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

Test Plan:
I'm extracting this from [a patch we're applying to Bluesky](https://github.com/bluesky-social/social-app/blob/2ef697fe3d7dec198544ed6834553f33b95790b3/patches/react-native%2B0.74.1.patch). I'll be honest — I have not tested this in isolation, and it likely requires some testing to get merged in. I do not, unfortuntately, have the capacity to do it myself so this is more of a "throw over the wall" kind of patch. Maybe it will be helpful to somebody else.

I've tested these in our real open source app (https://github.com/bluesky-social/social-app/pull/6298). You can reproduce it in any of the lightboxes in the feed or the profile.

### Before the fix

Observe the failing tap gestures, sudden jump while pinching, lack of rubber banding.

https://github.com/user-attachments/assets/c9883201-c9f0-4782-9b80-8e0a9f77c47c

### After the fix

Observe the natural iOS behavior.

https://github.com/user-attachments/assets/c025e1df-6963-40ba-9e28-d48bfa5e631d

Unfortunately I do not have the capacity to verify this fix in other scenarios outside of our app.

Reviewed By: sammy-SC

Differential Revision: D66093472

Pulled By: javache

fbshipit-source-id: 064f0415b8093ff55cb51bdebab2a46ee97f8fa9
2024-11-25 14:56:02 -08:00
Jorge Cabiedes Acosta 2a2f58ad9d Add mixBlendMode to iterator style parser (#47292)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47292

If we don't add the prop to the iterator style parser then since fabric is not parsing the prop we are not properly creating the stacking context for when a prop has a mix-blend-mode set

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D65166886

fbshipit-source-id: 7b5bce82e81bf0c566ccd4620852ae877ccbf376
2024-11-25 13:12:12 -08:00
Jorge Cabiedes Acosta b41fb6c88e Add fabric check to drawChild function (#47293)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47293

We missed fabric check for the mix-blend-mode conditional on `drawChildren` adding it now

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D65167244

fbshipit-source-id: 1af5dc1979fb79c453ba0f27c0385a94dc539a55
2024-11-25 13:12:12 -08:00
Dmitry Rykun 8d83da6460 Introduce experimental image prefetching API (#47755)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47755

TIA.
Changelog: [Internal]

Reviewed By: tdn120

Differential Revision: D65596686

fbshipit-source-id: 9fbd57caa2fdeab0bdf68e7919b1f65179634a9d
2024-11-25 12:40:09 -08:00
Jorge Cabiedes Acosta 81a94f4f14 Forward fix incorrect elliptical border radius (#47931)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47931

tsia

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D66388179

fbshipit-source-id: 5c614cf52e834f664bb9f59767b2e172c51af620
2024-11-25 11:10:02 -08:00
Mateo Guzmán 81cb166d10 fix(image): [android] cache control headers are being overwritten (#47922)
Summary:
While trying to write some test cases for `ReactOkHttpNetworkFetcher`, I found that the cache control headers are not being sent over the network request correctly. These cache control headers are always being overwritten by the rest of the headers hence all the logic to set this custom cache control doesn't seem to be working as expected.

As per the [Request headers](https://github.com/square/okhttp/blob/2832a9e532ecbc6f1f84b3a07e8e64b75372789c/okhttp/src/main/kotlin/okhttp3/Request.kt#L256) docs, this seems to be the explanation:

> /** Removes all headers on this builder and adds [headers]. */
    open fun headers(headers: Headers) = commonHeaders(headers)

With the new approach by setting the headers first, we ensure that the cache control headers don't get overwritten but they would get added on top of the passed headers.

Notice that currently it seems to be overwriting these headers even if there are not headers passed from the Image component (AKA null/empty).

See my reproduction example in the test plan.

## Changelog:

[ANDROID] [FIXED] - ReactOkHttpNetworkFetcher – cache control headers getting overwritten by the rest of the headers

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

Test Plan:
By creating the following component, we log the request headers using `FLog` with the previous and the new approach. See the difference on the outputs below:

Component:
```tsx
<Image
  source={{
    uri: 'https://www.facebook.com/assets/fb_lite_messaging/E2EE-settings@3x.png?cacheBust=reload',
    cache: 'reload',
    headers: {
      'some-header': 'some-header-value',
    },
  }}
/>
```

Setting the `headers` last (current approach):

```kt
val request =
        Request.Builder()
            .cacheControl(cacheControlBuilder.build())
            .url(uri.toString())
            .headers(headers)
            .get()
            .build()
FLog.w("RequestHeaders", request.headers.toString())
```

Output (notice that the Cache-Control header is not present):
```bash
RequestHeaders  com.facebook.react.uiapp  W  some-header: some-header-value
```

<img width="561" alt="image" src="https://github.com/user-attachments/assets/797cd90a-2064-4772-99cc-5f9d39d73361">

 ---

New approach by setting the `headers` first:

```kt
val request =
        Request.Builder()
            .headers(headers)
            .cacheControl(cacheControlBuilder.build())
            .url(uri.toString())
            .get()
            .build()
FLog.w("RequestHeaders", request.headers.toString())
```

Output (Cache-Control is present now along with the passed headers):
```bash
RequestHeaders  com.facebook.react.uiapp   W  some-header: some-header-value
Cache-Control: no-cache, no-store
```

<img width="556" alt="image" src="https://github.com/user-attachments/assets/1b9f7865-926e-496b-ad3a-36e19ae92188">

Reviewed By: rshest

Differential Revision: D66446820

Pulled By: javache

fbshipit-source-id: 2640ea4b0e678a7aa919b919b0b44bedc0da0af4
2024-11-25 07:34:51 -08:00
Joe Vilches 2781888d22 Back out "Modify private apis to set, store, and get intrinsic sizing keywords" (#47895)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47895

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

These APIs were only added so that we could do TDD as we work on intrinsic sizing functionality. As of right now they do nothing. We are aiming on publishing a new version of Yoga soon so for the time being we are going to back these out so as not to confuse anyone with this new functionality. Ideally we get to a point where we have some temporary experimental header to stage these in but this is a bit time sensitive so just backing out for now

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D66332307

fbshipit-source-id: 1d596964e0c893091c541988506e8b80fa6d1957
2024-11-25 00:40:03 -08:00
Joe Vilches 04e44f30f7 Back out "Update public API for intrinsic sizing setters" (#47896)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47896

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

These APIs were only added so that we could do TDD as we work on intrinsic sizing functionality. As of right now they do nothing. We are aiming on publishing a new version of Yoga soon so for the time being we are going to back these out so as not to confuse anyone with this new functionality. Ideally we get to a point where we have some temporary experimental header to stage these in but this is a bit time sensitive so just backing out for now

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D66332309

fbshipit-source-id: 793f77dad021fa5e57b52c36ae954307636bcbf0
2024-11-25 00:40:03 -08:00
Jorge Cabiedes Acosta 24b0ded3cf Enable mix-blend-mode on ReactRootView so blending works with app background (#47336)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47336

Before mix-blend-mode would not blend with the background color due to it not being a ViewGroup. This adds the mix-blend-mode logic to ReactRootView so blending works

Changelog:
[Android][Fixed] - Enable mix-blend-mode on ReactRootView so blending works with app background

Reviewed By: NickGerleman

Differential Revision: D65156543

fbshipit-source-id: b3628b667573d0b56c74214e40d21c656fda495a
2024-11-24 15:33:35 -08:00
Aryan Dev Shourie 30e75a51f3 Fixed a typo in README for better clarity and understanding (#47918)
Summary:
I was just going through the README file, and I felt that the word "repo" seems a bit informal. Thus I made the correction and made it "repository".

## Changelog:

[General] [Changed] - Fixed a typo in the README file.

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

Test Plan: No specific Test Plan for these changes, as it is just a typo fix in README.md

Reviewed By: fkgozali

Differential Revision: D66414686

Pulled By: arushikesarwani94

fbshipit-source-id: 578530d2dcdf046a90bf5a5bc32ba68e8f496c81
2024-11-23 20:44:34 -08:00
Panos Vekris d4d1eb9bb1 Deploy 0.254.2 to xplat (#47912)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47912

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D66379853

fbshipit-source-id: 3a7677c5a71ef74e509ed43be87e455aed0cbaa7
2024-11-22 21:48:38 -08:00
Ramanpreet Nara 1fed2cfdef bugfix: Only handle first javascript fatal error (#47914)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47914

This was a bug in the original diff: D66193194.

If a fatal js error happens, we should only drop subsequent **fatal** js errors. It's fine to report soft errors.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D66392706

fbshipit-source-id: c51bae186184c54faa9bce065b81b442607e751b
2024-11-22 18:10:23 -08:00
David Vacca 5dd712fc08 Deprecate NotThreadSafeViewHierarchyUpdateDebugListener (#47747)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47747

Deprecate NotThreadSafeViewHierarchyUpdateDebugListener as won't be available in new arch and will be deleted

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D66216730

fbshipit-source-id: 88f3346ad38b80a710d9df4ba08b63887048c8cd
2024-11-22 17:56:31 -08:00
David Vacca 0c47e1351f Remove @DeprecatedInNewArchitecture annotation from ReactPropGroup (#47746)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47746

Remove DeprecatedInNewArchitecture annotation from ReactPropGroup since this annotation is not deprecated in new arch

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D66216727

fbshipit-source-id: 252bae58557b51c9fbfb1deab4edc7c50511a005
2024-11-22 17:56:31 -08:00
David Vacca f03e75d9be Remove DeprecatedInNewArchitecture for ReactPropHolder annotation (#47745)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47745

Remove DeprecatedInNewArchitecture for ReactPropHolder annotation

ReactProp is still used in new arch, we might remove this annotation in the future but it will be independent of new arch

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D66216729

fbshipit-source-id: 3f64858ab4fa60b09978b18b17200ae488e229ce
2024-11-22 17:56:31 -08:00
Thomas Nardone 6a472c5cf2 Remove ReactViewGroup.getBackgroundColor() (#47906)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47906

There are no usages in the repo.  External usages should be using [BackgroundStyleApplicator](https://github.com/facebook/react-native/blob/main/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/BackgroundStyleApplicator.kt#L82).

Changelog: [Android][Breaking] Removed ReactViewGroup.getBackgroundColor()

Reviewed By: NickGerleman

Differential Revision: D66368623

fbshipit-source-id: bf173efc7e40d3d8a5d55ba0f82eed49b4cb2746
2024-11-22 17:52:32 -08:00
Eric Rozell a05d573f9e Guard against surface manager exceptions (#47910)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47910

It seems there could be a race where a commit is being processed on the JS thread after the surface has been removed from the mounting manager. Since we don't actually need to retrieve the default paddings in these cases, there's no reason we need an enforced read of the SurfaceMountingManager.

## Changelog

[Internal]

Reviewed By: javache

Differential Revision: D66369969

fbshipit-source-id: 44ccdc9beafdbd0ac47457fb01c4114348c1a316
2024-11-22 15:22:54 -08:00
Eric Rozell e344b4914c Unconditionally clear static LongLivedObjectCollection (#47891)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47891

Various C++ utilities for handling callbacks and promises rely on the static LongLivedObjectCollection. Even if a host platform injects it's TurboModuleBinding with a custom LongLivedObjectCollection, there's no guarantee that the platform is not also using C++ TurboModules that use the static LongLivedObjectCollection. Clearing both collections solves issues for TurboModuleBindings with custom LongLivedObjectCollections that also have cross platform C++ TurboModules that use the static collection.

## Changelog

[Internal]

Reviewed By: javache

Differential Revision: D66324044

fbshipit-source-id: a5a973087c35fc00240e40ba757d49125473daf4
2024-11-22 15:20:10 -08:00
Maddie Lord 450d982844 onHostDestroy, only set EnableDevSupport to false if the current activity is the one being destroyed (#47907)
Summary:
Changelog: [Internal]

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

EnableDevSupport is set to false on lifecyle events like onPause and onHostDestroy, and set to true on events like onResume and onCreate.

In apps like AMA and Twilight, there is first a loginActivity, which then calls the mainActivity. After mainActivity is created, loginActivity is destroyed. This causes enableDevSupport to always be false because onDestroy for loginActivity is triggered after onCreate for mainActivity.

Reviewed By: RSNara, alanleedev

Differential Revision: D66124018

fbshipit-source-id: e40a5b24cf73000b0bfeaa1d8e3902718b281410
2024-11-22 12:48:33 -08:00
Tom Scallon 162208d264 Support defining multiple CxxReactPackages from a single lambda (#47897)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47897

Changelog: [Internal]

In some situations, we want to provide multiple `CxxReactModules` from a single lambda. Currently, this is painful -- this change makes it less so.

Reviewed By: tdn120

Differential Revision: D66337573

fbshipit-source-id: ed57ad6ca2b98d4787aca7da3714c05c3d03b649
2024-11-22 12:09:12 -08:00