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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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