Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53530
Deprecate the `StyleSheet.absoluteFillObject` API in favour of `StyleSheet.absoluteFill` (functionally identical).
Secondly, refine the type definitions in our source code (and Strict TS API) from `any` → `AbsoluteFillStyle` — resolves https://github.com/facebook/react-native/issues/53470.
This will be followed with updates to our docs.
Changelog:
[General][Deprecated] - `StyleSheet.absoluteFillObject` is deprecated in favor of `StyleSheet.absoluteFill` (equivalent).
Reviewed By: yungsters
Differential Revision: D81327548
fbshipit-source-id: 2bcf14694dc1bd959419629ce717760086b80ec3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53454
Let's deprecate all the classes that aren't used by interop or the new architecture.
Changelog: [General][Deprecated] - Deprecate all the c++ classes not used by interop, or the new architecture.
Reviewed By: arushikesarwani94
Differential Revision: D80575767
fbshipit-source-id: 1d485300cbe24260d77bbeac75fe5b839121b6c8
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53521
Make `jsi::Object` constructor explicit, so its creation is explicit and
intentional. This prevents any sad foot-gun of constructing an Object
implicitly from a Runtime, which is certainly not a JS object.
Changelog: [Internal]
Reviewed By: avp
Differential Revision: D81274439
fbshipit-source-id: 5a9d9907f9deff7625dcff9c1072eb135ab7840e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53523
update `DisplayMetricsHolder.getWindowDisplayMetrics()` to `getScreenDisplayMetrics()`.
Where window width and height is not needed, prefer to use `screenDisplayMetrics` as with upcoming diff `windowDisplayMetrics` initialization only happen using UiContext and have potential to cause more issues if used unnecessarily.
Changelog: [Internal] Update `DisplayMetricsHolder.getWindowDisplayMetrics()` to use `.getScreenDisplayMetrics()`
---
Reviewed By: mlord93
Differential Revision: D81270196
fbshipit-source-id: 5b392d67449ddceebbc0fe81db15fa61ae44108f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53397
This is a runtime behaviour fix and an API change to `Appearance.setColorScheme`, motivated by a user report where providing `'unspecified'` (valid) to this function would trigger an incorrect invariant throw. Furthermore, there is already a [first party use](https://github.com/facebook/react-native/blob/aec35b896053d9372ccdaf67c939b2eb216d3455/packages/react-native/Libraries/Utilities/Appearance.js#L101) where we call `Appearance.setColorScheme('unspecified')`.
**Changes**
- `Appearance.d.ts` (current public API, manual types): Fix `ColorSchemeName` type to include `'unspecified'` value, and narrow to remove nullability — aligning with existing Flow source for this type in `NativeAppearance`.
- `Appearance.js` (implementation): Fix the invariant throw by **removing it**, and instead narrowing the input type to non-nullable. Redundant work in `getState` and `getColorScheme` is removed.
Changelog: [General][Breaking] `Appearance.setColorScheme` no longer accepts a nullable value
Reviewed By: andrewdacenko
Differential Revision: D80705652
fbshipit-source-id: cf221a33447606653050d471ca2d0347ab30db81
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53514
Changelog: [Internal]
Add a way to ignore unusually early timestamps, in our example those are artificial marks to create web tracks in correct order, coming from console.timeStamp via React. These markers are ignore in RNDT on Chrome, but not excluded in perfetto.
Reviewed By: hoxyq
Differential Revision: D81246527
fbshipit-source-id: d3342036698d1607c98e5bb4273ea1a3716fcb03
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53492
Changelog: [Internal]
Goal is to simplify code and to lower the JNI payload
- Send values as `int` instead of `Double` if they are converted to `int` on the Java side
- We only have 2 optional values - all others are mandatory
Reviewed By: lenaic
Differential Revision: D81202196
fbshipit-source-id: df8b7d9e6a98e7c919de9be6a277876684f0383c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53328
Disables the legacy performance overlay toggle from the Android DevMenu to make way for V2.
Changelog: [Internal]
Reviewed By: cortinico
Differential Revision: D79791703
fbshipit-source-id: c99ac95e2907ce978ef0c2711ad304c9a3f278ec
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53334
Adds background performance tracing options to the DevMenu based on the current background tracing state. Analyzing a trace will automatically open dev tools, navigate to the performance tab, and show the last 20 seconds of recorded performance data.
Changelog: [Internal]
Reviewed By: javache
Differential Revision: D79714164
fbshipit-source-id: 72ad4be4604c5f4e304b49877b2699be36562655
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53508
Simplify the expressions for checking a type of a container by always returning instead of falling through and returning.
Changelog: [Internal]
Reviewed By: sammy-SC
Differential Revision: D81230049
fbshipit-source-id: 02fd827462c9acf05a83bf88ed6bd0e6db55ebc8
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53507
We need this to be an unsigned value everywhere but all the API's and interfaces described this a signed number. While this doesn't make a difference in practice, it's better to explicit.
Changelog: [Internal]
Reviewed By: sammy-SC
Differential Revision: D81230050
fbshipit-source-id: 1eb914a79b9b94654cfa54c20a81ce689f79dcb9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53490
Changelog: [Internal]
Sending individual image prefetch request on Android over JNI is causing measurable performance regression. The idea here is batch all image prefetch request for a given shadowNodeTree and then flush it all at once - **DONE** in the next change.
Another optimization we should consider is to execute the batch on `n imagePrefetchRequest` off the JavaScript thread `mqt_v_js` and instead on e.g. the UiThread (on which currently Android Image UI initiates image resource downloads)
Reviewed By: lenaic
Differential Revision: D81186916
fbshipit-source-id: f8b24e70f2ded237be96bdb973b72acbbb8b1c20
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52910
For `get/has/setProperty`, we should also be able to take in a generic
JS Value as the property key. This change adds the Value overload for
these APIs.
The default implementation will use `Reflect.get`, `Reflect.has`, and
`Reflect.set`.
Changelog: [Internal]
Reviewed By: lavenzg
Differential Revision: D79120823
fbshipit-source-id: 7e2e5ff1ca93397c549e7dd922797fe77aa97940
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53513
D62853299 introduced the `defaultValue` argument to feature flag override functions, with the intent of enabling override functions to do something like this:
```
myFeatureFlag: (defaultValueForFlag) => someCondition ? value : defaultValueForFlag
```
However, there are no current use cases for this. This particular use case can also be solved by expanding support for override functions to return `null` or `undefined` which falls back to using the default value.
Furthermore, the type system has a difficult time representing the constraints when there are non-boolean JavaScript-only overrides (which was introduced recently).
This diff removes the argument and adds support for override functions to return `null` or `undefined`.
Changelog:
[Internal]
Reviewed By: lunaleaps
Differential Revision: D81163557
fbshipit-source-id: 38876c83d51d857dbea889928248410041c5d6d7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53519
Changelog: [Internal] - Remove empty checks on the target rects and early return for empty ScrollView rects -- aligning the implementation with v1 of VirtualView
Reviewed By: yungsters
Differential Revision: D81247994
fbshipit-source-id: 4fda9f90e18d736944fe4236a4b79f0681e1564c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53518
Changelog: [Internal] - Listen to `onSizeChanged` for VirtualViewExperimental and VirtualViewContainer (ScrollView) and add more debug logs and format the virtualViewID consistently for easier grepping
Reviewed By: yungsters
Differential Revision: D81184013
fbshipit-source-id: a4314ab0f94a87e97a7d9b74696726803525c698
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53512
Noticed a lint for this so decided to change
Changelog: [Internal]
Reviewed By: christophpurrer
Differential Revision: D81159958
fbshipit-source-id: c0b4b73055de26ea089e3cdb4edb7f073bd751d5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53502
Follows D81138169.
- This simplifies the total changes needed on implementing DevSupport classes.
- Widen outer API to accept any `String` panel name (futureproofing).
- Also add a complete set of supported values `DebuggerFrontendPanelName`.
Changelog:
[Android][Changed] - DevSupport `openDebugger()` methods now accept a `panel: String?` param. Frameworks directly implementing `DevSupportManager` will need to adjust call signatures.
Reviewed By: hoxyq, cortinico
Differential Revision: D81227870
fbshipit-source-id: 57b73703557971332e05076fb4ccac218079652a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53455
All these components have fabric replacements.
Let's deprecate them, so we can remove them eventually.
Changelog: [iOS][Deprecated] Deprecate all the legacy core components that have replacement implementations in fabric.
Reviewed By: cipolleschi
Differential Revision: D80973216
fbshipit-source-id: 2b20da0800f099244b4813abf9d8af175627a445
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53453
Let's deprecate all the classes that aren't used by interop, or the new architecture.
Changelog: [iOS][Deprecated] Deprecate all the objc classes not used by interop, or the new architecture.
Reviewed By: javache
Differential Revision: D80575768
fbshipit-source-id: ad12e4b639c21d608636eedbc7cd502fa9d7f461
Summary:
Changelog: [Internal]
Pull Request resolved: https://github.com/facebook/react-native/pull/53489
For error
```
Identity-sensitive operation on an instance of value type 'Int?' may cause unexpected behavior or errors.
```
due to https://youtrack.jetbrains.com/issue/KT-78352/
Reviewed By: cortinico
Differential Revision: D81174630
fbshipit-source-id: c68e3a348e75b7bceb183b77a45b2729f1e70bcd
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53510
Changelog: [Internal]
Electron imposes a [strange undocumented limitation](https://github.com/electron/electron/pull/13039) on the format of command-line arguments, which for some reason only affects Windows. Basically, the command line is truncated after the first argument that looks like a URL.
Electron's recommendation for avoiding this is to prefix the argument list with `--`, but I prefer switching to a different arg format (`--x=y` instead of `--x y`) that will prevent us from ever running into this issue.
NOTE: I will follow up with a diff to harden arg parsing in our Electron code so that it only accepts the `--x=y` format.
Reviewed By: huntie
Differential Revision: D81237713
fbshipit-source-id: a255dc63b6486b96d9f7ccf780d1b09bc4ddf7e0
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53504
Casting directly from double to int loses precision. Instead, match the (accidental) behaviour of the folly version, which always access the value as an int64_t first.
```
double value = 4294967040
(int)value = 2147483647 (overflow)
(int)(int64_t)value = -256 (signed version of 4294967040)
```
Changelog: [General][Fixed] Casting rawValue to int was incorrectly truncating
Reviewed By: zeyap, sammy-SC
Differential Revision: D81228983
fbshipit-source-id: d68d4e63d7c7bc9a9226592756a1e53666d58978
Summary:
When aligning Jest versions recently I have spotted that some old Jest (v24) dependencies are still fetched. After looking at lock the traces lead to outdated `jest-junit` dependency.
This PR updates the `jest-junit` package to get rid of those old Jest dependencies. I have went through [the release changelogs](https://github.com/jest-community/jest-junit/releases) to make sure there are no breaking changes with the current setup.
## Changelog:
[INTERNAL][CHANGED] - upgrade `jest-junit` to remove old Jest dependencies from the workspace
Pull Request resolved: https://github.com/facebook/react-native/pull/53444
Test Plan: I have made sure that `test-ci` tests are passing, and correct `junit.xml` is generated locally after the run.
Reviewed By: cortinico, christophpurrer
Differential Revision: D80904710
Pulled By: robhogan
fbshipit-source-id: 9b4c65e2fd370bbdb429fb628f79f94698e9c4c2
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52672
This was used internally to work around some limitations of the bridge lifecycle. Given that we now have C++ TurboModules which are much more versatile, let's remove unnecessary concepts externally, as we move towards deprecating legacy C++ modules entirely.
Changelog: [General][Breaking] Removed CxxSharedModuleWrapper
Reviewed By: rshest
Differential Revision: D78484221
fbshipit-source-id: 95ed46b597dac55d823b70abe196264ce5b326ab
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53488
Creates a new feature flag to experiment with `Activity` in `VirtualView`.
The feature flag enables the following treatments:
- `no-activity` is the same as what we currently do — no `Activity` and we render `null` for hidden elements.
- `activity-without-mode` wraps the children in `Activity` but does not set `mode` and still renders `null` for hidden elements.
- `activity-with-hidden-mode` wraps the children in `Activity` and sets `mode="hidden"` and continues providing `children` (not `null`) for hidden elements.
Changelog:
[Internal]
Reviewed By: rickhanlonii
Differential Revision: D81149561
fbshipit-source-id: ea2c319139962de30836d80a2492d8147cbe82ba
Summary:
On iOS, if the default locale is not supported in the app, it will fall back to the first available locale to decide if RTL layout should be enabled or not; however on Android, we use the default locale. So if the first locale is a RTL locale and not supported by the app on Android, the app will fall back to the first available locale which might not be RTL, but the layout would be decided as RTL according to the default locale.
## Changelog:
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
[ANDROID] [FIXED] - use the first available locale instead of the default one to decide `isDevicePreferredLanguageRTL`
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[ANDROID] [FIXED] - use the first available locale instead of the default one to decide `isDevicePreferredLanguageRTL`
Pull Request resolved: https://github.com/facebook/react-native/pull/53417
Test Plan:
I set my phone's locale to this order: Hebrew, English and enabled RTL layout:
```
import { I18nManager } from 'react-native';
I18nManager.allowRTL(true);
I18nManager.swapLeftAndRightInRTL(true);
```
Prior to my PR, the app would use RTL layout with English on Android which doesn't make much sense (iOS is LTR + English). With my PR Android app will behave exactly the same as the iOS app.
Reviewed By: rshest
Differential Revision: D80821903
Pulled By: zeyap
fbshipit-source-id: c1bd9b45341c344833a8fdfacc2c786ee8437415
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53480
Changelog: [Internal]
Improves the way `--version` and the User-Agent header work in `debugger-shell`.
* The same app name and version string format will be used across the `dev` and `prebuilt` flavours. Previously, `dev` would report itself as being `Electron v37.2.6` while `prebuilt` would report `react-native/debugger-shell v0.82.0-main`.
* `prebuilt` now also reports the original Meta-internal commit hash as a suffix `-rFBS..........` added to the semver string taken from `package.json`, while `dev` will have a `-dev` suffix in the same place.
* We do **not** modify the version in `package.json` during the build, nor do we pass the commit hash to `electron/packager`, because this would impose inconvenient platform-specific restrictions on the version string's format.
Reviewed By: huntie
Differential Revision: D81120181
fbshipit-source-id: e730dd35da78dfbb8de326f9a3ab76b747fdb0b3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53481
Small fix to this RNTester example to clean up hanging `setInterval` side effect making repeat network fetches.
Changelog: [Internal]
Reviewed By: hoxyq
Differential Revision: D81127809
fbshipit-source-id: 6036dd254888eb6160d2b1e116bbce63e5fd9328