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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43353
## Context
We are migrating to the new Hermes `CDPAgent` and `CDPDebugAPI` APIs in the modern CDP server (previously `HermesCDPHandler`).
## This diff
Integrates `HermesRuntimeAgentDelegateNew` (using the new Hermes `CDPAgent` setup) into `HermesRuntimeTargetDelegate` behind a new feature flag, `inspectorEnableHermesCDPAgent`. This completes the initial integration for all platforms.
Changelog: [Internal]
Reviewed By: motiz88
Differential Revision: D54586162
fbshipit-source-id: 5f26c28af4414d961b1c8c9cb4cd7135bd00b410
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43352
## Context
We are migrating to the new Hermes `CDPAgent` and `CDPDebugAPI` APIs in the modern CDP server (previously `HermesCDPHandler`).
## This diff
Adds the `HermesRuntimeAgentDelegateNew` class to provide a swap-in replacement for the existing `HermesRuntimeAgentDelegate` when we enable this via an incoming feature flag.
Changelog: [Internal]
Reviewed By: motiz88
Differential Revision: D53810356
fbshipit-source-id: c63684252230a747ecf0bd8cbb6f4e22052ed9bf
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43367
Enable `ReactActivityDelegate` to be used outside of `ReactActivity` as well.
Changelog: [Internal]
Reviewed By: arushikesarwani94
Differential Revision: D54634339
fbshipit-source-id: 977e0da689d5a827feca89a5dcc9416ad5178334
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43374
changelog: [internal]
when animation that uses native driver finishes, it must synchronise the end state with shadow tree.
`onUpdateRef` for native animated is only called when the animation finishes.
Reviewed By: javache, yungsters
Differential Revision: D54582987
fbshipit-source-id: 4320ed172b8bb4b22f82c6e24b47f88f1603e4fb
Summary:
The `react_render_textlayoutmanager` was not exposed via prefab. I'm adding it to make possible for react-native-live-markdown to integrate on top of React Native via prefab. Based on https://github.com/facebook/react-native/issues/36166.
## 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
-->
[ANDROID] [CHANGED] - Expose `react_render_textlayoutmanager` via prefab.
Pull Request resolved: https://github.com/facebook/react-native/pull/43381
Reviewed By: javache
Differential Revision: D54676207
Pulled By: cortinico
fbshipit-source-id: 90e3b90ff842250bf1e3abcc0c54f057b68a82fd
Summary:
`registerCallableModule()` was added from 7f549ec7be but no typescript types there. this pr tries to add the corresponding types.
## Changelog:
[GENERAL] [FIXED] - Add missing `registerCallableModule` TypeScript definitions
Pull Request resolved: https://github.com/facebook/react-native/pull/43366
Test Plan: patch locally and try to `import { registerCallableModule } from 'react-native';` in a 0.74.0-rc.2 project
Reviewed By: fabriziocucci
Differential Revision: D54676151
Pulled By: cortinico
fbshipit-source-id: cd01f2ebe2d2516b458fae5b2e83cba3d3794455
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43377
Fixes `VirtualizedList-test.js`, which assumes fake timers (e.g. using `jest.runAllTimers()` and `jest.runOnlyPendingTimers()`) but did not actually use fake timers.
Changelog:
[Internal]
Reviewed By: yungsters
Differential Revision: D54668281
fbshipit-source-id: b14757744bb7a21a4e5573053549c36178826021
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43371
This file has a lot of regexes, let's organize and comment them all.
Changelog: [Internal]
Reviewed By: yungsters
Differential Revision: D54638520
fbshipit-source-id: eed61133758ccefd2a640f121c4da214bcad4880
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43370
Component stacks with files ending in .ts, .tsx, or .jsx were skipped in LogBox reporting. This diff fixes the regex.
Changelog:
[General][Fixed] - Support .tsx, .ts, and .jsx in component stacks
Reviewed By: yungsters
Differential Revision: D54638526
fbshipit-source-id: a5271daaa7b687e8e075be3f94ab9b9c03f79b66
Summary:
Currently, the ability to convert JS values to `UIModalPresentationStyle` is not present directly on `RCTConvert`.
In the RN code base itself, there's not a lot of need to do this type of conversion, but in community modules, presenting ViewControllers can be a fairly common scenario and it'd be nice to be able to use this conversion directly from `RCTConvert`, rather than from `RCTModalHostViewManager`, as it'd improve its "discoverability" and consistency.
If someone relied on this, then it's technically speaking a breaking change but I'd say it's for the better, and searching `#import <React/RCTModalHostViewManager.h>` on github doesn't reveal a lot of results.
## Changelog:
[IOS] [ADDED] - RCTConvert to support UIModalPresentationStyle
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
Pull Request resolved: https://github.com/facebook/react-native/pull/43297
Test Plan:
Tested using RN Tester
https://github.com/facebook/react-native/assets/1566403/6e62df86-dde3-47b0-b2e9-bb6b483cadf6
Reviewed By: fkgozali
Differential Revision: D54635896
Pulled By: dmytrorykun
fbshipit-source-id: c6747857830762cd0333c31c287954f3f10d4954
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43368
This diff replaces direct invocation of the `cp` command with the platform agnostic `fs.cpSync`.
Changelog: [Internal]
Reviewed By: huntie
Differential Revision: D54634108
fbshipit-source-id: 41fe7b44b6534026ef1b930da85725bf3eb1e7bb
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43356
To make it accessible across different dylib/bundle.
Changelog: [Internal]
Reviewed By: d16r
Differential Revision: D54601288
fbshipit-source-id: e65b724b228a680784e81b8c51ecd3f4df3fd668
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43349
Changelog: [internal]
We still haven't found the root cause of some of the crashes we're seeing in the experiments to enable mount hooks on Android.
This adds a new feature flag to skip part of the mount hooks pipeline to see if we can scope the investigation to that specific part (where we query the root tree in the base revision from the mounting coordinator).
Reviewed By: sammy-SC
Differential Revision: D54587739
fbshipit-source-id: 792aa8b06808e96638d1bba072bf4060ec492bd2
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43350
Changelog: [internal]
Mount hooks have been shipped on iOS, so this removes the flag for them.
On Android, we're still testing them so it's worth moving them to the new system and scoping them to that platform.
Reviewed By: sammy-SC
Differential Revision: D54587740
fbshipit-source-id: d074927fee1a967bd3928970c31975d07cd393bb
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43337
Changelog: [internal]
Mount instructions and listeners are only called from the UI thread, so there's no need to have synchronization mechanisms for concurrency.
We're also scheduling mount hooks notifications once, but subsequent calls are ignored instead of accumulated to be notified together. This also changes that to collect all the surface IDs in the array that is read on notification.
Reviewed By: sammy-SC
Differential Revision: D54547194
fbshipit-source-id: a861e3b0113914aae5325c1486bcf8acd50eef79
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43340
Adds convenience methods `jsonResult`, `jsonError` and `jsonNotification` for more ergonomic construction of CDP JSON responses. Note that CDP is *loosely* based on [JSON-RPC 2.0](https://www.jsonrpc.org/specification), but differs for example in the omission of `"jsonrpc": "2.0"`.
Before:
```
frontendChannel_(folly::toJson(folly::dynamic::object("id", req.id)(
"error",
folly::dynamic::object("code", -32602)(
"message",
"executionContextName is mutually exclusive with executionContextId"))));
```
After:
```
frontendChannel_(cdp::jsonError(
req.id,
cdp::ErrorCode::InvalidParams,
"executionContextName is mutually exclusive with executionContextId"));
```
Changelog: [Internal]
Reviewed By: motiz88
Differential Revision: D54202854
fbshipit-source-id: 76a407ae39ff9c2ec79bcaddb6cd4d494afb7693
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43281
## Overview
This diff fixes a bug in the hermes component stack location parser, and fixes the hermes component stack tests which were not using hermes stack parsing, which is why the bug wasn't caught.
The bug fix is that React component stacks may not all have stack frame locations. For example, this stack:
```
at MyComponent (/path/to/filename.js:1:2)
at MyOtherComponent <-- no location
at MyAppComponent (/path/to/app.js:100:20)
```
This can happen when we're unable to make a component throw (e.g. it doesn't use a hook or access props). We have plans to fix these frames, but currently they can exist.
The bug was when `parseHermesStack` finds a frame without an `entry`, it would reset the `entries`. But if entries is already non-null, or if the current frame is a frame without a source, we should continue.
### Caveats
The handling here fixes the behavior to go back to skipping these frames. I'm not sure what the best way to handle these cases are, since these frames do not have source location and should skip symbolication. We should follow up with handling for these frames.
## Why it wasn't caught
In D18627930 we changed the hermes component stack parsing to check `global.HermesInternal`, but the tests for the hermes component stacks were still using the `stacktrace-parser`. I updated the tests to set/reset the global, which caught the bug.
Changelog:
[General][Fixed] - Support hermes component stacks with missing source info.
Reviewed By: yungsters
Differential Revision: D54423252
fbshipit-source-id: 80ded8b99eab919e60f847369dcb1f3afa72b6be
Summary:
This PR further optimizes RCTKeyWindow() for iOS 15+ removing the need for additional loop
bypass-github-export-checks
## Changelog:
[IOS] [ADDED] - optimize RCTKeyWindow() for iOS 15+
Pull Request resolved: https://github.com/facebook/react-native/pull/43066
Test Plan: Launch RNTester, check if proper keyWindow is returned for iOS 15+
Reviewed By: javache
Differential Revision: D54541838
Pulled By: cipolleschi
fbshipit-source-id: be79ff48f825d10c8fd71efc18629377aadc29fd