Commit Graph

38536 Commits

Author SHA1 Message Date
Blake Friedman e0799536ef Fix: OSS builds can accidentally using coreutils cp (#44097)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44097

There are two places where we use a feature specific to the system version of 'cp', the:

  -X    Do not copy Extended Attributes (EAs) or resource forks.

This feature isn't available in GNU's cp, which is commonly installed on macOS using:

  brew install coreutils && brew link coreutils

We can avoid the problem alltogether by being specific about the path of the system cp.

Changelog: [General][Fixed] don't break script phase and codegen when coreutils installed on macOS

Reviewed By: cipolleschi

Differential Revision: D56143216

fbshipit-source-id: f1c1ef9ea2f01614d6d89c4e9eedf43113deb80c
2024-04-17 08:08:50 -07:00
Moti Zilberman 1d26907ca4 Internal API for Activity-less "Paused in debugger" overlay (#44132)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44132

Changelog: [Breaking][Android] `DevSupportManagerFactory.create()` changed to take an additional parameter of type `PausedInDebuggerOverlayManager` (nullable)

Enables integrators of React Native Android to supply their own implementation of the Fusebox "paused in debugger" overlay. This is primarily intended for legacy Meta-internal integrations that can't use the built-in implementation based on `Dialog`. **The API will likely go away once those integrations have been migrated.**

Reviewed By: javache

Differential Revision: D56215119

fbshipit-source-id: 9cd79a6948c268a952ac28e5563ae57c90756da7
2024-04-17 07:26:54 -07:00
Dmitry Rykun 2f1cd04073 Try static view config if native view config is not available (#44065)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44065

React Native will try to use static view config if native view config is not available.
This will allow Fabric-only native components in Bridge mode.

Changelog: [General][Added] - Add support for Fabric-only native components in Bridge mode.

Reviewed By: cortinico

Differential Revision: D56062759

fbshipit-source-id: e562700695c14c88d11056aec1e66f8aa10a3957
2024-04-17 06:14:35 -07:00
Moti Zilberman 3426591bbe Tweak pause overlay design, remove Step Over button (#44119)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44119

Changelog: [Internal]

TSIA - following design feedback from huntie.

Reviewed By: hoxyq

Differential Revision: D56193523

fbshipit-source-id: 89e9fc77702e40a2f39be719c700fe9ad400a8a2
2024-04-17 05:22:09 -07:00
Moti Zilberman 233da7dde7 Style pause overlay to be similar to Chrome's (#44081)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44081

Changelog: [Internal]

Migrates the Fusebox "pause in debugger" on Android from `AlertDialog` to a custom dialog, with a look and feel based closely on the equivalent Chrome feature. I've adapted the layout slightly to be mobile-appropriate (touch target sizes etc) and drawn new icon assets that are effectively hand-upscaled versions of the Chrome ones.

Reviewed By: hoxyq

Differential Revision: D56105051

fbshipit-source-id: 42d7472c8dd8f842c0dbd82c12eba102bcf59b87
2024-04-17 05:22:09 -07:00
Moti Zilberman a5c6779ce5 Add Step Over and Resume buttons to pause overlay (#44082)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44082

Changelog: [Internal]

Adds the ability to interactively resume/step from the Fusebox "paused in debugger" overlay on Android. This uses HostCommands (D56098083) and extends the AlertDialog-based overlay (D56068445). In an upcoming diff on this stack, we'll update the design of the overlay to match Chrome's.

Reviewed By: hoxyq

Differential Revision: D56098084

fbshipit-source-id: 587b8bac7b0dd636363fc28ea7d0577b1a52d5c7
2024-04-17 05:22:09 -07:00
Moti Zilberman 6930f3daf7 Minimal implementation of "paused in debugger" overlay (#44079)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44079

Changelog: [Internal]

Implements an unstyled, non-interactive version of the "paused in debugger" in-app overlay in Fusebox on Android, based on the event introduced in D56068444. The implementation in `DevSupportManagerBase` is shared across Bridge and Bridgeless.

In upcoming diffs in this stack, we'll add interactive features (namely "resume" and "step over" buttons, like in Chrome) and improve the visual styling of this overlay.

Reviewed By: hoxyq

Differential Revision: D56068445

fbshipit-source-id: a9ac2765d29d64615751b5cdf03939e0b84d2545
2024-04-17 05:22:09 -07:00
Luis Miguel Alvarado 66fd1e8145 remove: leftover RCTSegmentedControl code (#44023)
Summary:
The `SegmentedControl` component was removed in https://github.com/facebook/react-native/pull/33140, but not all related code was moved.

See React Native 0.69 breaking-changes:  https://reactnative.dev/blog/2022/06/21/version-069#breaking-changes

## Changelog:

[INTERNAL] - remove: leftover `RCTSegmentedControl` code

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

Test Plan: CI will be OK.

Reviewed By: cortinico

Differential Revision: D56015121

Pulled By: dmytrorykun

fbshipit-source-id: 10e64e9bbd0e5346711fd2f42553deb2d992c191
2024-04-17 04:25:27 -07:00
Moti Zilberman f9eb35a581 Tweak pause overlay design, remove Step Over button (#44118)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44118

Changelog: [Internal]

TSIA - following design feedback from huntie.

Reviewed By: huntie, hoxyq

Differential Revision: D56191051

fbshipit-source-id: 6497a0ec6c51808410c3745ce97ed44085add0ac
2024-04-17 04:05:36 -07:00
Moti Zilberman 8872652236 Style pause overlay to be similar to Chrome's (#44085)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44085

Changelog: [Internal]

Styles the Fusebox "paused in debugger" overlay on iOS to look similar to the Chrome implementation (and the Android implementation as of D56105051) instead of using a plain `UIAlertController`.

The only thing missing at this point is the custom asset for the "step over" icon. Unlike on Android, RN doesn't currently ship any built-in images for iOS, so I'll figure out how to do that in a separate diff and use a system-provided icon in the interim.

Reviewed By: hoxyq

Differential Revision: D56116881

fbshipit-source-id: a07e1a7592c4210606a0e61366ad750faf6148bc
2024-04-17 04:05:36 -07:00
Moti Zilberman fc9e8ce649 "Paused in debugger" overlay based on UIAlertController (#44083)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44083

Changelog: [Internal]

Adds a working, interactive "paused in debugger" overlay to Fusebox for iOS (similar to what D56068445 + D56098084 did on Android). The overlay is rendered using a standard `UIAlertController`. In upcoming diffs on this stack we'll style the overlay to look more like the Chrome implementation.

Reviewed By: hoxyq

Differential Revision: D56105959

fbshipit-source-id: d752d6611b2d9e48b67a82f3a9a96c7785c31a7a
2024-04-17 04:05:36 -07:00
Nicola Corti 56da650c90 Use ClassFinder inside ViewManagerPropertyUpdater (#44114)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44114

In OSS, we should use the ClassFinder wrapper as the `Class.byName` calls will never succeed (we don't run the annotation processor in OSS).

Changelog:
[Internal] [Changed] - Use ClassFinder inside ViewManagerPropertyUpdater

Reviewed By: arushikesarwani94

Differential Revision: D56191175

fbshipit-source-id: a67195e983774872e27d35456b45651540411e2b
2024-04-17 03:43:02 -07:00
Phillip Pan aa7a0bc6a6 fix broken link in privacy manifest template message (#44128)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44128

Changelog: [Internal]

idk what happened but this link got abbreviated when i copypastad it, fixing it here

Reviewed By: javache

Differential Revision: D56228228

fbshipit-source-id: 35c5c9fb44e82083773302618474c1e3bbc71712
2024-04-17 03:02:18 -07:00
Moti Zilberman 58ddd74202 Add HostCommands for resuming and stepping debugger (#44080)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44080

## Design

Adds a new public `HostTarget::sendCommand` method, enabling integrators to send simple imperative commands to the target.

As an implementation detail, the commands are translated internally to CDP and sent over a dedicated `HostTargetSession` (encapsulated in `HostCommandSender`). Any response from the underlying Agent is ignored.

From the caller's perspective, these commands don't occur in the context of a session at all, and from the frontend's perspective, only the *effects* of the commands (if any) are seen.

## Use case

HostCommands are specifically useful when we want to resume/step execution in response to a UI action. The commands map directly to the `Debugger.resume` and `Debugger.stepOver` CDP methods.

NOTE: This is inspired by Chrome/V8's existing support for multiple concurrent CDP sessions. Any CDP client can successfully send `Debugger.resume` and `Debugger.stepOver` (without even subscribing to debugger events using `Debugger.enable`) and affect the state of other ongoing debugging sessions.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D56098083

fbshipit-source-id: 013ab748b360f700c453cf1447fb82d6d0d77c6f
2024-04-17 00:58:02 -07:00
Jane Li 2509eb710e Configure fragment-based nav to work with useEffect() (#44105)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44105

Previously, we skipped calling the ReactDelegate callback functions when the ReavtNavigationFragment was destroyed because it set the current activity to null when we need to actually keep the reference to the activity. However, skipping this entirely also skips core clean up logic, such as running the return() function for useEffect().

Instead of skipping the callback function entirely, we just need to make sure we don't set mCurrentActivity to null. I followed D30504616 to configure an option to not set mCurrentActivity to null if mKeepActivity flag is set on the ReactInstanceManager.

Changelog: [Internal]

Reviewed By: keoskate

Differential Revision: D56167533

fbshipit-source-id: cb3620e21599683e0c6bbc5a6a9c4f384fdbcc51
2024-04-16 17:18:09 -07:00
Jane Li 63e202f3d5 Remove changes to ReactFragment introduced for fragment-based navigation (#44104)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44104

We previously added the option to skip calling the delegate lifecycle events in D55646221 to support fragment-based navigation. However, we don't actually want to skip calling these events as they run some core clean up logic, such as calling the return value of useEffect(). There's a better way to get this working with fragment-based nav (see next diff).

Changelog:
[Internal] [Changed] - Remove option to skip calling delegate on ReactFragment lifecycle events

Reviewed By: keoskate, cortinico

Differential Revision: D56167614

fbshipit-source-id: 3a4b91a303a27c0e19644a4e6611229211a1e530
2024-04-16 17:18:09 -07:00
Samuel Susla 8c53ac6078 setup an experiment to prevent double measure of text (#44120)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44120

changelog: [internal]

Prevent measuring the same text twice in `ParagraphShadowNode`.

The current implementation calls `TextLayoutManager::measure` twice for a single `ParagraphShadowNode`. The first time to measure the node for Yoga. The second time inside `ParagraphShadowNode::layout`. I think the original author counted on the cache inside of `TextLayoutManager` to deal with this, but this is not always the case and `TextLayoutManager::measure` is called with two different available widths, leading to cache miss and fills the cache faster.

Reviewed By: NickGerleman

Differential Revision: D55757264

fbshipit-source-id: 0bf8b49f062f802a4e2f04cad1bf1d4bf001b870
2024-04-16 12:19:11 -07:00
Ruslan Lesiutin e47297967c Update debugger-frontend from 864bc72...fa52bd7 (#44110)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44110

Changelog: [Internal] - Update `react-native/debugger-frontend` from 864bc72...fa52bd7

Resyncs `react-native/debugger-frontend` from GitHub - see `rn-chrome-devtools-frontend` [changelog](https://github.com/facebookexperimental/rn-chrome-devtools-frontend/compare/864bc721a3f0f26b94f5730e59739a25e3182ce5...92227970f9128db14d080b5b9e9ddcafa23e7e17).

Reviewed By: robhogan

Differential Revision: D56159198

fbshipit-source-id: 8e39274569ee15476a6bb9ccab812d91177f388d
2024-04-16 10:56:24 -07:00
Ruslan Lesiutin 430dd0be26 refactor[setUpReactDevTools]: support both RDT from Fusebox and standalone ws-based frontend (#44095)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44095

# Changelog:
[General][Added] - support opening React DevTools from both Chrome DevTools frontend (React Native DevTools) and `react-devtools` standalone app

Reviewed By: robhogan

Differential Revision: D54896251

fbshipit-source-id: d6156ca09578b67d53393f564a3a591fd13d145f
2024-04-16 10:56:24 -07:00
Ruslan Lesiutin b8e6e35a59 feat: import setUpFuseboxReactDevToolsDispatcher in DEV (#44094)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44094

# Changelog: [Internal]

This script was added in D54770207.

This will be DEV-only for 2 reasons:
1. We need to double-check if Fusebox is ready to be used with production bundles, I don't think so.
2. Previous integration with RDT was DEV-only

Reviewed By: motiz88

Differential Revision: D56141041

fbshipit-source-id: 1141c65a5811d0f56c944e25a319ba21211b7836
2024-04-16 10:56:24 -07:00
Alex Hunt 7c0676db06 Add useLastSuccessfulPipeline to release testing script (#44088)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44088

This is a power user option for Release Crew members when testing locally — a flag to bypass being blocked on the latest in-progress CircleCI job and instead fetch build artifacts from the most recent successful pipeline (typically `HEAD~1`).

Example use cases where the latest pushed commit isn't impactful:
- An iOS-only fix, meaning Android can be tested now.
- A trivial fix that applies to CI only (e.g. RNTester Podfile.lock update).

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D56138727

fbshipit-source-id: f9884bdb289a92486807e8e033b756466fcec559
2024-04-16 10:34:44 -07:00
Ramanpreet Nara 3a3f3e6232 Introduce ReactContext.hasReactInstance() (#44116)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44116

This is just the bridgeless analogue to .hasCatalystInstance()

Changelog: [Android][Added] - Introduced ReactContext.hasReactInstance() to replace .hasCatalystInstance()

Reviewed By: fabriziocucci

Differential Revision: D56164488

fbshipit-source-id: 8be4676e18dc7df4765746f46cf36e62405b4ffa
2024-04-16 10:12:54 -07:00
Andrew Datsenko 94a58a8e42 fix AsyncTask deprecation suppression in ImageStoreManager.kt (#44113)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44113

Changelog: [Internal]
as title

Reviewed By: cortinico

Differential Revision: D56189597

fbshipit-source-id: 5e33f5db378c634a3ef34b1124bb25d3c97308ed
2024-04-16 10:10:16 -07:00
zhongwuzw 89eb794751 Fabric: Add font variant support (#44112)
Summary:
Fixes https://github.com/facebook/react-native/issues/44064

## Changelog:

[IOS] [FIXED] - [iOS] Fabric: Add font variant support

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

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

Reviewed By: cortinico

Differential Revision: D56189145

Pulled By: cipolleschi

fbshipit-source-id: a814cf4959b0160e36f79eaf6c7dcbffe5ef60c5
2024-04-16 08:53:17 -07:00
Andrew Datsenko 8a343c6256 //xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/camera:cameraAndroid (#44101)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44101

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D56138400

fbshipit-source-id: 5c09e4d28c69bbf87236607d38afbfbddcd28a0c
2024-04-16 08:03:33 -07:00
Biki-das b1576e5b1a feat: Added PixelRatio API example (#44000)
Summary:
Added the [PixelRatio](https://reactnative.dev/docs/pixelratio) API to the RN tester app on the API list examples.

## Changelog:

[General] [Added] - Add examples for the Pixel Ratio API, with all the available methods.

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

Test Plan:
**iOS**

https://github.com/facebook/react-native/assets/72331432/dd481916-a8df-4a62-8f63-61936d886d33

**android**

https://github.com/facebook/react-native/assets/72331432/4d8d67dc-ddeb-4ca7-b61c-07522951f9ee

Reviewed By: NickGerleman

Differential Revision: D56135685

Pulled By: hoxyq

fbshipit-source-id: f2f4eb9e31159a4a2c660d1a864b649e537916af
2024-04-16 07:17:36 -07:00
Blake Friedman b71cebbd37 react-native.config.js handle optional @react-native-community dependencies
Summary:
As part of decoupling our dependency on the react-native-community/cli, the `react-native.config.js` which is
a part of the community's config ecosystem should probably be entirely removed from the react-native package.

As part of this, we're making the config fail gracefully if these dependencies aren't available in a user's project:

- react-native-community/cli-platform-android
- react-native-community/cli-platform-ios

Changelog: [Internal]

This isn't going to be a visible change to any users.

bypass-github-export-checks

Reviewed By: cortinico

Differential Revision: D56137820

fbshipit-source-id: 528e25809a83b90e79b806a875001fc0f06db1cf
2024-04-16 07:16:48 -07:00
Moti Zilberman 8afa8beac2 Add boilerplate for handling Overlay.setPausedInDebuggerMessage (#44078)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44078

Changelog: [Internal]

Adds stub support for the [`Overlay.setPausedInDebuggerMessage`](https://cdpstatus.reactnative.dev/devtools-protocol/tot/Overlay#method-setPausedInDebuggerMessage) CDP method to `HostAgent` in the Fusebox backend, and propagates it into the Android and iOS integrations through `HostTargetDelegate`.

We take care to call `HostTargetDelegate::onSetPausedInDebuggerMessage()` a final time with a null `message` parameter, regardless of whether the client has actually sent the corresponding CDP message. Since multiple clients might be connected concurrently, we only send the `null` message when the *last* client which has requested a non-null message has disconnected.

Reviewed By: robhogan

Differential Revision: D56068444

fbshipit-source-id: c26e1cf17dec8d7dbb7edd5ab7fa3133642628ff
2024-04-16 04:52:13 -07:00
zhongwuzw d181f06b58 Fix rn-tester Accessibility example label color in dark mode (#44061)
Summary:
Fix rn-tester Accessibility example label color in dark mode

## Changelog:

[INTERNAL] [FIXED] - Fix rn-tester Accessibility example label color in dark mode

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

Test Plan:
Before:
![image](https://github.com/facebook/react-native/assets/5061845/286f25c1-3e9f-49d0-876b-8da552ecf5a9)

After fix:
![image](https://github.com/facebook/react-native/assets/5061845/264bfea4-c65b-4d72-be91-2fe72acbbf88)

Reviewed By: NickGerleman

Differential Revision: D56064680

Pulled By: dmytrorykun

fbshipit-source-id: bdf63939948803d15b2b730df567fce22160de73
2024-04-16 03:30:09 -07:00
Rob Hogan a52bd7dd08 Inspector proxy: Rewrite 127.0.0.1 to localhost in source map URLs to support IPv4->IPv6 tunnels (#44092)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44092

In a setup where a device retrieves a bundle from `http://127.0.0.1:8081`, but this is tunnelled to a remote host with only an IPv6 stack (eg, FB dev servers), the host running the inspector-proxy will fail to fetch source or source maps from 127.0.0.1 despite typically being on the same host (indeed, process) as Metro.

This causes a surprising inconsistency where using a bundler URL of `localhost` from the device results in source maps being inlined into `Debugger.scriptParsed`, but using a bundler URL of `127.0.0.1` causes inspector-proxy to fall back to preserving URLs, which are typically fetched lazily by CDT later.

This should be unnecessary once we've implemented CDP `Network.loadNetworkResource` and removed `Debugger.scriptParsed` rewriting, but for now it brings IPv6 tunnelled servers in line with local servers.

Changelog:
[General][Changed] Inspector proxy: Rewrite 127.0.0.1 to localhost in source map URLs for better IPv4->IPv6 tunnelling support.

Reviewed By: motiz88

Differential Revision: D56138742

fbshipit-source-id: b65c9cc8225a0ed54cf32171f640ef9e6408c762
2024-04-16 03:00:13 -07:00
Alan Lee 47c6311422 fix issue with PopupMenuAndroid event (#44103)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44103

Changes here fixes events in PopupMenuAndroid not being triggered correctly.

Issuses were:
1) naming mismatch
2) wrong parameters were set for the Event Map
3) missing code in .cpp

Applied fixes:
1) consistent event naming
2) fixed key used for event mapping
3) re-ran codegen to update .cpp files

## Changelog:

[Android] [internal] - Fix issue with PopupMenuAndroid event callback not working

Steps took to run codegen for this diff: https://www.internalfb.com/intern/phabricator/paste/markdown/P1214671854/

This diff is patching issues from D55531870

Reviewed By: RSNara

Differential Revision: D56164235

fbshipit-source-id: 4cf66ad3cfd753c146c5e219f27910834731e183
2024-04-16 00:27:57 -07:00
Soe Lynn 0c6fd0a86b Implement Percentage support for gap styles (#44067)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44067

X-link: https://github.com/facebook/litho/pull/980

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

Changelog [Internal]:
- Added percentage value for flex layout gap
- Wired up to pass proper available width and height to implement this feature

Reviewed By: NickGerleman

Differential Revision: D56002340

fbshipit-source-id: c0bc86ac70a1391f115c87da99c2ef411535f68b
2024-04-15 16:44:16 -07:00
Nick Gerleman d1e8328f7e Add QualifierAlignment to Clang Format Config (#44098)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44098

This sets `QualiferAlignment` so that code is automatically formatted to west const.

I did a pass at this before, but now that we are on new Clang Format, we can enforce it automatically, and I think a couple more cases not previously changed now are.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D56143678

fbshipit-source-id: 8f12b288476ea6019fd7d7a93a39b4fe2e75af14
2024-04-15 16:03:26 -07:00
Andrew Datsenko d53a2bd4a2 //xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/toast:toastAndroid (#44100)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44100

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D56138594

fbshipit-source-id: a3010e4d99e5ba9948c7214d546461cbbf959851
2024-04-15 14:09:52 -07:00
Ruslan Lesiutin e7154bdd9b upgrade[react-devtools]: v5.1.0 (#44093)
Summary:
X-link: https://github.com/facebook/flipper/pull/5575

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

# Changelog: [Internal]

Bump `react-devtools-*` packages to 5.1.0.

allow-large-files

Reviewed By: motiz88

Differential Revision: D56141042

fbshipit-source-id: 33ae0351dd1db21002d6323addd51ad98d86e3c3
2024-04-15 13:30:07 -07:00
Pieter De Baets 5e7f74d3a2 Support more stubbed methods in BridgelessCatalystInstance (#44091)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44091

These can be stubbed easily using existing ReactHostImpl/ReactInstance API's

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D56139806

fbshipit-source-id: cefabe3aa0fb6556f8e296243ff233df07ddffee
2024-04-15 12:46:50 -07:00
Riccardo Cipolleschi 6dd83cbb35 Backport fix for Ccache from 0.74 to main (#44089)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44089

While doing the release of 0.74.0-RC.9, we encountered some failures while building because the committed project had some new flags that have been added by cocoapods and that required Ccache.

However, Ccache is not a hard requirement to run React Native and the build started failing on systems that does not have ccache installed.
That happened because we were missing the piece of code that removed Ccache from the project in case the tool is not installed in the system.

We already committed such commit in the stable branch of 0.74, with [this commit](https://github.com/facebook/react-native/commit/2b18fdf8063b423a0fb5762f2c6044244b4c35e6). This change will port the same fix in main.

## Changelog
[iOS][Fixed] - Make sure to remove ccache scripts when ccache is not installed

Reviewed By: cortinico

Differential Revision: D56140015

fbshipit-source-id: 24e7ebb4e5c08766b29705e8b6f03c3f164a96ab
2024-04-15 10:11:03 -07:00
Alex Hunt 5493d7dea6 Add changelog for 0.74.0-rc.9 (#44090)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44090

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D56141063

fbshipit-source-id: 19b1255fd8c26567b16176f8acca5768ac3f92f6
2024-04-15 09:57:02 -07:00
Rob Hogan 704756352c Inspector proxy: Add ping/pong keepalive/heartbeat to debugger connection (#44086)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44086

When a debugger frontend is connected to inspector-proxy via another proxy or tunnel that times out on idle (such as [VS Code's remote tunnel](https://github.com/microsoft/vscode/blob/main/src/vs/platform/tunnel/node/tunnelService.ts)), the connection between proxy and debugger may be dropped.

In addition, when the connection is dropped without a closing handshake, the proxy does *not* detect the disconnection - no disconnect is logged to the reporter and no notifications are sent to any connected devices.

This adds a mechanism using the WebSocket-standard `ping` and `pong` frames to:
1. Keep the connection alive
2. Detect when the debugger has gone away

Note that as all WebSocket clients already **must** reply to a ping with a pong, this is non-breaking for compliant implementations: https://datatracker.ietf.org/doc/html/rfc6455#section-5.5.2

Changelog:
[General][Added] Inspector proxy: Add ping/pong keepalive to debugger connections.

Reviewed By: hoxyq

Differential Revision: D56069185

fbshipit-source-id: e322de631c652a502f3d554c15ed5412a751ee04
2024-04-15 08:55:05 -07:00
Nicola Corti 718041a9e4 ReactFeatureFlags.mFabricEnabled should default to ReactFeatureFlags.enableFabricRenderer (#44087)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44087

The `mFabricEnabled` field is initialized to false. This is a misalignment with how other classes are behaving like
ReactActivityDelegate.

Changelog:
[Internal] [Changed] - ReactFeatureFlags.mFabricEnabled should default to ReactFeatureFlags.enableFabricRenderer

Reviewed By: arushikesarwani94

Differential Revision: D56013057

fbshipit-source-id: fcab903ab42d3b30094dcebbcf5b662cd2f2c506
2024-04-15 07:51:50 -07:00
Nicola Corti 5d538ec105 Clarify documentation for debuggableVariants (#44040)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44040

This is just a clarification for the KDoc of this property.

Changelog:
[Internal] [Changed] - Clarify documentation for debuggableVariants

Reviewed By: andrewdacenko

Differential Revision: D56012825

fbshipit-source-id: 837d2dbc0f7ca5853ba1cedf71a4a5c36661318f
2024-04-15 06:54:33 -07:00
Arushi Kesarwani 99d0c540ca Edit Changelog (#44052)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44052

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D56043702

fbshipit-source-id: d5e255a5d8fa12ec7cdd1d1086119142a20a29f5
2024-04-15 01:47:21 -07:00
Andres Suarez a5eeea814d Apply clang-format 18
Summary: Previously this code conformed from clang-format 12.

Reviewed By: igorsugak

Differential Revision: D56065247

fbshipit-source-id: f5a985dd8f8b84f2f9e1818b3719b43c5a1b05b3
2024-04-14 11:28:32 -07:00
Nick Gerleman 314a919df6 Introduce "BoxShadowDrawable" for Android box shadows (#43722)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43722

This change adds a drawable, when when drawn on the bounds of a border-box sized view, will draw a spec compliant box-shadow outside the box. This is reliant on Android `RenderNode` and `RenderEffect` APIs provided by API 31.

Inset box shadows can also be added using a similar method, but this is not done yet.

The code which manages this is in flux, but the underlying drawable should be good. Will add some tests once it's more wired up.

Changelog: [Internal]

Reviewed By: javache, cortinico

Differential Revision: D55561465

fbshipit-source-id: 6180568cff2779b826e73bb9184dbe042863b262
2024-04-13 15:34:12 -07:00
Nick Gerleman c710386e72 Encapsulate border radius resolution logic (#43983)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43983

We duplicate some pretty hairy code related to conversion between logical and physical edges, along with the grafting between uniform and non uniform radii. This encapsulates border radius resolution/assignment logic.

Changelog: [Internal]

Reviewed By: alanleedev

Differential Revision: D55635743

fbshipit-source-id: 906c35af2bf18f0586d71d05f9cf61d4248ede1e
2024-04-13 15:34:12 -07:00
Nick Gerleman efc5ddd3ee Allow sigma blur without filter prop (#43721)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43721

Makes some changes to `FilterHelper` to expose RenderEffects for filters publicly to other classes in the module. We use this in box-shadow, in order to reuse logic for sigma accepting blur filters.

Also fixes a crash related to the conversions back and forward between sigma and radius, where small values would cause a crash.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D55563775

fbshipit-source-id: fabc888eecb451e75a88c8633fe5cca1f6644faa
2024-04-13 15:34:12 -07:00
Nick Gerleman d7766fa927 Move background drawing code from "react/views/view" to "react/uimanager/drawable" (#43720)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43720

This lets us use BG drawing code in rules which view depends on. I also removed some lib usage.

The original class is still present, subclassing the class in its new location, but is marked deprecated.

Next diffs in stack clean up some of our own now deprecated usage.

Changelog:
[Android][Breaking] - Deprecate `ReactViewBackgroundDrawable` in favor of `CSSBackgroundDrawable`

Reviewed By: javache

Differential Revision: D55565035

fbshipit-source-id: 501b3e2f674c09a88b1825657ba6349823054e8c
2024-04-13 15:34:12 -07:00
Sam Zhou 1b152f6eca Deploy v0.233.0 to xplat (#44062)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44062

Changelog: [Internal]

Reviewed By: pieterv

Differential Revision: D55773070

fbshipit-source-id: 685e290e27c9ea22d925fe6f8fbfaa30d0af3bb4
2024-04-12 17:25:25 -07:00
Arushi Kesarwani b72f5e9982 Implement getJavaScriptContextHolder for BridgelessCatalystInstance (#44054)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44054

Implement `getJavaScriptContextHolder()` for BridgelessCatalystInstance

Changelog:
[Android][Breaking] Implement `getJavaScriptContextHolder()` for Bridgeless Catalyst Instance

Reviewed By: christophpurrer

Differential Revision: D56046452

fbshipit-source-id: b7fed1da3064608d8ef5fa84f4e53a4f7a84cba7
2024-04-12 12:55:05 -07:00
Arushi Kesarwani 6a5aaad9e0 Implement getRuntimeExecutor for BridgelessCatalystInstance (#44053)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44053

Implement `getRuntimeExecutor()` for BridgelessCatalystInstance

Changelog:
[Android][Breaking] Implement `getRuntimeExecutor()` for Bridgeless Catalyst Instance

Reviewed By: christophpurrer

Differential Revision: D56046398

fbshipit-source-id: b9f947cf6f83ce7c1d334558a11b76fccab45dbd
2024-04-12 12:35:43 -07:00