Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52370
This is just a patch bump of Gradle ahead of the 0.81 branch cut.
Changelog:
[Android] [Changed] - Bump Gradle to 8.14.2
Reviewed By: fabriziocucci
Differential Revision: D77601121
fbshipit-source-id: b2fdc8b022f2ab43997f412c77e0c924c01f1a5d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52369
Tiny fix where the system status bar elements were no longer visible under Android edge-to-edge.
Changelog: [Internal]
Reviewed By: cortinico
Differential Revision: D77653633
fbshipit-source-id: 1275a0de6665a6ef4599166fb205865cd581bb41
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52359
This is needed ahead of the 81 branch cut.
Changelog:
[Internal] - Bump all packages to 0.81.0-main
Reviewed By: huntie
Differential Revision: D77602196
fbshipit-source-id: 1b52a7d1577783d72aba8d20f98032f29ffcc7df
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52357
Changelog: [Internal]
Adds a hyper-minimal build script using `electron/packager` that produces custom binaries for the experimental React Native DevTools standalone shell. The main user-facing benefit of this is replacing the Electron name and icon with our own branding.
NOTE: `electron/packager` is designed to include the application code in the resulting binary. This is arguably overkill for us - the current launch model of `electron src/electron/index.js` is actually wholly sufficient for what we need - but I decided to go with the grain of the available tooling for simplicity.
Icon design courtesy of huntie. 🙏
Reviewed By: huntie
Differential Revision: D77591742
fbshipit-source-id: a968465df4f54fba54c874b6300788e151600ed7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52365
Adds type imports autofix support and pass `fb_internal` paths in react native deep imports eslint rule. The rule fixes imports with all matched types with static API mapping to prevent splits.
Changelog:
[Internal]
Reviewed By: huntie
Differential Revision: D77445445
fbshipit-source-id: cd5b75b4b3b53792117b8297352dddc4d63dbf70
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52345
changelog: [internal]
I would like to measure impact of D76597973 to get a better understanding of UIKit's rendering.
Reviewed By: yungsters
Differential Revision: D77542666
fbshipit-source-id: 4c2de4f36d2b374d83df934dd3a98d01b24f487f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52342
This diff deletes `public-api-test` for detecting changes in public API. It is replaced with public API snapshot validation (in D76340729) for better detection and understanding of changes that influence external interfaces.
Changelog:
[Internal]
Reviewed By: huntie
Differential Revision: D77531763
fbshipit-source-id: a8ef2b6f52fa6efb5b312598ea3e4746fc51e4ec
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52343
This diff commits our V2 JavaScript API snapshot for React Native.
This is a new format and workflow that replaces the previous `public-api-test` Jest test.
Please look at the file header for up-to-date instructions on updating the API snapshot.
Changelog: [Internal]
Reviewed By: huntie
Differential Revision: D77532617
fbshipit-source-id: d5faae815aa5071b0f472fcb02318b73772b11cf
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52268
Ships the feature flag introduced in https://github.com/facebook/react-native/pull/51719 to fix crahes that result from shadowed animated style values.
Changelog:
[General][Changed] - Animated now always flattens `props.style`, which fixes an error that results from `props.style` objects in which `AnimatedNode` instances are shadowed (i.e. flattened to not exist in the resulting `props.style` object).
Reviewed By: javache
Differential Revision: D77314904
fbshipit-source-id: b442d0256aee7a8925e28c7e87aee5e0a3f39425
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52354
These should no longer be needed as `ReactNativeFeatureFlags` handles the missing native module gracefully.
Changelog: [Internal]
Reviewed By: rubennorte
Differential Revision: D77365271
fbshipit-source-id: 92c6789b2175f24c79838118f681107a43c9ff0a
Summary:
X-link: https://github.com/facebook/yoga/pull/1823
Pull Request resolved: https://github.com/facebook/react-native/pull/52348
Fixes https://github.com/facebook/yoga/issues/1819
Yoga has a fast path when measuring a node, if it thinks it knows its dimensions ahead of time.
This path has some eroneous logic, to set both axis to owner size, if *either* will evaluate to zero, while having an `YGMeasureModeAtMost`/`FitContent` constraint. This means that if a node is given a zero width, and Yoga later measures with with `FitContent`, its height will become the maximum allowable height, even if it shouldn't be that large.
We can fix this, by only allowing if both axis are this fixed case, instead of just one.
This bug has existed for about a decade (going back to at least D3312496).
Changelog:
[General][Fixed] - Fix possible invalid measurements with width or height is zero pixels
Reviewed By: yungsters
Differential Revision: D76851589
fbshipit-source-id: 6f5a0e6beccc51f591726c9e83e9b90f3350ed0f
Summary:
Static code analysis reports several weak warnings, many of which seem to be leftovers after Kotlin migration. This PR addresses quite a few:
- [Accessor call that can be replaced with property access syntax](https://www.jetbrains.com/help/inspectopedia/UsePropertyAccessSyntax.html)
## Changelog:
[INTERNAL] - Kotlin: fix static code analysis weak warnings (6/n)
Pull Request resolved: https://github.com/facebook/react-native/pull/52338
Test Plan:
```sh
yarn android
yarn test-android
```
Reviewed By: NickGerleman
Differential Revision: D77504913
Pulled By: cortinico
fbshipit-source-id: 62661ba6adafb7893ce27811357020966d5ea4c1
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52346
This is bypassing the mutex, and potentially not thread-safe.
Changelog: [Internal]
Reviewed By: sammy-SC
Differential Revision: D77541041
fbshipit-source-id: f97415d066786864806836768dbce2d5e68487ef
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52341
The setter for `createNewDialog` is now wrong (after D76834213).
If the `createNewDialog` has been set to `true` by any other field, we should respect it and not set it to true/false regardless
(only considering the `isEdgeToEdgeFeatureFlagOn`) property.
This fixes it.
Changelog:
[Internal] [Changed] -
Reviewed By: javache
Differential Revision: D77539533
fbshipit-source-id: a1deaf1f1b856895304e8b73fa5d0c0367e677af
Summary:
There is an issue with keyboard navigation if some scroll view sets `snapToAlignment`. In this case, we are unable to find potential focus candidates if clipping is enabled since this prop will make it so that certain views in the hierarchy under the scroll view form a native view without any traits being set. The fix we have in place currently relies on `FormsStackingContext` to be set to discover potential candidates so it will break in this case. To fix this, we just return the entire ancestor list, since native will know how to deal with the cases that are not actual views, and in general has the official knowledge of what can be in the hierarchy or not.
Changelog: [Internal]
Reviewed By: NickGerleman
Differential Revision: D77467933
fbshipit-source-id: 35daaba06347c738cf7a85eef86adb7944a9cb26
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52308
Experimentation shows, that we very heavily rely on the global text cache for performance (not sure how much of this is invalidation, vs repeated text, or revisiting previous surfaces).
This adds a global LRU cache, of prepared layouts, given a specific AttributedString and constraints. This is similar to the existing cache, with the caveat, that we need to have separate entries for any display states, instead of just those that effect metrics.
I sized it at 200 elements for now, since an Android `Layout` is much heavier than a `Size` (in practice, each seem to weight 1-3KB (though this will be significantly reduced with future change to move from `SpannableStringBuilder` to `SpannableString` and also contributes to the global JNI ref table, but set this up to be customizable via flag, so we can experiment, on perf impact, vs memory.
Changelog: [Internal]
Reviewed By: rshest
Differential Revision: D77341994
fbshipit-source-id: b453250dc475f6a281a3260b876bf80f301dd5dd
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52323
Original commit changeset: b144ca6db6f7
Original Phabricator Diff: D77388413
Reverting the revert since it did not fix our javascript crash problem for v270 https://fburl.com/scuba/errorreporting_system_vros_javascripterrors/mtexik9e
Original diff stack: D76908041
Revert diff stack: D77388940
Changelog[Internal]:
Puting back the Kotlin Migration for ReactDelegate file
Reviewed By: cortinico
Differential Revision: D77448293
fbshipit-source-id: ed40836c3ecb4ca551b23cb64de2c34cfda0dea1
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52322
Original commit changeset: 4a366205ea9c
Original Phabricator Diff: D77388940
Reverting the revert since it did not fix our javascript crash problem for v270 https://fburl.com/scuba/errorreporting_system_vros_javascripterrors/mtexik9e
Original diff stack: D76908041
Revert diff stack: D77388940
Changelog[Internal]:
Puting back the Kotlin Migration for ReactDelegate file
Reviewed By: cortinico
Differential Revision: D77448238
fbshipit-source-id: f41faa19f6761b7ed644e804019f5ec4738326a7
Summary:
This follows https://github.com/facebook/react-native/pull/47554
Compared to the initial proposal, I had to remove the `edgeToEdgeEnabled` property from the root `gradle.properties` and put it in the app `gradle.properties` instead (explaining the `AgpConfiguratorUtils.kt` / `GenerateEntryPointTask.kt` / `ProjectUtils.kt` / `PropertyUtils.kt` changes)
This PR:
- Enable edge-to-edge for `MainActivity` (when `edgeToEdgeEnabled` is set to `true`)
- Disable `StatusBar` `backgroundColor` and `translucent` (when `edgeToEdgeEnabled` is set to `true`)
- Enforce `statusBarTranslucent` and `navigationBarTranslucent` on `Modal` when edge-to-edge is enabled
- Add an `isEdgeToEdge` constant to `DeviceInfoModule` for [`react-native-is-edge-to-edge`](https://github.com/zoontek/react-native-edge-to-edge/tree/main/react-native-is-edge-to-edge) detection
## 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] [Added] - Add edge-to-edge opt-in support
Pull Request resolved: https://github.com/facebook/react-native/pull/52088
Test Plan:
- Update `enableEdgeToEdge` value in `packages/rn-tester/android/app/gradle.properties`
- Recompile
https://github.com/user-attachments/assets/4c6beb98-fa88-427c-b62d-a42ffe5330f0
Rollback Plan:
Reviewed By: cortinico
Differential Revision: D76834213
Pulled By: alanleedev
fbshipit-source-id: c39b2cff1a5e94e31306e3b35651aa2de83d2fe6
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52309
This is another class going from Java to Kotlin.
Thish should have no breaking changes, but I'll keep an eye to see if this is disruptive for users in the ecosystem.
I also haven't removed any of the Deprecated method, which can be cleaned up afterwards.
Changelog:
[Android] [Changed] - Migrate ThemedReactContext to Kotlin
Reviewed By: javache
Differential Revision: D77374236
fbshipit-source-id: d1787b21897b01c45bbf841fdda00972e0be58db
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52296
## Changelog:
[Internal] [Changed] - Fewer calls to direct manipulation callback
`NativeAnimatedNodesManager::onRender` is supposed to run each frame for c++ animation, from the callstack sample trace, the vast majority of time is spent on `updateNodes` (run update on all AnimatedNodes) and `commitProps` (where either Fabric ShadowTree commit or direct manipulation is called). Change in this PR is supposed to reduce time spent in `commitProps`
{F1979788964}
Reviewed By: sammy-SC
Differential Revision: D77380842
fbshipit-source-id: 2f25ca1fba4171a7b3e485298738379d0daff3ad
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52306
The RCTPushNotificationManager is deprecated and not part of the prebuilds as it is optional.
We mistakenly added it to the umbrella header and nightlies do not work with prebuilds.
This change removes the header ad should fix the build.
## Changelog:
[Internal] -
Reviewed By: philIip
Differential Revision: D77395754
fbshipit-source-id: 66371650dc56f5be16a00319d9e4a1078a7b68bd
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52276
The line metrics reported do not process the Spannable, meaning their layout results may disagree with those used for measurement and display.
Changelog:
[Android][Fixed] - Fix onTextLayout metrics not incorporating ReactTextViewManagerCallback
Reviewed By: lenaic
Differential Revision: D77261839
fbshipit-source-id: 87bdc86ce16a2ae9fa69532c5721c19567a53595
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52294
changelog: [internal]
Views that are hidden provide couple perf benefits:
- The layer is skipped during hit-testing, so the view no longer receives touches.
- Compositing work for the layer is skipped, so nothing is uploaded to the GPU for that view.
Note, VirtualView still occupies space in memory and because this is infinite list and its numbers will grow unbounded.
In this diff, hidden = YES is only set when VirtualView does not participate in accessibility features.
Reviewed By: yungsters
Differential Revision: D76597973
fbshipit-source-id: 10eb36fccabba9e37cc6322ed5969b8502193a5f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52295
The current setup for several of our podspecs abuses the `**` globbing mechanism, forcing us to specify some excluded folders.
By excplicitly mention the folders that we want to use on iOS, we can avoid the usage of the `exclude_files` property.
This should make the setup more reliable and it will also avoid to leak to OSS the presence of some folders we only use internally like `platform/macos` and `platform/windows`
## Changelog:
[Internal] -
Reviewed By: huntie
Differential Revision: D77381512
fbshipit-source-id: 4cb9118bf9f0ecd253d7d871341f733564d84c83
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52293
# Changelog:
[Internal] -
Adds a helper method to the `IMountingManager` API in order to get the platform specific image loader implementation, if available.
Reviewed By: christophpurrer
Differential Revision: D77379053
fbshipit-source-id: b7595d78c83e9270ec1818daf2d0f1d342661e52
Summary:
To make sure we are exposing the same public API to swift as without prebuilt, this commit changes the follow:
- ModuleMap / Umbrella file is generated from template, not dynamically to align with non-prebuilt (cocoapods). This is temporary, we are already working toward a solution to generate them dynamically.
- Headers are extracted by reading from podspec files and expanding their globs. This is now easy since we can use the podspec_sources function to look for file globs.
## Changelog:
[Internal] - refactored header/umbrella/modulemap generation for prebuild
Pull Request resolved: https://github.com/facebook/react-native/pull/52286
Test Plan:
- Run RN-tester with/without prebuilts
- Create new RN app based on nightly, build with/without prebuiltsTo make sure we expose all the swift features that we should, we expose and declare a variable from React_RCTAppDelegate
Rollback Plan:
Reviewed By: cortinico
Differential Revision: D77368255
Pulled By: cipolleschi
fbshipit-source-id: 88e2c9d1622753895c8667a9b5aeae4a0d332cc4
Summary:
# Changelog: [Internal]
Adds support for experimental non-standardized `console.timeStamp` API for capturing performance entries on a timeline. The main idea of the API is to be highly performant. More details in the corresponding RCP [1].
NOTE: Because of the `jsinspector-modern` stack gating logic, this won't be installed in production builds. `console.timeStamp` will be polyfilled with a stub - D76987507.
Reviewed By: rubennorte
Differential Revision: D77374707
fbshipit-source-id: cb66b9fda06168f4b13af764afe95a63a0a8d5a0
Summary:
Changelog: [Internal]
A minimal tweak to a legacy code path for React DevTools in React Native (**NOT** Fusebox!) that enables it to work / not crash when encountering an IPv6 dev server address. See doc comment for more.
Reviewed By: hoxyq
Differential Revision: D77150288
fbshipit-source-id: c11c742aad7b83861a1242dd13c5ed2753fbdf29
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52091
# Changelog: [Internal]
Adds support for experimental non-standardized `console.timeStamp` API for capturing performance entries on a timeline. The main idea of the API is to be highly performant. More details in the corresponding RCP [1].
NOTE: Because of the `jsinspector-modern` stack gating logic, this won't be installed in production builds. `console.timeStamp` will be polyfilled with a stub - D76987507.
Reviewed By: rubennorte
Differential Revision: D76284119
fbshipit-source-id: c87c6645fe32f56d84f5915ff57865cfd9723a47
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52168
# Changelog: [Internal]
The main reason for the stub is to make sure this method is always installed. The actual implementation will be part of the `jsinspector-modern` stack, which is fully initialized in production builds.
Once there is a gurantee that RuntimeTarget globals are always installed in any environments, we can remove polyfills altogether.
Reviewed By: rubennorte, GijsWeterings
Differential Revision: D76987507
fbshipit-source-id: 2602af28f9e4359cf58dfafdf84802c0bf92372d