Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52487
Continues integration of `NetworkReporter` (jsinspector-modern) on Android, to enable the Network panel in React Native DevTools.
NOTE: As with iOS, all changes are gated behind the `enableNetworkEventReporting` and `fuseboxNetworkInspectionEnabled` feature flags.
**This diff**
Integrates `Network.storeRequestBody` on Android (CDP: [`Network.getResponseBody`](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-getResponseBody) CDP event) to populate the "Preview" and "Response" tabs in the React Native DevTools Network panel.
This is integrated with `NetworkingModule.kt` to support synchronously received `text` or `blob` data types, with incremental response support added next in D77927896.
Changelog: [Internal]
Reviewed By: cortinico
Differential Revision: D77799617
fbshipit-source-id: 495baebbb3b447d1ea86705c1680578eed796d78
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51493
Changelog: [IOS][FIXED] Don't retain cached images in state after `RCTImageComponentView` gets recycled
Fixes https://github.com/facebook/react-native/issues/51198
Crosspost from the task comment:
From what I've been able to figure out, it seems like the image shadow nodes (keeping the loaded image in state) are being kept in memory by shadow node reference wrappers. It doesn't seem strictly like a memory leak - manually triggering garbage collection causes those nodes to be deallocated, but since Hermes isn't aware of the memory they are retaining, I think, it doesn't trigger it automatically.
This diff releases the image data when the observers are notified and adds a new (`Consumed`) status to signify that.
Reviewed By: sammy-SC
Differential Revision: D75137263
fbshipit-source-id: 97eda7e6d1ef5cd633c4a5a4c37babc5e08968fb
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52543
Prefixing "eager" to the name makes it less confusing. React native already has main queue modules: they're just lazy.
Changelog: [Internal]
Reviewed By: lunaleaps
Differential Revision: D78109287
fbshipit-source-id: 5fa6095d2dd8fcf74fdda64e05483eb487bc8f56
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52544
Let's remove these runtime errors for now. We can re-introduce this later, if needed.
Main queue coordinator will make "unsafe execute on main queue sync" not deadlock.
Changelog: [Internal]
Reviewed By: lunaleaps
Differential Revision: D78109286
fbshipit-source-id: 7c3acc2e560e341889d8ede4665bc70fefc2f058
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52548
Changelog: [Internal]
While this does not cause real crashes as the code is already gated via
```
bool haveRHS = j < rhs.operations.size();
```
it still represents a bug in the logic
Reviewed By: rshest
Differential Revision: D78133364
fbshipit-source-id: 80efc97b5174e3d0d7efe33604255a96bc856e87
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52542
Changelog: [internal]
This adds support to propagate performance entries logged to `console.timeStamp` to Perfetto, if enabled. It also modifies the Perfetto integration to support track groups, in addition to track names.
Reviewed By: hoxyq
Differential Revision: D78092596
fbshipit-source-id: 76b0fe2738d856fd75ee941de223d6a6a73d8e1c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52549
Changelog: [Internal]
- The #includes are not used
- `enum class` is C++, (enum is C)
Reviewed By: rshest
Differential Revision: D78135339
fbshipit-source-id: 1a35301ea063ce17c195be7dc373132d342f111a
Summary:
Resolves https://github.com/microsoft/react-native-windows/issues/14797
We were facing a type conversion error in the DynamicEventPayload::extractValue() method. The function signature declares a return type of std::optional<double>, but when handling INT64 values, but when handling `INT64` values, the code was directly returning `dynamic.asInt()` without proper type conversion
We faced the issue while integrating https://github.com/microsoft/react-native-windows/pull/14791
## Changelog:
[General][Fixed]
Pull Request resolved: https://github.com/facebook/react-native/pull/52525
Test Plan:
The fix involved wrapping the dynamic.asInt() call with static_cast<double>(), creating the corrected line: return static_cast<double>(dynamic.asInt())
Tested E2E in RNW
Reviewed By: andrewdacenko
Differential Revision: D78083842
Pulled By: rshest
fbshipit-source-id: 8dbedd67fa7c21e89b863d8b1bc7b9e0d7978b9f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52530
This PR fixes two issues with `display: contents` implementation:
1. When a node with `display: contents` set is a leaf, it won't be cloned after the initial tree is built. The added test case covers this scenario.
2. It was possible for the subtree of `display: contents` nodes not to be cloned during layout. I don't have a minimal reproduction for this one, unfortunately. It was discovered in the Expensify app: https://github.com/Expensify/App/issues/65268, along with a consistent reproduction. In that specific case, it seems to be heavily tied to `react-native-onyx`, which is a state management library.
Changelog: [GENERAL][FIXED] - Fixed nodes with `display: contents` set being cloned with the wrong owner
X-link: https://github.com/facebook/yoga/pull/1826
Reviewed By: adityasharat, NickGerleman
Differential Revision: D78084270
Pulled By: j-piasecki
fbshipit-source-id: eb81f6d7dcd1665974d07261ba693e2abea239bb
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52528
This was a breaking change that is currently breaking `react-native-safe-area-context` so we can't ship it as it is, especially because all the apps in OSS will be affected by this.
Changelog:
[General] [Changed] - Revert breaking change due to the removal of `ShadowNodeTraits::Trait::DirtyYogaNode`
Original commit changeset: 869e81f0ae00
Original Phabricator Diff: D75324251
Reviewed By: huntie
Differential Revision: D78085848
fbshipit-source-id: f7fcc5e33d59cc966a4ee88dfdbedca4f4c580e0
Summary:
When using prebuilts the USE_FRAMEWORKS setting is not really relevant for the React Native code, since there will not be any source code to build frameworks for - and because we already have a framework for the code in React.XCFramework.
This commit adds a new command to the React Native podspecs like we did with the ReactNativeDependencies framework. The method is called `add_rncore_dependency` and it does nothing when building from source - but when linking with the React.XCFramework it explicitly adds linking with the framework.
In addition there are a few places in the ruby code where we check for the USE_FRAMEWORK value and changes some settings - where needed this commit will add a separate check to ensure we're building from source when making these changes.
bypass-github-export-checks
## Changelog:
[IOS] [ADDED] - Added support for using USE_FRAMEWORKS with prebuilt React Native Core
Pull Request resolved: https://github.com/facebook/react-native/pull/52489
Test Plan:
RNTester:
- Builds without USE_FRAMEWORKS as before with/without prebuilt
- Builds with USE_FRAMEWORKS=dynamic as before with source - and now also with prebuilt code.
- Same goes for the static variant.
Reviewed By: mdvacca
Differential Revision: D78012332
Pulled By: cipolleschi
fbshipit-source-id: ea942738ae52b9dceae48fb78a5026f04b7545b8
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52519
Changelog: [Internal] - Experiment with intersection logic for VirtualViews in scrollView. Currently only on Android
### Changes in detail
`VirtualViewContainer` is held by the ScrollView and is lazily instantiated once a VirtualView tries to access.
Upon initial layout, a VirtualView will add itself to the container and report its updated `rect`. `VirtualViewContainer` holds a sorted list of VirtualViews and iterates through them to update mode
Reviewed By: yungsters
Differential Revision: D77313890
fbshipit-source-id: 30843143bf1828dcac9091479964e83934bf330c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52521
Progress is moving quickly on the cxxNativeAnimatedEnabled flag, which this animatedShouldSignalBatch was intended to de-risk. We no longer need this flag to de-risk issues with animated batch flushing.
## Changelog
[Internal]
Reviewed By: christophpurrer
Differential Revision: D78005971
fbshipit-source-id: 719f1dfb0594fbe90dd6f08dea21ad20665832df
Summary:
accessibilityRole is not getting the default value from sourceProps.
This change will fix https://github.com/facebook/react-native/issues/52396
## Changelog:
<!-- Help reviewers and the release process by writing your own changelog entry.
Fixed accessibilityRole parsing.
Pick one each for the category and type tags:
[GENERAL] [FIXED] - Added fix for setting the default value for accessibility props
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
Pull Request resolved: https://github.com/facebook/react-native/pull/52397
Test Plan: After this change accessibilityRole will get the default value from sourceProps.
Reviewed By: joevilches
Differential Revision: D77879025
Pulled By: NickGerleman
fbshipit-source-id: c2fd10dd34462e2cd01488b720ba91e4f1998000
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52511
# Changelog: [Internal]
This is actually used in React for logging triggers, like Mount / Unmount / Reconnect / Disconnect.
Reviewed By: huntie
Differential Revision: D78008351
fbshipit-source-id: 9d39d45da499ce78172531c00cc7465b985c2646
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52494
Changelog: [Internal]
- Use C++ private namespace instead of C static methods
- Strongly type C++ TM functions via AsyncCallback
Reviewed By: javache
Differential Revision: D77978354
fbshipit-source-id: 2274b95cfc5b65392fc3c808bbdf54ec4ab3a37e
Summary:
Resolves https://github.com/microsoft/react-native-windows/issues/14666
We faced this issue while integrating [0.79.0-nightly-20250220-41b597c73](https://github.com/microsoft/react-native-windows/pull/14662/files#top)
This warning is treated as error and should be fixed here as well.
## Changelog:
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
[GENERAL] [FIXED] - Message
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
Pull Request resolved: https://github.com/facebook/react-native/pull/52496
Test Plan:
Fixed error:
##[error]node_modules\react-native\ReactCommon\react\renderer\css\CSSHexColor.h(39,12): Error C4244: 'return': conversion from 'int' to 'uint8_t', possible loss of data
2>D:\a_work\1\s\node_modules\react-native\ReactCommon\react\renderer\css\CSSHexColor.h(39,12): error C4244: 'return': conversion from 'int' to 'uint8_t', possible loss of data [D:\a_work\1\s\vnext\Microsoft.ReactNative\Microsoft.ReactNative.vcxproj]
(compiling source file '../../node_modules/react-native/ReactCommon/react/renderer/components/view/BaseViewProps.cpp')
Tested E2E in RNW
Reviewed By: javache
Differential Revision: D78000818
Pulled By: rshest
fbshipit-source-id: 5caafc5e92540f722b009480f030276e526355af
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52442
Changelog: [Internal]
The sample is from an outdated approach of enabling C++ Modules in RN which is not recommended anymore.
Prefer C++ Turbo Modules if you need to expose / access C or C++ APIs in RN apps:
https://reactnative.dev/docs/the-new-architecture/pure-cxx-modules
It is not included in any RNTester app at this time
Reviewed By: cortinico
Differential Revision: D77771111
fbshipit-source-id: a4fe1d13fd0224babc46f54b921a036f7b237a48
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52401
changelog: [internal]
- Mark ShadowNode::ListOfWeak as deprecated with appropriate deprecation message
- Replace all usages of ShadowNode::ListOfWeak with std::vector<std::weak_ptr<const ShadowNode>>
- Updated primitives.h and ReactNativeCPP.api to use the explicit type instead of the alias
This change continues the effort to remove type aliases in favor of explicit standard library types for better code clarity and maintainability.
Reviewed By: christophpurrer
Differential Revision: D77652083
fbshipit-source-id: 79cad019e039c19f661346604ff49a44a4af7a79
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52432
Changelog: [internal]
This creates a battery of tests for `performance.mark` and `performance.measure`. For this, it was necessary to add a new method in the native module to mock the current time.
Many of the tests are currently failing, as the API doesn't support all the options or behaviors defined in the spec. They're skipped here and will be re-enabled and fixed in a following diff.
Reviewed By: huntie
Differential Revision: D77795989
fbshipit-source-id: 3ebf18c8ac336df1fb43003a55a4678b52e8982d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52402
changelog: [internal]
Mark ShadowNode::ListOfShared as deprecated and replace most usages throughout the React Native renderer codebase with the explicit std::vector<std::shared_ptr<const ShadowNode>> type. This improves code clarity by making the container type explicit rather than relying on a type alias.
Reviewed By: christophpurrer
Differential Revision: D77651676
fbshipit-source-id: 8c4bd9b8cbbe467384b947ef9e7a4524f2053e36
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52412
Changelog: [Internal]
The sample is from an outdated approach of enabling C++ Modules in RN which is not recommended anymore.
Prefer C++ Turbo Modules if you need to expose / access C or C++ APIs in RN apps:
https://reactnative.dev/docs/the-new-architecture/pure-cxx-modules
It is not included in any RNTester app at this time
Reviewed By: cortinico
Differential Revision: D77770455
fbshipit-source-id: 987c9f2b9ab4145a2f6a724aad12d8473957dbe8
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52407
Changelog: [Internal]
The sample is from an outdated approach of enabling C++ Modules in RN which is not recommended anymore.
Prefer C++ Turbo Modules if you need to expose / access C or C++ APIs in RN apps:
https://reactnative.dev/docs/the-new-architecture/pure-cxx-modules
Reviewed By: javache
Differential Revision: D77765443
fbshipit-source-id: 112fef4c1a7e1c567f3c1d471728a1dfc926adc6
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52388
Changelog: [Internal]
Similar to `AsyncCallback<>` (the foundation of `AsyncPromise`) we should allow `void` Promise types in C++ such as `AsyncPromise<>`
Reviewed By: rbergerjr
Differential Revision: D77712020
fbshipit-source-id: d7360df5cc1b77f1e03e5fb73b0b468f6e3a415b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52393
## Changelog:
[General][Deprecated] - ShadowNode::Shared is now deprecated. Use `std::shared_ptr<const ShadowNode>` instead.
- Mark ShadowNode::Shared as deprecated in ShadowNode.h
- Replace all uses of ShadowNode::Shared with std::shared_ptr<const ShadowNode>.
This continues the systematic effort to remove ShadowNode type aliases in favor of explicit standard library types for improved code clarity and maintainability.
Reviewed By: christophpurrer
Differential Revision: D77650696
fbshipit-source-id: b4769e2a1e39f49d14d5927be105487ecf69fa3f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52382
Changelog: [Internal]
In C++, both `virtual ~CallInvoker() {}` and `virtual ~CallInvoker() = default` can be used to define a virtual destructor. However, they have slightly different implications:
1. `virtual ~CallInvoker() {}`:
* This is the traditional way of defining a virtual destructor.
* It provides an empty implementation for the destructor, which does nothing.
* The compiler will not generate a default implementation, as you've provided one explicitly.
2. `virtual ~CallInvoker() = default`:
* This is a more modern way of defining a virtual destructor (introduced in C++11).
* It tells the compiler to generate a default implementation for the destructor.
* The default implementation will perform the necessary cleanup operations, such as calling the destructors of base classes and member variables.
In general, `= default` is considered better because it:
* Avoids unnecessary code duplication: By letting the compiler generate the default implementation, you avoid duplicating code that's already generated by the compiler.
* Improves maintainability: If the class has member variables or base classes with non-trivial destructors, using `= default` ensures that the correct cleanup operations are performed without requiring manual updates.
* Conveys intent: Using `= default` clearly indicates that the destructor should perform its default behavior, making the code easier to understand.
So, unless you have a specific reason to provide a custom implementation, `virtual ~CallInvoker() = default` is generally the better choice.
Reviewed By: rshest
Differential Revision: D77685932
fbshipit-source-id: 78c81f8e400069ad38d8d7405dafeb0b6db8e67b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52335
Adds support for `Network.requestWillBeSentExtraInfo` and `Network.dataReceived` CDP events in jsinspector-modern and wires up for iOS.
In particular, `Network.requestWillBeSentExtraInfo` is necessary to populate request headers in the UI.
**End of base Network implementation for iOS**
After this diff, we are spec-complete on all CDP Network methods for our V1, on iOS.
Changelog: [Internal]
Reviewed By: hoxyq
Differential Revision: D77489476
fbshipit-source-id: 84aa4da9d9fcbdc61eff236fc6bd2136496910a5