Commit Graph

30865 Commits

Author SHA1 Message Date
Moti Zilberman d2c5db59cd Identify Hermes CDPAgent/CDPHandler via log message (#43442)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43442

Changelog: [Internal]

TSIA

Reviewed By: huntie

Differential Revision: D54630591

fbshipit-source-id: ef3c9f871a5c7150b1b890b6afb0f07bb77968fd
2024-03-12 16:45:36 -07:00
Ruslan Shestopalyuk 3bbe193ab1 Add missing dependency from AndroidTextInput (#43448)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43448

## Changelog:
[Internal] -

This adds a stub for `TextLayoutManager.measureCachedSpannableById`, as well as a missing explicit dependency to `jni/react/jni` from the `TextInput` implementation on the Android platform.

This is required in order for certain build configurations to compile.

Reviewed By: andrewdacenko

Differential Revision: D54807518

fbshipit-source-id: 206f0edb03a4ed328a962e57d1e791614eb7f851
2024-03-12 15:24:50 -07:00
Samuel Susla 255d1cebf2 delete passthroughAnimatedPropExplicitValues from animated component (#43407)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43407

changelog: [internal]

`passthroughAnimatedPropExplicitValues` is not used. Let's remove it.

Reviewed By: yungsters

Differential Revision: D54583470

fbshipit-source-id: 9e480e4bf3216d4d6c9d7eac99a6b4d5a2e9583f
2024-03-12 15:05:51 -07:00
Fabrizio Cucci 41b6371940 Synchronize access to LongLivedObjectCollection instances (#43450)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43450

Changelog: [Internal]

This is just to make sure that all instances of `LongLivedObjectCollection` map can be safely accessed by multiple threads.

Reviewed By: RSNara

Differential Revision: D54801015

fbshipit-source-id: e0b15bfbeac9ce3a1051f83a59c5513a90ba2a4b
2024-03-12 13:18:25 -07:00
Alex Hunt eef87ca59e Implement previouslyExportedState on HermesRuntimeAgentDelegateNew (#43392)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43392

## Context

We are migrating to the new Hermes `CDPAgent` and `CDPDebugAPI` APIs in the modern CDP server (previously `HermesCDPHandler`).

## This diff

Wires up `previouslyExportedState` with `CDPAgent`, and re-enables the `ResolveBreakpointAfterReload` integration test.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D54369985

fbshipit-source-id: 5dcb4fe59b8b36b2db9f0385e8487097822e5704
2024-03-12 13:03:13 -07:00
Samuel Susla 55ed1c26ab delete EventPriority and its uses (#43437)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43437

## Changelog:
[iOS][Removed] - remove EventPriority class and always use the default EventPriority::AsynchronousBatched. This is potentially a breaking change if something in OSS sets a different priority. If a build fails because of this, simply remove the use of EventPriority.

EventPriority::AsynchronousBatched is the default and none of the other priorities are used anymore. This is the first step of removing this concept from the codebase.

Reviewed By: NickGerleman

Differential Revision: D54684311

fbshipit-source-id: 18240e5ee84f489f43b15fd9aab43f3b1b1b4963
2024-03-12 12:08:00 -07:00
Arushi Kesarwani 7b40c8ee5f Support onWindowFocusChange in Bridgeless (#43398)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43398

Implement onWindowFocusChange in Bridgeless by adding it to the ReactHostImpl

Changelog:
[Android][Breaking] Implement onWindowFocusChange in Bridgeless

Reviewed By: javache

Differential Revision: D54670119

fbshipit-source-id: 71f560e5a3bf0e853ac06955e67b8035f1ec0468
2024-03-12 11:52:52 -07:00
Pieter De Baets 9af98ccd71 Prevent OSS build breakage due to unused-local-typedef (#43449)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43449

Error:

```
react-native/packages/react-native/ReactCommon/react/renderer/uimanager/UIManagerBinding.cpp:162:5: error: unused typedef 'INVALID_REQUESTED_LOG_SEVERITY' [-Werror,-Wunused-local-typedef]
      LOG_EVERY_N(INFO, 10) << "instanceHandle is null, event of type " << type
      ^
  react-native/packages/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:943:30: note: expanded from macro 'LOG_EVERY_N'
                               INVALID_REQUESTED_LOG_SEVERITY);           \
                               ^
  1 error generated.
  ninja: build stopped: subcommand failed.
```

This has been fixed upstream (https://github.com/google/glog/commit/8b3023f7e4ca46e0ecf5f660dd7340c79139bc34) but we're on an older glog version, so ignore the error.

Changelog: [Internal]

Reviewed By: fabriziocucci

Differential Revision: D54811655

fbshipit-source-id: a00c23528d457ae365b0a27e680bb46afabb152f
2024-03-12 11:17:40 -07:00
Joe Vilches 3341ab7cc0 Fix bug where absolute nodes were not insetted correctly in certain cases (#43417)
Summary:
X-link: https://github.com/facebook/yoga/pull/1593

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

There was a bug where we did not position absolute nodes correctly if the static node had a different main/cross axis from the containing node. This fixes that. The change is somewhat complicated unfortunately but I tried to add sufficient comments to explain what is happening

Reviewed By: NickGerleman

Differential Revision: D54703955

fbshipit-source-id: 096c643f61d4f9bb3ee6278d675ebd69b57350d7
2024-03-12 11:08:43 -07:00
Samuel Susla 92540a618d do not synchronise native animated in paper
Summary:
## Changelog:
[General][Fixed] - Fix broken native animation in Paper

In Native Animated Paper, `scheduleUpdate` must not be called. In Fabric, the synchronisation between Fiber and Shadow trees is a must but in Paper it sets undesired state.

Reviewed By: javache

Differential Revision: D54799237

fbshipit-source-id: f6b07dc377111ed2f8253ea0c7c7e312168166e8
2024-03-12 10:19:56 -07:00
Rob Hogan 00d8f497ea Re-enable stale execution context test under new Hermes CDP Agent (#43444)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43444

Re-enable a test now that D54649943 added correct handling of stale execution context IDs.

NOTE: There's a minor difference in returned error code. The test now allows either, though note that the old implementation is more consistent with Chrome itself which returns -32000 (server error). Semantically -32600 (invalid request) seems more appropriate.

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D54805777

fbshipit-source-id: eb2baadf6b35319f5331462425eaa38b4edfab28
2024-03-12 10:04:40 -07:00
Cedric van Putten 3f41fb5d5b feature(dev-middleware): add custom message handlers to extend CDP capabilities (#43291)
Summary:
This is a proposal for the `react-native/dev-middleware` package, to allow implementers to extend the CDP capabilities of the `InspectorProxy`. It's unfortunately needed until we can move to the native Hermes CDP layer.

At Expo, we extend the CDP capabilities of this `InspectorProxy` by injecting functionality on the device level. This proposed API does the same, but without having to overwrite internal functions of both the `InspectorProxy` and `InspectorDevice`.

A good example of this is the network inspector's capabilities. This currently works through the inspection proxy, and roughly like:
- Handle any incoming `Expo(Network.receivedResponseBody)` from the _**device**_, store it, and stop event from propagating
- Handle the incoming `Network.getResponseBody` from the _**debugger**_, return the data, and stop event from propagating.

This API brings back that capability in a more structured way.

## API:

```ts
import { createDevMiddleware } from 'react-native/dev-middleware';

const { middleware, websocketEndpoints } = createDevMiddleware({
  unstable_customInspectorMessageHandler: ({ page, deviceInfo, debuggerInfo }) => {
    // Do not enable handler for page other than "SOMETHING", or for vscode debugging
    // Can also include `page.capabilities` to determine if handler is required
    if (page.title !== 'SOMETHING' || debuggerInfo.userAgent?.includes('vscode')) {
      return null;
    }

    return {
      handleDeviceMessage(message) {
        if (message.type === 'CDP_MESSAGE') {
          // Do something and stop message from propagating with return `true`
          return true;
        }
      },
      handleDebuggerMessage(message) {
        if (message.type === 'CDP_MESSAGE') {
          // Do something and stop message from propagating with return `true`
          return true;
        }
      },
    };
  },
});
```

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[GENERAL] [ADDED] - Add inspector proxy device message middleware API

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

Test Plan: See added tests and code above

Reviewed By: huntie

Differential Revision: D54804503

Pulled By: motiz88

fbshipit-source-id: ae918dcd5b7e76d3fb31db4c84717567ae60fa96
2024-03-12 09:58:51 -07:00
Rubén Norte 5833eb59e3 Implement microtasks using new JSI method (#43397)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43397

Changelog: [internal]

This migrates the Hermes-specific use of microtasks to an engine agnostic implementation based on the new JSI method to queue microtasks.

Reviewed By: sammy-SC

Differential Revision: D54687056

fbshipit-source-id: b077ba47b80f7b31c77b7e449def8a56061b0b69
2024-03-12 09:54:11 -07:00
Rubén Norte 4799d0cc5c Move spec files to specs directories in react-native/src/private (#43395)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43395

Changelog: [internal]

This moves native module specs to `specs` directory to align with the general convention.

Reviewed By: cortinico

Differential Revision: D54680056

fbshipit-source-id: 8b6ae6187e2ffa9120159b7d1fa25957677e0f4f
2024-03-12 09:54:11 -07:00
Rubén Norte 9c9c7edeb3 Allow accessing common feature flags before setting overrides for JS-only overrides (#43394)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43394

Changelog: [internal]

When we built the new feature flag system we added a constraint in the JS API to prevent calling `override` if any of the flags was already accessed from JS.

This is very restrictive because it doesn't allow us to access common flags (like `enableMicrotasks`) set up from native during the initialization of the framework because then applications wouldn't be able to set JS-only overrides.

This relaxes the constraint to disallow accessing JS-only flags before setting JS-only overrides, but accessing common (native) flags before that is ok.

Reviewed By: rshest

Differential Revision: D54687055

fbshipit-source-id: b0716f24baf7d12a5e4a61fba79e6b50ef0ad10a
2024-03-12 09:54:11 -07:00
Rubén Norte 2830066b7c Update feature flag generator to create directories for generated files before writing (#43393)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43393

Changelog: [internal]

The generator doesn't create intermediate directories, which is causing issues now that we're moving the generated native module spec to a new directory.

This fixes that.

Reviewed By: rshest

Differential Revision: D54690126

fbshipit-source-id: 1ba0d821872da7bbe1f6120ef6d0c1f800326778
2024-03-12 09:54:11 -07:00
Cedric van Putten c62be78d99 feature(dev-middleware): use userAgent query parameter as fallback when header is unset (#43364)
Summary:
At Expo, we use [Expo Tools](https://github.com/expo/vscode-expo/blob/main/src/expoDebuggers.ts) to connect the [built-in vscode-js-debug](https://github.com/microsoft/vscode-js-debug) to Hermes.

Since there are a few differences in vscode vs chrome devtools, we need to enable a couple of modifications through the [`customMessageHandler` API](https://github.com/facebook/react-native/pull/43291). Unfortunately, vscode itself doesn't set the `user-agent` header when connecting to the inspector proxy. Becuase of that, we'd need a fallback to "manually" mark the debugger as being vscode ([we use this query parameter here](https://github.com/expo/vscode-expo/blob/main/src/expoDebuggers.ts#L208)).

This PR supports setting the `user-agent` through `?userAgent=` when the header is not set.

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[GENERAL] [ADDED] - Fallback to query parameter based `user-agent` when header is unset

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

Test Plan:
- Install [Expo Tools](https://marketplace.visualstudio.com/items?itemName=expo.vscode-expo-tools)
- Start Metro with this change.
- Connect a device.
- Run the vscode command `"Expo: Debug Expo app ..."`
- Debugger should connect, and have it's user-agent marked as:
    `vscode/1.87.0 vscode-expo-tools/1.3.0`

Reviewed By: huntie

Differential Revision: D54804556

Pulled By: motiz88

fbshipit-source-id: 1ff558ba5350811ad042d08a713438e046759feb
2024-03-12 09:39:00 -07:00
Alfonso Curbelo 032873a84c Add missing commit to 0.72.12 changelog (#43434)
Summary:
## Changelog:

[INTERNAL] - Add missing commit to 0.72.12 changelog

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

Reviewed By: huntie

Differential Revision: D54805620

Pulled By: tdn120

fbshipit-source-id: c3bc31842b57c85fa584894132015f9856086876
2024-03-12 09:18:08 -07:00
Rubén Norte d456e50bb0 Add new systrace sections in MountingCoordinator (#43408)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43408

Changelog: [internal]

I think mount operations are taking longer than expected because of a debugging block (that we might remove). This adds some systrace sections to distinguish that from the overall time and confirm this only happens in debug builds.

Reviewed By: sammy-SC

Differential Revision: D54746491

fbshipit-source-id: 317b22b6dcd1ae117ed4a013180df8842bf712f0
2024-03-12 08:59:30 -07:00
Alex Hunt e2c5a36ec7 Add enableHermesCDPAgent case to ReactInstanceIntegrationTest (#43436)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43436

## Context

We are migrating to the new Hermes `CDPAgent` and `CDPDebugAPI` APIs in the modern CDP server (previously `HermesCDPHandler`).

## This diff

Expands test coverage for the Hermes `CDPAgent` implementation by enabling in `ReactInstanceIntegrationTest`.

Changelog: [Internal]

bypass-github-export-checks

Reviewed By: motiz88

Differential Revision: D54801168

fbshipit-source-id: 9b71f8e697c7ab24c1383100938b3f648774a106
2024-03-12 08:19:49 -07:00
szymonrybczak 7a00623947 Update @react-native-community/cli to 14.0.0-alpha.0 (#43415)
Summary:
Updates CLI to 14.0.0-alpha.0

## Changelog:

[GENERAL] [CHANGED] - Update `react-native-community/cli` to 14.0.0-alpha.0

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

Test Plan: CI

Reviewed By: cortinico

Differential Revision: D54760054

Pulled By: huntie

fbshipit-source-id: c4e29e2122c5de0ff60f9c52bd6f9a86ce0a5560
2024-03-12 06:18:30 -07:00
Pieter De Baets 276fdc414b Reduce logspam of missing instanceHandle (#43432)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43432

Changelog: [Internal]

Reviewed By: sammy-SC, fabriziocucci

Differential Revision: D54798889

fbshipit-source-id: 19cbac6b6bbb19242227ad9357cd9e8b86cdd331
2024-03-12 05:38:45 -07:00
Alfonso Curbelo 81d39d9e16 Changelog: 0.72.12 (#43419)
Summary:
## Changelog:
Changelog: [INTERNAL] Generated changelog

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

Reviewed By: cortinico

Differential Revision: D54799352

Pulled By: huntie

fbshipit-source-id: ad777f8804e14da4b4ed77ea0742560c1d01c7b5
2024-03-12 04:36:57 -07:00
Samuel Susla 2ed1e9ad28 remove sync events from TextInput (#43429)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43429

changelog: [internal]

these experimental props have served their purpose and can be deleted.

Reviewed By: rubennorte

Differential Revision: D54682805

fbshipit-source-id: aee5072e2aa056c862f369426617d0d51c98997f
2024-03-12 04:32:01 -07:00
Pieter De Baets 9e2bb4efc3 Fix TimingModuleTest in OSS (#43422)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43422

After my changes in D54496604, this test now requires the main looper to progress as well, to dispatch the right callback.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D54776392

fbshipit-source-id: ba272a08d4b88d1c3301618eed1a03253e615b84
2024-03-12 04:25:17 -07:00
Arushi Kesarwani bdca260679 Fix Bridgeless React Context test in OSS (#43424)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43424

https://github.com/facebook/react-native/pull/43400/ caused a `getCatalystInstanceTest` to fail in OSS due to `bridgelessReactContext` not being a Mock object.

Reviewed By: fkgozali

Differential Revision: D54781539

fbshipit-source-id: 1c784804c31d4b57fe438d49f3ee3eb7034dd7a6
2024-03-11 23:21:05 -07:00
Phillip Pan 5522d522bb support jsCallInvoker in RCTBridgeProxy (#43314)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43314

Changelog: [Internal]

making call invoker a breaking change to runtime executor in 0.74 seems to be causing a lot of discourse. let's simplify things and first add the callinvoker to the backwards compat layer

Reviewed By: cipolleschi

Differential Revision: D54404845

fbshipit-source-id: 983e86829030557033b95625dab9068492739417
2024-03-11 21:55:42 -07:00
Phillip Pan 620459a07e change import to RCTBridgeProxy to forward declaration (#43313)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43313

Changelog: [Internal]

we can simplify the build graph here

Reviewed By: cipolleschi

Differential Revision: D54404844

fbshipit-source-id: 52dfbd05106e72687b969357e274d2c4cdd9ca34
2024-03-11 21:55:42 -07:00
Fabrizio Cucci 86a52cc2dc Scope LongLivedObjectCollection per runtime [3/n] (#43410)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43410

Changelog:
[General] [Breaking] - Make `LongLivedObjectCollection::get` accept a Runtime reference as parameter.

# Context

Approach 1 as described in [RFC post](https://fb.workplace.com/groups/615693552291894/permalink/1693347124526526/).

# This diff

* Replace the `LongLivedObjectCollection` singleton with a map from `Runtime -> LongLivedObjectCollection` so that each RN instance has its own collection.
* Update MSFT fork accordingly

Reviewed By: javache, RSNara

Differential Revision: D54649209

fbshipit-source-id: ecd2ab3917843ca82388b7b9cce06c05679f2d60
2024-03-11 15:55:45 -07:00
Pieter De Baets da21799ca3 Fix stack overflow in createRootView (#43420)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43420

Calling `mReactDelegate.createRootView` just ends up calling the overridden method in the anonymous inner class. Instead have the base implementation return null, and call super.

Changelog: [Internal]

Reviewed By: jessebwr, janeli-100005636499545

Differential Revision: D54772205

fbshipit-source-id: fc90e6718f9c287e8b86e5768cf7f74d0db06c49
2024-03-11 14:49:52 -07:00
Fabrizio Cucci 3706bf077e Scope LongLivedObjectCollection per runtime [2/n] (#43409)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43409

Changelog:
[General] [Breaking] - Make `LongLivedObject` constructor accept a `Runtime` reference.

# Context

Approach 1 as described in [RFC post](https://fb.workplace.com/groups/615693552291894/permalink/1693347124526526/).

# This diff

* Embed `Runtime` reference in `LongLivedObject` to keep supporting `allowRelease` method (and update extending classes accordingly)
* Update MSFT fork accordingly

Reviewed By: RSNara

Differential Revision: D54638813

fbshipit-source-id: 0d58d1c32b3689bdd1223c13f5d5ee2f2e15f223
2024-03-11 13:01:09 -07:00
Arushi Kesarwani c6076bca97 Implement getJSCallInvokerHolder for BridgelessCatalystInstance (#43400)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43400

Implement `getJSCallInvokerHolder()` for BridgelessCatalystInstance

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

Reviewed By: cortinico

Differential Revision: D54650305

fbshipit-source-id: effac3daaad5173c2fd78ab11bbe3f3156a9c07b
2024-03-11 12:19:49 -07:00
Alex Hunt a7fde7c885 Enable JSI integration tests for Hermes CDPAgent (#43391)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43391

## Context

We are migrating to the new Hermes `CDPAgent` and `CDPDebugAPI` APIs in the modern CDP server (previously `HermesCDPHandler`).

## This diff

Bootstraps `HermesRuntimeAgentDelegateNew` within `JsiIntegrationTest.cpp`.

Test cases which currently do not pass with `HermesRuntimeAgentDelegateNew` are selectively matched against a new alias to exclude them: `JsiIntegrationHermesLegacyTest`.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D53810357

fbshipit-source-id: 2d7d7446038530d19d93add71361b4bf581cff18
2024-03-11 11:03:58 -07:00
Alex Hunt c6ca7d61af Add changelog for 0.74.0-rc3
Summary: Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D54755786

fbshipit-source-id: 76dfac43143d95a8765d67c93a2d8a30edec4259
2024-03-11 10:39:52 -07:00
Nick Gerleman b696a7dc5e Reduce warning level of distributed Yoga builds (#43405)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43405
X-link: https://github.com/facebook/yoga/pull/1592

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

Yoga may be built with a high warning level. This is helpful in letting Yoga be used in more places, and finding defects. We currently set these in the internal BUCK build, the CMake reference build, and the Yoga Standalone (not RN) CocoaPods build.

Yoga's reference CMake build and spec are consumed today by users of Yoga, instead of just Yoga developers. Here, it makes more sense to avoid anything that could break compiler-to-compiler compatibility.

We default these to a less intense (`-Wall -Werror`). I kept `/W4`, for pragmatic reasons, and since it is relatively standard for MSVC.

We continue to build with strict flags on Buck build on Clang.

Reviewed By: cortinico

Differential Revision: D54735661

fbshipit-source-id: 130e35ac9dcffa2f7e70e48d18770f1275864e2a
2024-03-11 10:38:55 -07:00
Rick Hanlon e9e668f0ec Symbolicate component stacks (#43166)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43166

# Overview
This diff adds support for symbolicating component stacks that provide the new stack frame formatting. It currently switches between a `componentStackType` value to enable stack frame parsing, but once the feature flag lands we can clean this up so that the type of `ComponentStack` is always just `Array<StackFrame>`

## Screen

### With stack frame component stacks
{F1459181398}

## Legacy version
 {F1463451637}

Changelog:
[General][Fixed] - Support component stacks without source info.

Reviewed By: yungsters

Differential Revision: D53984570

fbshipit-source-id: 68afbe70b65c7a8861d049bebe0659dbe1db146f
2024-03-11 10:29:06 -07:00
hurali97 d66b9a5b28 Changelog: 0.73.6 (#43412)
Summary:
## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

Changelog: [Internal] Generated changelog

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

Reviewed By: cortinico

Differential Revision: D54753626

Pulled By: huntie

fbshipit-source-id: c0a2348601b3d78b08ccaab570f346716d3793e6
2024-03-11 10:18:36 -07:00
Pieter De Baets 3283202248 Remove createRootView(initialProps) from ReactDelegate (#43365)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43365

Changelog: [Android][Changed] Simplified ReactActivityDelegate to expose a single createRootView method.

Reviewed By: cortinico

Differential Revision: D54434648

fbshipit-source-id: 305c54910a1eac25664507972879c7c6bd633466
2024-03-11 09:40:33 -07:00
Moti Zilberman aeb250430d Make FallbackRuntimeAgentDelegate private (#43348)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43348

Changelog: [Internal]

Followup from D54585658. Moves the branching on `HERMES_DEBUGGER_ENABLED` into `HermesRuntimeTargetDelegate`, and correspondingly makes `FallbackRuntimeAgentDelegate` private (not exposed directly to integrators).

Reviewed By: huntie

Differential Revision: D54587558

fbshipit-source-id: 554b41356c1421a508c1a788d7c27f53445ecb6b
2024-03-11 09:30:53 -07:00
Pieter De Baets 641a9c468f Move lifecycle listener inside JavaTimerManager (#43338)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43338

Reafactor JavaTimerManager so more code is shared between bridge and bridgeless.

Note that HeadlessJSTaskContext is not currently configured when using bridgeless.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D54496604

fbshipit-source-id: 2a61294267df372e69f8316dd8f8059625d0a2bd
2024-03-11 09:09:52 -07:00
Moti Zilberman 7c5a014c0d Pass whole RuntimeTargetDelegate from RN instead of aggregating its methods (#43346)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43346

Changelog: [Internal]

(Continuing the theme of reducing integration boilerplate from D54537844.)

This diff changes both `JSExecutor` (Bridge) and `JSRuntime` (Bridgeless) to no longer implement `RuntimeTargetDelegate`. Instead, each of them exposes a `getRuntimeTargetDelegate()` method that returns a stable reference to a target delegate that it *owns*.

To facilitate this, we create a new `FallbackRuntimeTargetDelegate` for use in non-Hermes cases. This replaces *almost* all direct uses of `FallbackRuntimeAgentDelegate` outside of `jsinspector`. I'll follow up in a separate diff to deal with the last case and make the fallback agent delegate fully private.

As a result, changing the `RuntimeTargetDelegate` interface (which we'll need to do for console support) becomes much easier: we only have unit test mocks + two concrete `RuntimeTargetDelegate` implementations (one fallback, one Hermes) to update for each API change.

Reviewed By: huntie

Differential Revision: D54585658

fbshipit-source-id: 08b61c74008ddc36c2b134a40755ef8e43ab21ed
2024-03-11 06:29:32 -07:00
D N 1ea269f42c fix: [TypeScript] Allow to pass empty string as style (#43404)
Summary:
```tsx
import {Text} from 'react-native'

interface Props {
  foregroundColor?: string | undefined | null
}

function Test({foregroundColor}: Props){
  return <Text style=[styles.icon, foregroundColor && { color: foregroundColor }] />
  // ^^^ Error: Type "" is not assignable to type TextStyle | Falsy | RegisteredStyle<TextStyle> | RecursiveArray<TextStyle...
}
```

## Changelog:

[GENERAL] [ADDED] - [TypeScript] Allow to pass empty string as style

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

Test Plan:
Change `Falsy` type locally and test it on the next code

```tsx
const styles = StyleSheet.create({
  text: {
    color: 'red',
  },
});
export const a = <Text style={[styles.text, null, '', undefined, false]} />;
```

Reviewed By: rshest

Differential Revision: D54744517

Pulled By: javache

fbshipit-source-id: c5b934616cc0501c2b6a7907e6be522187a2cc20
2024-03-11 06:00:36 -07:00
Alex Hunt 80891468d2 Update InspectorFlags to lazily pull upstream values (#43390)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43390

Refactor after D54639775. This avoids the unfortunate side effect where `InspectorFlags::dangerouslyResetFlags()` would immediately reread `ReactNativeFeatureFlags `. This call is now relocated in our test util.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D54684692

fbshipit-source-id: 962c7d78bbf71b1d81af412081d3ef5cfe443fa1
2024-03-11 05:29:07 -07:00
Cedric van Putten 3dee6d31b9 fix(dev-middleware): allow inspector proxy to fetch sourcemaps on lan connections (#43307)
Summary:
The inspector proxy is inlining source maps on `Debugger.scriptParsed` CDP events. The inlining prevents Chrome DevTools from downloading this remotely, as that's not supported in newer versions anymore.

The current implementation locks this inlining mechanism to just `localhost` and/or `127.0.0.1` addresses, making it incompatible with LAN or tunnel device connections.

This PR removes that limitation to allow source map inlining on these LAN and tunnel connections.

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[GENERAL][FIXED] Allow Inspector proxy to inline source maps on LAN connections

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

Test Plan:
- See added test
- Start Metro and connect a device over LAN, open the chrome devtools

Reviewed By: huntie

Differential Revision: D54485247

Pulled By: robhogan

fbshipit-source-id: 6fcb0c6dd762d2f0a013497ba0a1126095b9130b
2024-03-11 03:48:49 -07:00
Ruslan Lesiutin e2157f063a bump react-devtools-* packages to ^5.0.2 (#43384)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43384

Changelog: [Internal]

via `js1 upgrade react-devtools -v ^5.0.2`

5.0.1 and 5.0.2 mostly include fixes, biggest change is the way how we find source location of the element and the symbolication.

Backend from `react-devtools-core` 5.0.2 is required for symbolication.

allow-large-files

Reviewed By: huntie

Differential Revision: D54679238

fbshipit-source-id: 13656b2d9bad106246c019e1627b87ffbc2735fe
2024-03-08 13:07:49 -08:00
Ruslan Shestopalyuk 6c28c87c4d TurboModule::emitDeviceEvent doesn't require jsi::Runtime argument anymore (#43376)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43376

## Changelog:
[Internal] -

Make it possible to call `emitDeviceEvent` from C++ TurboModules without the need to explicitly provide the reference to `jsi::Runtime`, as in some contexts (when we call e.g. not from the JS thread itself) it may be hard to get hold of.

Reviewed By: rubennorte

Differential Revision: D54643903

fbshipit-source-id: 25cea413e66c6e76c958395879db1169899e3bc9
2024-03-08 10:28:45 -08:00
Ruslan Shestopalyuk 76ce789014 Pass jsi::Runtime reference into CallInvoker::invoke* callbacks (#43375)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43375

## Changelog:
[Internal] -

As discussed with the team, it makes more sense to pass the reference to the correct `jsi::Runtime` object as an argument to the ` CallInvoker::invoke*` callbacks, that are provided by the user.

There are various use cases when user would like to get a hold of the `jsi::Runtime` in the callback, and it makes sense, since it is guaranteed to run on the JS thread.

So far people have been coming up with all kinds of workarounds for that, none of them safe enough.

Reviewed By: rubennorte

Differential Revision: D54643171

fbshipit-source-id: 2f6015426a9e29cb9fcf5a9a3e2f6f33ff692538
2024-03-08 10:28:45 -08:00
Luna Wei 208be50000 Try renaming build_npm_package for nightly job (#43379)
Summary:
Changelog: [Internal] Try renaming nightly job so we can automate if there are failures
See https://circleci.com/docs/configuration-reference/#name

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

Reviewed By: cortinico

Differential Revision: D54670307

Pulled By: lunaleaps

fbshipit-source-id: 85a26f92d7789f6195c9cf07909dd12850010a4b
2024-03-08 09:46:48 -08:00
Alexey Litvinov eadcebbb3e add support for text highlighting (#43386)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43386

Changes:
- fixes `RCTAttributedTextUtils` to set `RCTAttributedStringIsHighlightedAttributeName` attribute according to `isHighlighted` textAttribute value.
- adds block to `drawAttributedString` and passed highlighted bezier curve to it.
- updates `drawRect` to visually highlight selected text.

## Changelog:
[iOS][Fixed] - Fixed text highlighting in the New Architecture

Reviewed By: sammy-SC

Differential Revision: D54594472

fbshipit-source-id: ed454e3a1660fa76d96cb131e33fba1c05f47776
2024-03-08 09:24:45 -08:00
Rick Hanlon 7bb204a160 Fix public-api-test "expected parse error" assertion (#43378)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43378

## Overview
I noticed while running this test, that there's an existing `console.error` to remove a file from the `FILES_WITH_KNOWN_ERRORS` list, but the tests pass despite the error. This happens because the `console.error` throws to fail the test, but this `console.error` is inside a try/catch, so the error is swallowed.

This diff moves the check to a finally, which fails the test.

I also fixed the `FILES_WITH_KNOWN_ERRORS` list.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D54587062

fbshipit-source-id: c46e98326ef6654452871337364d7e66ff204e2c
2024-03-08 08:53:49 -08:00