Commit Graph
29665 Commits
Author SHA1 Message Date
Ruslan LesiutinandFacebook GitHub Bot dbd42d406c refactor: use reactDevToolsAgent in state (#41291)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41291

Changelog: [Internal]

We have the same logic in 3 different places, encapsulating access to React DevTools hook in one place, all other components that require agent will get it as a prop.

Reviewed By: GijsWeterings

Differential Revision: D50559550

fbshipit-source-id: f3667a82ca48a36032c60c730df8f661098401ee
2023-11-09 11:09:10 -08:00
Ruslan LesiutinandFacebook GitHub Bot d659a560ce refactor: move devtools types to a separate file (#41307)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41307

Changelog: [Internal]

To be able to use it in other possible places.

Reviewed By: javache

Differential Revision: D50952773

fbshipit-source-id: f21f4553e7f51ab0683a6adb834dc5c90c33c927
2023-11-09 11:09:10 -08:00
Ruslan LesiutinandFacebook GitHub Bot 9cc46f58ad refactor[AppContainer]: migrate to functional component (#41285)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41285

Changelog: [Internal]

I have an ongoing work on improving debugging overlays, lots of changes in these files are planned.

- Split `AppContainer` into 2 implementations: DEV and PROD
- Rewrite to functional components

Reviewed By: javache

Differential Revision: D50559549

fbshipit-source-id: 3790f149d504bd45be78c6f3103e05677f3a107d
2023-11-09 11:09:10 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 19945ad83b Add Github Action to add a commit with #run-e2e-tests (#41311)
Summary:
https://github.com/facebook/react-native/issues/41308 introduce the possibility to run e2e tests if a commit contains #run-e2e-tests in the commit message.
This PR builds on top of that, and let users to run e2e tests by adding a comment with with #run-e2e-tests

## Changelog:
[Internal] - Allow to run e2e tests from comments

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

Test Plan: Not sure it can be tested until the PR is merged... ¯\_(ツ)_/¯

Reviewed By: dmytrorykun

Differential Revision: D51111543

Pulled By: cipolleschi

fbshipit-source-id: e6c55950552f03830fa35c89d385ab9b17f8facb
2023-11-09 05:53:47 -08:00
Oskar KwaśniewskiandFacebook GitHub Bot 7bcfd02a60 feat(iOS) make build-hermes-xcode.sh more extensible for out of tree platforms (#41387)
Summary:
This PR aims to make scripts building hermes locally more extensible for out-of-tree platforms. It will make it easier for forks like visionOS to add additional `elif` statements.

As a side benefit this PR fixes Hermes builds for MacOS 😄 (I've checked that it now builds correctly)

## Changelog:

[IOS] [ADDED] - make build-hermes-xcode.sh more extensible for out-of-tree platforms

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

Test Plan: Run the local Hermes build by running `USE_HERMES=1 bundle exec pod install` and check if it runs smoothly. Also, a CI check should be sufficient.

Reviewed By: dmytrorykun

Differential Revision: D51156307

Pulled By: cipolleschi

fbshipit-source-id: 1c65b84b16fc8bd0552037c6ef558543cbe03889
2023-11-09 05:53:30 -08:00
George ZaharievandFacebook GitHub Bot c95b2d9728 Enable Flow casting_syntax=both in fbsource
Summary:
Enable Flow `casting_syntax=both` in fbsource, before the announcement so that when people see it they can check it out without rebasing.

bypass-github-export-checks
bypass-lint

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D51097870

fbshipit-source-id: dfcb04000df26140c971422389b6fce0b1ba51e7
2023-11-09 01:02:55 -08:00
Pieter De BaetsandFacebook GitHub Bot 050a5a3797 Fix CellRenderer onCellFocusCapture not being stable (#41381)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41381

Noticed that when scrolling VirtualizedList's CellRenderer was re-rendering due to `onCellFocusCapture` not having a stable identify. Change the interface to CellRenderer to pass in the `cellKey` in the callback to save on creating new callbacks.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D51112928

fbshipit-source-id: 3fcb974d9b5585403895746fbc45f2cf5a9fa6b1
2023-11-08 15:16:54 -08:00
Intl SchedulerandFacebook GitHub Bot ae9302cca8 translation auto-update for i18n/fb4a.config.json on master
Summary:
Chronos Job Instance ID: 1125907943211396
Sandcastle Job Instance ID: 4503600731222116
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D51133781

fbshipit-source-id: 1acc03a3fbb8692161ff0f41764542bf32039485
2023-11-08 14:44:03 -08:00
hieu9102002andFacebook GitHub Bot 05d92bf2a5 Remove redundant LongLivedObject import in RCTTurboModule.mm (#41368)
Summary:
Similarly to https://github.com/facebook/react-native/issues/36391 , we found that this import was periodically causing issues for our builds. We applied this patch and found that it is solving the issue, thus raising the PR here.

It may potentially be related to https://github.com/facebook/react-native/issues/35664 and https://github.com/facebook/react-native/issues/41281

## Changelog:

[IOS] [FIXED] - Unbreak Cocoapods build

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

Test Plan: Automated test builds should be able to spot out potential issues.

Reviewed By: javache

Differential Revision: D51117316

Pulled By: cipolleschi

fbshipit-source-id: 5c8ee35ab38539ae1f5556202bb274566adf09b3
2023-11-08 12:36:53 -08:00
Moti ZilbermanandFacebook GitHub Bot 1bcd28636f Handle source file / source map fetch errors correctly, add tests (#41342)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41342

While rewriting `Debugger.getScriptSource` messages to fetch code and source map over HTTP, we weren't checking the status code of the fetch calls. This diff fixes that and adds corresponding tests (as well as for the filesystem error case).

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D51013054

fbshipit-source-id: 58e7bb9fcd6a3cf92329b43fb8a139093c80d305
2023-11-08 07:19:40 -08:00
Moti ZilbermanandFacebook GitHub Bot 4eb3e300a4 Add tests for reload message injection (#41340)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41340

Tests for D17100911 and D14503522.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D51013053

fbshipit-source-id: 65aba42e21fad891e458647c8421cd316518ec3c
2023-11-08 07:19:40 -08:00
Moti ZilbermanandFacebook GitHub Bot 246657214d Add tests for Debugger.getScriptSource rewriting (#41338)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41338

Tests for D21401320 and D39629274.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D51013052

fbshipit-source-id: af25935d1d7fff90112720888b3728ce195ac5d1
2023-11-08 07:19:40 -08:00
Moti ZilbermanandFacebook GitHub Bot 3afadef6d6 Add tests for source map fetching and URL rewriting hacks (#41339)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41339

Tests for D42973408, D14800976, and D15116579.

Changelog: [Internal]

Reviewed By: blakef

Differential Revision: D51013055

fbshipit-source-id: cff8a9d1dd22b642117594da16e6b74cf679aa34
2023-11-08 07:19:40 -08:00
Moti ZilbermanandFacebook GitHub Bot c6eccda2c7 Add tests for HTTPS-specific behaviour (#41341)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41341

* Extends `dev-middleware`'s test utilities to enable testing against an HTTPS server with a self-signed cert.
* Runs the CDP transport integration tests (D51002261) using both HTTP and HTTPS.
* Adds a test to explicitly cover the `ws=...` / `wss=...` variation in `devtoolsFrontendUrl` first introduced in D49158227.

Changelog: [Internal]

Reviewed By: blakef

Differential Revision: D51006835

fbshipit-source-id: df3db8cd865898248cd0d8f307f75949a7f313fd
2023-11-08 07:19:40 -08:00
Moti ZilbermanandFacebook GitHub Bot c85b2da1e7 Add minimal test for "Improved Chrome Reloads" synthetic page (#41335)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41335

`inspector-proxy` has special behaviour to allow a debugger connection to persist across app reloads.

In the React Native runtime, a reload is modelled as the creation of an entirely new "page" with its own ID. To insulate the debugger from this detail, the proxy advertises a separate, synthetic page on each device, with ID `-1`, that always maps to the latest React Native page reported by that device.

Here we test the message forwarding part of this functionality. The proxy also injects CDP messages (in both directions) as part of simulating a reload, but that will be tested in a separate diff.

Changelog: [Internal]

Reviewed By: blakef

Differential Revision: D51002262

fbshipit-source-id: 296135177321a511ebbe7d9696e4e7a61275aa32
2023-11-08 07:19:40 -08:00
Moti ZilbermanandFacebook GitHub Bot 38a878194b Add CDP transport tests (#41343)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41343

Changelog: [Internal]

Adds basic tests for two-way communication between a debugger (frontend) and a target (backend) using CDP over `inspector-proxy`.

Reviewed By: blakef

Differential Revision: D51002261

fbshipit-source-id: 44e571f89437c26e76ef6e6192b2bf6244665cf0
2023-11-08 07:19:40 -08:00
Moti ZilbermanandFacebook GitHub Bot 1602d42cec Clean up polling interval on device disconnection (#41331)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41331

`inspector-proxy`'s `Device` class currently leaks a `setInterval` handle. This is mostly harmless in current usage. In the test suite added up the stack, it shows up as a leak that prevents Jest from exiting cleanly, so let's clean it up properly.

Changelog: [Internal]

Reviewed By: blakef

Differential Revision: D51002263

fbshipit-source-id: ca36797ce1196aa049ceb3a8e96ee53d34893fdc
2023-11-08 07:19:40 -08:00
Moti ZilbermanandFacebook GitHub Bot 0ea72807a6 Add tests for inspector-proxy's HTTP API (#41314)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41314

Changelog: [Internal]

Adds the beginning of a test suite for `inspector-proxy`. For maintainability, we only test functionality exposed from the `dev-middleware` boundary rather than instantiating `InspectorProxy` directly.

In this diff, the test coverage is far from complete, but this is a first stab at covering some basics. `InspectorProxyHttpApi-test` exercises the HTTP GET endpoints (`/json/list` and `/json/version`) as well as some device registration logic through the `/inspector/device` WebSocket. Some reusable helpers for server setup and device mocking are included in separate files.

As an overall strategy, I'm planning to add multiple test files that share helpers between them, not build out one massive test file with all the helpers inline. There will likely be some verbose tests when we start covering debugger-to-device communication, and I want to keep them as readable as possible.

Reviewed By: blakef

Differential Revision: D50980467

fbshipit-source-id: 962dae5a380451d6dac57eac23c4436550a39cf8
2023-11-08 07:19:40 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 47f773e458 Migrate the remaining Podspec (#41359)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41359

This change migrates the remaining podspecs to the new functions, so we do not depend on hardcoded values anymore and we can scale the solution to other platforms.

## Context
Last week I helped macOS to work with static framework.
When multiple platforms are specified, frameworks are build in two variants, the iOS and macOS one.

This break all the HEADER_SEARCH_PATHS as now we have to properly specify the base folder from which the search path is generated.
See also [this PR](https://github.com/microsoft/react-native-macos/pull/1967) where I manually make MacOS work with `use_framewroks!`

## Changelog:
[Internal] - Add helper function to create header_search_path

Reviewed By: shwanton

Differential Revision: D51068403

fbshipit-source-id: 4c0455543363ccf4272d5e8590a7c663d9c33e8b
2023-11-08 03:31:18 -08:00
Riccardo CipolleschiandFacebook GitHub Bot fa6f170658 Expose function to create Header Search Paths and migrate Ruby Code (#41358)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41358

This change expose a missing function to create Header Search Paths when a podspec can't depend on another one explicitly.
This also migrate the ruby code to this new function.

## Context
Last week I helped macOS to work with static framework.
When multiple platforms are specified, frameworks are build in two variants, the iOS and macOS one.

This break all the HEADER_SEARCH_PATHS as now we have to properly specify the base folder from which the search path is generated.
See also [this PR](https://github.com/microsoft/react-native-macos/pull/1967) where I manually make MacOS work with `use_framewroks!`

## Changelog:
[Internal] - Add helper function to create header_search_path

Reviewed By: shwanton

Differential Revision: D51068390

fbshipit-source-id: ba9e09cd2f0671a9f3f00cc72496a0d5682eeb90
2023-11-08 03:31:18 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 406e6361f9 Migrate React-RCTBlob to add_dependency (#41357)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41357

This change migrate React-RCTBlob to the new add_dependency to improve its compatibility with macOS and to remove some maintenance burden.

## Context
Last week I helped macOS to work with static framework.
When multiple platforms are specified, frameworks are build in two variants, the iOS and macOS one.

This break all the HEADER_SEARCH_PATHS as now we have to properly specify the base folder from which the search path is generated.
See also [this PR](https://github.com/microsoft/react-native-macos/pull/1967) where I manually make MacOS work with `use_framewroks!`

## Changelog:
[Internal] - Add helper function to create header_search_path

Reviewed By: shwanton

Differential Revision: D51030365

fbshipit-source-id: c4b9037d6d0223052d659c04a1f494508944ed2a
2023-11-08 03:31:18 -08:00
Riccardo CipolleschiandFacebook GitHub Bot 21902d70ba Cleanup React-Core (#41356)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41356

React-Core does not depends on any bit of ReactCommon, React-RCTFabric or React-NativeModuleApple, so I'm cleaning that up.

## Context
Last week I helped macOS to work with static framework.
When multiple platforms are specified, frameworks are build in two variants, the iOS and macOS one.

This break all the HEADER_SEARCH_PATHS as now we have to properly specify the base folder from which the search path is generated.
See also [this PR](https://github.com/microsoft/react-native-macos/pull/1967) where I manually make MacOS work with `use_framewroks!`

## Changelog:
[Internal] - Add helper function to create header_search_path

Reviewed By: shwanton

Differential Revision: D51030115

fbshipit-source-id: f87dbfe99e90d52cf8c07057be22cd024e38db42
2023-11-08 03:31:18 -08:00
Riccardo CipolleschiandFacebook GitHub Bot e1092b4e3c Add add_dependency function to ract_native_pods and Migrate React-RCTAppDelegate (#41355)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41355

This change expose a new API to react_native_pod to add dependencies that automatically configure their search paths when using frameworksa and with multiple Apple platforms.
It also migrates React-RCTAppDelegate to this new mechanism to test that it works.

## Context
Last week I helped macOS to work with static framework.
When multiple platforms are specified, frameworks are build in two variants, the iOS and macOS one.

This break all the HEADER_SEARCH_PATHS as now we have to properly specify the base folder from which the search path is generated.
See also [this PR](https://github.com/microsoft/react-native-macos/pull/1967) where I manually make MacOS work with `use_framewroks!`

## Changelog:
[Internal] - Add helper function to create header_search_path

Reviewed By: shwanton

Differential Revision: D51029484

fbshipit-source-id: 77dfe85419d495f7327a2f484d33f9ed8701e00d
2023-11-08 03:31:18 -08:00
Riccardo CipolleschiandFacebook GitHub Bot befc6d4004 Add helper function to add dependencies (#41354)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41354

In order to make the infra scalable and avoid a maintenance nightmare for macOS and future platform, we are introducing this function that automate adding a dependency to a podspec and it generates the required search paths.

## Context
Last week I helped macOS to work with static framework.
When multiple platforms are specified, frameworks are build in two variants, the iOS and macOS one.

This break all the HEADER_SEARCH_PATHS as now we have to properly specify the base folder from which the search path is generated.
See also [this PR](https://github.com/microsoft/react-native-macos/pull/1967) where I manually make MacOS work with `use_framewroks!`

## Changelog:
[Internal] - Add helper function to create header_search_path

Reviewed By: shwanton

Differential Revision: D51027343

fbshipit-source-id: 33ac4c07112eacb08067220397e38db0a19240fb
2023-11-08 03:31:18 -08:00
Riccardo CipolleschiandFacebook GitHub Bot a66fdd43eb Add helper function to create header_search_path (#41353)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41353

Last week I helped macOS to work with static framework.
When multiple platforms are specified, frameworks are build in two variants, the iOS and macOS one.

This break all the HEADER_SEARCH_PATHS as now we have to properly specify the base folder from which the search path is generated.
See also [this PR](https://github.com/microsoft/react-native-macos/pull/1967) where I manually make MacOS work with `use_framewroks!`

In order to make the infra scalable and avoid a maintenance nightmare for macOS and future platform, we are introducing this function that should factor out the platforms from the generation of header search paths.

## Changelog:
[Internal] - Add helper function to create header_search_path

Reviewed By: shwanton

Differential Revision: D51026356

fbshipit-source-id: 7cf03601d94d7680f3fdfcaf52b2fd6bcd48c5b4
2023-11-08 03:31:18 -08:00
Riccardo CipolleschiandFacebook GitHub Bot bb4e940b6d Configure E2E tests to run on a commit that contains #run-e2e-tests (#41308)
Summary:
This change allow our CI to run E2E tests using a specific tag in the commit message

## Changelog:
[Internal] - Allow to run e2e test using a specific tag in the last commit message

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

Test Plan:
CircleCI is green
Tested interacting with the PR/branch

Reviewed By: NickGerleman

Differential Revision: D50975588

Pulled By: cipolleschi

fbshipit-source-id: 6318800d7e86e1cab394af2b320e280304189dd2
2023-11-08 02:03:52 -08:00
Moti ZilbermanandFacebook GitHub Bot 5abaf388cd Use hermes-parser for Flow codegen specs (#39036)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39036

Changelog: [General][Changed] Use `hermes-parser` instead of `flow-parser` to parse Flow Codegen specs.

`hermes-parser` is a WASM build of the Hermes parser (plus supporting code), maintained by the Flow and Hermes teams. It is the recommended way of parsing Flow code in Node and its benefits (compared to `flow-parser`) include better performance and improved type safety.

Here we update `react-native/codegen` to use `hermes-parser` instead of `flow-parser`. Both parsers produce ASTs that conform to the ESTree spec so this is mostly a drop-in replacement.

In future work we should be able to use the improved AST types available in `hermes-estree` to improve type safety within `react-native/codegen` itself.

Reviewed By: huntie

Differential Revision: D48384078

fbshipit-source-id: 310ad150ec62671ba395b0e2f6415ccae97ac04d
2023-11-08 01:33:42 -08:00
Moti ZilbermanandFacebook GitHub Bot a74765eb0a Throw Flow syntax errors instead of continuing to process the AST (#39035)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39035

Changelog: [General][Fixed] Flow syntax errors in Codegen specs are no longer ignored.

Instead of throwing errors like most parsers, the `flow-parser` package returns errors as part of the AST (along with a best-effort parse). It turns out that `react-native/codegen` ignores such errors and only detects a subset of them after the fact. Here we change the behaviour to immediately throwing a descriptive error message (containing the file name and a code frame).

**This change is theoretically breaking** for any published packages that already contain broken Flow code (that somehow doesn't happen to affect the Codegen output today). Hopefully, anyone using Flow-flavoured RN Codegen is also typechecking with Flow and/or building with Metro (which would both flag the same errors), so the impact should be fairly contained.

Reviewed By: huntie

Differential Revision: D48385786

fbshipit-source-id: c7e1f5fb64a61fb0eb9e9f8f7501b43264c9626c
2023-11-08 01:33:42 -08:00
Nick GerlemanandFacebook GitHub Bot 5a7ae618a2 Remove Yoga-internal.h (#41346)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41346

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

This removes the last remnant from `Yoga-interna.h`, `YGNodeDellocate()`. The API is renamed to `YGNodeFinalize` to give it the explicit purpose of freeing the node from a garbage collector, and made public with that documented contract.

With that, every top-level header is now a public API, and Yoga's JNI bindings do not need to rely on private headers anymore.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D51014340

fbshipit-source-id: 553f04b62c78b76f9102cd6197146650955aeec5
2023-11-07 21:27:59 -08:00
Nick GerlemanandFacebook GitHub Bot 74caed5d3f Remove YGNodeMarkDirtyAndPropagateToDescendants (#41305)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41305

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

This should not be part of Yoga's API. If benchmarks want to do this, they still can (though I don't know the ones we have for it are super valuable).

Reviewed By: javache

Differential Revision: D50963933

fbshipit-source-id: 6482bd269928188b6469a358ffde5c4f9f5f9527
2023-11-07 21:27:59 -08:00
Luna WeiandFacebook GitHub Bot 5f65f21668 Update changelog for 0.73.0-rc.4 (#41349)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/41349

Reviewed By: fkgozali

Differential Revision: D51081295

Pulled By: lunaleaps

fbshipit-source-id: 02f9ecbeb922186cd7745772260380586f1a9561
2023-11-07 18:50:22 -08:00
Arushi KesarwaniandFacebook GitHub Bot 16fb64a9ef Adding FabricUIManager() getter & setter and setter for TurboModuleRegistry (#41302)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41302

Adding  `setTurboModuleRegistry(TurboModuleRegistry turboModuleRegistry)`, `setFabricUIManager(UIManager fabricUIManager)`, `getFabricUIManager()` new APIs

Changelog:
[General][Added] Introduce APIs for FabricUIManager

Reviewed By: philIip

Differential Revision: D50832557

fbshipit-source-id: 9a27a5683f312fb93f09bb4d97a615988269876e
2023-11-07 17:20:49 -08:00
Arushi KesarwaniandFacebook GitHub Bot 3e158217df Adding new APIs for creating UIManager in FabricUIManagerProviderImpl (#41301)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41301

Adding the new API for creating UIManager(`FabricUIManager`) for Fabric initialization:
```
createUIManager(ReactApplicationContext reactApplicationContext)
```

and `FabricUIManagerProviderImpl()` and making it also implement the `UIManagerProvider` interface

NOTE:

Letting the older implementations in place and will be removed once the references have been removed from the apps and similarly for old constructor `FabricUIManagerProviderImpl()` and similarly for old implement relationship with `JSIModuleProvider`

Changelog:
[Internal] internal

Reviewed By: javache, philIip, mdvacca

Differential Revision: D50783295

fbshipit-source-id: 767f27c7f0d42840a5dad693e98cf5b6a243f933
2023-11-07 14:58:06 -08:00
Arushi KesarwaniandFacebook GitHub Bot bc68794c67 Rename FabricJSIModuleProvider -> FabricUIManagerProviderImpl (#41296)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41296

As part of adding new implementation for `FabricUIManagerProviderImpl` APIs renaming the old class `FabricJSIModuleProvider` -> `FabricUIManagerProviderImpl` so as to add the new APIs later and preserve history.

Changelog:
[Internal] internal

Reviewed By: philIip

Differential Revision: D50949208

fbshipit-source-id: b833c4783b383c175fa682c558d31d8ecfa9f0ac
2023-11-07 12:38:20 -08:00
Eric RozellandFacebook GitHub Bot 4023e45439 Eliminate static const UndefinedColor from SharedColor (#41364)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41364

Initializing UndefinedColor on iOS and Android is trivial because the platform color is an int32_t. On platforms where the HostPlatformColor header defines a color as a struct (e.g., Windows) it is less trivial to compose a constexpr for the undefined color representation to initialize this static const value with.

As it turns out, UndefinedColor is only used for operator bool in SharedColor, so it's reasonably safe to remove this "public" API (also good to limit the surface of SharedColor).

## Changelog:
[Internal]

Reviewed By: sammy-SC

Differential Revision: D51073395

fbshipit-source-id: 375e43aa9a30d394d35ce2946224563738d8973c
2023-11-07 11:54:44 -08:00
Moti ZilbermanandFacebook GitHub Bot 0614479042 Silence console logs in individual tests to prevent spam (#41363)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41363

TSIA

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D51070939

fbshipit-source-id: 0d764b1e8a7594b7ee795a00349595d72e071cbf
2023-11-07 11:16:02 -08:00
Moti ZilbermanandFacebook GitHub Bot 7f82e16c7d Reenable console.log in tests (#41330)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41330

D41564032 made `console.log` (as well as `debug` and `info`) a noop in tests within the React Native repo. Here we allow them through while still throwing errors on `console.error` and `console.warn`.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D51002264

fbshipit-source-id: 44ca8bef38695dd76fe509341adced887bef2e6b
2023-11-07 11:16:02 -08:00
Joe VilchesandFacebook GitHub Bot 9847bcab51 Fix issue where absolute children of row-reverse containers would inset on the wrong side (#41293)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41293

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

NickGerleman pointed out that my recent changes to fix the slew of row-reverse problems in Yoga actually ended up regressing some parts. Specifically, absolute children of row-reverse containers would have their insets set to the wrong side. So if you set left: 10 it would apply it to the right.

Turns out, in `layoutAbsoluteChild` there were cases where we were applying inlineStart/End values to the flexStart/End edge, which can never be right. So I changed the values to also be flexStart/End as the fix here.

Reviewed By: NickGerleman

Differential Revision: D50945475

fbshipit-source-id: 290de06dcc04e8e644a3a32c127af12fdabb2f75
2023-11-07 11:02:20 -08:00
Joe VilchesandFacebook GitHub Bot 3b13d3c7d0 Introduce isDefined() and remove cases of !isUndefined() (#41209)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41209

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

There are so many instances in this code base where we use the double negative of `!yoga::isUndefined(<something>)`. This is not as easy to read since because of this double negative imo. Additionally, sometimes we have really long chains like `!longVariableName.longFunctionName(longArgumentName).isUndefined()` and it is hard to see that this undefined is inverted.

This just replaces all instances of inverted `isUndefined()` with `isDefined()` so its easier to read.

Reviewed By: NickGerleman

Differential Revision: D50705523

fbshipit-source-id: edc7d3f2cbbae38ddaeb2030a419320caf73feff
2023-11-07 11:02:20 -08:00
Joe VilchesandFacebook GitHub Bot 1984bcc0c1 Simplify getting padding + border for cross axis in algorithm (#41208)
Summary:
X-link: https://github.com/facebook/yoga/pull/1437

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

Reading through the sizing logic and this seemed a bit redundant/confusing. Lets use the same function we just used for the main axis for the cross axis as well so people do not think its special. Also we will need one less variable. The reason this was done it seems is because we need the leading padding + border elsewhere so this is technically a few less steps but this is cleaner

Reviewed By: NickGerleman

Differential Revision: D50704177

fbshipit-source-id: 1a091edbfee6482a2bf472aca2980702bd75ad94
2023-11-07 11:02:20 -08:00
Moti ZilbermanandFacebook GitHub Bot d2e8225887 Revert import order change in dangerfile.js (#41366)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41366

Changelog: [Internal]

D51025812 broke Danger runs in the React Native repo, so let's revert the changes to `dangerfile.js`.

Reviewed By: hoxyq

Differential Revision: D51075476

fbshipit-source-id: 66dc08e10a44e9a9a371af28d9a7440167470702
2023-11-07 09:41:35 -08:00
David VaccaandFacebook GitHub Bot 45dce98533 Fix rendering of RN Tester New Architecture examples in Android
Summary:
When bridgeless is enabled, RN Tester New Architecture examples crashed with a StackOverflow Exception
The root cause of this issue is that MyLegacyViewManager is sending an event to JS during the execution of MyLegacyViewManager.createViewInstance() method.

This is a problem because the delivery of events depend on the "id" of the view, but the "id" of the view is set after MyLegacyViewManager.createViewInstance() finishes executing.

The documentations "implicitly" mentions to not set props during the execution of the ViewManager.createViewInstance() method:

https://reactnative.dev/docs/native-components-android#2-implement-method-createviewinstance

To fix this issue I'm removing the execution of the method that triggers the event.

bypass-github-export-checks

changelog: [Android][Fix] Fix rendering of 'RN Tester New Architecture examples' when bridgeless is enabled

Reviewed By: fkgozali

Differential Revision: D51047007

fbshipit-source-id: 17be493f79114fa402029063e79fabc1d90efc17
2023-11-07 09:41:23 -08:00
kassens (Meta Employee)andFacebook GitHub Bot b561d46b06 rename unstable_Offscreen to unstable_Activity (#27640)
Summary:
`Activity` is the current candidate name. This PR starts the rename work
by renaming the exported unstable component name.

NOTE: downstream consumers need to rename the import when updating to
this commit.

DiffTrain build for commit https://github.com/facebook/react/commit/ce2bc58a9f6f3b0bfc8c738a0d8e2a5f3a332ff5.

Reviewed By: tyao1

Differential Revision: D50945046

Pulled By: kassens

fbshipit-source-id: be9b3254c7a98840b0769135770e9bf7858cf1a3
2023-11-07 07:10:58 -08:00
Alex ZelenskyandFacebook GitHub Bot 016b62c549 Add missing ping() method into WebSocket interface (#41071)
Summary:
The `ping()` method seems missing in `WebSocket` interface. The implementation can be found in different places :

https://github.com/facebook/react-native/blob/main/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/websocket/WebSocketModule.java#L323

https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/WebSocket/NativeWebSocketModule.js#L24

https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/WebSocket/WebSocket.js#L209

The change adds missing `ping()` method into `WebSocket` TypeScript interface.

## Changelog:

[GENERAL] [FIXED] - Add missing `ping()` method into `WebSocket` interface

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

Test Plan: Running `yarn test-typescript` and `yarn test-typescript-offline` works with no errors.

Reviewed By: NickGerleman

Differential Revision: D50975349

Pulled By: javache

fbshipit-source-id: fc3d62091f7a1543ac92faa1bd9a804c699f725d
2023-11-07 05:34:01 -08:00
Ruslan ShestopalyukandFacebook GitHub Bot d11d5f3832 Expose EventEmitter::dispatchEvent APIs for all platforms (#41345)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41345

## Changelog:
[Internal] -

This API was already accessible on the Android platform, now other platforms (C++) would benefit from having it available as well.

Arguably, it's perfectly fine to have it as public class members - based on empiric experience with the use case we have had.

Reviewed By: christophpurrer

Differential Revision: D51031340

fbshipit-source-id: 0426deede5d9e5c552c92f8a25d30fe2274a1941
2023-11-06 17:15:07 -08:00
Moti ZilbermanandFacebook GitHub Bot d6e0bc714a Enable lint/sort-imports everywhere (#41334)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41334

TSIA.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D51025812

fbshipit-source-id: e10d437be775a6b80946483aa96460f34927f870
2023-11-06 12:59:38 -08:00
Moti ZilbermanandFacebook GitHub Bot fda7d69b38 Enable lint/sort-imports everywhere (#41333)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41333

Enables the `sort-imports` lint rule introduced in D39907799 in ~all files, rather than just in `react-native/Libraries`.

We exclude only `packages/react-native/template`, in order to (1) minimise noise for projects that are tracking updates to the template, (2) avoid the possibility of something breaking if the `react-native` import isn't at the top of `template/index.js`, (3) avoid leaking a reference to `lint/sort-imports` to the template (which doesn't ship with this rule) via an ESLint suppression comment.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D51025811

fbshipit-source-id: a62b0d6ebc5323116a4b2f1b69c4e8d48cde3215
2023-11-06 12:59:38 -08:00
George ZaharievandFacebook GitHub Bot 1e21e34695 Update hermes-parser and related packages in fbsource to 0.17.1 (#41328)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41328

Update hermes-parser and related packages in fbsource to 0.17.1

Changes are just bug fixes: https://github.com/facebook/hermes/blob/main/tools/hermes-parser/js/CHANGELOG.md

Changelog: [internal]

Reviewed By: SamChou19815

Differential Revision: D50999408

fbshipit-source-id: 0d8e01719fecff648fb0c3800296c335962d7fd9
2023-11-06 11:56:03 -08:00
Moti ZilbermanandFacebook GitHub Bot 68930f78d1 Add rejectUnauthorized option to ws types (#41337)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41337

X-link: https://github.com/facebook/metro/pull/1133

Changelog: [Internal]

Adds a Flow definition that allows passing the [`rejectUnauthorized`](https://nodejs.org/api/tls.html#tlscreateserveroptions-secureconnectionlistener:~:text=(120%20seconds).-,rejectUnauthorized,-%3Cboolean%3E%20If) option to a WebSocket client. (See [example usage](https://github.com/websockets/ws/blob/a049674d936746c36fe928cc1baaaafd3029a83e/examples/ssl.js#L33) in the `ws` repo.)

Reviewed By: robhogan

Differential Revision: D51014312

fbshipit-source-id: 25794b1867ca5f15fab1592e8f80cdad8cdf897a
2023-11-06 11:01:25 -08:00
Moti ZilbermanandFacebook GitHub Bot 1d6b0f1420 Use exact, read-only types for protocol data structures (#41315)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41315

TSIA

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D50980466

fbshipit-source-id: 1f289b868f5c735396fe07899c558e417a4ee2ff
2023-11-06 11:01:02 -08:00