Commit Graph

38536 Commits

Author SHA1 Message Date
Blake Friedman 9ba600c066 chore: remove lockfile from Helloworld (#45135)
Summary:
Accidentally shipped, removing.

## Changelog: [Internal]

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

Reviewed By: christophpurrer

Differential Revision: D58950410

Pulled By: blakef

fbshipit-source-id: 7bda7278f918a1e50c25f86e461e19fe7e176c5c
2024-06-24 08:08:11 -07:00
Nicola Corti 61b3c95b45 Bump CLI to 14 alpha9 (#45121)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45121

As the title says

Changelog:
[Internal] [Changed] - Bump CLI to 14 alpha9

Reviewed By: cipolleschi, blakef

Differential Revision: D58945983

fbshipit-source-id: 227b56bb0441a60ce247524ac8361e5eb8674c3c
2024-06-24 06:51:29 -07:00
Riccardo Cipolleschi 42735717b5 Fix Cache checks in build_hermes_macos (#45127)
Summary:
The cache checks in GHA were performed against bool values, while the actual values are strings.
So the checks were always failing and all the steps were executed, even when not necessary.

The reason why it was failing is because, with this setup, when a cache is hit, some steps were skipped in previous jobs, making following jobs trying to execute code on not-existing files.

## Changelog:
[Internal] - Fix cache for build_hermes_macos

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

Test Plan: GHA are green again

Reviewed By: blakef

Differential Revision: D58947838

Pulled By: cipolleschi

fbshipit-source-id: 8dba216e72a3034fd4c1484418d37bfb78cf314d
2024-06-24 05:54:30 -07:00
Nick Lefever 72ce6ff03a Fix runtime shadow node reference corruption on measure (#45116)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45116

Changelog: [Internal]

The UIManagerBinding `findShadowNodeByTag_DEPRECATED` method returns a shadow node and was updating the runtime reference on the shadow node with the created wrapper for the return value.

The JSObject holding the wrapper would get deallocated, which would deallocate the wrapper stored on the shadow node.

This would cause crashes on the next reference update for the shadow node, due to the shared_ptr being reassigned with the new value while it was already deallocated.

The `sendAccessibilityEvent` function calls `findShadowNodeByTag_DEPRECATED` to get the shadow node referenced by the provided react tag, which could lead to runtime shadow node reference corruption.

Reviewed By: sammy-SC

Differential Revision: D58920296

fbshipit-source-id: ddb9ed0ee64bc01934aabde7070731dc53a2db70
2024-06-24 05:20:42 -07:00
Oskar Kwaśniewski 6bb75c7b13 fix: set proper framework dependencies for built-in pods (#45104)
Summary:
Platforms like visionOS require explicit framework dependencies to be set in pods to build properly. For some reason linking on visionOS is more strict than on iOS but this might change in some future OS versions so it's good to have pods having exact dependencies.

I've discussed that earlier with Saadnajmi and cipolleschi. Let me know if you are okay with this change.

## Changelog:

[IOS] [FIXED] - set proper framework dependencies for built-in pods

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

Test Plan: CI Green

Reviewed By: dmytrorykun

Differential Revision: D58943593

Pulled By: cipolleschi

fbshipit-source-id: 3d2df4f3bbdf36704e09f5e39bfb838b2e0f3c99
2024-06-24 03:14:55 -07:00
Panos Vekris f7fe68861a set one_sided_type_guards=true in fbsource (#45107)
Summary:
This diff enables:
1.  [one-sided type guards](https://flow.org/en/docs/types/type-guards/#one-sided-type-guards) (`implies x is T`), and
2. stricter checking of type guard consistency (see [relevant docs page](https://flow.org/en/docs/types/type-guards/#toc-consistency-checks-of-type-guard-functions)).

To prevent many new errors from being introduced this diff also converts some two-sided type guards to [one-sided](https://flow.org/en/docs/types/type-guards/#one-sided-type-guards) ones.

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

Updated the flowconfigs and synced flow_runner/codemods since the change has already been applied there:
```
js1 upgrade www-shared -p flow_runner/codemods
```

Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D58874409

fbshipit-source-id: 959a6773701518a1d6aa35e2ec28fd4ce12d2e75
2024-06-21 16:15:34 -07:00
Benoit Girard 8a6508c623 Increase the buffer size and try kStall to avoid dropping samples (#45111)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45111

Spent time debugging this issue today:
https://fb.workplace.com/groups/1700234700326965/posts/2197109080639522

The problem is described here:
https://perfetto.dev/docs/concepts/buffers

But basically we're writing too much data, too fast and the traced process can't read it fast enough. Perfetto is doing data drop.

This diff tries to use the `kStall` mode. It doesn't seem to do much but I'll leave it in for now because it shouldn't hurt too much. It's designed for our use case.

The main fix comes from increasing the buffer size to 20MB. Since it's not on by default I think it's fine to have a really large buffer for now to unblock tracing.

Reviewed By: javache

Differential Revision: D58832598

fbshipit-source-id: 101b364e2e9e28aa6a041ded1df82d5fec1f42e1
2024-06-21 13:31:55 -07:00
Oskar Kwaśniewski 34cd195d9f fix: retrieve statusbar size using RCTUIStatusBarManager (#45103)
Summary:
This PR changes the call from `RCTSharedApplication()` to retrieve the status bar size using the `RCTUIStatusBarManager()` method, a way which supports multi-window apps.

## Changelog:

[IOS] [FIXED] - Retrieve status bar size using RCTUIStatusBarManager

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

Test Plan: Check if the perf menu pops up in the correct spot.

Reviewed By: javache

Differential Revision: D58868503

Pulled By: cipolleschi

fbshipit-source-id: db5fc80a712a8a18a2863cdfbbe44f48bafe9fc3
2024-06-21 08:27:50 -07:00
Rubén Norte a8a76f9bfa Improve profiling information for timers (#45091)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45091

Changelog: [internal]

We're currently logging when we execute timers in Systrace/Perfetto, but we have no information about them whatsoever.

This adds some additional information:
  * What kind of timer it is
  * It's ID
  * And most importantly, when it was created (including the ID as well).

This allows us to know where was a specific timer scheduled and with what API.

Reviewed By: bgirard

Differential Revision: D58832112

fbshipit-source-id: 1bc11759b6c8296acf63ff3533ca1dc3428360a7
2024-06-21 05:13:20 -07:00
Rubén Norte fdf0183831 Stop defining setImmediate and clearImmediate from TimerManager when using microtasks (#45090)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45090

Changelog: [internal]

The definition of these methods is redundant when using microtasks, so it's better to avoid defining them in the first place (to also detect issues if the setup is not what we expect).

Reviewed By: sammy-SC

Differential Revision: D58816582

fbshipit-source-id: dd1b07f8b11069605e3184b1272a9bbc3b44ca75
2024-06-21 05:13:20 -07:00
Irfanwani 1bec961c95 fix: post install error in iOS after running pod install, undefined method 'path' for nil:NilClass (#45095)
Summary:
After upgrading my project to the latest version of react native i.e, 0.74.2, i was getting an error when running `pod install` an the error was coming from the post install hook. Going deeper into the file tree, i found that some of the things are Nil and react native is trying to use some methods on them, so fixed those issues by using chaining operators to conditionally apply the path method on them.

## Changelog:

[Internal] - fixes the post install issue when running pod install with react native version, 0.74.2

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

Test Plan: Manually tested the fix. Works perfectly fine in both debug and production mode.

Reviewed By: cortinico

Differential Revision: D58863666

Pulled By: cipolleschi

fbshipit-source-id: 64459711dcf926b7544b99b542e9861c1c0f05ca
2024-06-21 04:36:01 -07:00
Oskar Kwaśniewski a7b2555644 feat: remove upper limit for Cocoapods version (allow for 1.15.2) (#45099)
Summary:
This PR uses a suggested solution from here: https://github.com/facebook/react-native/issues/42698 to allow users to use Cocoapods 1.15.2 which fixed issues regarding RN builds.

## Changelog:

[IOS] [FIXED] - Bump cocoapods version to 1.15.2 excluding 1.15.0, 1.15.1

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

Test Plan: CI Green

Reviewed By: blakef

Differential Revision: D58863685

Pulled By: cipolleschi

fbshipit-source-id: 0128eb0cbf83e4a3d35addbae4c31e349775688c
2024-06-21 04:12:26 -07:00
Nicola Corti e7d1708701 Fix broken unableToAddHandledRootView (#45101)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45101

This test broke after I merged
https://github.com/facebook/react-native/pull/34785
yesterday.

Just fixing it in a similar way as the test above.

Changelog:
[Internal] [Changed] - Fix broken unableToAddHandledRootView

Reviewed By: rubennorte, blakef

Differential Revision: D58864166

fbshipit-source-id: 4f48dbfd5238a2811564ce02199af7fc284d39b4
2024-06-21 03:41:40 -07:00
Nicola Corti 15909fab95 packages/react-native-gradle-plugin/ -> packages/gradle-plugin/ (#44832)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44832

I'm renaming this folder as now we have 2 gradle plugins + we currently have
`package/react-native-gradle-plugin/react-native-gradle-plugin/` which is confusing so we can just call this folder `packages/gradle-plugin/`
to be consistent with the NPM package name

Changelog:
[Internal] [Changed] - packages/react-native-gradle-plugin/ -> packages/gradle-plugin/

Reviewed By: blakef

Differential Revision: D58284883

fbshipit-source-id: 5a7bb40a5d80f6fbab4ffb29e44107453f1013ec
2024-06-21 01:08:00 -07:00
psionic12 3429dc1ccf Log a SoftException on SurfaceMountingManager.addRootView (#34785)
Summary:
Follow the same solution (do not throw a crash when view ID is set already) used in `ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java` for `ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/SurfaceMountingManager.java`

## Changelog

[Android] [Changed] - Log a SoftException on SurfaceMountingManager.addRootView

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

Test Plan: None

Reviewed By: cipolleschi

Differential Revision: D40022263

Pulled By: cortinico

fbshipit-source-id: d565d2831e2833ccea55f28ea16083b7bae0ed32
2024-06-20 13:16:32 -07:00
Blake Friedman 3dcf86b802 Update @react-native-community/cli to 14.0.0-alpha.7 (#45086)
Summary:
RN CLI to 14.0.0-alpha.7

## Changelog:
[General][Changed] RN CLI to 14.0.0-alpha.7

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

Test Plan:
```
yarn
```

Reviewed By: cortinico

Differential Revision: D58819145

Pulled By: blakef

fbshipit-source-id: 025f190908c52afd3f1055a665986fea4785e192
2024-06-20 11:48:18 -07:00
Jakub Piasecki 2eaf0b0848 Add an overload for createLayout to reduce code duplication (#45083)
Summary:
Adds an overload for `createLayout` method that also handles extracting paragraph attributes and scaling font size if necessary.

## Changelog:

[ANDROID] [CHANGED] - Extracted common parts related to calculating text layout to a helper

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

Test Plan: Tried out on RNTester

Reviewed By: robhogan

Differential Revision: D58818560

Pulled By: cortinico

fbshipit-source-id: a42b5de04c4a70edb88cdd734387d7e4cee94032
2024-06-20 11:09:15 -07:00
Nicola Corti 8a6b88eeaf Back out "Add Float and Int type support for Android modules" (#45087)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45087

Original commit changeset: 32b3bbdf5fd2

Fixes https://github.com/facebook/react-native/issues/44963
Closes https://github.com/facebook/react-native/pull/45024

Original Phabricator Diff: D52420921

Changelog:
[Internal] [Changed] - Back out "[RN][Codegen]Add Float and Int type support for Android  modules"

Reviewed By: dmytrorykun

Differential Revision: D58820544

fbshipit-source-id: 59cd0e7cc17a681785c57b5ce1a9d50d28a348af
2024-06-20 11:06:46 -07:00
Alan Lee 8a3ffb6d23 fix TextInput 'contextMenuHidden' prop (#45014)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45014

`TextInput`'s `contextMenuHidden` prop isn't working working as expected.
It should hide the context menu (copy/paste/...) that pops up from input text.

Reference: [Android doc](https://developer.android.com/reference/android/widget/TextView#setCustomSelectionActionModeCallback(android.view.ActionMode.Callback))
> Returning false from `ActionMode.Callback.onCreateActionMode(ActionMode, android.view.Menu)` will prevent the action mode from being started.

**Changelog:** [Android][Fixed] - TextInput's `contextMenuHidden` prop bug fix

Reviewed By: javache

Differential Revision: D58684366

fbshipit-source-id: 328c267ed0e896a78e114578e3a00adf41f2e095
2024-06-20 10:38:58 -07:00
Riccardo Cipolleschi 75451d5b89 Fix yml syntax on main (#45084)
Summary:
While landing a change on GH, I forget to remove one line that does not belong to an action

## Changelog:
[Internal] - CI fix

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

Test Plan: GHA are green

Reviewed By: blakef

Differential Revision: D58817768

Pulled By: cipolleschi

fbshipit-source-id: 5fc02d2d2a19dd3fe2202c93d0d1873e5dda4b82
2024-06-20 07:49:52 -07:00
Riccardo Cipolleschi 9c6c637816 Refactor Hermes workspace (#45071)
Summary:
This change is the first step in refactoring GHA so that they can be reused more easily across jobs.
Its goal is also to be more reliable w.r.t. caches.

That this change do:
* moves `prepare_hermes_workspace` to a composite action
	* saves the `prepare_hermes_workspace` caches only on main
	* uploads the destination folder as an artifact so that we can use it later in the run
* makes the `test-all`, `nightly` and `publish-release` workflow use the new composite action
* updates the `setup-hermes-workspace` to download and use the artifact uploaded by `prepare_hermes_workspace`

## Changelog:
[Internal] - Factor out the prepare_hermes_workspace action

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

Test Plan: GHA in CI

Reviewed By: cortinico

Differential Revision: D58808087

Pulled By: cipolleschi

fbshipit-source-id: 42c46bcf75fc73b2edfda9be62b5d0fe8a919a5d
2024-06-20 06:50:23 -07:00
Pieter De Baets 2e6f105ef3 Pass EventDispatcher listeners by value (#45077)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45077

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D58791938

fbshipit-source-id: 079fbfad4dd309a41c360e1bdb93e56f8793e6b3
2024-06-20 06:15:11 -07:00
Pieter De Baets a2cb34371e Handle textAlignment: start and make logs consistent (#45076)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45076

> **start**: The same as left if direction is left-to-right and right if direction is right-to-left.

This is equivalent to `auto`, which is not actually a valid CSS value.

Changelog: [General][Added] Add support for `texAlignment: 'start'`

Reviewed By: sammy-SC

Differential Revision: D58791937

fbshipit-source-id: 09622d814212a7055f94b1f091c71edae5db117c
2024-06-20 06:15:11 -07:00
Nicola Corti a297b30377 Bump reactnativecommunity/react-native-android to 13.1 (#45073)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45073

We can also remove the workaround needed for git `safe.directory`
as this is now configured inside the container as `*`

Changelog:
[Internal] [Changed] - Bump reactnativecommunity/react-native-android to 13.1

Reviewed By: blakef

Differential Revision: D58789791

fbshipit-source-id: f44163a0aa822b19e0dd1106d3f039fd0dc83186
2024-06-20 06:04:45 -07:00
Riccardo Cipolleschi ea31a79fe9 Fix build_android by setting git safe folders (#45065)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45065

This fix makes sure that Android runner can run git commands.
This is porting in main the commit https://github.com/facebook/react-native/commit/fee215664287ddca31c8400c87a825c8e9822290

## Changelog
[Internal] - Make the build_android run git commands

Reviewed By: cortinico

Differential Revision: D58782969

fbshipit-source-id: ab35f7e3d1733ab770f2a397552daa1ec7c13cf7
2024-06-20 03:24:29 -07:00
Riccardo Cipolleschi 710b0e64ab Port fixes to release scripts to use GITHUB_REF and GITHUB_REF_NAME variables (#45066)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45066

This changes ports in main the fixes we had to make to the release scripts to run properly in release mode.

This includes the commits:

* https://github.com/facebook/react-native/commit/375c88478c985976e1b59dfa7353042a18b4d132
* https://github.com/facebook/react-native/commit/609c7c05b13214f2a834b251de095243f8dcbf68
* https://github.com/facebook/react-native/pull/45062

## Changelog:
[Internal] - Fix release scripts to run properly in release mode

Reviewed By: cortinico

Differential Revision: D58782925

fbshipit-source-id: b096909d5f8281809ee3c2a01eefda1d19f32936
2024-06-20 03:24:29 -07:00
Riccardo Cipolleschi 90d4d55122 Port Create Release fixes from Stable to main (#45063)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45063

While doing the release of 0.75, we have to fix the Create Release action a few times to get it right.
This change contains the fixes from
* https://github.com/facebook/react-native/commit/e36b46f0c970dc3f1f5b5058a8d10834acdb2667
* https://github.com/facebook/react-native/commit/1b891357b2f1995f2344cc991be423ca66fa6770
* https://github.com/facebook/react-native/commit/56e1c8bfdd57600e79c0b17de1d2fd933d20b8f9
* https://github.com/facebook/react-native/commit/03591318fbabdc0c06808316f471cc361b53c57f
* https://github.com/facebook/react-native/commit/528097709aeef434b0d85565bfd89a4a9ff5644e
* https://github.com/facebook/react-native/commit/f4b1dd1fa11374cae8a696833ad9ded0767cba8f

## Changelog
[Internal] - Backport changes to Create Release github action

Reviewed By: cortinico

Differential Revision: D58782391

fbshipit-source-id: b68088fb8c4290efcb4599d1b090b18e401e4b66
2024-06-20 03:24:29 -07:00
Riccardo Cipolleschi b04d0d0c8c Port Update the testing script to run with the community template (#45064)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45064

This changes port back in main the changes we made in the Stable branch with https://github.com/facebook/react-native/commit/b236f9bd82374e5cf92e1ad622bba3b14f948a04

## Changelog:
[Internal] - Update release testing to work with the new template

Reviewed By: cortinico

Differential Revision: D58782241

fbshipit-source-id: be9f6d4310d3a83e6cc0df4bb690c746229c7ae3
2024-06-20 03:24:29 -07:00
Riccardo Cipolleschi bb886d751f Improve test stability in CI (#45070)
Summary:
This change splits the build step and the test step for running the test on iOS, so we can introduce a retry for the test only.
We are doing that because we have seen some flakyness in CI jobs as sometimes the simulator fails to install the app.

## Changelog:
[Internal] - Add retry to iOS tests

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

Test Plan: Testing in CircleCI

Reviewed By: cortinico

Differential Revision: D58786706

Pulled By: cipolleschi

fbshipit-source-id: 61363cb86dd1a496d3595b43b6331cbee7f032ea
2024-06-20 03:13:13 -07:00
Edmond Chui e5c7eb57e2 Update debugger-frontend from f7e972c...750ed14 (#45074)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45074

Changelog: [Internal] - Update `react-native/debugger-frontend` from f7e972c...750ed14

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

Reviewed By: vzaidman

Differential Revision: D58790390

fbshipit-source-id: b6b15ecbd521cdb231aa9d21135aacc39f31a425
2024-06-20 02:46:03 -07:00
Rob Hogan 2a6a895b17 Debugger: j opens debugger on most recently connected target (#45060)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45060

Currently, `j`, (i.e., `/open-debugger` with no parameters), connects the "first available" target, which in practice is the first page of the first connected device still connected.

In the absence of a target selection UI, a better guess at user intent is to use the *latest* target (most recently added page of most recently connected device).

Also slightly reduces CLI noise by not claiming that we're launching a debugger when there's no target, and not qualifying which target when there's only one.

Changelog:
[General][Changed] Debugger: `j` opens most recent (not first) target.

Reviewed By: huntie

Differential Revision: D58736151

fbshipit-source-id: 3d106a1fa958f9e5c91b16e04075609e1abf6e97
2024-06-19 11:28:36 -07:00
Rob Hogan 53951d7fec Debugger: Make /json/list ordered (#45069)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45069

Currently, `/json/list` returns pages within each device in the iteration order of a C++ `unordered_map`, which doesn't tell us anything useful. Page IDs happen to be sequential, but only as an implementation detail.

Change this contract so that we guarantee ordering reflects addition order, allowing clients to consistently select e.g. most recently added page for a given device.

The implementation of this is as simple as switching from an `unordered_map` to a key-ordered`map`, because we already assign keys (page IDs) with an incrementing integer. Within the inspector proxy, devices already use an insertion (connection)-ordered JS `Map`, so we just document this guarantee.

Changelog:
[General][Changed] Debugger: Make `/json/list` return connection-addition-ordered targets.

Reviewed By: huntie

Differential Revision: D58735947

fbshipit-source-id: 7a132cc5e750475792a2b845afc9a42424690bf1
2024-06-19 11:28:36 -07:00
Benoit Girard 30087a6e00 Introduce FuseboxTracer for DevTools tracing (#44840)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44840

Changelog: [Internal]

Introduce a simplified and minimal tracing backend for Fusebox. This backend is sufficient to implement a pretty usable performance panel.

Although the more I see how easy this is and how annoying working with Perfetto is, the more I think we should just maintain this going forward. Anyways we can figure that out incrementally. For now the plan is still for this to be temporary.

Reviewed By: motiz88

Differential Revision: D57981944

fbshipit-source-id: b3d8c6e8c5a18311bbe98254f8ddf3810fa1334b
2024-06-19 10:11:14 -07:00
Samuel Susla 82325b4260 use feature flag in render function for optimized text (#45068)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45068

changelog: [internal]

In D58672844 I added gating to module.exports.

This gating is sensitive to when feature flags are initialised and causes test failures and regressions for developers. Let's move the feature flag check to component's render function. It introduces extra spread operator but it is good enough to compare new and old <Text /> component.

Reviewed By: GijsWeterings

Differential Revision: D58783941

fbshipit-source-id: f89f4f48e6aeb774ed4a84483a9f4ad59d5bc045
2024-06-19 10:06:15 -07:00
Pieter De Baets 51e464f50f Remove unnecessary synchronized collections from ReactHostImpl (#45026)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45026

All callsites for these containers already explicitly synchronize using these objects, so there's no need to use a synchronized collection wrapper here.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D58724044

fbshipit-source-id: 5151ebb0ceda8656b6039d9984cc32a843051abd
2024-06-19 05:05:00 -07:00
Pieter De Baets 9b67547bec Remove enableArchitectureIndicator from AppRegistry API (#45025)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45025

This API just passed through the `enableArchitectureIndicator` prop to a custom WrapperComponent, as there is no default consumer of it. Instead, each provider of a custom WrapperComponent can capture the required value of itself.

Changelog: [General][Removed] Removed enableArchitectureIndicator API which is only used internally.

Reviewed By: cortinico

Differential Revision: D58723922

fbshipit-source-id: 0c52a904424382f33caab92ac50b316ae161f877
2024-06-19 05:05:00 -07:00
Blake Friedman 927815b9f6 use correct has to label hermes cache key (#45061)
Summary:
This incorrectly used the SHA from facebook/react-native instead of
facebook/hermes to label the hermes cache key. This would bloat our
cache by ~ 1.2GB for each PR.

Changelog: [Internal]

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

Test Plan: We should remove the existing entries for v4-hermes and track the growth over time.

Reviewed By: cipolleschi

Differential Revision: D58780475

Pulled By: blakef

fbshipit-source-id: 0f192faa287f53154f1c8319be6783820d614018
2024-06-19 05:00:41 -07:00
Samuel Susla 0c2fea5c23 fix syntax error (#45058)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45058

changelog: [internal]

Fix github action failure:

```
TransformError [SyntaxError]: /__w/react-native/react-native/packages/react-native/Libraries/Text/Text.js: Missing semicolon. (345:1)

  343 |     ? require('./TextOptimized')
  344 |     : Text
> 345 | ) as typeof Text;
```

Reviewed By: fabriziocucci

Differential Revision: D58779125

fbshipit-source-id: 76917aebf8ae8cfb9f2aa7a75a76383c5a832732
2024-06-19 04:59:02 -07:00
Rubén Norte 58ff2fc636 Make the instructions to regenerate feature flags easier to see in the docs (#45059)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45059

Changelog: [internal]

By moving the command to a code block it's going to be easier to see it when quickly reading the README.

Reviewed By: cortinico

Differential Revision: D58779883

fbshipit-source-id: e912a58641245c6d7dc158f7af0a722e438a0cc3
2024-06-19 04:13:38 -07:00
Samuel Susla 2f0c06de10 setup gating for <TextOptimized /> (#45031)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45031

changelog: [internal]

Reviewed By: rubennorte

Differential Revision: D58672844

fbshipit-source-id: 2c99d3b66665c8dc0b796713b21d91211b469d81
2024-06-18 16:23:45 -07:00
Jorge Cabiedes Acosta d8739e1d37 Add unit tests for BorderRadiusStyle (#44964)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44964

Testing property priority and correct setting percentages for business logic of `BorderRadiusStyle.kt`

To prevent issues like the one fixed by D57473482

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D58705515

fbshipit-source-id: 74e9a68fc0e3d1e88b8eebbb34a1ca8c29052c21
2024-06-18 10:46:23 -07:00
Nicola Corti 3fc6963da3 Fix release regex for publish-release workflow (#45043)
Summary:
The existing regex is not workign. I've split it in two and tested it against a private repo.

## Changelog:

[INTERNAL] - Fix release regex for publish-release workflow

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

Test Plan: Tested on privare repo with GHA

Reviewed By: cipolleschi

Differential Revision: D58736292

Pulled By: cortinico

fbshipit-source-id: f07ef32dcb0059922100c555f7894bbf0c7dd8f6
2024-06-18 10:09:29 -07:00
Moti Zilberman e0fcf2983a Use hermes-parser when building Node packages (#45041)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45041

Changelog: [Internal]

TSIA

Reviewed By: huntie

Differential Revision: D58734657

fbshipit-source-id: d5b17bc0ee8f36bae7c594d99ce70ecea9bf4a40
2024-06-18 09:43:20 -07:00
Moti Zilberman e55ea2daf1 Fix debugger handoff logic to prevent "zombie" state (#45035)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45035

Changelog: [General][Fixed] Avoid a zombie state when opening a second debugger frontend concurrently.

The problem here was that we were sending proxy-protocol messages to the device in the wrong order (`disconnect` *after* `connect`):

 {F1701266597}

The root cause was that we were depending on the outgoing debugger socket's async `close` event to trigger sending the `disconnect` message to the device. This would happen after we'd already (synchronously) sent the `connect` message.

With this diff, we send the `disconnect` message synchronously with calling `close()` on the debugger socket, which fixes the ordering problem at the source. To avoid sending duplicate `disconnect` messages (e.g. one before calling `close()` and one from the `close` event handler), we store some extra state on `Device` (`#connectedPageIds`).

Reviewed By: robhogan, huntie

Differential Revision: D58730634

fbshipit-source-id: 0f54af2e4f8071a8f6d97cc9e3d8a4ea89a46f43
2024-06-18 09:39:35 -07:00
Moti Zilberman 9cca4c1ec1 Add test for connecting multiple debuggers to a single page, reproing "zombie" state (#45034)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45034

Changelog: [Internal]

TSIA

Reviewed By: hoxyq

Differential Revision: D58728261

fbshipit-source-id: 32d4b05d69f88e68b5327dc5c8e837291e3d7726
2024-06-18 09:39:35 -07:00
Moti Zilberman 6695b6e3b8 Reuse Device instances when handing off connections based on device ID (#45027)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45027

Changelog: [Internal]

Changes the device ID collision handling logic to reuse `Device` instances instead of creating new ones. This enables further refactoring of `Device` to improve session state isolation.

Reviewed By: hoxyq

Differential Revision: D58724884

fbshipit-source-id: bc11ce45ce8c80c58c32dcd1b07b28f1d1753a62
2024-06-18 09:39:35 -07:00
Riccardo Cipolleschi 4ecc165029 remove publishing jobs from cci (#45040)
Summary:
We are moving to publish from gha so we need to remove these jobs

## Changelog:

[Internal] - Remove old publishing jobs from CI

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

Test Plan: CircleCI is green

Reviewed By: cortinico

Differential Revision: D58734881

Pulled By: cipolleschi

fbshipit-source-id: 5981bfcf2aa51d55d54d08556631b30b6102a7cd
2024-06-18 09:20:30 -07:00
Nicola Corti a272e8ee66 Remove unused rn-tester e2e tests (#45032)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45032

Those tests haven't been running since ~1 year now.
I know it's not ideal but I'd rather remove them instead of keeping them around not executing.
We can still revert them back from the history once we decide to revive the E2E testing effort.

Changelog:
[Internal] [Changed] - Remove unused rn-tester e2e tests

Reviewed By: cipolleschi

Differential Revision: D58729123

fbshipit-source-id: f0f47e3c2e087141fdff506b7c5c9b460263721b
2024-06-18 09:06:42 -07:00
Hailey cdab5370af fix (iOS): fix selectTextOnFocus in Fabric and non-Fabric by calling selectAll after becomeFirstResponder (#44307)
Summary:
Fixes https://github.com/facebook/react-native/issues/41988

Hopefully even if this isn't the right way to go about solving this, it at least points in the right direction for a different fix!

Currently - both on Paper and Fabric - the `selectTextOnFocus` prop does not work as expected on a single line text input. It seems that if the `UITextField` has not yet become the first responder, the text will be briefly selected but then deselected immediately afterward.

This can be seen in the tester when running for either Fabric or Paper (video using Fabric)

https://github.com/facebook/react-native/assets/153161762/aa9c609e-6eb8-4177-a41f-32aae53c06ac

Instead, we can move the `selectAll` call to `reactFocus` in `RCTBaseTextInputView` or `focus` `RCTTextInputComponentView` - both of which first call `becomeFirstResponder` - to get the expected result.

## Changelog:

[IOS] [FIXED] - fix selectTextOnFocus in Fabric and non-Fabric by calling selectAll after becomeFirstResponder

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

Test Plan:
* Test changes on RN Tester (iOS)

 https://pxl.cl/55kDc

Reviewed By: cipolleschi

Differential Revision: D56699773

Pulled By: fabriziocucci

fbshipit-source-id: ed092835f3c602e2c50a4198357653a9cef942d9
2024-06-18 08:44:09 -07:00
Moti Zilberman db2c44a7eb Make inspector-proxy protocol types mutable by default (#45021)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45021

Changelog: [Internal]

TSIA, hoisted from an upcoming refactor of `Device` in inspector-proxy.

Reviewed By: hoxyq

Differential Revision: D58723496

fbshipit-source-id: af272b08bc280d681bd7e1adb60d2a411a549864
2024-06-18 08:25:32 -07:00