Commit Graph

12270 Commits

Author SHA1 Message Date
Ruslan Lesiutin 9e9fbec475 Update debugger-frontend from 1467870...b6c974c (#44161)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44161

Changelog: [Internal] - Update `react-native/debugger-frontend` from 1467870...b6c974c

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

Reviewed By: robhogan

Differential Revision: D56347692

fbshipit-source-id: 5efd6b5339008238aebe50bb5ac060df59c6afd9
2024-04-19 02:40:51 -07:00
Jane Li 727c4040b8 Back out "Use ClassFinder inside ViewManagerPropertyUpdater" (#44152)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44152

We're seeing an increase of crashes on Twilight (https://www.internalfb.com/logview/twilight_android_crashes/d25ec89876821abdd07f98d08a729f7c?trace_tab=0&ds=%7B%22start%22%3A%22-2%20weeks%22%2C%22end%22%3A%22now%22%7D) related to setting fontWeight with Double instead of String.

Original commit changeset: a67195e98377

Original Phabricator Diff: D56191175

Changelog:
[Internal] [Changed] - Revert use ClassFinder inside ViewManagerPropertyUpdater

Reviewed By: cortinico

Differential Revision: D56311183

fbshipit-source-id: e3407ff4858f00f8dadb882221e64a2631105597
2024-04-18 18:02:55 -07:00
Nick Gerleman ed6abc4e83 Use modern Differentiator "sliceChildShadowNodeViewPairs" in tests (#44131)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44131

Stub tree creation is using an old differentiator path we aren't shipping today. This removes that path, so that we can unit test the new one

1. Remove `ForTesting`/`Legacy` functions
3. Update stub view tree code for API/behavior difference of new differentiator functions including unflattened views. Don't create view instructions for those, and use `mountIndex` instead of pair index
4. Remove `V2` suffix, since the old path is deleted
5. Move mounting stub test utils out of the production library

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D56227426

fbshipit-source-id: 0f525097cfb576e0228c9ca20a770fa41ddf1e0d
2024-04-18 17:37:12 -07:00
Alex Taylor (alta) 739a8dfcf4 Deploy 0.234.0 to xplat
Summary: Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D56280192

fbshipit-source-id: 68e0288bb214644d24f3d9f132c3ffff2a3d512a
2024-04-18 16:40:54 -07:00
Alan Lee c631e93341 Remove UIManager.{show|dismiss}PopupMenu (#44096)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44096

These Android only APIs have been deprecated and are being removed for 0.75 release.

Changelog:
[Android][Removed] - UIManager.showPopupMenu() and UIManager.dismissPopupMenu() have been removed

Reviewed By: RSNara

Differential Revision: D56041827

fbshipit-source-id: e2afebf55860f33d2c8d1887e865adb4dd555e6c
2024-04-18 13:52:21 -07:00
Moti Zilberman 4fbc1f2ef8 Include stack traces in console messages (#44150)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44150

Changelog: [Internal]

* Adds the `RuntimeTargetDelegate::captureStackTrace` method for capturing stack traces during JS execution. The returned stack traces are opaque to RN, but may be passed back into the `RuntimeTargetDelegate`, particularly through the `addConsoleMessage` method.
* Implements `captureStackTrace` for Hermes (based on D55757947).
* Integrates `captureStackTrace` into the `console` handler (`RuntimeTargetConsole`)

Reviewed By: hoxyq

Differential Revision: D55474512

fbshipit-source-id: 3547d756844fa24c24cd9bcdc507b33c6ab673a9
2024-04-18 12:44:06 -07:00
Moti Zilberman ddc9bd1ff3 Refactor ConsoleApiTest to use stored Matchers instead of an intermediate struct
Summary:
bypass-github-export-checks

Changelog: [Internal]

Rewrites all `ConsoleApiTest` test cases to use matchers instead of a homegrown solution for buffering `EXPECT_*` calls.

Reviewed By: robhogan

Differential Revision: D55485495

fbshipit-source-id: 1aa50bbbb5a3b02280ed4a0bee59682716b4fd7e
2024-04-18 08:00:37 -07:00
Intl Scheduler 0276500d19 translation auto-update for Apps/Wilde/scripts/intl-config.json on master
Summary:
Chronos Job Instance ID: 1125907948563891
Sandcastle Job Instance ID: 18014399763343604
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D56301324

fbshipit-source-id: 76491a8facd51ac155096a7b07ef29afc630e3c5
2024-04-18 05:25:32 -07:00
Nick Gerleman f21d9afe0b Fixup margin: auto and justification behavior for overflowed containers (#44069)
Summary:
X-link: https://github.com/facebook/yoga/pull/1646

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

Fixes https://github.com/facebook/yoga/issues/978

1. Don't allow auto margin spaces to become a negative length
2. Replicate fallback alignment behavior specified by box-alignment spec that we are using for align-content.

Reviewed By: joevilches

Differential Revision: D56091577

fbshipit-source-id: 3c02f81f969bb947cdc5c80b15faaa0b0d39c0c2
2024-04-17 21:50:55 -07:00
Jane Li b580a071ca Fix logic for mKeepActivity (#44139)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44139

I added logic to make useEffect() work w/ fragment-based nav, but I mixed up some logic. Fixed it here
Changelog: [Internal]

Differential Revision: D56264138

fbshipit-source-id: b551f0cb93cb4a0291733edbd341d3508b61e392
2024-04-17 20:17:47 -07:00
Intl Scheduler 72e262eb5b translation auto-update for i18n/oculus-mirage.config.json on master
Summary:
Chronos Job Instance ID: 1125907948552357
Sandcastle Job Instance ID: 9007200506994282
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D56284224

fbshipit-source-id: 9e91ccd825f78960dc0e09ff923867f544f7883d
2024-04-17 20:16:15 -07:00
Soe Lynn 41a14962fc Expose Gap Percentage to ReactNative (#44129)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44129

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

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

Expose the Gap Percent from Yoga to RN Layer

Changelog:
[Android][Breaking] Enable flex gap percentage value for RN.

Reviewed By: NickGerleman

Differential Revision: D56160597

fbshipit-source-id: 34c05d39a03cf013f279a2cf9eb9762772ee11de
2024-04-17 17:24:00 -07:00
Ruslan Lesiutin fe9942a19d Update debugger-frontend from fa52bd7...1467870
Summary:
Changelog: [Internal] - Update `react-native/debugger-frontend` from fa52bd7...1467870

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

Reviewed By: EdmondChuiHW

Differential Revision: D56249192

fbshipit-source-id: 7c1de5780c86222d48b2f277aaebe21afbfa153d
2024-04-17 10:00:47 -07:00
Arushi Kesarwani 4595351310 Remove getJavaScriptContextHolder() from BridgelessReactContext (#44124)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44124

This API was introduced as part of Backwards Compat effort recently but now this backwards comptability is supported through BridgelessCatalystInstance. The major OSS usages are through Catalyst Instance and not through Bridgeless React Context which is why deleting this makes sense so that people do not start depending on this.

Changelog:
[Android][Removed] - Remove getJavaScriptContextHolder() from BridgelessReactContext since now it can be accessed through BridgelessCatalystInstance in Bridgeless mode

Reviewed By: RSNara

Differential Revision: D56205699

fbshipit-source-id: 175463e17c526359c2e04fec4b2104aea3949d5d
2024-04-17 09:53:35 -07:00
Arushi Kesarwani f7b9aafd10 Remove getRuntimeExecutor() from ReactContext (#44102)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44102

Remove `getRuntimeExecutor()` from ReactContext since now it can be accessed through BridgelessCatalystInstance.getRuntimeExecutor() directly

Changelog:
[Android][Removed] - Remove getRuntimeExecutor() from ReactContext since now it can be accessed through BridgelessCatalystInstance in Bridgeless mode

Reviewed By: RSNara

Differential Revision: D56151365

fbshipit-source-id: 42bb6a6a3d729339cfb83ffdd3f7cbec314b687a
2024-04-17 09:53:35 -07:00
Ruslan Lesiutin 1d1b40cbbe fix: always subscribe RDT listeners, even if frontend is already connected (#44133)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44133

# Changelog: [Internal]

Previous implementation doesn't have support for one specific case, when RN runtime was initialized and frontend is ready to be connected, but then it gets disconnected and re-connected again for the same runtime.

The issues were:
- For Fusebox: backend and frontend are correctly re-connected if user had Chrome DevTools opened, frontend invalidated via reload, then Chrome DevTools closed and re-opened again
- For DebuggingOverlayRegistry: it didn't subscribe to events from new `react-devtools-agent`, which emits events such as `showNativeHighlight` or `drawTraceUpdates`

Reviewed By: motiz88

Differential Revision: D56239185

fbshipit-source-id: ffa886b396790cb46de1d86fb000ff907edc1437
2024-04-17 09:46:19 -07:00
Jakub Piasecki 747a96b7b3 Add implementation of adjustsFontSizeToFit on the new architecture on Android (#44075)
Summary:
`adjustsFontSizeToFit` prop is exposed on both platforms but is missing implementation on the new arch on Android. This Pr adds it.

Fixes https://github.com/facebook/react-native/issues/43104

## Changelog:

[ANDROID] [FIXED] - Fixed `adjustsFontSizeToFit`  not working on Android when using the new architecture

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

Test Plan:
Tested on the RN Tester app using the `AdjustingFontSize` test:

| Old architecture | New architecture |
|------------------|------------------|
| <video src="https://github.com/facebook/react-native/assets/21055725/9243317c-1917-4ddb-9b8a-e9e99638409d">           | <video src="https://github.com/facebook/react-native/assets/21055725/39a7a9f2-21e4-4ba7-9ceb-dfec4ca6f643">         |

Reviewed By: javache

Differential Revision: D56134348

Pulled By: cortinico

fbshipit-source-id: b8339e3bec08e307abb0c6e4bd3f5fe143303014
2024-04-17 08:57:41 -07:00
Andrew Datsenko 46366867f7 //xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/module/model:modelAndroid (#44134)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44134

Changelog: [Internal]

Reviewed By: strulovich

Differential Revision: D56138858

fbshipit-source-id: 5ea349b6c8565f825de273adbb192c6005a2a357
2024-04-17 08:50:34 -07:00
Moti Zilberman 3220825782 Don't autosize text in "Paused in debugger" overlay
Summary:
Changelog: [Internal]

bypass-github-export-checks

Reviewed By: EdmondChuiHW, huntie

Differential Revision: D56244413

fbshipit-source-id: 99218114a7cefb9a305f504d45550f10bd6f1586
2024-04-17 08:40:48 -07:00
zhongwuzw 297ae37367 Fix rn-tester Animated example label color in dark mode (#44127)
Summary:
Fix rn-tester Animated example label color in dark mode

## Changelog:

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

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

Test Plan:
Animated examples render incorrectly in dark mode. So let's fix them. :)

![image](https://github.com/facebook/react-native/assets/5061845/ad882ee2-d156-4b24-8ddb-0ec27dc27cba)

Reviewed By: fabriziocucci

Differential Revision: D56234954

Pulled By: javache

fbshipit-source-id: 5fd8604077ced9aa3acd23a7dc9ebd8476a7330b
2024-04-17 08:21:38 -07:00
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
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