Summary:
Solve a part of this issue: https://github.com/facebook/react-native/issues/46631
## 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
-->
[IOS] [CHANGED] - Passed correct title and titleColor prop to updateTitle function
**What's the Issue:**
When updating the PullToRefreshViewProps in a React Native iOS app, changes to the title and titleColor were not being reflected properly in the RefreshControl. This happened because the function responsible for updating the title (_updateTitle) was not always receiving the correct or updated values for title and titleColor.
**Updated `_updateTitle` function:**
The _updateTitle method was modified to accept both title and titleColor as parameters. This ensures that the latest values are always used when updating the refresh control's attributedTitle.
If the title is empty, the attributedTitle is cleared by setting it to nil. Otherwise, both the title and titleColor (if present) are applied correctly.
Pull Request resolved: https://github.com/facebook/react-native/pull/46655
Test Plan:
**Without fix:**
https://github.com/user-attachments/assets/8a83c247-bf78-4080-bdc1-ac5a852481e8
**With Fix:**
https://github.com/user-attachments/assets/52e2495a-4419-41d1-b308-acb64600f9f7
Reviewed By: javache
Differential Revision: D63466516
Pulled By: cipolleschi
fbshipit-source-id: fef61a003b658b20a25b61b6d07ee9fe0750dae7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46705
We have multiple classes in React Native Android acting as a binding layer (between C++ and Java, between C++ and JS). Make it more obvious this Binding is for (Android) FabricUIManager and flatten the (now) unused Binding interface.
Changelog: [Android][Removed] BindingImpl is no longer part of the public interface
Reviewed By: cortinico
Differential Revision: D63536329
fbshipit-source-id: 329d184c1889fbe804995211cdd339b50a7c9234
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46701
Reduce the interface we expose in SurfaceHandler(Binding), and concentrate the logic in the FabricUIManager Binding.
Changelog: [Internal]
Reviewed By: rshest
Differential Revision: D63536328
fbshipit-source-id: 5882bdd24fd3ca8f3d36210dca80587fee091dcf
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46704
Our build log for Gradle is extremely noisy due to Hermes.
Here I'm suppressing all the build output from Hermes as we can't really do much from that side of the build.
This should make it easier for folks on GitHub Actions to immediately spot where are failures.
Changelog:
[Internal] [Changed] - Silence unnecessary Gradle outputs
Reviewed By: GijsWeterings
Differential Revision: D63541175
fbshipit-source-id: d1a60098c317ff9e8c9575b5b8b2aab639f28f2f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46680
Since the parent of a view with mixBlendMode prop set is the one responsible for setting the compositing of the child, when updating mixBlendMode on a child we need to also invalidate the parent.
Changelog: [Android] [Fixed] - mixBlendMode now properly does state updates
Reviewed By: joevilches
Differential Revision: D63424394
fbshipit-source-id: 0eb15520f1087e25683853632943e64a66344481
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46685
This attempts a similar fix to D59566611, but keeps the removedClippedSubviews logic as is, instead moving the current translation done in ReactHorizontalScrollContainerView onLayout to ShadowNode layout metric assignment (so the world is consistent from very early on, and `removeClippedSubviews` never sees coordinates before translation),
I suspect doing this at the ShadowNode layer might also result in some fixes to DevTools in RTL.
This should let us roll out setAndroidLayoutDirection again.
Changelog:
[Android][Fixed] - Fix interactions between removeClippedSubviews and RTL
Reviewed By: mdvacca
Differential Revision: D63318754
fbshipit-source-id: 828e103e2ad21c7e886e39c163474b10ebd5099e
Summary:
A crash we are getting in the wild suggests that destruction on weak ref count going away may be delaying RuntimeExecutor task destruction to a point where jsi::Function is invalid. Let's try backing D62748768 out and seeing if the crash goes away.
Changelog:
[General][Fixed] - Attempt to fix crash from delayed RuntimeExecutor task destruction
#bypass-github-export-checks
Reviewed By: mdvacca
Differential Revision: D63568504
fbshipit-source-id: 6152e7293902d0eb67a14c5840bea56561c35b08
Summary:
Fixes https://github.com/facebook/react-native/issues/46568 . cc cipolleschi
## Changelog:
[IOS] [FIXED] - Fabric: Fixes animations strict weak ordering sorted check failed
Pull Request resolved: https://github.com/facebook/react-native/pull/46582
Test Plan:
See issue in https://github.com/facebook/react-native/issues/46568
## Repro steps
- Install Xcode 16.0
- navigate to react-native-github
- yarn install
- cd packages/rn-tester
- bundle install
- RCT_NEW_ARCH_ENABLED=1 bundle exec pod install
open RNTesterPods.xcworkspace to open Xcode
{F1885373361}
Testing with Reproducer from OSS
| Paper | Fabric (With Fix) |
|--------|-----------------|
| {F1885395747} | {F1885395870} |
Android - LayoutAnimation (Looks like it has been broken and not working way before this changes.)
https://pxl.cl/5DGVv
Reviewed By: cipolleschi
Differential Revision: D63399017
Pulled By: realsoelynn
fbshipit-source-id: aaf4ac2884ccca2da7e90a52a8ef10df6ae4fc8a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45786
Following D60377082, `packages/react-native/Libraries/` is now 100% parsable by `flow-api-translator` and covered by `flow-api-test`. This diff increases test strictness to preserve this state going forward.
Changelog: [Internal]
Reviewed By: cortinico
Differential Revision: D60377123
fbshipit-source-id: 8c48bdd73d9d0d97a114d553eb70cc01faf18e89
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45785
Adds `flow` annotation, and/or adds minimal Flow types to remaining files under `packages/react-native/Libraries/`. As of this diff, 100% of this directory is now parsable by `flow-api-translator` and covered by `public-api-test`.
Changelog: [Internal]
Reviewed By: cortinico
Differential Revision: D60377082
fbshipit-source-id: 67e8acafc3fdd8f107f1d8d53c69ee6c27d3ed0a
Summary:
Similar to D63541483, modernises our Flow syntax support for our published ESLint config to use `hermes-eslint` (`hermes-parser`).
Changelog: [Internal]
Reviewed By: hoxyq
Differential Revision: D63541856
fbshipit-source-id: 06cc5725faf5934fda07713ec1dac54ff9c32ddf
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46696
Following D62161923, we began to lose sync with modern Flow syntax when Metro's `transformer.hermesParser` option is disabled. This config option loads Babel for transformation (instead of `hermes-parser`), which requires a Babel plugin to parse (not strip) Flow syntax.
This diff migrates us away from `babel/plugin-syntax-flow` (see also https://github.com/babel/babel/issues/16264) and uses the modern [`babel-plugin-syntax-hermes-parser`](https://www.npmjs.com/package/babel-plugin-syntax-hermes-parser) instead (a component of the modern Hermes Parser stack).
Following this change, new projects that unset `transformer.hermesParser` will compile.
Resolves https://github.com/facebook/react-native/issues/46601.
Changelog:
[General][Fixed] - Fix parsing of modern Flow syntax when `transformer.hermesParser = false` is configured in Metro config
Reviewed By: cipolleschi
Differential Revision: D63535216
fbshipit-source-id: d2c6ddec030d89e2698e03b76194cf3568d04e6b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46699
Switch from legacy Babel Flow parser integrations to the Meta-maintained `hermes-eslint` and `babel-plugin-syntax-hermes-parser` packages (both part of the `hermes-parser` codebase).
Required to unblock D63535216.
Changelog: [Internal]
Reviewed By: hoxyq
Differential Revision: D63541483
fbshipit-source-id: 04ccfa04c9a2b8c0a87ef1a5c38e952971838b77
Summary:
I've noticed that some users are reporting build failures due to warnings inside RNGP.
We do have `allWarningsAsErrors` set to true for everyone (also for users).
That's too aggressive, and can cause build failures which are not necessary. Let's keep it enabled only on our CI (when the `enableWarningsAsErrors` property is set).
## Changelog:
[INTERNAL] - RNGP: Read `enableWarningsAsErrors` property correctly
Pull Request resolved: https://github.com/facebook/react-native/pull/46657
Test Plan: CI
Reviewed By: NickGerleman
Differential Revision: D63459601
Pulled By: cortinico
fbshipit-source-id: 0307e8d6771518038a5abe27ca5a993cb0a9f8c0
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46691
In Bridgeless, ReactSurface would only call `registerSurface` when it started, which did not match the behaviour seen in startSurface(WithConstraints). Instead, make all calls to start the surface go through the FabricUIManager Binding so we can correctly configure `setMountingOverrideDelegate` which is required for layout animations.
Changelog: [Android][FIxed] LayoutAnimations work on full new architecture
Reviewed By: cortinico
Differential Revision: D63533635
fbshipit-source-id: f6d3db020bb2d7245f7b14f2407271d76837d40c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46663
# Changelog: [Internal]
Now we can use the native module for persisting settings in React DevTools. Basically, this diff adds read / write implementations.
Reviewed By: huntie
Differential Revision: D62967060
fbshipit-source-id: c14ef056c8d7e30a23d2b84d1ad4fc0ad8eaaf34
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46665
# Changelog: [Internal]
Looks like this module was missing on android for a while.
Reviewed By: huntie
Differential Revision: D63460309
fbshipit-source-id: 7146e7f2104f868d0f2b7271bd2c452608611ea3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46662
# Changelog: [Internal]
This should not have been a public API in the first place.
1. Moving this to `src/private`.
2. Removed some unused APIs, such as profiling settings.
Reviewed By: huntie
Differential Revision: D62965492
fbshipit-source-id: fb97eccaf647ce418f500b02d153263aa8632eee
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46669
# Changelog: [Internal]
In React DevTools 6.0.0, settings manager is [no longer used](https://github.com/facebook/react/pull/30986), because the host of the Backend is responsible for settings persistance.
Also, `installHook()` call was removed from the top level of the JavaScript module and now we need to call `initialize()` explicitly.
The logic for persisting settings will be added in one of the next diffs at the top.
Reviewed By: huntie
Differential Revision: D62967059
fbshipit-source-id: 5022546aab02540f38c8d2e2f2e7dfeb82863f3f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46694
The DevMenu module was never implemented on Android. This adds its implementation by mirroring the iOS implementation.
Fixes https://github.com/facebook/react-native/issues/46679
Changelog:
[Android] [Fixed] - Add missing Android implementation for DevMenu Module
Reviewed By: cipolleschi
Differential Revision: D63535172
fbshipit-source-id: 791e72b46b7d3264b98e85a73f2d9025dc3a2c7d
Summary:
If the module sets the method queue to the main queue, we should call it on the main queue if it contains some UI operations, otherwise it may lead to some undefined behavior.
## Changelog:
[IOS] [FIXED] - Fixes the exported synchronous method not being called on the method queue when it's the main queue
Pull Request resolved: https://github.com/facebook/react-native/pull/46344
Test Plan: The sync method should be called on the main queue if the module's method queue is main queue.
Reviewed By: cipolleschi
Differential Revision: D63532525
Pulled By: javache
fbshipit-source-id: 55baaa60af96bb1355d3641174f23bccd8eb9344
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46677
Since removing `react-native-community/cli` as a dependency in 0.76 the `npx react-native init` command isn't working. This is the deprecated way to run this command, but users should still expect it to work for now.
This now forks this kind of request to `npx react-native-community/cli init <args>` as described in the warning logs to the user.
Changelog: [Internal]
Issue: reactwg/react-native-releases#508
Reviewed By: cortinico
Differential Revision: D63467046
fbshipit-source-id: 84560bdae8d6f62629dee61da3cbbf544b9a83b2
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46623
I've just noticed that ReactFragment is not properly instantiating the `ReactDelegate` with a ReactHost
when on Bridgeless. This causes Fragments to crash when the app is on bridgeless mode.
Fixes https://github.com/facebook/react-native/issues/46566
Changelog:
[Android] [Fixed] - ReactFragment should properly instantiate ReactDelegate on Bridgeless
Reviewed By: mdvacca
Differential Revision: D63319977
fbshipit-source-id: 08256e35b2769e18df2d24f870ec5d98e5574f85
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46683
Enabling these Microtask, ModernRuntimeScheduler and NativeViewConfigsInBridgelessMode in BridgeMode is risky and leads to bugs. In this diff I'm ensuring we only enable these flags when newArchitecture is enabled
changelog: [internal] internal
Reviewed By: shwanton
Differential Revision: D63503519
fbshipit-source-id: 4ef757834b8f7fba595b3394735f4b91335d7c98
Summary: Backing out the stack since a same crash that previously effected many apps appeared again, and there are changes soon landing that will add more conflicts.
Reviewed By: Abbondanzo
Differential Revision: D63493332
fbshipit-source-id: 4423bf41c793e00a0aa22d12a77bca69d3b1ae77
Summary: Backing out the stack since a same crash that previously effected many apps appeared again, and there are changes soon landing that will add more conflicts.
Reviewed By: Abbondanzo
Differential Revision: D63493331
fbshipit-source-id: 44658ffc99eb4ebc947f95bb6e6bde105ac88c93
Summary: Backing out the stack since a same crash that previously effected many apps appeared again, and there are changes soon landing that will add more conflicts.
Reviewed By: Abbondanzo
Differential Revision: D63493334
fbshipit-source-id: 175fc7b5b69aa2874c867e460ab102bb077a7cd8
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46668
Small tweaks post-Kotlin-conversion:
- Make `overflow` a var
- Replace `+ -` with `-`
- Clean up properties and move up init block
- Iterate over entire allChildren array to clean up listeners
Changelog: [Internal]
Reviewed By: cortinico
Differential Revision: D63343964
fbshipit-source-id: 2e9022e2d7e54ac338d1003419d8959771f7f270
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46676
Changelog: [internal]
## Context
We recently "fixed" a problem in `MountingCoordinator` on Android where it would report that it doesn't have any pending transactions when, in fact, it does. The fix introduces a new method in that class to delay marking transactions as done until a mount hook is invoked for that surface.
That fixed the issue... by always reporting that there were pending transactions accidentally.
The reason for this bug is that the mount hook doesn't have access to the mounting coordinator of the surface if the surface is registered through some of the methods in `Binding.cpp` that don't add the surface to a registry. In that case, we can never mark the transactions as done and the mounting coordinator for those surfaces always report pending transactions incorrectly.
NOTE: this bug only affects apps that have the `fixMountingCoordinatorReportedPendingTransactionsOnAndroid` feature flag enabled.
## Changes
This fixes the issue by making sure that surfaces are always registered in the registry and that we can access their mounting coordinators in the mount hook to report the transactions as done.
Reviewed By: rubennorte
Differential Revision: D63466672
fbshipit-source-id: a621a12cda89a3ab7331d3c6a16c6cdfa9341821
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46678
I'm investigating some issues with surface management and noticed `surfaceHandlerRegistry_` is not updated in the bridgeless path when using ReactSurfaceView.
Adding a warning to help us validate this is resolved when we do eventually fix it.
Changelog: [Internal]
Reviewed By: fabriziocucci
Differential Revision: D63463521
fbshipit-source-id: 38995924588f1d71b9fc517c76a6e0c572fd0699
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46674
bypass-github-export-checks
React DevTools no longer operates with just Fibers, it now builds its
own Shadow Tree, which represents the tree on the Host (Fabric on
Native, DOM on Web).
We have to keep track of public instances for a select-to-inspect
feature. We've recently changed this logic in
https://github.com/facebook/react/pull/30831, and looks like we've been
incorrectly getting a public instance for Fabric case.
Not only this, turns out that all `getInspectorData...` APIs are
returning Fibers, and not public instances. I have to expose it, so that
React DevTools can correctly identify the element, which was selected.
Changes for React Native are in
[D63421463](https://www.internalfb.com/diff/D63421463)
DiffTrain build for commit https://github.com/facebook/react/commit/d66fa02a303fc53d901bdb0d7bbdaec3e6774b19.
Test Plan: Sandcastle tests
Reviewed By: poteto
Differential Revision: D63453667
Pulled By: hoxyq
fbshipit-source-id: 21b1d5d4cd68b42748d4a785e0f28eaf5db57f21
Summary:
Changelog: [internal]
(this functionality hasn't been enabled in OSS yet, so no changelog necessary).
Fix https://github.com/facebook/react-native/issues/45122.
performance.mark is currently O(1) but performance.clearMark is O(n) (being n the number of entries in the buffer), which makes this operation very slow.
### Changes overview
- Created new `PerformanceEntryBuffer` abstraction with the following subtypes, that differ on how entries are stored:
- `PerformanceEntryCircularBuffer` - stores them in a ring buffer that was already implemented, removed key lookup cache (`BoundedConsumableBuffer`)
- `PerformanceEntryKeyedBuffer` - stores them in a `unordered_map`, allowing for faster retrieval by type
- `PerformanceEntryLinearBuffer` - a simple infinite buffer based on `std::vector`, currently used in a `PerformanceObserver`
- Created `PerformanceObserver` abstraction on native side.
- Created `PerformanceObserverRegistry` that collects active observers and forwards entries to observers that should retrieve them
- Moved some method implementations to `.cpp` files to reduce potential compilation time slowdown. As the `PerformanceEntryReporter` can be included from anywhere in the code, it will be beneficial to make header files as light as possible.
- Add comments to methods that note which standard is the method from/for.
- Added some `[[nodiscard]]` attributes
- Since the logic of routing entries to observers is moved to native side, JS side of the code got much simplified
- If ever needed, `PerformanceObserver` can be created from native-side
Standards covered:
- https://www.w3.org/TR/performance-timeline
- https://www.w3.org/TR/event-timing/
- https://w3c.github.io/timing-entrytypes-registry
- https://w3c.github.io/user-timing/
Pull Request resolved: https://github.com/facebook/react-native/pull/45206
Test Plan:
I've tested this e2e on IGVR and in the RNTester playground for the performance APIs. Everything works as expected.
There are also new unit tests for this.
C++ test results: https://www.internalfb.com/intern/testinfra/testconsole/testrun/8725724513169247/
Reviewed By: rshest
Differential Revision: D63101520
Pulled By: rubennorte
fbshipit-source-id: 5970b5c14692ff33ffda44a9f09067f6a758bdbe