Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54292
Sets up a feature flag to experiment with using `useInsertionEffect` in `Pressability`, instead of `useEffect.
Using `useInsertionEffect` enables `Pressability` to behave more predictability in component trees with `<Activity mode="hidden">` because the events are scheduled more similarly to platform controls (e.g. focus and blur events will still fire even when "hidden").
Changelog:
[Internal]
Reviewed By: javache
Differential Revision: D85612742
fbshipit-source-id: c2faab25bfcf7f964521e680eb3c4132c1087ef4
Summary:
An earlier change (0.79 and onwards, I believe?) runs the iOS artifacts code generator script in Xcode as well as from Cocoapods. This duplication runs it twice, but the second step isn't able to load the new `autolinking.json` correctly; See: https://github.com/facebook/react-native/pull/53503
This PR "double" fixes this by:
- simply passing the "real" output directory to the artifacts generator in (`script_phases.sh`) where it's called by Xcode, rather than a temporary directory
- preferring `$RCT_SCRIPT_OUTPUT_DIR` if it's set as an environment variable in the artifacts generator (which it is by `script_phases.sh`)
While this is technically redundant, future changes here make this feel like a safer option, since both conventions overlap in these two places, and the double fix may prevent a regression here in the shortterm and convey what this path is supposed to be in both places.
## Changelog:
[IOS] [FIXED] - Fix autolinking-generated react-native-config output not being used in ReactCodegen script phase due to temp output directory
Pull Request resolved: https://github.com/facebook/react-native/pull/54066
Test Plan:
- Prefer `$RCT_SCRIPT_OUTPUT_DIR` env var for finding `build/generated/autolinking/autolinking.json`
- Always use real `$RCT_SCRIPT_OUTPUT_DIR` as output in `withCodegenDiscovery` in `react_native_pods_utils/script_phases.sh` (which is called by Xcode rather than Cocoapods to invoke the artifacts generator) since the temporary output directory isn't necessary
Reviewed By: javache
Differential Revision: D85673625
Pulled By: cipolleschi
fbshipit-source-id: 9d297fb0ee24f52a0bb7c5a8f41bf770bf63b18f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54303
React 19.2.0 introduces the `useEffectEvent`, which are functions that can be used inside `useEffect` but that should not be listed in the `useEffect` dependencies.
Without this bump, eslint will still tell the user to add the function declared with `useEffectEvent` into the dependency array of a useEffect.
## Changelog:
[General][Changed] - Bump eslint-plugin-react-hooks to 7.0.1
Reviewed By: huntie
Differential Revision: D85658780
fbshipit-source-id: 75860f06a2875b53de61f4f99572277d9d04839f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54290
A few places where we fall through intentionally are implicit. We can make those explicit with `NS_FALLTHROUGH`. Many places, however, are bugs from failing to add a `break` :eek: -- fix those places too.
These are all found via `-Wimplicit-fallthrough`... we will seek to make this an error by default (vs only in `CompilerWarningLevel.MEDIUM` or higher).
## Changelog:
[iOS] [Fixed] - Add missing `break;` to `-[RCTViewManager pointerEvents]`
Reviewed By: philIip
Differential Revision: D85583441
fbshipit-source-id: e8959b27a2e23ccfc6581286257d5d41b18c5630
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54291
We are computing a weighted distance by squaring the major and minor axis distance. For particularly long lists, this means that items that are quite far away have a tendency to overflow the int value when squared, producing a negative number that becomes the smallest weighted distance.
Switching the computed value to double should mitigate the issue, since MAX_DOUBLE >>> MAX_INT ^ 2.
## Changelog
[Android][Fixed] - Resolves an int overflow in findNextFocusableElement
Reviewed By: martinbooth
Differential Revision: D85598005
fbshipit-source-id: 2a5de4e10c21f3d42ae5872d311e714b3f92efad
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54235
Changelog: [Internal]
Reverting `experimental_prefetchResources` back to `experimental_prefetchResource` for simplicity of use
Reviewed By: lenaic, mdvacca
Differential Revision: D85261208
fbshipit-source-id: 1c7705187346a2422dddb5c106fd372a8ee49283
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54244
# Changelog: [Internal]
Refactors the logic a bit.
We will use `Runtime` domain as a signal for installation of `console.createTask()` implementation.
Reviewed By: huntie
Differential Revision: D85274860
fbshipit-source-id: 80c91a8a83ba2b95b70aa38a72529bbd20275c0d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54261
# Changelog: [Internal]
These are actually unused and we've changed the approach - CDP agents do not control tracing status.
Reviewed By: huntie
Differential Revision: D85436029
fbshipit-source-id: faa79bbda92c0e0c55f26389bfe0c6efcf9e76c8
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54252
## Changelog:
[Internal] [Added] - pass down isAsync arg to start/stopOnRenderCallback to indicate thread
make it more explicit where start/stopOnRenderCallback is invoked so we can handle it on each platform in a more thread safe way
Reviewed By: lenaic
Differential Revision: D85365058
fbshipit-source-id: 5f0ee1343547fe3466fcd23282e0f27e129a2e7d
Summary:
Fixes https://github.com/facebook/react-native/issues/54168
In React Native 0.82.0, text on Android does not scale down when the system font scale is set to less than 1.0 (e.g., 85%). This regression was introduced when `PixelUtil.toPixelFromSP()` was changed to use `DisplayMetricsHolder.getScreenDisplayMetrics()` instead of `getWindowDisplayMetrics()` in commit [1ad2ec09](https://github.com/facebook/react-native/commit/1ad2ec099ac0ccc7402c37783004fbad3dbe0484).
The issue occurs because:
1. **windowDisplayMetrics** is obtained from `context.resources.displayMetrics` and includes the system font scale from `Configuration`
2. **screenDisplayMetrics** is populated by `Display.getRealMetrics()`, which returns physical display metrics **without** the system font scale setting ([Reference](https://developer.android.com/reference/android/view/Display#getRealMetrics(android.util.DisplayMetrics)))
When `getRealMetrics()` is called, it overwrites the `scaledDensity` value (which is `density * fontScale`), effectively resetting it to just `density` and losing the user's font scale preference.
## 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] [FIXED] - Fix text not scaling down when system fontScale < 1.0
Pull Request resolved: https://github.com/facebook/react-native/pull/54238
Test Plan:
https://github.com/kdwkr/rn-0.82.0-android-layout-scale
Tested with this reproducer
---
Reviewed By: javache
Differential Revision: D85350263
Pulled By: alanleedev
fbshipit-source-id: ff646cf0405f689ff2a9166a1474fdb8b1b85fd6
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54264
Implementing a fantom test covering the correct update of runtime shadow node references when using passChildrenWhenCloningPersistedNodes combined with syncOnCommit.
Changelog: [Internal]
Reviewed By: sbuggay
Differential Revision: D85437783
fbshipit-source-id: adad786e293c1acfe13e3a07ffb210dec0c17292
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54263
When enabling `passChildrenWhenCloningPersistedNodes` and `updateRuntimeShadowNodeReferencesOnCommit`, updates inserting shadow nodes between existing child shadow nodes would result in shadow node reference updates being skipped.
Since `passChildrenWhenCloningPersistedNodes` requires that the react fiber references the mounted shadow node instance at all times, this would result in invalid react renders, bringing back old revisions holding invalid layout metrics.
This diff updates the reference update applied on commit, submitting the updated shadow node references for added shadow nodes. Inserted shadow nodes between existing child shadow nodes will move the previously mounted shadow nodes to the end of the child array. This leads to the `updateMountedFlag` pass to consider these as "added" shadow nodes.
Changelog: [Internal]
Reviewed By: sbuggay
Differential Revision: D85406405
fbshipit-source-id: 7bd9a492fc67549970183c0932cfd7c8b7e61312
Summary:
This PR adds support for background size, position and repeat styles. It follows the [CSS](https://www.w3.org/TR/css-backgrounds-3/#backgrounds) spec. Currently we default to `background-origin: padding-box` and `background-clip : border-box` to match the web's behavior. We can introduce these styles later. I have split the PR intro three parts for review. This PR includes JS parsing and style propagation to native changes. I wanted to introduce one style at a time, but CSS spec is such that size, position and repeat are intertwined.
## Changelog:
[GENERAL][ADDED] - Background size, position and repeat styles.
<!-- 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
Pull Request resolved: https://github.com/facebook/react-native/pull/52284
Test Plan:
Merge the [iOS](https://github.com/facebook/react-native/pull/52283) and [android](https://github.com/facebook/react-native/pull/52282) PR into this, this PR includes `BackgroundImageExample`. I have also added testcases for parsing syntax in JS.
https://github.com/user-attachments/assets/b7192fdf-52ba-4eb0-a1be-d47c72d87e92
Reviewed By: joevilches
Differential Revision: D82973282
Pulled By: jorge-cab
fbshipit-source-id: a94e33962c6708be963e1cac049da50d4764da64
Summary:
This PR adds support for background size, position and repeat styles. It follows the [CSS](https://www.w3.org/TR/css-backgrounds-3/#backgrounds) spec. Currently we default to `background-origin: padding-box` and `background-clip : border-box` to match the web's behavior. We can introduce these styles later. I have split the PR intro three parts for review. This PR includes android only changes. I wanted to introduce one style at a time, but CSS spec is such that size, position and repeat are intertwined.
## Changelog:
[ANDROID][ADDED] - Background size, position and repeat styles.
<!-- 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
Pull Request resolved: https://github.com/facebook/react-native/pull/52282
Test Plan:
Merge the [JS](https://github.com/facebook/react-native/pull/52284) PR, rebuild android app and test RNTester app, it includes `BackgroundImageExample`. I have also added testcases for parsing syntax in JS.
https://github.com/user-attachments/assets/b7192fdf-52ba-4eb0-a1be-d47c72d87e92
Reviewed By: joevilches
Differential Revision: D82993837
Pulled By: jorge-cab
fbshipit-source-id: 52859e51d2c4bab27823d3eb913993fdfbb4c04d
Summary:
This PR adds support for background size, position and repeat styles. It follows the [CSS](https://www.w3.org/TR/css-backgrounds-3/#backgrounds) spec. Currently we default to `background-origin: padding-box` and `background-clip : border-box` to match the web's behavior. We can introduce these styles later. I have split the PR intro three parts for review. This PR includes iOS only changes. I wanted to introduce one style at a time, but CSS spec is such that size, position and repeat are intertwined.
## Changelog:
[IOS][ADDED] - Background size, position and repeat styles.
<!-- 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
Pull Request resolved: https://github.com/facebook/react-native/pull/52283
Test Plan:
Merge the [JS](https://github.com/facebook/react-native/pull/52284) PR, run `pod install` and test RNTester example, it includes `BackgroundImageExample`. I have also added testcases for syntax parsing in JS.
https://github.com/user-attachments/assets/b7192fdf-52ba-4eb0-a1be-d47c72d87e92
Reviewed By: joevilches
Differential Revision: D82993888
Pulled By: jorge-cab
fbshipit-source-id: af545acaf4b9d116b5905f912c494d2e77324380
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54257
When moving Hermes to the Hermes repo, we mistakenly updated the nightly and the publish_release job to depend on an non-existing job
## Changelog:
[Internal] - Fix CI jobs for nightlies and releases
Reviewed By: huntie
Differential Revision: D85422837
fbshipit-source-id: 18d4ef73c80032b55f09f27e4b58b399f0a148c9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54234
Changelog: [Internal]
This feature does not work reliably and caused crashes during experimentation
Reviewed By: lenaic
Differential Revision: D85259390
fbshipit-source-id: 5b3d48e411f1e8fae2ee8c64166b53a28b1211d1
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54229
Changelog: [General][Added] Added eslint rule to warn when a non-error is being thrown from a function or rejected for a promise.
Reviewed By: huntie
Differential Revision: D85237916
fbshipit-source-id: e0e4fbc6b4620a19be1959d3953856c7e44ad4e0
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54241
Changelog: [Internal]
Added Hermes version besides information that the app is running using Hermes. This information will be helpful now that Hermes is being published independently from React Native and users are able to choose between two versions at a time (current and V1).
Reviewed By: cipolleschi
Differential Revision: D85333735
fbshipit-source-id: b07b75be3e3d4b5424d4c2185916bac507fc5eca
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54226https://github.com/facebook/react-native/pull/54226
Joysticks, mouse wheels, and trackpads can issue an `ACTION_SCROLL` event when performing scroll. However, the `ACTION_SCROLL` generic motion event does not run the post touch runnable and paging/snap alignment is not honored when these events are received. To fix this, both ScrollView implementations should call `handlePostTouchScrolling` with a 0 velocity, ensuring that momentum events are sent, fabric scroll state is updated, and `flingAndSnap` is properly called to align to a page.
This change adds some checks to queue a runnable that calls `handlePostTouchScrolling` after no more `ACTION_SCROLL` events are received in the same 20ms delay it uses to determine a stable frame. The end result is that snap alignments are correctly honored
Changelog: [Android][Fixed] - Controller-driven scroll events now honor paging/snap alignment
Reviewed By: javache
Differential Revision: D85172309
fbshipit-source-id: 5818777b3c371b3da4aa925a8c840e0da89bf6a4
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54236
Changelog[Internal] -
Fix faulty changes made to Interval Tree in previous diff.
The issue was in the right-right rotation case of the internal Interval Tree implementation:
```
// Right heavy
if (bf < -1) {
if (balanceFactor(node.right) > 0) {
node.right =
rotateRight(...)
```
This diff also includes a minor update to logic in IntervalTree's `delete` operation. There was previously a missing `balance` operation.
Reviewed By: lunaleaps
Differential Revision: D85263661
fbshipit-source-id: 8636984161a8668d74973b6aebad9842d4d7f34f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54142
## Changelog:
[Internal] [Added] - Allow passing down frameRateListenerCallback in cxx animated
exposing `frameRateListenerCallback` to add instrumentation at animation frame and stop
we're deferring the actual implementation of frame rate listening/logging to app/platform side
Reviewed By: sammy-SC
Differential Revision: D84510183
fbshipit-source-id: d8835542e8e50c5018032c951a510fec27b5a4d5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54211
## Changelog:
[Internal] [Added] - always invoke onRender via UIManagerNativeAnimatedDelegate
Previously only android invokes `onRender` via UIManagerNativeAnimatedDelegate::runAnimationFrame()
consolidating so it's easier for debugging, also in cases where we want to add extra work per frame (e.g. add performance logging) in AnimatedNodesManagerProvider
Reviewed By: sammy-SC
Differential Revision: D85071075
fbshipit-source-id: 770df523de506c8442d063c417229e36bcf5dd31
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54232
We're not syncing the legacy renderers, which means the React package will continue to move forward while these stay frozen. That means we need to remove the version compatibility checks between react and the legacy ReactNativeRenderers.
Changelog:
[Internal]
Reviewed By: cortinico, cipolleschi
Differential Revision: D85248891
fbshipit-source-id: 19e0812c59f69301e2666e6272c10ac56ecbde1f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53837
Changelog: [Internal]
Replaces usage of Hermes built inside the React Native repository with the release published from the Hermes repo.
Reviewed By: cipolleschi
Differential Revision: D82721725
fbshipit-source-id: 357d5e2b914675ec6e60f810c382a945aa461732
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53985
Changelog: [Internal]
Updates the release scripts to set the Hermes version independently from React Native.
Reviewed By: cipolleschi
Differential Revision: D82438054
fbshipit-source-id: 154c19d1d0d16fd5879ad663428d803ceadc5a1f
Summary:
This is an automatically generated fixup patch to bring fbsource back into sync with
facebook/react's builds/facebook-fbsource branch on GitHub. Land this patch as soon as possible, as the difference
reflected on here is already on GitHub and future changes may depend on these
changes!
<< DO NOT EDIT BELOW THIS LINE >>
diff-train-skip-merge
Generated by: https://www.internalfb.com/intern/sandcastle/job/9007201517475550/
GitHub Repo: facebook/react
# Changelog: [Internal]
Reviewed By: hoxyq
Differential Revision: D84722100
fbshipit-source-id: cbc6f4cdec01124b00ca011b1667c4f7bdb98a37