Commit Graph

33932 Commits

Author SHA1 Message Date
Pieter De Baets
b04f5fbfba Add Binding.h header back for backwards compat (#47453)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47453

`react-native-screens` [depends on this header](https://github.com/software-mansion/react-native-screens/blob/main/android/src/main/cpp/NativeProxy.cpp#L2) and this is an unnecessary API breakage.

Changelog: [Android][Fixed] Added back `<react/fabric/Binding.h>` header.

Reviewed By: fabriziocucci

Differential Revision: D65534176

fbshipit-source-id: ce252f29be1c5322f44e20b6e36ab51db9c7a8ef
2024-11-06 06:38:47 -08:00
Pieter De Baets
5b41c7a84b Convert com.facebook.react.views.text.TextTransform to Kotlin (#47412)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47412

Changelog: [Internal]

Reviewed By: cortinico, fabriziocucci

Differential Revision: D65478027

fbshipit-source-id: e65019b7a90b696c3764e1deaf94f5f8bb0a7a95
2024-11-06 06:38:29 -08:00
Nicola Corti
10f6d5adb5 Stable API - Make ClipboardModule internal (#47413)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47413

This class should not be accessed directly, therefore I'm making it internal.
Technically breaking but I verified that there are no meaningful usages in OSS:
https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+com.facebook.react.modules.clipboard.ClipboardModule

Changelog:
[Android] [Breaking] - Stable API - Make `ClipboardModule` internal

Reviewed By: mdvacca

Differential Revision: D65479065

fbshipit-source-id: 1c534cafffdb27b808553eec7346e21fe4f38c24
2024-11-06 04:16:43 -08:00
Riccardo Cipolleschi
d352a9979d Add checkout step to check nightly (#47448)
Summary:
In order to use a reusable workflow in GHA, we need first to checkout the repository so the action has access to the other workflows.

## Changelog:
[Internal] - Add checkout step to Check Nightlies

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

Test Plan: GHA - https://github.com/facebook/react-native/actions/runs/11702038686?pr=47448

Reviewed By: cortinico

Differential Revision: D65532274

Pulled By: cipolleschi

fbshipit-source-id: 58117ac81973e3c07829d73d5bde4e6fd4d212f9
2024-11-06 04:07:13 -08:00
kunal.chavhan
92f51c009f add e2e test for empty case in flatlist (#47444)
Summary:
Part of https://github.com/facebook/react-native/issues/46757
Solves: ME2E0010

## Changelog:

[INTERNAL][ADDED] - add e2e test for empty case in flatlist

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

Test Plan:
```
yarn e2e-test-ios
yarn e2e-test-android
```

Reviewed By: cortinico

Differential Revision: D65531064

Pulled By: cipolleschi

fbshipit-source-id: 700c2fd6d43c24671021b6c3c5a4218e5699c7d9
2024-11-06 04:07:01 -08:00
Riccardo Cipolleschi
f94ca27986 Add job to test libraries on nightlies (#47409)
Summary:
We want to test libraries against React Native nightlies to check when we introduce breakig change

## Changelog:
[Internal] - Add CI tests for libraries

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

Test Plan: GHA - https://github.com/facebook/react-native/actions/runs/11700016815/job/32583153239?pr=47409

Reviewed By: cortinico

Differential Revision: D65530787

Pulled By: cipolleschi

fbshipit-source-id: ef4d13c30995f119715ef4f12ea51eaa65152518
2024-11-06 02:32:16 -08:00
David Vacca
fddf7aaad1 Migrate ReactHorizontalScrollContainerViewManager to use ViewManagerInterface (#47395)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47395

Migrate ReactHorizontalScrollContainerViewManager to use ViewManagerInterface

changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D65428646

fbshipit-source-id: 7e36f3642ac31aa747c2b7f21c251173516fffad
2024-11-06 00:01:07 -08:00
David Vacca
bed778fa5a Migrate ReactUnimplementedViewManager to use ViewManagerInterface (#47392)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47392

Migrate ReactUnimplementedViewManager to use ViewManagerInterface

changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D65428644

fbshipit-source-id: 011d06b6cb06c4fcc5e072b625b943ec6b7f1a62
2024-11-06 00:01:07 -08:00
David Vacca
b4a24a163c Migrate DebuggingOverlayManager to use ViewManagerDelegate (#47393)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47393

Migrate DebuggingOverlayManager to use ViewManagerDelegate

changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D65428645

fbshipit-source-id: 9cf6932a209935b6e85b7d8870a7aa610c45aded
2024-11-06 00:01:07 -08:00
David Vacca
496b0a8729 Migrate ReactVirtualTextShadowNode to kotlin and make it internal (#47434)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47434

Migrate ReactVirtualTextShadowNode to kotlin and make it internal

changelog: [Android][Breaking] Reduce visibility of ReactVirtualTextShadowNode to internal

Reviewed By: shwanton

Differential Revision: D65493927

fbshipit-source-id: 2b5997d000b5dc489ba93edb226455ef0855b98b
2024-11-05 21:44:38 -08:00
David Vacca
4a119c4c3a Migrate ReactVirtualTextViewManager to kotlin and reduce visibility tointernal (#47402)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47402

Migrate ReactVirtualTextViewManager to kotlin and reduce visibility tointernal

changelog: [Android][Breaking] Reduce visibility of ReactVirtualTextViewManager to internal

Reviewed By: cortinico

Differential Revision: D65462051

fbshipit-source-id: fa6daef4e557d527d594616ca032ebf0180cbba2
2024-11-05 21:44:38 -08:00
David Vacca
5c3c1524dd Exclude $$PropSetter classes from public API (#47432)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47432

In this diff we are excluding the $$PropSetter classes from public API, we do this by adding the UnstableReactNativeAPI annotation on all $$PropSetter classes

changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D65488026

fbshipit-source-id: 9f1bbe7b25fa69c0a40f6cb0ff38a8ae6ee8d97d
2024-11-05 21:44:38 -08:00
Phillip Pan
b7ec7523cc clean up contextContainer->insert("ReactNativeConfig") from oss (#47350)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47350

Changelog: [Internal]

we don't need any of these now since no one is calling `contextContainer_->at<std::shared_ptr>("ReactNativeConfig")` anymore

Reviewed By: NickGerleman

Differential Revision: D65304976

fbshipit-source-id: 5f835ab9ac429aa1942cc8d9669812c1ac994238
2024-11-05 17:43:18 -08:00
Nicola Corti
39dfbadd5d Stable API - Make classes in com.facebook.react.views.safeareaview internal (#47375)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47375

This makes the following class internal:
- ReactSafeAreaView
- ReactSafeAreaViewManager

Those classes should have not been exposed in the first place. Marked as breaking but no
meaningful usages are available in OSS:
https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+com.facebook.react.views.safeareaview.ReactSafeAreaView

Changelog:
[Android] [Breaking] - Stable API - Make classes in `com.facebook.react.views.safeareaview` internal

Reviewed By: javache

Differential Revision: D65422197

fbshipit-source-id: d245155c7c92a408cfbb2a7a0015a73fd1d9f9b8
2024-11-05 16:38:17 -08:00
Ramanpreet Nara
ef6b6f315c earlyjs: Attach js build to all errors (#46868)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46868

jsBuild prasing was done at the js level.

But, for the c++ pipeline, we have to parse the js build in native.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D63927093

fbshipit-source-id: ce7ee46714ee0e72e450003330dbca78acb264a3
2024-11-05 16:15:09 -08:00
Soe Lynn
120a12f01a Convert [bridge_ reload] to RCTReloadCommand (#47400)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47400

Changelog [Internal]:

Convert `[bridge_ reload]` to RCTReloadCommand

Reviewed By: cipolleschi

Differential Revision: D65455862

fbshipit-source-id: 5d5e504cc0b4151a2fb4c86c08e84dbd7040ed68
2024-11-05 15:45:22 -08:00
Yedidya Feldblum
2dcffef5c4 let Pointer be nothrow-move-constructible (#47331)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/47331

Reviewed By: Gownta

Differential Revision: D65271354

fbshipit-source-id: cd3ff9db94f2ad332afd68dae438c404f8807f70
2024-11-05 15:44:57 -08:00
Nicola Corti
a72c35f98c Stable API - Make VibrationModule internal (#47414)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47414

This class should not be accessed directly, therefore I'm making it internal.
Technically breaking but I verified that there are no meaningful usages in OSS:
https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+com.facebook.react.modules.vibration.VibrationModule

Changelog:
[Android] [Breaking] - Stable API - Make ClipboardModule internal

Reviewed By: mdvacca

Differential Revision: D65479292

fbshipit-source-id: 383790e6432c3c8c6f47289d2156099d263cc8ca
2024-11-05 15:41:41 -08:00
Nicola Corti
c4f58d2452 Update messages for @react-native-bot (#47428)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47428

This changes the messages that the bot is printing.
I've moved from using a table to using GitHub's admonitions that
renders nicely are are more informative.

Changelog:
[Internal] [Changed] - Update messages for react-native-bot

Reviewed By: mdvacca

Differential Revision: D65485633

fbshipit-source-id: f43f7bd75280bfd0aceab48b2517306c1057b778
2024-11-05 14:33:29 -08:00
Nicola Corti
d2a91617da Prevent @react-native-bot from double posting on missing reproducer (#47427)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47427

I've noticed that react-native-bot posts twice once we can't find a reproducer.
(see here: https://github.com/facebook/react-native/issues/47421)

This fixes it by letting it post only once.

Changelog:
[Internal] [Changed] - Prevent react-native-bot from double posting on missing reproducer

Reviewed By: mdvacca

Differential Revision: D65485634

fbshipit-source-id: dbe9b1311aef246dead6d9b922c1256363e894f7
2024-11-05 14:33:29 -08:00
Nicola Corti
bbe714e487 Undo a breaking change on ReactViewGroup constructor (#47423)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47423

cipolleschi found out that we broke the `ReactViewGroup` constructor when making this class Nullsafe.

Specifically now users would need to pass a `Context` and not a `Context?` as libraries will break (and this will break a lot of them).
So I'm undoing this change by annotating this parameter as Nullable.

Changelog:
[Android] [Changed] - Undo a breaking change on ReactViewGroup constructor

Reviewed By: tdn120

Differential Revision: D65483379

fbshipit-source-id: 43f7bcab5f10b1b8b5601de1dab314d7bbb1eefe
2024-11-05 13:59:31 -08:00
David Vacca
72bd840dd3 Deprecate BridgelessCatalystInstance class (#47385)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47385

BridgelessCatalystInstance class is deprecated, please to migrate to new architecture using [com.facebook.react.defaults.DefaultReactHost] instead.

changelog: [Android][Changed] Deprecate BridgelessCatalystInstance class

Reviewed By: cortinico

Differential Revision: D65430789

fbshipit-source-id: 011b372c93c39862d5821713aa8f673084b52c2a
2024-11-05 12:34:51 -08:00
Soe Lynn
2168dca4ac Fix warning for adjustImageWhenDisabled (#47401)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47401

Changelog [Internal]:

Replace deprecated `adjustImageWhenDisabled` with `UIButtonConfiguration`

Reviewed By: cipolleschi

Differential Revision: D65457771

fbshipit-source-id: ffb5b4fc629ba671cb6fec1dc333bf693e4be8ea
2024-11-05 12:11:51 -08:00
Mateo Guzmán
d8cfd98070 feat(image): support for resizeMode and objectFit value of 'none' (#47110)
Summary:
As part of https://github.com/facebook/react-native/issues/34425, `objectFit` value of `'none'` needs to be supported for the Image component.

In order to support this, a new value must also be added to support the equivalent in `resizeMode`. With this new value, the image will not be resized at all and keeping it in the initial position within a container (see in the screenshots).

In this PR the support is added for both Fabric and Paper.

## Changelog:

[GENERAL] [ADDED] - image `resizeMode` and `objectFit` support for `'none'`.

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

Test Plan:
Using the `rn-tester`, there is a new image example for both `resizeMode` and `objectFit`.

See below the results for both Android and iOS:

<details>
<summary>Fabric screenshots</summary>

**Android:**

| Resize Mode | Object Fit |
| --------- | ---------- |
| ![Screenshot_1729232899](https://github.com/user-attachments/assets/ea765afc-9f85-4ac3-96ab-229b3f1def20) | ![Screenshot_1729232912](https://github.com/user-attachments/assets/75033e76-5faa-438d-81b1-4bf8436f9ef2) |

**iOS:**

| Resize Mode | Object Fit |
| --------- | ---------- |
| ![Simulator Screenshot - iPhone 16 Pro Max - 2024-10-18 at 08 16 37](https://github.com/user-attachments/assets/ade02ba9-4792-4760-aada-6ea56b591801) | ![Simulator Screenshot - iPhone 16 Pro Max - 2024-10-18 at 08 16 55](https://github.com/user-attachments/assets/abf68db9-841a-4ee5-b5db-64fe84a69089) |

</details>

<details>
<summary>Paper screenshots</summary>

**Android:**

| Resize Mode | Object Fit |
| --------- | ---------- |
| ![Screenshot_1729286528](https://github.com/user-attachments/assets/88e89191-d70a-4013-8380-2ecefd9532b4) | ![Screenshot_1729286542](https://github.com/user-attachments/assets/43d84ae0-2ed3-47ad-a725-ac6aea0b3245) |

**iOS:**

| Resize Mode | Object Fit |
| --------- | ---------- |
| ![Simulator Screenshot - iPhone 16 Pro Max - 2024-10-18 at 22 21 22](https://github.com/user-attachments/assets/e14a81de-3a69-4e73-8c85-ec08ac30b04f) | ![Simulator Screenshot - iPhone 16 Pro Max - 2024-10-18 at 22 21 16](https://github.com/user-attachments/assets/595f9f5e-96a6-4f6b-9614-f6c236837ba8) |

</details>

Reviewed By: fabriziocucci

Differential Revision: D65420002

Pulled By: javache

fbshipit-source-id: df3bc8fc931b88cde5fe51d89685bf327e30ed9f
2024-11-05 11:36:27 -08:00
Nicola Corti
d7d5de9f96 Stable API - Make NativeModulePerfLogger internal (#47415)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47415

This class should not be accessed directly, therefore I'm making it internal.
Technically breaking but I verified that there are no meaningful usages in OSS:
https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+com.facebook.react.reactperflogger.NativeModulePerfLogger

Changelog:
[Android] [Breaking] - Stable API - Make NativeModulePerfLogger internal

Reviewed By: mdvacca

Differential Revision: D65479550

fbshipit-source-id: 545c33e2c526e396084af65fc19314f59c8a74f8
2024-11-05 11:35:12 -08:00
Alan Lee
d1fb01cd85 Make FrescoBasedReactTextInlineImageViewManager Nullsafe (#47425)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47425

Make FrescoBasedReactTextInlineImageViewManager Nullsafe.

Changelog: [Internal]

Reviewed By: tdn120

Differential Revision: D65456481

fbshipit-source-id: c841494ba933be149a2124a461d6a5011ce7d993
2024-11-05 11:31:37 -08:00
Nick Gerleman
19b0acf754 Minor display: contents optimizations (#47358)
Summary:
X-link: https://github.com/facebook/yoga/pull/1736

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

`LayoutableChildren<yoga::Node>::Iterator` showed up to a surprising extent on a recent trace. Part of this was during pixel grid rounding, which does full tree traversal (we should fix that...), where the iterator is the first thing to read from the node.

I ran Yoga microbenchmark with Yoga compiled with `-O2`, where we saw a regression of synthetic performance by ~10%, but it turns out this build also had ASAN and some other heavy bits enabled, so the real impact was quite lower (~6%).

I was able to make some optimizations in the meantime against that, which still show some minor wins, reducing that overhead to ~4% in the properly optimized build (and a bit more before that). This is still measurable on the beefy server, and the code is a bit cleaner, so let's commit these!

Note that, in real scenarios, measure functions may dominate layout time, so display: contents does not mean end-to-end 4% regression, even after this change.

This change makes a few different optimizations
1. Removes redundant copies
2. Removes redundant index keeping
3. Mark which branches are likely vs unlikely
4. Shrink iterator size from 6 pointers to 3 pointers
5. Avoid usage in pixel grid rounding (so we don't need to have cache read for style)

In "Huge nested layout" example

| Before display: contents support | After display: contents support | After optimizations |
| 9.77ms | 10.39ms | 10.17ms |

Changelog: [Internal]

Reviewed By: rozele

Differential Revision: D65336148

fbshipit-source-id: 01c592771ed7accf2d87dddd5a3a9e0225098b56
2024-11-05 11:28:37 -08:00
Luna Wei
06071c68d5 Remove experimental types (#47405)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47405

Changelog: [Internal] - With New Architecture out, delete experimental type definition and move types back to relevant definition files

Reviewed By: cortinico, jorge-cab

Differential Revision: D65462903

fbshipit-source-id: bd7fc5bb689eb054b3a30ec7b388e0f455ff1c93
2024-11-05 10:24:13 -08:00
Riccardo Cipolleschi
ba41228a66 Back out "Add png extension only if file exist when load local image" (#47417)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47417

Backing out this change as it was breaking an internal app. I'll reland this next week when I have more time.

## Changelog:
[iOS][Changed] - Revert fix that checks whether an image is present on disk.

## Facebook:
This is breaking twilight.

Differential Revision: D65479912

fbshipit-source-id: dcd5ac5f3d98ba2f10b9519f09d3eb1fd454da61
2024-11-05 10:06:35 -08:00
Luna Wei
f489944051 Convert PanResponder example into functional component (#47381)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47381

Convert PanResponder example into functional component

Changelog: [Internal] Update PanResponder example to functional component

Reviewed By: lyahdav

Differential Revision: D65430973

fbshipit-source-id: 0db09ce12a8c59ec74beaf2ee10326c984fa682c
2024-11-05 09:30:30 -08:00
Nicola Corti
8c50bf0beb Stable API - Make DevLoadingModule internal (#47368)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47368

This class should be internal and has no meaningful usages outside of React Native.
See https://github.com/search?type=code&q=%22DevLoadingModule%3A%3Aclass%22

So technically breaking but I expect no impact for OSS at all.

Changelog:
[Android] [Breaking] - Make `DevLoadingModule` internal

Reviewed By: javache

Differential Revision: D64725164

fbshipit-source-id: 5f39e609c611662c71cc08bffa195f7bea5db5bd
2024-11-05 07:35:36 -08:00
Nicola Corti
287e200332 Stable API - Convert to Kotlin and make internal NotThreadSafeViewHierarchyUpdateDebugListener (#47371)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47371

This interface should have not been exposed in the first place.
I'm converting it to Kotlin + making it `internal`.
I found no meaningful usage in OSS so I expect no breakages.

Changelog:
[Android] [Breaking] - Stable API - Convert to Kotlin and make internal `NotThreadSafeViewHierarchyUpdateDebugListener`

Reviewed By: javache

Differential Revision: D65420912

fbshipit-source-id: 5afdb013f588a5698b4e7467a7f1096c24d1733e
2024-11-05 04:11:48 -08:00
Nicola Corti
1f62529dc4 Properly handle paths with spaces in autolinking (#47388)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47388

Fixes https://github.com/facebook/react-native/issues/47364
Fixes https://github.com/facebook/react-native/issues/47377
Fixes https://github.com/facebook/react-native/issues/37124

We're having problems is a path contains a space ' ' because when autolinking,
the `add_subdirectory()` function of CMake consider the path with space as 2 parameters.

This fixes it by properly quoting the path.

Changelog:
[Android] [Fixed] - Properly handle paths with spaces in autolinking

Reviewed By: cipolleschi

Differential Revision: D65434413

fbshipit-source-id: b9147482f98f7e222405cc8d9e6f3c17a5f4ed02
2024-11-05 03:32:16 -08:00
Nicola Corti
3956955eaa Use absolute path when compiling appmodules.so sources (#47379)
Summary:
Fixes https://github.com/facebook/react-native/issues/47352

This fixes a bug when the user is providing its own CMakeLists.txt file say because they want to compile more C++ code than we actually provide.

Previously the `*.cpp` will evalute file in the current directory, meaning that the app's default `OnLoad.cpp` file would be ignored.

## Changelog:

[ANDROID] [FIXED] - Use absolute path when compiling appmodules.so sources

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

Test Plan:
Tested against the reproducer provided in:
- Use absolute path when compiling appmodules.so sources

Reviewed By: cipolleschi

Differential Revision: D65428676

Pulled By: cortinico

fbshipit-source-id: 7f3e4d470da0fffc5191c1a2c7e8fec517fee496
2024-11-05 03:27:59 -08:00
Nicola Corti
83d38501b8 setup-gradle v4 + Remove unnecessary Gradle Wrapper Validation (#47389)
Summary:
As per: https://github.com/gradle/actions#the-wrapper-validation-action

> Starting with v4 the setup-gradle action will [perform wrapper validation](https://github.com/gradle/actions/blob/main/docs/setup-gradle.md#gradle-wrapper-validation) on each execution. If you are using setup-gradle in your workflows, it is unlikely that you will need to use the wrapper-validation action.

I'm moving to setup-gradle v4 and remove this unnecessary extra action.

## Changelog:

[INTERNAL] - setup-gradle v4 + Remove unnecessary Gradle Wrapper Validation

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

Test Plan: CI

Reviewed By: blakef

Differential Revision: D65435069

Pulled By: cortinico

fbshipit-source-id: c28b4d520e91fea9c59a341fb94598db5fc69900
2024-11-05 03:19:06 -08:00
Riccardo Cipolleschi
d7d5535fe1 Suppres CC_MD5 warning (#47378)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47378

The RCTMD5Hash in RCTUtils is using CC_MD5 function which is deprecated. unfortunately we can't really change it or we will break many apps that use it in the AsyncStorage.

Those app wlll have to do a migration to use a different function. Meanwhile we are suppressing the warning

## Changelog
[Internal] - Suppress CC_MD5 warning

Reviewed By: cortinico

Differential Revision: D65424309

fbshipit-source-id: e0258ae68482f6c4a3a865bb52920f87bc5ada21
2024-11-05 02:48:49 -08:00
Ramanpreet Nara
0e7ba9094e Make redboxes resilient to react native preloading (#47391)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47391

React Native can preload before the activity is available.

Preloading will execute the js bundle. If the js bundle throws an error, it'll try to render a redbox.

If the activity isn't available, and hasn't been set on the react instance yet, the redbox will just render nothing.

## Changes
In this diff, just re-try displaying the redbox after the application sets the activity on the react instance (i.e: calls onHostResume(activity)).

Changelog: [Android][Breaking] - Rename DevSupportManagerBase.getCurrentContext() -> getCurrentReactContext()

Reviewed By: mdvacca

Differential Revision: D65352596

fbshipit-source-id: 7750f6ca493fc50405119958e0f2908fc24f1cb4
2024-11-04 18:46:35 -08:00
Ramanpreet Nara
5a6a42c7d0 DevSupportManagerBase: Rename getCurrentContext() -> getCurrentReactContext() (#47390)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47390

getCurrentContext() is very ambiguous.

Changelog: [Android][Breaking] - Make DevSupportManagerBase.getCurrentReactContext() public

Reviewed By: mdvacca

Differential Revision: D65433217

fbshipit-source-id: a739d206de8085fc5b47b2a31c7e94fe6e71852f
2024-11-04 18:46:35 -08:00
David Vacca
fe656be26e Reduce visibility of ReactUnimplementedViewManager to internal (#47396)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47396

Migrate ReactUnimplementedViewManager to internal visibility

verified and there are usages on OSS

changelog: [Android][Breaking] Reduce visibility of ReactUnimplementedViewManager to internal

Reviewed By: cortinico

Differential Revision: D65444514

fbshipit-source-id: 11ff2acc96098bc4e53be7ef3059e4a5c112c43e
2024-11-04 17:46:14 -08:00
Joe Vilches
c9a96715ef Update public API for intrinsic sizing setters (#46939)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46939

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

tsia! opted for one function for each keyword just like auto. This is kinda annoying and not the most sustainable, so maybe it makes more sense to make a new enum here and just add one function

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D64002837

fbshipit-source-id: f15fae9fc0103175e1d85850fc9aa68579989fd3
2024-11-04 16:02:37 -08:00
Joe Vilches
027b8032c2 Modify private apis to set, store, and get intrinsic sizing keywords (#46938)
Summary:
X-link: https://github.com/facebook/yoga/pull/1721

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

The private internals of how we store styles needed to change a bit to support 3 new keyword values. Right now the only other keyword that can be stored is `auto`. As a result there isn't much fancy logic to support storing this and its just stored as a specific type inside of `StyleValueHandle`. There are only 3 bits for types (8 values), so it is not sustainable to just stuff every keyword in there. So the change writes the keyword as a value with a new `keyword` `Type`.

I chose not to put `auto` in there even though it is a keyword since it is a hot path, I did not want to regress perf when I did not need to.

I also make a new `StyleSizeValue` class to store size values - so values for `width`, `height`, etc. This way these new keywords are kept specific to sizes and we will not be able to create, for example, a margin: `max-content`.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D63927512

fbshipit-source-id: 7285469d37ac4b05226183b56275c77f0c06996c
2024-11-04 16:02:37 -08:00
Eli White
35f0e1cca2 Fix CodegenSchema Enum type to not export array (#47324)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47324

I need to reference this type somewhere else, but not an array of the type.

Generally we prefer that all exported types are the object itself, and it used as a member type of arrays when used.

Changelog: [Internal]

Reviewed By: makovkastar

Differential Revision: D65259014

fbshipit-source-id: 35fb5fe03a44bed61ad87337d0fc5c198744c0e9
2024-11-04 12:58:49 -08:00
Eli White
dd472101b7 Add NumberLiteralTypeAnnotation support (#47323)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47323

This change adds support for number literals as a type.

The codegen already has parsing support for these types
```
  +passNumber: (arg: number) => void;
  +passString: (arg: string) => void;
  +passStringLiteral: (arg: 'A String Literal') => void;
```

This change now also supports
```
  +passNumberLiteral: (arg: 4) => void;
```

On the native side this is treated the same as `number`. It could be strengthened in the future.

This is a pre-requisite for number literal unions and enums.

Changelog: [Added] Codegen: Added support for Number literals in native module specs

Reviewed By: makovkastar

Differential Revision: D65249334

fbshipit-source-id: 98b051d2a6bd1ad5cc6473ac88acfcbe82bd5c7d
2024-11-04 12:58:49 -08:00
Nicola Corti
623d481991 Make ReactDebugOverlayTags, DebugOverlayTags, Printer, PrinterHolder, NoopPrinter internal
Summary:
Those 2 classes are not supposed to be exposed externally, so I'm making them internal.
The were never part of the public API so I'm not marking this commit as [BREAKING]

Changelog:
[Android] [Changed] - Make ReactDebugOverlayTags, DebugOverlayTags, Printer, PrinterHolder, NoopPrinter internal

Reviewed By: fabriziocucci

Differential Revision: D65420257

fbshipit-source-id: b870274e84d9c3202b9f21360c29eeb995a8d52b
2024-11-04 12:20:50 -08:00
Nicola Corti
cba1d4bae7 Stable API - Make InteropModuleRegistry internal (#47374)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47374

I've converted this class to Kotlin + made it `internal` as it should not be exposed publicly.
This class is part of the iterop layer for the New Architecture.
Marked as breaking but I expect no meaningful breakages here.

Changelog:
[Android] [Breaking] - Stable API - Make InteropModuleRegistry internal

Reviewed By: javache

Differential Revision: D65421965

fbshipit-source-id: 207be5379ebe3a31530cfea75b4623787f5ae7cf
2024-11-04 11:01:46 -08:00
zhongwuzw
44f2a08371 Add png extension only if file exist when load local image (#46971)
Summary:
FIxes https://github.com/facebook/react-native/issues/46870.

To avoid many breaking changes, I modified the logic to add the PNG extension only if the file exists.

## Changelog:

[IOS] [FIXED] - Add png extension only if file exist when load local image

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

Test Plan: Demo in https://github.com/facebook/react-native/issues/46870 .

Reviewed By: blakef

Differential Revision: D65276409

Pulled By: cipolleschi

fbshipit-source-id: 9e03a36b229f7c336632b5b76a92d9f749c59835
2024-11-04 10:26:55 -08:00
Nicola Corti
d7550293a2 Stable API - Make ReactDevToolsSettingsManagerModule and ReactDevToolsRuntimeSettingsModule internal (#47373)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47373

Users should not depend on `ReactDevToolsSettingsManagerModule` directly hence I'm making it internal.
I expect to breakages in OSS as there no usages at all:
https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+com.facebook.react.modules.reactdevtoolssettings.ReactDevToolsSettingsManagerModule
https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+com.facebook.react.modules.devtoolsruntimesettings.ReactDevToolsRuntimeSettingsModule

Changelog:
[Android] [Breaking] - Stable API - Make ReactDevToolsSettingsManagerModule and ReactDevToolsRuntimeSettingsModule internal

Reviewed By: javache

Differential Revision: D65421030

fbshipit-source-id: e9d701af6cde25133f7b3ff9b07b678a7710852c
2024-11-04 10:26:47 -08:00
oddlyspaced
cc1d2853fb feat(Android): add support for invert colors check on android accessibility (#47341)
Summary:
This PR provides a fix for the long existing issue of missing check for invert color in accessibility options on Android.
Reference Issue : https://github.com/facebook/react-native/issues/30870

## Changelog:
- Added native module code to check for invert color settings value
- Updated js module to return a proper promise instead of default false for isInvertColorsEnabled()

Pick one each for the category and type tags:

[ANDROID] [FIXED] - Missing isInvertColorsEnabled implementation for Android

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

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

Test Plan: Tested on OnePlus 12 with Android 14 and Pixel 6 with Android 15. The try catch exists because in some cases if the switch hasn't been toggled before the android system raises the missing settings exception.

Reviewed By: cortinico, fabriziocucci

Differential Revision: D65419632

Pulled By: javache

fbshipit-source-id: ddb103445a9d0f318e52ba9d23750140ce5a7ed0
2024-11-04 10:06:10 -08:00
Mateo Guzmán
dc9db01665 feat(image): [android] adding only-if-cached cache control option (#47348)
Summary:
Following up from https://github.com/facebook/react-native/issues/47182, as basic caching control is already in place in Android, it can be extended to include the `only-if-cached` option.

We check whether the image is in the cache. If it is, we proceed to load it. Otherwise, we do nothing.

## Changelog:

[ANDROID] [ADDED] - Image `only-if-cached` cache control option

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

Test Plan:
In the `rn-tester`, I added a third example for Android where the third image will never be loaded as the cache policy is set to `only-if-cached` and the image has not been loaded before.

<details>
<summary>Video demonstrating how the `only-if-cached` options behaves</summary>

https://github.com/user-attachments/assets/45669e81-5414-4103-8931-138bffa81447

</details>

<details>
<summary>Error from image not found in cache example</summary>

<img width="807" alt="image" src="https://github.com/user-attachments/assets/6b79d811-1809-437c-b2fe-c86d3da7c58d">

</details>

Reviewed By: rshest

Differential Revision: D65384639

Pulled By: Abbondanzo

fbshipit-source-id: f4a72694f45eb3d7097c350f4a4008a0abf0a1ab
2024-11-04 08:37:59 -08:00
Samuel Susla
91df5a4a0f surface setup issues in EventBeat and Scheduler (#47355)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47355

changelog: [internal]

Reviewed By: rshest

Differential Revision: D65333695

fbshipit-source-id: 854dbc3ae52db0093961cbeb81f1f96934eca40d
2024-11-04 08:15:12 -08:00