Commit Graph

30644 Commits

Author SHA1 Message Date
Alex Hunt ebca982365 Update Hermes version 2024-02-20 15:24:28 +00:00
szymonrybczak c99d96b7a1 Bump CLI to 13.6.0 (#43093)
Summary:
Bump CLI version to 13.6.0

## Changelog:

[GENERAL] [CHANGED] - Bump CLI to 13.6.0

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

Test Plan: CI

Reviewed By: cipolleschi

Differential Revision: D53920559

Pulled By: cortinico

fbshipit-source-id: 7c95345f47c80864881fff7fce5adb35195ec723
2024-02-20 07:04:33 -08:00
Dmitry Rykun de5619ed8c Make codegenNativeComponent show warning and not error (#43070)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43070

**Context**

The `codegenNativeComponent` function is a hint for the codegen that the file that contains it is a Native Component spec. Static ViewConfig codegen overwrites this function call by the generated ViewConfig.
If this function is not overwritten by the codegen, it has runtime behaviour that falls back to `requireNativeComponent`. At the time when this system was built `requireNativeComponent` was not supported in Bridgeless mode because it is relied on some Bridge-only functionality. That's why it outputs error in Bridgeless mode.
 ---

This is not the case any more, we now have interop layers which provide the functionality needed by `requireNativeComponent`.
The SVC codegen is implemented as [Babel plugin](https://github.com/facebook/react-native/tree/main/packages/babel-plugin-codegen). The are scenarios when it is not run for the native component specs:
- If the plugin is not used for whatever reason.
- If Babel is not used for whatever reason.

In order to not to regress the DevX for such cases, we've turned the error into the warning.

**Note:** we use `console.info('⚠️...` instead of `console.warn('...`. That's because `console.warn` also prints a stack trace in the console, and we didn't want to create too much noise.

Changelog: [General][Changed] - codegenNativeComponent show warning and not error if not code generated at build time.

Reviewed By: huntie, rshest

Differential Revision: D53761805

fbshipit-source-id: c924c7668e6d2e45b920672b8a309221be767a73
2024-02-20 07:04:03 -08:00
Alex Hunt a4d6be8908 Update set-version to reuse set-rn-version (#43109)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43109

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D53940616

fbshipit-source-id: 8ce85437ab5164dae81a9956706c517880ee1f74
2024-02-20 05:06:03 -08:00
Alex Hunt cffb69a12b Fix path in trigger-react-native-release (#43107)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43107

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D53940161

fbshipit-source-id: 0de7887ff117db6f876420c1b609924bfc237847
2024-02-20 04:22:55 -08:00
Alex Hunt 1b504382c1 Fix import in bump-all-updated-packages, add Flow (#43106)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43106

Missed import in untyped, untested script during recent file move.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D53940160

fbshipit-source-id: ec86c5881a2f34d992538c713f808c8d5634ba16
2024-02-20 04:22:55 -08:00
Jakub Trzebiatowski 69977d05f0 De-duplicate the logic for counting attachments (#42596)
Summary:
De-duplicate the logic for counting attachments.

This is a minor improvement in the context of my multi-PR work on https://github.com/react-native-community/discussions-and-proposals/issues/695.

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

[INTERNAL] [CHANGE] - De-duplicate the logic for counting attachments

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

Reviewed By: rshest

Differential Revision: D53917281

Pulled By: cipolleschi

fbshipit-source-id: cdb9bc834bddd7deffc60f33578464733982fedf
2024-02-20 04:04:01 -08:00
Riccardo Cipolleschi 10edb9f545 Add build script to check that codegen run properly in the project (#43105)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43105

This is a quality of like improvement for the project we create for the final users.
Codegen generates code in `rncore`, within `node_modules`. This is not the perfect approach but it is working so far.

To make it more robust, we added a small script in React-Fabric podspec to check that codegen run properly when building.
In this way, if a user run `yarn install` and, for any reason, react-native is regenerated, we can provide a better DevX to our users with an actionable message on how to fix the build problem.

##Changelog
[iOS][Added] - Add error message if codegen has not run properly

Reviewed By: cortinico

Differential Revision: D53927788

fbshipit-source-id: a01a33086e4a0a1b0ada6c83283a5fd3fb5ee3eb
2024-02-20 04:01:50 -08:00
Moti Zilberman c02e83ca7a Add test for Hermes breakpoint persistence
Summary:
Changelog: [Internal]

TSIA

bypass-github-export-checks

Reviewed By: huntie

Differential Revision: D53919695

fbshipit-source-id: 54792111f075d9834a2b61de91251614ad5ce770
2024-02-20 02:21:31 -08:00
Moti Zilberman e6995583d3 Save exported state across RuntimeAgent instances (#43098)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43098

Changelog: [Internal]

Wraps Hermes's `CDPHandler::getState()` API in an engine-agnostic abstraction (`RuntimeAgentDelegate::getExportedState`).

An Agent's lifetime ends when its Target is destroyed, but it can occasionally be useful to persist some state for the "next" Target+Agent of the same type (in the same session) to read.

`RuntimeAgentDelegate` is polymorphic and can't just write arbitrary data to SessionState. Instead, it can now *export* a state object that we'll store and pass to the next `RuntimeTargetDelegate::createAgentDelegate` call.

Reviewed By: huntie

Differential Revision: D53919696

fbshipit-source-id: a8e9b921bc8fc2d195c5dddea9537e6ead3d0358
2024-02-20 02:21:31 -08:00
Phillip Pan 01d704dd45 cxx module autolinking without codegen (#43054)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43054

Changelog: [iOS][Android][Added] Experimental macro to autolink C++ turbomodules

This implementation is inspired by RCT_EXPORT_MODULE on iOS. We keep a global data structure that maps module names to a lambda that returns the C++ turbomodule. This will come with a hit to startup time. the only way to avoid that is a solution that does static analysis of the list of C++ turbomodules being linked to the library.

Reviewed By: fkgozali

Differential Revision: D53602544

fbshipit-source-id: 8ea49fa576dc718f44b1595b68ab7c606c2db605
2024-02-19 23:51:06 -08:00
Christoph Purrer 28da7f9f54 Share re-defined defineReadOnlyGlobal(...) (#42801)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42801

Fixes some tech debug

Changelog: [Internal] [Fixed] Share re-defined defineReadOnlyGlobal(...)

Reviewed By: javache

Differential Revision: D53340274

fbshipit-source-id: 1f8021eae7403675bc045c8031af09718830c2fe
2024-02-19 11:52:15 -08:00
Moti Zilberman 046f664a49 Port Hermes integration tests to TYPED_TEST
Summary:
Changelog: [Internal]

Ports RN's Hermes CDP integration tests to `TYPED_TEST` so we can easily run them against a different Hermes engine adapter in another diff.

bypass-github-export-checks

Reviewed By: huntie

Differential Revision: D53810359

fbshipit-source-id: fb9717bbdc1346ed26b9c8796c13bac641bc5a60
2024-02-19 09:13:24 -08:00
Moti Zilberman 1863805164 Support limiting CDP bindings to specific contexts (#43089)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43089

Changelog: [Internal]

Completes React Native's support for the [`Runtime.addBinding`](https://cdpstatus.reactnative.dev/devtools-protocol/tot/Runtime#method-addBinding) and [`Runtime.removeBinding`](https://cdpstatus.reactnative.dev/devtools-protocol/tot/Runtime#method-removeBinding) methods (in the modern CDP backend) by handling the optional `executionContextId` and `executionContextName` params.

Reviewed By: huntie

Differential Revision: D53760393

fbshipit-source-id: 1679fcde64c1125eb3f0f780432fedd6e3c2efc1
2024-02-19 09:13:24 -08:00
Nicola Corti 918b75f3f4 Fix typo in unit test (#43091)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43091

Fix typo in unit test

Changelog:
[Internal] [Changed] - Fix typo in unit test

Reviewed By: mdvacca

Differential Revision: D53918471

fbshipit-source-id: 0453c01fab1dc04397058577ea61b50994124cf0
2024-02-19 08:15:12 -08:00
Fabrizio Cucci 5bec42f902 Convert Touchable to ESM (#42889)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42889

As per title.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D53471205

fbshipit-source-id: 04b043b78e21a5ff7f245322958cf2923def6131
2024-02-19 08:04:09 -08:00
Nicola Corti 89d331209a Remove test_windows from CircleCI (#43090)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43090

I'm removing test_windows from CircleCI as the job is often flaky for various reasons.
The cost of maintainaining it is so high at the moment, and it brings little to no value to our developers.
We'll re-evaluate what to do with it once we move to GHA.

Changelog:
[Internal] [Changed] - Remove test_windows from CircleCI

Reviewed By: cipolleschi

Differential Revision: D53918601

fbshipit-source-id: b76c92f1eb3d2302595773dff9f8bbc292c0bfcf
2024-02-19 07:59:22 -08:00
Moti Zilberman 3a1e769573 Reject Runtime.evaluate messages with the wrong contextId
Summary:
Changelog: [Internal]

Hermes:

Adds the missing `validateExecutionContext` call to `Runtime.evaluate`.

React Native:

Adds an integration test case to cover the expected behaviour around targeting `Runtime.evaluate` by execution context.

bypass-github-export-checks

Reviewed By: huntie

Differential Revision: D53776532

fbshipit-source-id: 66676383ba5b373fdbf2deb8c75f22791b07e300
2024-02-19 05:34:11 -08:00
zhongwuzw d655fee28b Resolving case sensitivity issue in header file import (#42786)
Summary:
Fixes included header case.
![image](https://github.com/facebook/react-native/assets/5061845/aa0c3e12-16b6-4d32-bc0f-08d39076f59f)

cc. cipolleschi .
## Changelog:

[IOS] [FIXED] - Resolving case sensitivity issue in header file import

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

Test Plan: NULL.

Reviewed By: dmytrorykun

Differential Revision: D53917009

Pulled By: cipolleschi

fbshipit-source-id: 53eda41278eaeaf78fff8d2c8dee72c913492019
2024-02-19 04:43:28 -08:00
Riccardo Cipolleschi 55c5cd67a2 Remove unneded character (#43075)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43075

There is a `\` in the new_architecture.rb file that should not be there.

## Changelog:
[Internal] - remove unnecessary character

Reviewed By: cortinico

Differential Revision: D53886548

fbshipit-source-id: a614368bed9f467b80c3384e4adc4be2cbcaba2d
2024-02-19 04:04:11 -08:00
Samuel Susla cb307b9b02 add synchronisation to Animated when used with setNativeProps (#43083)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43083

changelog: [internal]

See code comments for details.

Reviewed By: yungsters

Differential Revision: D53818488

fbshipit-source-id: 71a1636a635c4c6599313b0c44be7215e9bdbcb5
2024-02-19 02:24:46 -08:00
Riccardo Cipolleschi 475a156310 Make React-jsiinspector depends on hermes-engine to fix Dynamic Frameworks (#43081)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43081

When Hermes i used, it is hermes that provides JSI to React Native and not React-jsi.
This is required to fix the ODR violatons.
Dynamic frameworks requires that all the dependencies are declared explicitly, and missing the `hermes-engine` dependency was breaking the dependency graph.

## Changelog
[Internal] - Make JSIInspector depends o hermes-engine

Reviewed By: motiz88

Differential Revision: D53901016

fbshipit-source-id: a511719647e6203d082696fd572593fd851a1dde
2024-02-18 11:23:47 -08:00
Luna Wei 8ff05b5a18 Remove release-branch-cutoff from yarn bump-all-updated-packages (#43040)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43040

Changelog: [Internal] Remove release-branch-cutoff option as its been replaced by `yarn set-version --skip-react-native-version`

Reviewed By: huntie

Differential Revision: D53742450

fbshipit-source-id: 726479698ec4f4f61d9a1ddde95e246e033f864c
2024-02-16 15:57:37 -08:00
Ingrid Wang fdf4ec3297 Remove unused handler on PushNotificationIOS.removeEventListener (#43037)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43037

Changelog:
[iOS][Breaking] Removing unused `handler` param on  PushNotificationIOS.removeEventListener

Reviewed By: philIip

Differential Revision: D53781102

fbshipit-source-id: a3372d0ccb4addf9983c143fb1a3e206f6aae103
2024-02-16 15:22:49 -08:00
Ingrid Wang 1bd45768e3 Update docs on PushNotificationIOS (#43038)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43038

Changelog:

[Internal] Documentation edits

Reviewed By: philIip

Differential Revision: D53782268

fbshipit-source-id: b13ce5e64f9fc106d29f9b04fb6b7ba3e2ae0b2c
2024-02-16 15:22:49 -08:00
Ingrid Wang 713ded1d5f Tweak documentation for soundName property (#43004)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43004

Changelog: [Internal]

Reviewed By: philIip

Differential Revision: D53734570

fbshipit-source-id: e2233b4a2f1bcb48af5d56319d215eb0ccceaa4e
2024-02-16 15:22:49 -08:00
Moti Zilberman da03d7b829 Implement Runtime.addBinding (global bindings only) (#43065)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43065

Changelog: [Internal]

Implements support for [`Runtime.addBinding`](https://cdpstatus.reactnative.dev/devtools-protocol/tot/Runtime#method-addBinding) in the new RN CDP backend.

This implementation is mostly complete and matches Chrome's behaviour, but does not include the ability to target bindings by execution context (the optional `executionContextId` and `executionContextName` params) - that will come in a separate diff for ease of review/landing.

Incidentally, this diff also introduces the `JsiIntegrationPortableTest::expectMessageFromPage` helper, which allows us to "asynchronously" extract the contents of an expected message. For consistency and clarity, we refactor all the other `EXPECT_CALL(this->fromPage(), onMessage(JsonEq(...)))` assertions to use it as well.

Reviewed By: huntie

Differential Revision: D53266709

fbshipit-source-id: 046326acdf5dacc18e179e43589cdd2d012f353a
2024-02-16 11:16:41 -08:00
Moti Zilberman 828ad04cef Assign auto-incrementing execution context IDs (#43064)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43064

Changelog: [Internal]

Aligns React Native's CDP backend with V8's behaviour of assigning a sequential ID (here unique within a given PageTarget) to each execution context.

Reviewed By: huntie

Differential Revision: D53776531

fbshipit-source-id: 950599c323f416e8180e42281d94ae9c00f15fb0
2024-02-16 11:16:41 -08:00
Moti Zilberman e34e7d75b3 Lift execution context management out of Runtime (#43063)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43063

Changelog: [Internal]

Moves the responsibility for managing CDP execution contexts out of the Runtime and into the Instance.

This includes the responsibilities to:
1. Assign execution context IDs/names
2. Emit events when execution contexts are created/destroyed
3. Route CDP messages to the correct Runtime

**Re 1:** We currently assign a *constant* execution context ID, which diverges from V8's implementation but is in line with what Hermes has done so far. I'll follow up separately to assign (locally) unique IDs, since this diff is long enough already.

**Re 3:** Right now, the message routing responsibility is mostly theoretical: only one Runtime exists at a time and "routing" can be done by RuntimeAgent simply deciding whether or not to act on a message (since it receives all messages by default and knows its own `ExecutionContextDescription`). True multi-Runtime / multi-context support is firmly a future concern, and we can revisit this ( = probably hoist more logic into Instance) when we get there.

In the `ExecutionContextNotifications` integration test we can see that a few minor bugs in the current Hermes-based implementation are fixed, and also that execution context management is now engine-agnostic (so we can use `JsiIntegrationPortableTest` instead of `JsiIntegrationHermesTest`).

Reviewed By: huntie

Differential Revision: D53759776

fbshipit-source-id: 50ac126789c95b25f845780df2c3346ec345d5d5
2024-02-16 11:16:41 -08:00
Alex Hunt 98ea5ea29b Refactor set-version to use new getPackages util (#43072)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43072

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D53851089

fbshipit-source-id: 6305f7404a43a8da8bfe84137921437423be7985
2024-02-16 10:41:04 -08:00
Riccardo Cipolleschi 5164e83c3b Fix the compiler flags for libraries (#43071)
Summary:
While looking at another issue, I realized that in some cases the script was adding the same flags twice and it was leaving the RCT_NEW_ARCH_ENABLED behind.

## Changelog:
[iOS][Fixed] - Pass the right flags to libraries

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

Test Plan: Fixed Unit tests

Reviewed By: huntie

Differential Revision: D53860576

Pulled By: cipolleschi

fbshipit-source-id: 1f6f4852df8d316293b93d7c5fbef09a249893a5
2024-02-16 10:39:01 -08:00
Riccardo Cipolleschi f61f87c5ef Make the addUIBlock's Dictionary works correctly (#43060)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43060

When inestigating the reason why [`react-native-view-shot`]() ws not working, we realized that there are many libraries that follows this pattern:

```objc
[self.bridge.uiManager addUIBlock:^(RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
    if (UIView *view = viewRegistry[reactTag]) {
      //do something with the View
    }
  }];
```
The problem is that, with the New Architecture, that view registry is usually empty, because the components are registered and tracked in another place.
This make many libraries stop working when used with the New Architecture.

This change introduces a class that behaves like a dictionary but that forward the calls to retrieve the view to the right place, in order to get the view that is needed.

Noticably, this approach allow us also to remove some shenanigans we were applying to make sure that the interop layer could access the views wrapped in it, so the current solution is more general and should work in multiple situations.

## Changelog
[iOS][Fixed] - Make sure that `addUIBlock` provides a Dictionary-look-alike object that returns the right views when queried.

Reviewed By: sammy-SC

Differential Revision: D53826203

fbshipit-source-id: 08d359676d69777b88fa9b18dc141187ac42dbce
2024-02-16 09:39:44 -08:00
Nicola Corti 906985b097 Back out "Update RNGP to handle cxxModule in codegenConfig" (#43050)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43050

Original commit changeset: 702f09ccf793

Original Phabricator Diff: D53669912

Changelog:
[Internal] [Changed] - Back out "[RN][Android][TmCxxAutolinking] Update RNGP to handle cxxModule in codegenConfig"

Reviewed By: cipolleschi

Differential Revision: D53812110

fbshipit-source-id: a7583c0cb8354bf31723794fbbb4ca5de8f1790a
2024-02-16 09:20:02 -08:00
Nicola Corti 2697b9af5c Back out "Add cxxModule to RN-Tester's codegenConfig" (#43051)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43051

Original commit changeset: 97b9985b94ef

Original Phabricator Diff: D53669913

Changelog:
[Internal] [Changed] - Back out "[RN][Android][TmCxxAutolinking] Add cxxModule to RN-Tester's codegenConfig"

Reviewed By: cipolleschi

Differential Revision: D53812108

fbshipit-source-id: 5c5dfbaf95685953ef20cf35061a72afffe00ed3
2024-02-16 09:20:02 -08:00
Riccardo Cipolleschi 267ea2661a Convert RCTConvert to mm in preparation for DisplayP3 changes
Summary:
This is a preliminary change which converts RCTConvert to an objectiveC++ file. This is required by the next diffs in the stack.

## Changelog
[iOS][Changed] - Make RCTConvert an Objective-C++ (`.mm`) file in prep for DisplayP3 changes

Reviewed By: javache

Differential Revision: D53520228

fbshipit-source-id: cf45c42955401b4e14fe68221129077817b2598e
2024-02-16 09:15:49 -08:00
Riccardo Cipolleschi eca78c30c7 Add hermes commit to github action cache (#43067)
Summary:
The test_ios_rntester-Hermes which runs in github actions was created to make sure that recent commits on Hermes/main won't be breaking React Native
However, we discovered that the job was using a cached version of hermes and it was't really downloading the latest hermes every time.

With this change, the cocoapods cache will be invalidated whenever there is a commit on hermes/main, forcing the job to reinstall the dependencies when that happens.

bypass-github-export-checks

## Changelog:
[internal] - Fixed GH Action job to properly refetch newest version on Hermes when it changes.

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

Test Plan:
Github Actions must be green and the action should show that a new version of Hermes is downloaded.

The commit is downloaded here:
 {F1457505882}

And it is used here, notice the last hash:
 {F1457505989}

Reviewed By: motiz88

Differential Revision: D53853963

Pulled By: cipolleschi

fbshipit-source-id: 7a65dd72a21b6da12b826273d1c92bb90b678652
2024-02-16 06:59:10 -08:00
Alex Hunt 80ec096e7c Create shared consts module for scripts
Summary:
Tidy up, removes risk of breakage when relocating inner modules.

Changelog: [Internal]

Reviewed By: lunaleaps

Differential Revision: D53813025

fbshipit-source-id: 43dc4a57191363546d6858cff311e260d416192f
2024-02-16 03:21:25 -08:00
Alex Hunt a80674fc7c Relocate run-ci-e2e-tests script, add Flow (#43053)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43053

- Relocate under `scripts/e2e/` (also move util used only by this cript).
- Type as Flow (to catch trivial errors). Some cleanup of `log()` calls as errors.

Changelog: [Internal]

Reviewed By: lunaleaps

Differential Revision: D53813023

fbshipit-source-id: 05caf415ec0bf3739a6f7fec3afd385a195f42e9
2024-02-15 14:51:48 -08:00
Alex Hunt fb446598f9 Rename E2E template init script, relocate Verdaccio config + storage (#43001)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43001

More understandable name: ~"React Native init, for E2E testing". Also relocates Verdaccio config and storage location under `scripts/e2e/` (resolving TODO comment).

The intent is for the `scripts/e2e/` dir to also group the existing E2E testing-related scripts — although I will stop here for the current release-related work.

Changelog: [Internal]

Reviewed By: lunaleaps

Differential Revision: D53609332

fbshipit-source-id: fb2f6502a18c4a4ac2368b46af1e3ee42edbadd6
2024-02-15 14:51:48 -08:00
Alex Hunt e4135e9be5 Update test-e2e-local to use source monorepo packages for RNTestProject (#42899)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42899

Updates the `test-e2e-local` script to bootstrap `/tmp/RNTestProject/` using the currently checked out repository as the source of truth for all monorepo packages (previously we only did this for the `react-native` package).

This enables release testers to validate a release **before** physically publishing new dependency versions via `yarn bump-all-updated-packages`.

We are able to reuse the `scripts/template/initialize.js` script that is currently used for E2E validation in CI. This sets up a local Verdaccio server during project install.

NOTE: The time taken for `Build packages` + Verdaccio isn't ideal, I may explore a way to reuse the published package state in a future diff. Until then, this extra time (~1 min) will still be much less pain than the `bump-all-updated-packages` + commit process loop.

Changelog:
[Internal] - Update test-e2e-local to use source monorepo packages for RNTestProject

Reviewed By: lunaleaps

Differential Revision: D53484510

fbshipit-source-id: 600a8a3257a4947d7738ab9d908d6549c38545e6
2024-02-15 13:04:00 -08:00
David Vacca 15700626cc Enable FabricPendingEventQueue by default in RN OSS (#43029)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43029

Enable FabricPendingEventQueue by default in RN OSS

changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D53766819

fbshipit-source-id: 53529b10a3880702867793c3eeae216a2c3f4cea
2024-02-15 11:49:19 -08:00
Oskar Kwaśniewski c5f48ac612 feat: make __gitignore file work for OOT platforms (#42963)
Summary:
This PR makes `__gitignore` file universal for Apple OOT platforms.

## Changelog:

[GENERAL] [CHANGED] - Make template's .gitignore file universal for OOT platforms

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

Test Plan: CI Green

Reviewed By: NickGerleman

Differential Revision: D53674632

Pulled By: yungsters

fbshipit-source-id: cb510d9bd2ee6f1c39b77a842e7947b67def552a
2024-02-15 11:44:42 -08:00
Luna Wei d6a440ee8b Remove process.exit calls from publish-npm and throw errors instead (#43039)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43039

Changelog: [Internal] - `publish-npm.js` is a [script we call in our CI](https://www.internalfb.com/code/fbsource/[c0b8566ac0d66c2c0282eeb597bfb54bedf757c6]/xplat/js/react-native-github/.circleci/configurations/jobs.yml?lines=1243) to publish the react-native package and others.

Currently, the script leverages `exit/process.exit` to terminate early in a couple of places which makes the code hard to test because our tests don't truly early exit when `exit/process.exit` is called.

This change removes any explicit `exit` calls and instead leverages the uncaught error to terminate the process and set the non-zero exit code. This makes our tests more accurate to the real control flow of the script.

I've also updated the tests to better capture what we're actually testing by mocking at a higher level.

Reviewed By: cipolleschi

Differential Revision: D53792754

fbshipit-source-id: 9293bb9a95430c50052db36c0e6f6c1ba348107f
2024-02-15 11:18:05 -08:00
Oskar Kwaśniewski 209140046b fix: PerfMonitor option not showing on iOS (Bridgeless) (#42891)
Summary:
This PR fixes PerfMonitor option not showing on iOS when running bridgeless. The `initialize` method is not called in bridgeless which causes this option to not be added. I've converted this approach to work for both bridgeless and non-bridgeless.

bypass-github-export-checks

## Changelog:

[IOS] [FIXED] - Perf Monitor option not showing in Bridgeless

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

Test Plan: Run RNTester, open Perf monitor

Reviewed By: RSNara

Differential Revision: D53518507

Pulled By: cipolleschi

fbshipit-source-id: c16d41006c5a3f96d53d4f76fd317941a1eb839f
2024-02-15 09:11:41 -08:00
Alex Hunt 24f7bd7445 Remove .npmrc write from setupVerdaccio util (#42941)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42941

I noticed that programatically running `npm set registry <value>` would fail within the repo root dir (intended run location) (`node` version `18.18.2`).

```
npm ERR! This command does not support workspaces.
```

It turns out this is no longer supported from npm 9.x: https://github.com/npm/cli/issues/6099. **Note**: The workaround discussed in this thread is incompatible/nontrivial with `npx`, so I've opted to remove this behaviour.

**Changes**

- Remove `npm set registry http://localhost:4873` call.
    - This is non-breaking due to the [explicit `--registry` arg already present in `run-e2e-ci-tests.js`](https://github.com/facebook/react-native/blob/b366b4b42e0f91eb2b1850c404fadd0f0322fc61/scripts/run-ci-e2e-tests.js#L102). The previous `.npmrc` config value is unnecessary, and probably was being ignored (will be validated for this PR in CircleCI run).
- Add comment against remaining `.npmrc` write, convert to `fs` call.
- Remove unused params on `setupVerdaccio` (moved to constants which will be exported and referenced in the next diff).

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D53609308

fbshipit-source-id: 77d3666b42963cd61f6d3fd0be00cdc19bbb1ec8
2024-02-15 09:06:44 -08:00
Alex Hunt afc61ab643 Fix test-e2e-local when building artifacts locally (#43043)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43043

Restores behaviour of `yarn test-e2e-local` when we are not using `--circleciToken`. The `npm pack` logic (necessary for the subsequent `updateTemplatePackage` call before initing `RNTestProject`) was deleted in https://github.com/facebook/react-native/pull/41172 / D50651448.

https://github.com/facebook/react-native/commit/4eed12b7df5d9731e556b77d701c87dcf91d3a1f#diff-56f57bf0eac99b0fda1b2938aceb8d9b663db82c07cb405bd53a01c8689710ffL224-L240

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D53806191

fbshipit-source-id: 918306d5dea90266292728cda9c0e243e5c37eba
2024-02-15 09:06:44 -08:00
Samuel Susla ca980447f0 remove feature flag enableOnDemandReactChoreographer (#43044)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43044

changelog: [internal]

Reviewed By: javache

Differential Revision: D53758129

fbshipit-source-id: bd921553e2aeaadac56624a100f5f27310995c98
2024-02-15 08:09:27 -08:00
Riccardo Cipolleschi ab5e2e8099 Fix forwarding touches to components in the Interop Layer
Summary:
When analyzing the `hitTest:withEvent` function, I realized that we were not forwarding the touches to the legacy view.

The previous algorithm was returning the InteropLegacyWrapper view itself when the touches were happening in the legacy view, preventing the handlers attached to the legacy view to fire.

With this change, if the legacy view receives a touch, it can handle it.

## Changelog
[iOS][Fixed] - Make sure to forward touches to the wrapped component in the InteropLayer.

Reviewed By: sammy-SC

Differential Revision: D53806218

fbshipit-source-id: 87b0aa6e900935092e6f5e1533b871c1d224b718
2024-02-15 07:54:46 -08:00
Pieter De Baets 53e3f364cf Fix incorrect cast in RemoveDeleteTree (#43018)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43018

Assuming that if View is a ViewGroup, its ViewManager is a ViewGroupManager is incorrect. Custom ViewManagers may use ViewGroups internally to represent complex views exposed to JS.

Type-check the ViewManager instead to avoid the crash seen in T178300877

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D53586565

fbshipit-source-id: 49408098cebc7f76d8be0e585187ba9b6ca52049
2024-02-15 05:39:23 -08:00
Pieter De Baets 5a5c9eb96c Remove ReactViewManagerWrapper
Summary:
This was introduced to support MapBuffer-based view managers (D33735245), but that experiment has been removed from the codebase (D53072714).

This indirection is preventing a proper fix for a crash we're seeing with RemoveDeleteTree (T178300877)

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D53586567

fbshipit-source-id: d391ca56b23fc3dd57429c5ad8a7a405e97a81f2
2024-02-15 05:39:23 -08:00