Compare commits

..
Author SHA1 Message Date
Devmate Bot 947331a12d xplat/js/react-native-github/packages/react-native/ReactCommon/react/renderer/components/scrollview/platform/android/react/renderer/components/scrollview/AndroidHorizontalScrollContentViewShadowNode.cpp
Reviewed By: rshest

Differential Revision: D83729418
2025-10-03 02:47:25 -07:00
Nick Lefever 88cf30a675 Add backgroundImage prop diffing to View (#54042)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54042

Update the View component props to diff the `backgroundImage` property and assign the value to `experimental_backgroundImage` which maps to the `backgroundImage` property on the Android `ReactViewManager`.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D83788008

fbshipit-source-id: 5f9d93403af483c9494d2782aedad604cbb7cbbc
2025-10-02 22:00:56 -07:00
Nick Lefever d9d3b3e08b Add toDynamic conversion for RadialGradient (#54041)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54041

Implement toDynamic conversion of the RadialGradient following the parse logic as described here: https://www.internalfb.com/code/fbsource/[28de0c66daab]/xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/style/RadialGradient.kt?lines=33-129

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D83788007

fbshipit-source-id: 305e6f5011f16103a559132e61b6d4eae24cc137
2025-10-02 22:00:56 -07:00
Nick Lefever c53541f3a1 Add toDynamic conversion for LinearGradient (#54040)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54040

Implement toDynamic conversion of the LinearGradient following the parse logic as described here: https://www.internalfb.com/code/fbsource/[5fa7eb2b733a]/xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/style/LinearGradient.kt?lines=24-76

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D83788005

fbshipit-source-id: 9114451b12e31ad86abde54dbe2c8819a304e777
2025-10-02 22:00:56 -07:00
Nick Lefever e88962bb1a Add toDynamic conversion for ValueUnit and ColorStop (#54039)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54039

Adding toDynamic conversion to `ColorStop` and `ValueUnit` structs which are being used by the linear and radial gradient data structures.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D83788006

fbshipit-source-id: 1ec0300ac4f17b65b6896d4d2c131eb05a059a22
2025-10-02 22:00:56 -07:00
Eric Rozell 26502c6319 Do not scroll to child inside nested scroll view (#54044)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54044

In rare cases, there may be a vertical ScrollView nested inside another vertical ScrollView. In these cases, when the requestChildFocus method is called, we may attempt to bring the entire focused child into view. However, we really only want to bring the entire nested ScrollView into view.

## Changelog

[Android][Fixed] Focused scroll into view behaviors for nested vertical scroll views

Reviewed By: bvanderhoof

Differential Revision: D83804043

fbshipit-source-id: 8df8f637e7f908cc283f55c0d78ee03ed3bb9117
2025-10-02 21:20:53 -07:00
David Vacca aab0d3397c Add a Log error to discourage usages of getJSModule(RCTEventEmitter) in new architecture (#54038)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54038

This diff adds a Log error to discourage usages of getJSModule(RCTEventEmitter) in new architecture, recommending migration to new API

changelog: [Android][Changed] Add Log error to discourage usages of getJSModule(RCTEventEmitter) API

Reviewed By: shwanton

Differential Revision: D83523928

fbshipit-source-id: d967456087a59366a3bca9590cb4d6d1fdd5b60d
2025-10-02 14:04:02 -07:00
Sam Zhou 36a9b7eda7 Replace React.ElementProps in tests and examples (#54035)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54035

`React.ElementConfig` is often the better choice. See https://flow.org/en/docs/react/types/#toc-react-elementprops

Changelog: [Internal]

Reviewed By: panagosg7

Differential Revision: D83749631

fbshipit-source-id: 81b21c1a0dced5bc578d3a5752c303b57b467f7b
2025-10-02 13:48:56 -07:00
Sam Zhou 041b4c3dd0 Replace React.ElementProps with React.ElementConfig in createAnimatedComponent.js (#54034)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54034

`React.ElementConfig` is often the better choice. See https://flow.org/en/docs/react/types/#toc-react-elementprops

Changelog: [Internal]

Reviewed By: panagosg7

Differential Revision: D83750127

fbshipit-source-id: 788169d73cccc2ed7c9b250845ad7277fe79c47f
2025-10-02 13:47:40 -07:00
generatedunixname89002005287564 481df76c24 Fix CQS signal readability-named-parameter in xplat/js/react-native-github/packages [B] (#54028)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54028

Reviewed By: javache

Differential Revision: D83719979

fbshipit-source-id: 4d683f7f95b2dc8502653d22a9a1d9fd6ab03b81
2025-10-02 12:55:56 -07:00
Devan Buggay 8c90f81aab Improve DevMenu for Android 11 (#54023)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54023

Android 12 introduced a new AlertDialog that better fits a longer list of content.
Android 11 and earlier have an AlertDialog that has a very small list view, requiring users to scroll through to find what they need. This change also fixes Android 12+ enable/disable states on menu items, as it no longer uses `isEnabled` for styling.

Before:
{F1982416953}

After:
{F1982416486}

Android 12:
{F1982430956}

Changelog: [Internal]

Reviewed By: shwanton

Differential Revision: D83688775

fbshipit-source-id: a96120142f648e849be670bde5897c884f1f5f52
2025-10-02 09:30:08 -07:00
Devan Buggay 6e8fab96fa Harden perf monitor to metro connection changes (#54022)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54022

Perf monitor shows in a broken state if metro is started while the app is running. This change improves the tracing and monitor lifecycle around the metro connection events.

Before:
{F1982430185}

After:
{F1982430062}

Changelog: [Internal]

Reviewed By: shwanton

Differential Revision: D83714223

fbshipit-source-id: 76826122924baa1a80c04dcc5ff18bc756a8e816
2025-10-02 09:30:08 -07:00
Vitali Zaidman 6c874f25e2 Fix SoLoader race condition in InspectorNetworkRequestListener (#54029)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54029

Changelog: [Android][Fixed] Fixed `SoLoader` race condition in `InspectorNetworkRequestListener`

When enabling `LoadNetworkResrouce` with flag `nativeSourceCodeFetching` in `InspectorInterfaces.h`, running the app, and opening the debugger, the app was crashing with
```
No implementation found for void com.facebook.react.devsupport.inspector.InspectorNetworkRequestListener.onHeaders(int, java.util.Map)
(
tried
  Java_com_facebook_react_devsupport_inspector_InspectorNetworkRequestListener_onHeaders
and
  Java_com_facebook_react_devsupport_inspector_InspectorNetworkRequestListener_onHeaders__ILjava_util_Map_2
) - is the library loaded, e.g. System.loadLibrary?
```

Reviewed By: huntie

Differential Revision: D83741114

fbshipit-source-id: b878fb4680e6a51f9403e8dea2872da85254e024
2025-10-02 07:36:10 -07:00
Devan Buggay 53dc68a31d Don't flash the performance monitor there's no metro connection (#54019)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54019

Currently the performance monitor flickers on boot if there's no metro connection. This change checks first if we have a packager before enabling the monitor.

No metro connection:
{F1982423105}

Metro connection:
{F1982423112}

Changelog: [Internal]

Reviewed By: shwanton

Differential Revision: D83701372

fbshipit-source-id: d099880d3ab509942a937a6bde11ebdde13450cd
2025-10-02 07:21:18 -07:00
Devan Buggay 84947fb0de Fix performance analyze path from DevMenu (#54018)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54018

The DevMenu path for perf analyzing no-ops. This is due to incorrectly not inverting the bool result of `pauseAndAnalyzeBackgroundTrace()`. See https://www.internalfb.com/code/fbsource/%5Bfcebbc02e701%5D/xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/perfmonitor/PerfMonitorOverlayManager.kt?lines=73-75.

{F1982418482}

Changelog: [Internal]

Reviewed By: shwanton

Differential Revision: D83691623

fbshipit-source-id: a16e39b00c07b6846092cc29bc656a08a61d20bb
2025-10-02 07:21:18 -07:00
Rob Hogan 89f0a37800 Minor bump Metro to ^0.83.3 (#54010)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54010

Bump Metro minimum to 0.83.3

This release fixes a regression in loading config files that export promises.

Full changelog: https://github.com/facebook/metro/releases/tag/v0.83.3

Changelog:
[General][Changed] Metro bump to ^0.83.3

Reviewed By: vzaidman

Differential Revision: D83655569

fbshipit-source-id: 106a957620e4591ef3cce21d327886354913560b
2025-10-02 06:53:57 -07:00
generatedunixname89002005287564 880b7e2c3a Fix CQS signal readability-named-parameter in xplat/js/react-native-github/packages [B] (#54025)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54025

Reviewed By: rshest

Differential Revision: D83704348

fbshipit-source-id: 8f5e34aa1b344a30dfea26661ac7b71fa4b2ddb1
2025-10-02 06:50:35 -07:00
generatedunixname89002005287564 bcf974838e Fix CQS signal readability-named-parameter in xplat/js/react-native-github/packages [A] (#54027)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54027

Reviewed By: javache

Differential Revision: D83703007

fbshipit-source-id: 36f08f1b48f52750065a39ef322cc675aa828f9e
2025-10-02 06:41:54 -07:00
generatedunixname89002005287564 fd95f824d0 Fix CQS signal readability-named-parameter in xplat/js/react-native-github/packages [A] (#54026)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54026

Reviewed By: javache

Differential Revision: D83719624

fbshipit-source-id: 9e43d15dd4b44c9c7b3be711d62541135031d1f8
2025-10-02 06:24:14 -07:00
generatedunixname537391475639613 47d1d2b256 xplat/js/react-native-github/packages/react-native/ReactCommon/react/renderer/attributedstring/TextAttributes.cpp (#54024)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54024

Reviewed By: rshest

Differential Revision: D83641704

fbshipit-source-id: 2d102bc1078a951aefee2097914477c6508cc988
2025-10-02 06:22:42 -07:00
Nick Lefever 0e03adcc79 Add support for nextFocus props to View (#54021)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54021

Adding missing `nextFocus*` props to the View props to enable correct Props 2.0 diffing.

Changelog: [Internal]

Reviewed By: rozele

Differential Revision: D83714902

fbshipit-source-id: 9b47ba5ea3e177e72b77b1df4b6b6082848c77a4
2025-10-01 20:14:24 -07:00
David Vacca 07fcdfebae Fix publish-updated-packages-test (#54017)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54017

Fix test: publish-updated-packages-test
changelog: [internal] internal

Reviewed By: christophpurrer

Differential Revision: D83699726

fbshipit-source-id: 45f4713d18ed74a6b344f34ab9b3dd7760088fcc
2025-10-01 17:22:35 -07:00
Moti Zilberman 7dc26f58ee Allow tests to run against all versions of Hermes (#54011)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54011

Gets the `jsinspector-modern` (CDP backend) integration tests in React Native to pass when run against all relevant versions of Hermes: Legacy Hermes (`xplat/hermes`), Static Hermes stable (`xplat/shermes/stable`), and Static Hermes trunk (`xplat/static_h`).

This involves disabling the two types of failing test:

1. Tests that should be legitimately disabled because Static Hermes omits the legacy, pre-Fusebox debugger infra (see changes to `ReactInstanceIntegrationTest.cpp`)
2. Tests that should be passing but expose a current bug in Static Hermes (see changes to `JsiIntegrationTest.cpp`)

This provides a useful baseline for upcoming work in CDPDebugAPI (etc) across the different versions of Hermes.

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D83564896

fbshipit-source-id: c27f02266d63d58983c660ba0e4be5c44f02c9b6
2025-10-01 12:48:25 -07:00
David Vacca 10c5c75de4 Delete Legacy Architecture class CoreModulesPackage (#53787)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53787

CoreModulesPackage is part of legacy architecture and unused on new architecture, let's delete it

changelog: [internal] internal

Reviewed By: rshest

Differential Revision: D82235543

fbshipit-source-id: bd18a1e26929c1f4533175d7567c552e142fbebb
2025-10-01 10:55:17 -07:00
generatedunixname1395667395051502 8825ec7464 Update React Native DevTools binaries
Summary:
Automated update of React Native DevTools binaries
bypass-github-export-checks
Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D83661214

fbshipit-source-id: f1de9dc96d30c46da986f52c6bdb623eeee469dc
2025-10-01 08:54:14 -07:00
Nicola Corti d9a582e949 Bump packages to 0.83.0-main (#54009)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54009

Packages haven't been bumped on main ahead of 0.83. This takes care of it.

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi, huntie

Differential Revision: D83580515

fbshipit-source-id: 7471e77f74e3fb3b4ee6538a49369b5df1393098
2025-10-01 07:13:33 -07:00
Bartłomiej Błoniarz e091759947 Animation Backend init (#53526)
Summary:
This diff adds AnimatedProps class that allows prop diffs to be passed to the backend. Currently it is implemented through subclassing, but the implementation details are subject to change. To simplify integration with animation frameworks AnimatedPropsBuilder class was created - frameworks can use it to prepare their diffs.

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[GENERAL] [ADDED] - AnimatedProps.h AnimatedPropsBuilder.h
[GENERAL] [CHANGED] - AnimationBackend initialisation and style updates

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests

Pull Request resolved: https://github.com/facebook/react-native/pull/53526

Test Plan:
js1 fantom AnimatedBackend-itest.js
js1 fantom Animated-itest.js

Reviewed By: zeyap

Differential Revision: D81309558

Pulled By: bartlomiejbloniarz

fbshipit-source-id: 92476568b6498d7ee64203f70a17c3e578de7ac1
2025-10-01 04:15:11 -07:00
Bartlomiej Bloniarz 7ec470d49a Expose the backend via UIManager (#53995)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53995

### Summary

Exposes the animation backend via UIManager by introducing two new methods: `unstable_setAnimationBackend` and `unstable_getAnimationBackend`. The `NativeAnimatedNodesManagerProvider` is updated to initialize the animation backend using the `useSharedAnimatedBackend` feature flag.

## Changelog:

[GENERAL] [ADDED] - unstable_setAnimationBackend, unstable_getAnimationBackend in UIManager
[GENRAL] [CHANGED] - call unstable_setAnimationBackend in NativeAnimatedNodesManager

Reviewed By: zeyap

Differential Revision: D81137954

fbshipit-source-id: b9a45b1d1e694e28865c27181bcbd578c1b7b9a0
2025-10-01 04:15:11 -07:00
Bartlomiej Bloniarz 3f396616d2 Init the backend closer to the uiManager (#53996)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53996

## Summary

This diff makes changes to the `NativeAnimatedNodesManager` and `AnimationBackend` to initialize the backend closer to the `UIManager`.

## Changelog:

[GENERAL] [CHANGED] - initialize the backend in NativeAnimatedNodesManagerProvider

Reviewed By: sammy-SC

Differential Revision: D81138133

fbshipit-source-id: 5be0c8d5f5e3593bcd8111bbd1d0e90502a53a0d
2025-10-01 04:15:11 -07:00
Bartlomiej Bloniarz 325c681cb1 boostrap shared animation backend (#53994)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53994

# Summary

This diff introduces the Shared Animation Backend - a class that can be used by animation frameworks to schedule and run animation updates.

## Changelog:

[GENERAL] [ADDED] - AnimationBackend-itest.js AnimationBackend BUCK/CmakeLists
[GENERAL] [ADDED] - useSharedAnimationBackend feature flag
[GENERAL] [CHANGED] - make AnimatedNodesManager use the backend behind the flag

Reviewed By: zeyap, sammy-SC

Differential Revision: D80809364

fbshipit-source-id: dbfe273362410cdf2f9fc37d78adac7faf4cd118
2025-10-01 04:15:11 -07:00
generatedunixname89002005287564 33bc2716e4 Fix CQS signal modernize-use-designated-initializers in xplat/js/react-native-github/packages [A] (#54002)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54002

Reviewed By: javache

Differential Revision: D83622069

fbshipit-source-id: 70b1393dc71ea80d9910682ce86ffd7dd8cd04d5
2025-10-01 04:10:58 -07:00
Dawid Malecki 29d5aa582f iOS: Add new configuration for RCTDevMenu (#53505)
Summary:
Following the [RFC](https://github.com/react-native-community/discussions-and-proposals/pull/925), this PR adds new `RCTDevMenu` configuration  and extends `RCTReactNativeFactory` API for passing it to the particular `RCTHost`.  The `RCTDevMenuConfiguration` includes:

- isDevMenuEnabled,
- isShakeGestureEnabled,
- areKeyboardShortcutsEnabled

## Changelog:

[IOS][ADDED] - Add new configuration for `RCTDevMenu`

<!-- 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/53505

Test Plan:
Tested with different configurations on `RCTDevMenuConfiguration`:

<details>
<summary>Click to view code</summary>

```objc
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  self.reactNativeFactory = [[RCTReactNativeFactory alloc] initWithDelegate:self];
#if USE_OSS_CODEGEN
  self.dependencyProvider = [RCTAppDependencyProvider new];
#endif

  RCTDevMenuConfiguration *devMenuConfiguration = [[RCTDevMenuConfiguration alloc] initWithDevMenuEnabled:true shakeGestureEnabled:false keyboardShortcutsEnabled:false];

  [self.reactNativeFactory setDevMenuConfiguration:devMenuConfiguration];

  self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];

  [self.reactNativeFactory startReactNativeWithModuleName:@"RNTesterApp"
                                                 inWindow:self.window
                                        initialProperties:[self prepareInitialProps]
                                            launchOptions:launchOptions];

  [[UNUserNotificationCenter currentNotificationCenter] setDelegate:self];

  return YES;
}
```

</details>

Run helloworld:

<img src="https://github.com/user-attachments/assets/16c35176-6fbe-498c-96fd-a0fe988a5e3c" alt="hello-world-screenshot" width="300">

Reviewed By: cipolleschi

Differential Revision: D81684275

Pulled By: coado

fbshipit-source-id: 500e170c93df25949de433970442d20c442be7f2
2025-10-01 02:42:54 -07:00
React Native Bot 3766e58b9a Add changelog for v0.82.0-rc.5 (#53993)
Summary:
Add Changelog for 0.82.0-rc.5

## Changelog:
[Internal] - Add Changelog for 0.82.0-rc.5

Pull Request resolved: https://github.com/facebook/react-native/pull/53993

Test Plan: N/A

Reviewed By: cortinico

Differential Revision: D83564973

Pulled By: vzaidman

fbshipit-source-id: 411da5ee9f1be6e9a8891c12a5e5e2e09c5c15f6
2025-10-01 00:35:58 -07:00
Chi Tsai 6031905711 Fix JSI isArray method to match JS Array.isArray (#53998)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53998

As the previous few diffs, JSI `isArray` API should follow
`Array.isArray` from the JS spec.

The current implementation does not consider Proxy objects, only Array
exotic objects.

Changelog: [Internal]

Reviewed By: lavenzg

Differential Revision: D83391784

fbshipit-source-id: 6db8e5a48458a1aa57006fb0747f62ec78efa675
2025-09-30 20:17:12 -07:00
Fernando Gorodscy 990ca0d100 Add support for .ktx images (#53991)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53991

As part of D83474751 to migrate Store from arvr to xplat we discovered that ktx images are not setup correctly in xplat. Adding support for it in flow and jest

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D83562581

fbshipit-source-id: 8c7205417dc24ca2d48a2e2fa1ca7dea40504c18
2025-09-30 18:36:11 -07:00
Jakub Piasecki e02e7b1a29 Request layout on configuration change only when the font scale has changed (#53984)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53984

Changelog: [ANDROID][CHANGED] - Request layout on configuration change only when the font scale has changed

Wraps call to `requestLayout` in a condition to only run layout when the font scale has changed to prevent it from executing in response to other configuration changes.

Reviewed By: Abbondanzo

Differential Revision: D83546632

fbshipit-source-id: 41a5199dd2ef72b8f6257637c1d35d4a790ea006
2025-09-30 08:40:09 -07:00
Pieter De Baets af904e563e Unbreak Fb4aReactPackageTest (#53988)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53988

These broke during Kotlin conversions etc as `context.getSystemService` is nullable.

Changelog: [Internal]

Reviewed By: lenaic, rshest

Differential Revision: D83503457

fbshipit-source-id: f4d2a09d60c38e6e5ae2b01d61fa73459b0f7f4d
2025-09-30 05:03:42 -07:00
Nick Lefever a073080810 Fix serialization for vector of primitive type (#53982)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53982

This diffs adds specific `toDynamic` conversions for props defined as arrays holding primitive types. This fixes the serialization of `std::vector<Float>` that was failing to correctly convert to a `folly::dynamic` type when using Props 2.0.

Changelog: [Internal]

Reviewed By: Abbondanzo

Differential Revision: D83520605

fbshipit-source-id: 80a6ce2b3a265601f945ff3b76840c04e46aacdc
2025-09-29 18:17:49 -07:00
generatedunixname89002005287564 5a4ed2d955 Fix CQS signal modernize-use-designated-initializers in xplat/js/react-native-github/packages [B] [B] [B] (#53970)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53970

Reviewed By: rshest

Differential Revision: D83404453

fbshipit-source-id: 852d553b9c70a00c8493f8f0ad2d55df0a6093ea
2025-09-29 16:52:55 -07:00
Chris Lewis 0a3bcc97ec Back out "Genalize focus/blur behavior in JS" (#53979)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53979

This reverts a previous change that modified how focus behavior is handled in JavaScript. That change caused hierarchy rows to no longer be focusable, either manually or programmatically as they were before, which in turn broke arrow key navigation in entity lists. Reverting the change restores the expected focus behavior and re-enables proper arrow key functionality within entity lists.

Changelog: [Internal]

Differential Revision: D83390685

fbshipit-source-id: 165567eceedce5d0a2e664a9ef3070d5a2bf9b67
2025-09-29 16:09:05 -07:00
Pieter De Baets a81e94a40c Fix useNativeTransformHelper behaviour when frame size is 0 (#53978)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53978

Inconsistency between the previous and old version of `processTransform` - if frameSize is 0, the transform was being ignored, which is not correct when considering a fixed transform origin and a rotation animation for example. Instead, always apply the transform origin if it's set.

Changelog: [Android][Fixed] Fixed representation of transforms when view is originally zero-sized

Reviewed By: mdvacca

Differential Revision: D83469083

fbshipit-source-id: e9ae1500f64c700708edb00b2d5871e3f224fb07
2025-09-29 15:37:24 -07:00
generatedunixname89002005287564 fa465c6da9 Fix CQS signal modernize-use-designated-initializers in xplat/js/react-native-github/packages [B] [A] [B] (#53972)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53972

Reviewed By: rshest

Differential Revision: D83405113

fbshipit-source-id: 5e7b3c37e08d49991fd112180625953a0edca047
2025-09-29 12:36:44 -07:00
Devan Buggay 0b14a19ea6 Migrate ReactRoot to Kotlin (#53238)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53238

Changelog:
[Android][Changed] - Migrated ReactRoot to Kotlin

Reviewed By: cortinico

Differential Revision: D80074359

fbshipit-source-id: 273f5bfc2826f59f2bb1521b8dbd95c48e5eb0c4
2025-09-29 12:28:02 -07:00
generatedunixname89002005287564 3774f75705 Fix CQS signal modernize-use-designated-initializers in xplat/js/react-native-github/packages [A] (#53969)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53969

Reviewed By: rshest

Differential Revision: D83350635

fbshipit-source-id: 48ec748e3ffadd9985daa40895ffbbd1dd40e946
2025-09-29 10:34:02 -07:00
generatedunixname89002005287564 279835dc14 Daily arc lint --take KTFMT (#53974)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53974

Reviewed By: VladimirMakaev

Differential Revision: D83454863

fbshipit-source-id: 6742bac1207743f3fc58c48d1261de00bcfacf85
2025-09-29 10:05:01 -07:00
generatedunixname89002005287564 3fb6c12ec8 Fix CQS signal readability-const-return-type in xplat/js/react-native-github/packages (#53940)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53940

Reviewed By: javache

Differential Revision: D83238455

fbshipit-source-id: ea3d3180f37151b3bba432d55324f2d854f29bc4
2025-09-29 08:16:45 -07:00
generatedunixname89002005287564 fe043446e8 Fix CQS signal modernize-use-designated-initializers in xplat/js/react-native-github/packages [A] (#53971)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53971

Reviewed By: rshest

Differential Revision: D83395511

fbshipit-source-id: 832901c112d6ebf0b58280bf12a50f7845251c5c
2025-09-29 06:30:14 -07:00
197 changed files with 3283 additions and 1237 deletions
+1 -1
View File
@@ -69,7 +69,7 @@ munge_underscores=true
module.name_mapper='^react-native$' -> '<PROJECT_ROOT>/packages/react-native/index.js'
module.name_mapper='^react-native/\(.*\)$' -> '<PROJECT_ROOT>/packages/react-native/\1'
module.name_mapper='^@react-native/dev-middleware$' -> '<PROJECT_ROOT>/packages/dev-middleware'
module.name_mapper='^@?[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\|xml\)$' -> '<PROJECT_ROOT>/packages/react-native/Libraries/Image/RelativeImageStub'
module.name_mapper='^@?[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\|xml\|ktx\)$' -> '<PROJECT_ROOT>/packages/react-native/Libraries/Image/RelativeImageStub'
module.system.haste.module_ref_prefix=m#
+17 -4
View File
@@ -1,13 +1,17 @@
# Changelog
## v0.81.4
## v0.82.0-rc.5
### Fixed
### Breaking
- **InteractionManager:** InteractionManager has been deprecated and no longer respects interaction handles. Instead, it is now recommended to avoid executing long-running JavaScript tasks by breaking them up into smaller tasks and scheduling them using `requestIdleCallback()`. ([03d9f34a82](https://github.com/facebook/react-native/commit/03d9f34a8252456d389d9f9a3bd04b99a2828c16) by [@yungsters](https://github.com/yungsters))
### Added
#### iOS specific
- Fix regression that skips artifacts code generation ([f6f5ea0b2e](https://github.com/facebook/react-native/commit/f6f5ea0b2eed894725d8f6e8bd045c99c3182026) by [@kitten](https://github.com/kitten))
- Reapplied "Use autolinking-generated react-native-config output in second step of cocoapods linking that generates artifacts and generated source" ([bb73315a3f](https://github.com/facebook/react-native/commit/bb73315a3fd8cd203c4ddb3ffa10bfec307c7e92) by [@kitten](https://github.com/kitten))
- **New Architecture:** Crash the app if they force the legacy architecture. ([dc132a4fd4](https://github.com/facebook/react-native/commit/dc132a4fd4ca8dc28dc7dbb2406ac67dac1a0ee7) by [@cipolleschi](https://github.com/cipolleschi))
- **Fabric:** Add invalidation callback for non-recycled component instances ([dc4a6d2c7e](https://github.com/facebook/react-native/commit/dc4a6d2c7e2ed421b61929896f60b1a864a60d97) by [@kkafar](https://github.com/kkafar))
## v0.82.0-rc.4
@@ -35,6 +39,15 @@
- **Codegen:** Fix regression that skips artifacts code generation ([f6f5ea0b2e](https://github.com/facebook/react-native/commit/f6f5ea0b2eed894725d8f6e8bd045c99c3182026) by [@kitten](https://github.com/kitten))
## v0.81.4
### Fixed
#### iOS specific
- Fix regression that skips artifacts code generation ([f6f5ea0b2e](https://github.com/facebook/react-native/commit/f6f5ea0b2eed894725d8f6e8bd045c99c3182026) by [@kitten](https://github.com/kitten))
- Reapplied "Use autolinking-generated react-native-config output in second step of cocoapods linking that generates artifacts and generated source" ([bb73315a3f](https://github.com/facebook/react-native/commit/bb73315a3fd8cd203c4ddb3ffa10bfec307c7e92) by [@kitten](https://github.com/kitten))
## v0.81.3
### Fixed
+1 -1
View File
@@ -128,7 +128,7 @@ if (project.findProperty("react.internal.useHermesNightly")?.toString()?.toBoole
That's fine for local development, but you should not commit this change.
********************************************************************************
"""
"""
.trimIndent()
)
allprojects {
+4 -4
View File
@@ -58,8 +58,8 @@
"@jest/create-cache-key-function": "^29.7.0",
"@microsoft/api-extractor": "^7.52.2",
"@octokit/rest": "^22.0.0",
"@react-native/metro-babel-transformer": "0.82.0-main",
"@react-native/metro-config": "0.82.0-main",
"@react-native/metro-babel-transformer": "0.83.0-main",
"@react-native/metro-config": "0.83.0-main",
"@tsconfig/node22": "22.0.2",
"@types/react": "^19.1.0",
"@typescript-eslint/parser": "^8.36.0",
@@ -101,8 +101,8 @@
"markdownlint-cli2": "^0.17.2",
"markdownlint-rule-relative-links": "^3.0.0",
"memfs": "^4.38.2",
"metro-babel-register": "^0.83.1",
"metro-transform-plugins": "^0.83.1",
"metro-babel-register": "^0.83.3",
"metro-transform-plugins": "^0.83.3",
"micromatch": "^4.0.4",
"node-fetch": "^2.2.0",
"nullthrows": "^1.1.1",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/assets-registry",
"version": "0.82.0-main",
"version": "0.83.0-main",
"description": "Asset support code for React Native.",
"license": "MIT",
"repository": {
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/babel-plugin-codegen",
"version": "0.82.0-main",
"version": "0.83.0-main",
"description": "Babel plugin to generate native module and view manager code for React Native.",
"license": "MIT",
"repository": {
@@ -26,7 +26,7 @@
],
"dependencies": {
"@babel/traverse": "^7.25.3",
"@react-native/codegen": "0.82.0-main"
"@react-native/codegen": "0.83.0-main"
},
"devDependencies": {
"@babel/core": "^7.25.2"
+6 -6
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/community-cli-plugin",
"version": "0.82.0-main",
"version": "0.83.0-main",
"description": "Core CLI commands for React Native",
"keywords": [
"react-native",
@@ -22,16 +22,16 @@
"dist"
],
"dependencies": {
"@react-native/dev-middleware": "0.82.0-main",
"@react-native/dev-middleware": "0.83.0-main",
"debug": "^4.4.0",
"invariant": "^2.2.4",
"metro": "^0.83.1",
"metro-config": "^0.83.1",
"metro-core": "^0.83.1",
"metro": "^0.83.3",
"metro-config": "^0.83.3",
"metro-core": "^0.83.3",
"semver": "^7.1.3"
},
"devDependencies": {
"metro-resolver": "^0.83.1"
"metro-resolver": "^0.83.3"
},
"peerDependencies": {
"@react-native-community/cli": "*",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/core-cli-utils",
"version": "0.82.0-main",
"version": "0.83.0-main",
"description": "React Native CLI library for Frameworks to build on",
"license": "MIT",
"main": "./src/index.flow.js",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/debugger-frontend",
"version": "0.82.0-main",
"version": "0.83.0-main",
"description": "Debugger frontend for React Native based on Chrome DevTools",
"keywords": [
"react-native",
@@ -1,71 +1,71 @@
#!/usr/bin/env dotslash
// @generated SignedSource<<f03dde90e30b4654dc18ba4c688f588e>>
// @generated SignedSource<<8b06371489dc8b79c23cbf095568c91a>>
{
"name": "React Native DevTools",
"platforms": {
"linux-aarch64": {
"size": 116056498,
"size": 116051181,
"hash": "sha256",
"digest": "74ddbe463a81b57533a87f4301c6a6c74323018f70e4f1dbeed0dfbe2ebab257",
"digest": "a6060e1291f9ee7e9feecd511012c041ed2a65c6df6f8ab5aca4d96adbbc9921",
"providers": [
{
"type": "http",
"url": "https://scontent.xx.fbcdn.net/mci_ab/uap/?ab_b=m&ab_page=react_native_devtools_binaries&ab_entry=AQNNgo1RofrfkLfx2qh_zLXdyNL54sIiYfd6p9aXIk-1zJ2lV1dpD2p58FTweCN6y3RZcdE_u9U8z16S_xRbtgA0mobHgSK6JASeR3dCLmMAazKXiiSb98rToqI9XAdOc4pJOGhOb2PVQ_c6lzngiOQ0vkyYU7xFENy-7jKKLbqYFSoDgT7RBs4dnbw"
"url": "https://scontent.xx.fbcdn.net/mci_ab/uap/?ab_b=m&ab_page=react_native_devtools_binaries&ab_entry=AQOD3-UmqD25MctpnB7Ogj0A8nHDs-SgFnMNFfStIxOajFAFSN93zuoWsLD3ylc3wVuX6-L-ndcMftTd7tlR1ZZWYy4a7g78w4N1UTzIT_z9vdOXpYGe7fZrHXiBHJu0QexD0b54OcdDSEFhh0-7puUTGPnIg3pHhThiU6bf_5AqvGIEYA5FGjih3zY"
}
],
"format": "tar.gz",
"path": "React Native DevTools-linux-arm64/React Native DevTools"
},
"linux-x86_64": {
"size": 115924960,
"size": 115927343,
"hash": "sha256",
"digest": "eba05066886fe6cd88b4123ed423ad301fd35b2f12381627b3b22c7955c73333",
"digest": "354f6550617d0c6b4bb4478ad085d4efe3671ba9a1b78d90d9bfc003a523cb6d",
"providers": [
{
"type": "http",
"url": "https://scontent.xx.fbcdn.net/mci_ab/uap/?ab_b=m&ab_page=react_native_devtools_binaries&ab_entry=AQOXAiG9ivBeW9v9jZMpg7nJZRT1SNBjTz8Nc5_SWUPCUf3xDekbhB6w3lWc8JtfklAzOL5TlJOsvIT3eujx2exadBpcS5NiAnq47KYvcgGP9iVxv5NuRwxttCc3Vncl5CLpGA6-Ifkt1g2-MrdM5yiaSaMKOCDQ83C2Fw07zH6tXt28jsZcTaPj"
"url": "https://scontent.xx.fbcdn.net/mci_ab/uap/?ab_b=m&ab_page=react_native_devtools_binaries&ab_entry=AQMVMfCfSykWSI8mB5koUEUtx819xGQGW3Tm1DBpEmjWA_g8C4PoPPDCIPpgJmB5nUKrv081_dtayoArCncyFJVs0ofbxGn0EkaEW2vW3OJ2J0XMH58v5cTLED3dT8TmWwAg6aYUTr0ch8DfVXRxsibYUIWaxJUwOJ-urR-iQm7YPQUboLElaJbM"
}
],
"format": "tar.gz",
"path": "React Native DevTools-linux-x64/React Native DevTools"
},
"macos-aarch64": {
"size": 110890882,
"size": 110891048,
"hash": "sha256",
"digest": "f289b7ae3c300b9d744c729a0024e55a2a8d6953a6a8e834d867f705daad1153",
"digest": "df41cfce9bc977ef4fdc66c3c892c0eedee5b07aa618550308157c51b8e75561",
"providers": [
{
"type": "http",
"url": "https://scontent.xx.fbcdn.net/mci_ab/uap/?ab_b=m&ab_page=react_native_devtools_binaries&ab_entry=AQP4xY72fwAGy3-m2Gx7mPodV90K-GbWYYIZ9_xgI89O0rm5GPmXE0u-C18Vq2h6x3zL479nhS7o9_OonWaISxx6TMYZcZsG9nkqTW3-uWcUi6ndzPNQILwryGVg034jrlmjKLB2CiIRoJvdW37wB_1AWFCOKO9gXRozFKV4ndjGDxDC6HJvbfFTacvX"
"url": "https://scontent.xx.fbcdn.net/mci_ab/uap/?ab_b=m&ab_page=react_native_devtools_binaries&ab_entry=AQOGfzOOV_mwg63orI4Hv0VQKQtE5Vk60eSl55gZDd0djjU-lmqddRZm_LxsWsek4xM7qIxqCbw6wGx7zqnrlmQGyfD98n0TBFh3uhVeYP_j3r2UkKci6tqjEqcLTHjFj3agjI6jDEe3fDpZtwKY4UMhXdVP4o1goYq13rG-IQAqIsAm04MnPFOYyp5X"
}
],
"format": "tar.gz",
"path": "React Native DevTools.app/Contents/MacOS/React Native DevTools"
},
"macos-x86_64": {
"size": 117778007,
"size": 117777930,
"hash": "sha256",
"digest": "a4698d6c3e2fdfb0c7bafec2130f3701c655468f953af836bf66ce3fe848c6ae",
"digest": "96805c51623a163b1d94b501e2e091f403b4c3575063bd7363f8e1550cda8dc5",
"providers": [
{
"type": "http",
"url": "https://scontent.xx.fbcdn.net/mci_ab/uap/?ab_b=m&ab_page=react_native_devtools_binaries&ab_entry=AQMpGXCifWF6VrFwv_jM4lw-E8eFi59l776z1OYrS8u3mLluAyA8bUtscEyLwoMitqyjF7or5lPuW7OFyiyZ00bKFxSC5lH6Xo_Sc41cQN5n5hmXCX7Wpku9ilU39_ZWmI95W3_oAacYXA1l6ZmHX2AWlv3jERpywrP4J_RNFBi5UAvOhPFo4LtRXw"
"url": "https://scontent.xx.fbcdn.net/mci_ab/uap/?ab_b=m&ab_page=react_native_devtools_binaries&ab_entry=AQNbF-vba13QuctGdSckSWSApEqUne0w8vGceEm5u9VNYqHzwaZu6_T0n12Ml7aHuNgAgU0OOxJKUjcr2DVsNEsjcCYwMqCjZys8yF8NfM39OH1YePjHZCw5jinydbhGxhF1zbJ_zKmuOx1FhJtzCD3CUbLSea7fuhPh6ytLUIu3Ctx4aFQLFtbJZQ"
}
],
"format": "tar.gz",
"path": "React Native DevTools.app/Contents/MacOS/React Native DevTools"
},
"windows-x86_64": {
"size": 125528869,
"size": 125533589,
"hash": "sha256",
"digest": "95234a13e6ba55556cff46f3da8af9e57ff1010c5483265cbbd444cad01c4216",
"digest": "7f560e6d68b4b917c53ba0518a778a20e267cce55474ad972d345b2738746a52",
"providers": [
{
"type": "http",
"url": "https://scontent.xx.fbcdn.net/mci_ab/uap/?ab_b=m&ab_page=react_native_devtools_binaries&ab_entry=AQOJdgsL68PBrM0rJk-WOm-re-8uqKfI1FfcTcAr1hiFSQr2bKBOqQNtHLnEA6JlRvKrwlOp4XTB6y9pC1TISeGo2dG_BYwN9jsVRLzcGWvfnpZ6GR7evVe82-XKS3Ya5YpScRdLycRqrhHuACXXbQ0HNvhNJjBWZtnQ8N3vOFJXn5QOGlobXqYp"
"url": "https://scontent.xx.fbcdn.net/mci_ab/uap/?ab_b=m&ab_page=react_native_devtools_binaries&ab_entry=AQPZzccNNBkp1OKt_SPZ-iDoK5LDWyvZhFMgz4oTf9Ja9PlKU7i_5ydAVd714waJteCM1cdAidPN6PumBRs1uK12E9moytEskWXlMPbQObFpaTnkxLn6xp3N5EAKbAXvPfecX41Tz_7HRqh19_hW3XpwXF-VNsAdtn59ApMtX1fpN0peB1l4o57P"
}
],
"format": "tar.gz",
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@react-native/debugger-shell",
"productName": "React Native DevTools",
"version": "0.82.0-main",
"version": "0.83.0-main",
"description": "Experimental debugger shell for React Native for use with @react-native/debugger-frontend",
"keywords": [
"react-native",
+4 -4
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/dev-middleware",
"version": "0.82.0-main",
"version": "0.83.0-main",
"description": "Dev server middleware for React Native",
"keywords": [
"react-native",
@@ -23,8 +23,8 @@
],
"dependencies": {
"@isaacs/ttlcache": "^1.4.1",
"@react-native/debugger-frontend": "0.82.0-main",
"@react-native/debugger-shell": "0.82.0-main",
"@react-native/debugger-frontend": "0.83.0-main",
"@react-native/debugger-shell": "0.83.0-main",
"chrome-launcher": "^0.15.2",
"chromium-edge-launcher": "^0.2.0",
"connect": "^3.6.5",
@@ -39,7 +39,7 @@
"node": ">= 20.19.4"
},
"devDependencies": {
"@react-native/debugger-shell": "0.82.0-main",
"@react-native/debugger-shell": "0.83.0-main",
"selfsigned": "^2.4.1",
"undici": "^5.29.0",
"wait-for-expect": "^3.0.2"
@@ -1,6 +1,6 @@
{
"name": "@react-native/eslint-config",
"version": "0.82.0-main",
"version": "0.83.0-main",
"description": "ESLint config for React Native",
"license": "MIT",
"repository": {
@@ -22,7 +22,7 @@
"dependencies": {
"@babel/core": "^7.25.2",
"@babel/eslint-parser": "^7.25.1",
"@react-native/eslint-plugin": "0.82.0-main",
"@react-native/eslint-plugin": "0.83.0-main",
"@typescript-eslint/eslint-plugin": "^8.36.0",
"@typescript-eslint/parser": "^8.36.0",
"eslint-config-prettier": "^8.5.0",
@@ -1,6 +1,6 @@
{
"name": "@react-native/eslint-plugin",
"version": "0.82.0-main",
"version": "0.83.0-main",
"description": "ESLint rules for @react-native/eslint-config",
"license": "MIT",
"repository": {
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/eslint-plugin-specs",
"version": "0.82.0-main",
"version": "0.83.0-main",
"description": "ESLint rules to validate NativeModule and Component Specs",
"license": "MIT",
"repository": {
@@ -26,7 +26,7 @@
"dependencies": {
"@babel/core": "^7.25.2",
"@babel/plugin-transform-flow-strip-types": "^7.25.2",
"@react-native/codegen": "0.82.0-main",
"@react-native/codegen": "0.83.0-main",
"make-dir": "^2.1.0",
"pirates": "^4.0.1",
"source-map-support": "0.5.0"
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/gradle-plugin",
"version": "0.82.0-main",
"version": "0.83.0-main",
"description": "Gradle Plugin for React Native",
"license": "MIT",
"repository": {
+5 -5
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/metro-config",
"version": "0.82.0-main",
"version": "0.83.0-main",
"description": "Metro configuration for React Native.",
"license": "MIT",
"repository": {
@@ -26,9 +26,9 @@
"dist"
],
"dependencies": {
"@react-native/js-polyfills": "0.82.0-main",
"@react-native/metro-babel-transformer": "0.82.0-main",
"metro-config": "^0.83.1",
"metro-runtime": "^0.83.1"
"@react-native/js-polyfills": "0.83.0-main",
"@react-native/metro-babel-transformer": "0.83.0-main",
"metro-config": "^0.83.3",
"metro-runtime": "^0.83.3"
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/new-app-screen",
"version": "0.82.0-main",
"version": "0.83.0-main",
"description": "NewAppScreen component for React Native",
"keywords": [
"react-native"
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/normalize-colors",
"version": "0.82.0-main",
"version": "0.83.0-main",
"description": "Color normalization for React Native.",
"license": "MIT",
"repository": {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/js-polyfills",
"version": "0.82.0-main",
"version": "0.83.0-main",
"description": "Polyfills for React Native.",
"license": "MIT",
"repository": {
@@ -1,6 +1,6 @@
{
"name": "@react-native/babel-preset",
"version": "0.82.0-main",
"version": "0.83.0-main",
"description": "Babel preset for React Native applications",
"repository": {
"type": "git",
@@ -66,7 +66,7 @@
"@babel/plugin-transform-typescript": "^7.25.2",
"@babel/plugin-transform-unicode-regex": "^7.24.7",
"@babel/template": "^7.25.0",
"@react-native/babel-plugin-codegen": "0.82.0-main",
"@react-native/babel-plugin-codegen": "0.83.0-main",
"babel-plugin-syntax-hermes-parser": "0.32.0",
"babel-plugin-transform-flow-enums": "^0.0.2",
"react-refresh": "^0.14.0"
@@ -1,6 +1,6 @@
{
"name": "@react-native/metro-babel-transformer",
"version": "0.82.0-main",
"version": "0.83.0-main",
"description": "Babel transformer for React Native applications.",
"repository": {
"type": "git",
@@ -27,7 +27,7 @@
],
"dependencies": {
"@babel/core": "^7.25.2",
"@react-native/babel-preset": "0.82.0-main",
"@react-native/babel-preset": "0.83.0-main",
"hermes-parser": "0.32.0",
"nullthrows": "^1.1.1"
},
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/codegen",
"version": "0.82.0-main",
"version": "0.83.0-main",
"description": "Code generation tools for React Native",
"license": "MIT",
"repository": {
@@ -1,6 +1,6 @@
{
"name": "@react-native/compatibility-check",
"version": "0.82.0-main",
"version": "0.83.0-main",
"description": "Check a React Native app's boundary between JS and Native for incompatibilities",
"license": "MIT",
"repository": {
@@ -29,7 +29,7 @@
"dist"
],
"dependencies": {
"@react-native/codegen": "0.82.0-main"
"@react-native/codegen": "0.83.0-main"
},
"devDependencies": {
"flow-remove-types": "^2.237.2",
@@ -1,6 +1,6 @@
{
"name": "@react-native/popup-menu-android",
"version": "0.82.0-main",
"version": "0.83.0-main",
"description": "PopupMenu for the Android platform",
"main": "index.js",
"files": [
@@ -21,7 +21,7 @@
},
"license": "MIT",
"devDependencies": {
"@react-native/codegen": "0.82.0-main"
"@react-native/codegen": "0.83.0-main"
},
"peerDependencies": {
"@types/react": "^19.1.0",
@@ -0,0 +1,75 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @fantom_flags useSharedAnimatedBackend:true
* @flow strict-local
* @format
*/
import '@react-native/fantom/src/setUpDefaultReactNativeEnvironment';
import type {HostInstance} from 'react-native';
import ensureInstance from '../../../src/private/__tests__/utilities/ensureInstance';
import * as Fantom from '@react-native/fantom';
import {createRef} from 'react';
import {Animated, useAnimatedValue} from 'react-native';
import ReactNativeElement from 'react-native/src/private/webapis/dom/nodes/ReactNativeElement';
test('animated opacity', () => {
let _opacity;
let _opacityAnimation;
const viewRef = createRef<HostInstance>();
function MyApp() {
const opacity = useAnimatedValue(1);
_opacity = opacity;
return (
<Animated.View
ref={viewRef}
style={[
{
width: 100,
height: 100,
opacity: opacity,
},
]}
/>
);
}
const root = Fantom.createRoot();
Fantom.runTask(() => {
root.render(<MyApp />);
});
const viewElement = ensureInstance(viewRef.current, ReactNativeElement);
expect(viewElement.getBoundingClientRect().x).toBe(0);
Fantom.runTask(() => {
_opacityAnimation = Animated.timing(_opacity, {
toValue: 0,
duration: 30,
useNativeDriver: true,
}).start();
});
Fantom.unstable_produceFramesForDuration(30);
expect(Fantom.unstable_getDirectManipulationProps(viewElement).opacity).toBe(
0,
);
// TODO: this shouldn't be neccessary since animation should be stopped after duration
Fantom.runTask(() => {
_opacityAnimation?.stop();
});
expect(root.getRenderedOutput({props: ['opacity']}).toJSX()).toEqual(
<rn-view opacity="0" />,
);
});
@@ -97,7 +97,7 @@ export default function createAnimatedComponent<
>(
Component: TInstance,
): AnimatedComponentType<
$ReadOnly<React.ElementProps<TInstance>>,
$ReadOnly<React.ElementConfig<TInstance>>,
React.ElementRef<TInstance>,
> {
return unstable_createAnimatedComponentWithAllowlist(Component, null);
@@ -24,6 +24,7 @@
@class RCTBridge;
@protocol RCTComponentViewProtocol;
@class RCTSurfacePresenterBridgeAdapter;
@class RCTDevMenuConfiguration;
NS_ASSUME_NONNULL_BEGIN
@@ -116,6 +117,8 @@ typedef NS_ENUM(NSInteger, RCTReleaseLevel) { Canary, Experimental, Stable };
@property (nonatomic, weak) id<RCTReactNativeFactoryDelegate> delegate;
@property (nonatomic, nullable) RCTDevMenuConfiguration *devMenuConfiguration;
@end
NS_ASSUME_NONNULL_END
@@ -7,6 +7,7 @@
#import "RCTReactNativeFactory.h"
#import <React/RCTColorSpaceUtils.h>
#import <React/RCTDevMenu.h>
#import <React/RCTLog.h>
#import <React/RCTRootView.h>
#import <React/RCTSurfacePresenterBridgeAdapter.h>
@@ -82,7 +83,8 @@ using namespace facebook::react;
{
UIView *rootView = [self.rootViewFactory viewWithModuleName:moduleName
initialProperties:initialProperties
launchOptions:launchOptions];
launchOptions:launchOptions
devMenuConfiguration:self.devMenuConfiguration];
UIViewController *rootViewController = [_delegate createRootViewController];
[_delegate setRootView:rootView toRootViewController:rootViewController];
window.rootViewController = rootViewController;
@@ -18,6 +18,7 @@
@class RCTHost;
@class RCTRootView;
@class RCTSurfacePresenterBridgeAdapter;
@class RCTDevMenuConfiguration;
NS_ASSUME_NONNULL_BEGIN
@@ -201,7 +202,13 @@ typedef void (^RCTLoadSourceForBridgeBlock)(RCTBridge *bridge, RCTSourceLoadBloc
* @parameter: moduleName - the name of the app, used by Metro to resolve the module.
* @parameter: initialProperties - a set of initial properties.
* @parameter: launchOptions - a dictionary with a set of options.
* @parameter: devMenuConfiguration - a configuration for enabling/disabling dev menu.
*/
- (UIView *_Nonnull)viewWithModuleName:(NSString *)moduleName
initialProperties:(NSDictionary *__nullable)initialProperties
launchOptions:(NSDictionary *__nullable)launchOptions
devMenuConfiguration:(RCTDevMenuConfiguration *__nullable)devMenuConfiguration;
- (UIView *_Nonnull)viewWithModuleName:(NSString *)moduleName
initialProperties:(NSDictionary *__nullable)initialProperties
launchOptions:(NSDictionary *__nullable)launchOptions;
@@ -219,11 +226,16 @@ typedef void (^RCTLoadSourceForBridgeBlock)(RCTBridge *bridge, RCTSourceLoadBloc
* Use it to speed up later viewWithModuleName: calls.
*
* @parameter: launchOptions - a dictionary with a set of options.
* @parameter: devMenuConfiguration - a configuration for enabling/disabling dev menu.
*/
- (void)initializeReactHostWithLaunchOptions:(NSDictionary *__nullable)launchOptions;
- (void)initializeReactHostWithLaunchOptions:(NSDictionary *__nullable)launchOptions
devMenuConfiguration:(RCTDevMenuConfiguration *)devMenuConfiguration;
- (RCTHost *)createReactHost:(NSDictionary *__nullable)launchOptions;
- (RCTHost *)createReactHost:(NSDictionary *__nullable)launchOptions
devMenuConfiguration:(RCTDevMenuConfiguration *__nullable)devMenuConfiguration;
@end
NS_ASSUME_NONNULL_END
@@ -7,6 +7,7 @@
#import "RCTRootViewFactory.h"
#import <React/RCTCxxBridgeDelegate.h>
#import <React/RCTDevMenu.h>
#import <React/RCTLog.h>
#import <React/RCTRootView.h>
#import <React/RCTSurfacePresenterBridgeAdapter.h>
@@ -133,29 +134,47 @@
- (UIView *)viewWithModuleName:(NSString *)moduleName initialProperties:(NSDictionary *)initialProperties
{
return [self viewWithModuleName:moduleName initialProperties:initialProperties launchOptions:nil];
return [self viewWithModuleName:moduleName
initialProperties:initialProperties
launchOptions:nil
devMenuConfiguration:[RCTDevMenuConfiguration defaultConfiguration]];
}
- (UIView *)viewWithModuleName:(NSString *)moduleName
{
return [self viewWithModuleName:moduleName initialProperties:nil launchOptions:nil];
return [self viewWithModuleName:moduleName
initialProperties:nil
launchOptions:nil
devMenuConfiguration:[RCTDevMenuConfiguration defaultConfiguration]];
}
- (void)initializeReactHostWithLaunchOptions:(NSDictionary *)launchOptions
devMenuConfiguration:(RCTDevMenuConfiguration *)devMenuConfiguration
{
// Enable TurboModule interop by default in Bridgeless mode
RCTEnableTurboModuleInterop(YES);
RCTEnableTurboModuleInteropBridgeProxy(YES);
[self createReactHostIfNeeded:launchOptions];
[self createReactHostIfNeeded:launchOptions devMenuConfiguration:devMenuConfiguration];
return;
}
- (UIView *)viewWithModuleName:(NSString *)moduleName
initialProperties:(NSDictionary *)initialProperties
launchOptions:(NSDictionary *)launchOptions
{
return [self viewWithModuleName:moduleName
initialProperties:initialProperties
launchOptions:launchOptions
devMenuConfiguration:[RCTDevMenuConfiguration defaultConfiguration]];
}
- (UIView *)viewWithModuleName:(NSString *)moduleName
initialProperties:(NSDictionary *)initProps
launchOptions:(NSDictionary *)launchOptions
devMenuConfiguration:(RCTDevMenuConfiguration *)devMenuConfiguration
{
[self initializeReactHostWithLaunchOptions:launchOptions];
[self initializeReactHostWithLaunchOptions:launchOptions devMenuConfiguration:devMenuConfiguration];
RCTFabricSurface *surface = [self.reactHost createSurfaceWithModuleName:moduleName
initialProperties:initProps ? initProps : @{}];
@@ -226,14 +245,21 @@
#pragma mark - New Arch Utilities
- (void)createReactHostIfNeeded:(NSDictionary *)launchOptions
devMenuConfiguration:(RCTDevMenuConfiguration *)devMenuConfiguration
{
if (self.reactHost) {
return;
}
self.reactHost = [self createReactHost:launchOptions];
self.reactHost = [self createReactHost:launchOptions devMenuConfiguration:devMenuConfiguration];
}
- (RCTHost *)createReactHost:(NSDictionary *)launchOptions
{
return [self createReactHost:launchOptions devMenuConfiguration:[RCTDevMenuConfiguration defaultConfiguration]];
}
- (RCTHost *)createReactHost:(NSDictionary *)launchOptions
devMenuConfiguration:(RCTDevMenuConfiguration *)devMenuConfiguration
{
__weak __typeof(self) weakSelf = self;
RCTHost *reactHost =
@@ -243,7 +269,8 @@
jsEngineProvider:^std::shared_ptr<facebook::react::JSRuntimeFactory>() {
return [weakSelf createJSRuntimeFactory];
}
launchOptions:launchOptions];
launchOptions:launchOptions
devMenuConfiguration:devMenuConfiguration];
[reactHost setBundleURLProvider:^NSURL *() {
return [weakSelf bundleURL];
}];
@@ -449,12 +449,6 @@ function InternalTextInput(props: TextInputProps): React.Node {
before we can get to the long term breaking change.
*/
if (instance != null) {
// Register the input immediately when the ref is set so that focus()
// can be called from ref callbacks
// Double registering during useLayoutEffect is fine, because the underlying
// state is a Set.
TextInputState.registerInput(instance);
// $FlowFixMe[prop-missing] - See the explanation above.
// $FlowFixMe[unsafe-object-assign]
Object.assign(instance, {
@@ -21,8 +21,8 @@ const ViewNativeComponent: HostComponent<Props> =
}));
interface NativeCommands {
+focus: (viewRef: HostInstance) => void;
+blur: (viewRef: HostInstance) => void;
+focus: () => void;
+blur: () => void;
+hotspotUpdate: (viewRef: HostInstance, x: number, y: number) => void;
+setPressed: (viewRef: HostInstance, pressed: boolean) => void;
}
@@ -13,7 +13,7 @@ typedef NSURLSessionConfiguration * (^NSURLSessionConfigurationProvider)(void);
* The block provided via this function will provide the NSURLSessionConfiguration for all HTTP requests made by the
* app.
*/
RCT_EXTERN void RCTSetCustomNSURLSessionConfigurationProvider(NSURLSessionConfigurationProvider);
RCT_EXTERN void RCTSetCustomNSURLSessionConfigurationProvider(NSURLSessionConfigurationProvider /*provider*/);
/**
* This is the default RCTURLRequestHandler implementation for HTTP requests.
*/
@@ -14,7 +14,6 @@ import '@react-native/fantom/src/setUpDefaultReactNativeEnvironment';
import type {HostInstance} from 'react-native';
import ReactNativeElement from '../../../../src/private/webapis/dom/nodes/ReactNativeElement';
import TextInput from '../../../Components/TextInput/TextInput';
import TextInputState from '../../../Components/TextInput/TextInputState';
import View from '../../../Components/View/View';
import ReactFabricHostComponent from '../ReactFabricHostComponent';
@@ -49,7 +48,7 @@ describe('ReactFabricPublicInstance', () => {
const nodeRef = createRef<HostInstance>();
Fantom.runTask(() => {
root.render(<TextInput ref={nodeRef} />);
root.render(<View ref={nodeRef} />);
});
const node = nullthrows(nodeRef.current);
@@ -74,7 +73,7 @@ describe('ReactFabricPublicInstance', () => {
const ref = createRef<HostInstance>();
Fantom.runTask(() => {
root.render(<TextInput ref={ref} />);
root.render(<View ref={ref} />);
});
const node = nullthrows(ref.current);
+7 -2
View File
@@ -37,8 +37,13 @@ RCT_EXTERN BOOL RCTIsMainQueue(void);
do { \
} while (false)
#endif
RCT_EXTERN void _RCTAssertFormat(const char *, const char *, int, const char *, NSString *, ...)
NS_FORMAT_FUNCTION(5, 6);
RCT_EXTERN void _RCTAssertFormat(
const char * /*condition*/,
const char * /*fileName*/,
int /*lineNumber*/,
const char * /*function*/,
NSString * /*format*/,
...) NS_FORMAT_FUNCTION(5, 6);
/**
* Report a fatal condition when executing. These calls will _NOT_ be compiled out
+1 -1
View File
@@ -22,7 +22,7 @@ RCTAssertFunction RCTCurrentAssertFunction = nil;
RCTFatalHandler RCTCurrentFatalHandler = nil;
RCTFatalExceptionHandler RCTCurrentFatalExceptionHandler = nil;
NSException *_RCTNotImplementedException(SEL, Class);
NSException *_RCTNotImplementedException(SEL /*cmd*/, Class /*cls*/);
NSException *_RCTNotImplementedException(SEL cmd, Class cls)
{
NSString *msg = [NSString stringWithFormat:
@@ -117,7 +117,7 @@ NSSet<NSString *> *getCoreModuleClasses(void)
}
static NSMutableArray<NSString *> *modulesLoadedWithOldArch;
void addModuleLoadedWithOldArch(NSString *);
void addModuleLoadedWithOldArch(NSString * /*moduleName*/);
void addModuleLoadedWithOldArch(NSString *moduleName)
{
static dispatch_once_t onceToken;
@@ -138,7 +138,7 @@ NSMutableArray<NSString *> *getModulesLoadedWithOldArch(void)
* prior to the first bridge initialization.
* TODO: (T115656171) Refactor RCTRegisterModule out of Bridge.m since it doesn't use the Bridge.
*/
void RCTRegisterModule(Class);
void RCTRegisterModule(Class /*moduleClass*/);
void RCTRegisterModule(Class moduleClass)
{
if (RCTAreLegacyLogsEnabled() && ![getCoreModuleClasses() containsObject:[moduleClass description]]) {
@@ -18,7 +18,7 @@ NSString *const RCTBundleURLProviderUpdatedNotification = @"RCTBundleURLProvider
const NSUInteger kRCTBundleURLProviderDefaultPort = RCT_METRO_PORT;
#if RCT_DEV_MENU | RCT_PACKAGER_LOADING_FUNCTIONALITY
#if RCT_DEV | RCT_PACKAGER_LOADING_FUNCTIONALITY
static BOOL kRCTAllowPackagerAccess = YES;
void RCTBundleURLProviderAllowPackagerServerAccess(BOOL allowed)
{
@@ -78,7 +78,7 @@ static NSURL *serverRootWithHostPort(NSString *hostPort, NSString *scheme)
(unsigned long)kRCTBundleURLProviderDefaultPort]];
}
#if RCT_DEV_MENU | RCT_PACKAGER_LOADING_FUNCTIONALITY
#if RCT_DEV | RCT_PACKAGER_LOADING_FUNCTIONALITY
+ (BOOL)isPackagerRunning:(NSString *)hostPort
{
return [RCTBundleURLProvider isPackagerRunning:hostPort scheme:nil];
@@ -155,14 +155,14 @@ static NSURL *serverRootWithHostPort(NSString *hostPort, NSString *scheme)
- (NSString *)packagerServerHostPort
{
#if RCT_DEV_MENU | RCT_PACKAGER_LOADING_FUNCTIONALITY
#if RCT_DEV | RCT_PACKAGER_LOADING_FUNCTIONALITY
if (!kRCTAllowPackagerAccess) {
RCTLogInfo(@"Packager server access is disabled in this environment");
return nil;
}
#endif
NSString *location = [self jsLocation];
#if RCT_DEV_MENU
#if RCT_DEV
NSString *scheme = [self packagerScheme];
if ([location length] && ![RCTBundleURLProvider isPackagerRunning:location scheme:scheme]) {
location = nil;
@@ -177,9 +177,14 @@ typedef NSArray UIColorArray __deprecated_msg("Use NSArray<UIColor *>");
/**
* Underlying implementations of RCT_XXX_CONVERTER macros. Ignore these.
*/
RCT_EXTERN NSNumber *RCTConvertEnumValue(const char *, NSDictionary *, NSNumber *, id);
RCT_EXTERN NSNumber *RCTConvertMultiEnumValue(const char *, NSDictionary *, NSNumber *, id);
RCT_EXTERN NSArray *RCTConvertArrayValue(SEL, id);
RCT_EXTERN NSNumber *
RCTConvertEnumValue(const char * /*typeName*/, NSDictionary * /*mapping*/, NSNumber * /*defaultValue*/, id /*json*/);
RCT_EXTERN NSNumber *RCTConvertMultiEnumValue(
const char * /*typeName*/,
NSDictionary * /*mapping*/,
NSNumber * /*defaultValue*/,
id /*json*/);
RCT_EXTERN NSArray *RCTConvertArrayValue(SEL /*type*/, id /*json*/);
/**
* This macro is used for logging conversion errors. This is just used to
+6 -4
View File
@@ -75,12 +75,12 @@ RCTFormatLog(NSDate *timestamp, RCTLogLevel level, NSString *fileName, NSNumber
/**
* A method to generate a string RCTLogLevel
*/
RCT_EXTERN NSString *RCTFormatLogLevel(RCTLogLevel);
RCT_EXTERN NSString *RCTFormatLogLevel(RCTLogLevel /*level*/);
/**
* A method to generate a string from a RCTLogSource
*/
RCT_EXTERN NSString *RCTFormatLogSource(RCTLogSource);
RCT_EXTERN NSString *RCTFormatLogSource(RCTLogSource /*source*/);
/**
* The default logging function used by RCTLogXX.
@@ -149,5 +149,7 @@ RCT_EXTERN void RCTLogSetBridgelessCallableJSModules(RCTCallableJSModules *calla
} while (0)
#endif
RCT_EXTERN void _RCTLogNativeInternal(RCTLogLevel, const char *, int, NSString *, ...) NS_FORMAT_FUNCTION(4, 5);
RCT_EXTERN void _RCTLogJavaScriptInternal(RCTLogLevel, NSString *);
RCT_EXTERN void
_RCTLogNativeInternal(RCTLogLevel /*level*/, const char * /*fileName*/, int /*lineNumber*/, NSString * /*format*/, ...)
NS_FORMAT_FUNCTION(4, 5);
RCT_EXTERN void _RCTLogJavaScriptInternal(RCTLogLevel /*level*/, NSString * /*message*/);
+1 -1
View File
@@ -706,7 +706,7 @@ NSURL *RCTDataURL(NSString *mimeType, NSData *data)
[data base64EncodedStringWithOptions:(NSDataBase64EncodingOptions)0]]];
}
BOOL RCTIsGzippedData(NSData *__nullable); // exposed for unit testing purposes
BOOL RCTIsGzippedData(NSData *__nullable /*data*/); // exposed for unit testing purposes
BOOL RCTIsGzippedData(NSData *__nullable data)
{
UInt8 *bytes = (UInt8 *)data.bytes;
@@ -12,7 +12,7 @@
#import <React/RCTEventEmitter.h>
RCT_EXTERN void RCTEnableAppearancePreference(BOOL enabled);
RCT_EXTERN void RCTOverrideAppearancePreference(NSString *);
RCT_EXTERN void RCTOverrideAppearancePreference(NSString * /*colorSchemeOverride*/);
RCT_EXTERN void RCTUseKeyWindowForSystemStyle(BOOL useMainScreen);
RCT_EXTERN NSString *RCTCurrentOverrideAppearancePreference(void);
RCT_EXTERN NSString *RCTColorSchemePreference(UITraitCollection *traitCollection);
@@ -12,12 +12,26 @@
#import <React/RCTBridgeProxy.h>
#import <React/RCTDefines.h>
#if RCT_DEV_MENU
RCT_EXTERN NSString *const RCTShowDevMenuNotification;
@interface RCTDevMenuConfiguration : NSObject
#if RCT_DEV_MENU
@property (nonatomic, readonly) BOOL devMenuEnabled;
@property (nonatomic, readonly) BOOL shakeGestureEnabled;
@property (nonatomic, readonly) BOOL keyboardShortcutsEnabled;
- (instancetype)initWithDevMenuEnabled:(BOOL)devMenuEnabled
shakeGestureEnabled:(BOOL)shakeGestureEnabled
keyboardShortcutsEnabled:(BOOL)keyboardShortcutsEnabled;
#endif
+ (instancetype)defaultConfiguration;
@end
@class RCTDevMenuItem;
/**
@@ -45,6 +59,16 @@ RCT_EXTERN NSString *const RCTShowDevMenuNotification;
*/
@property (nonatomic, assign) BOOL hotkeysEnabled;
/**
* Whether the developer menu is enabled.
*/
@property (nonatomic, assign) BOOL devMenuEnabled;
/**
* Whether keyboard shortcuts are enabled.
*/
@property (nonatomic, assign) BOOL keyboardShortcutsEnabled;
/**
* Presented items in development menu
*/
@@ -76,6 +100,11 @@ RCT_EXTERN NSString *const RCTShowDevMenuNotification;
*/
- (void)addItem:(RCTDevMenuItem *)item;
/**
* Disable the reload command (Cmd+R) in the simulator.
*/
- (void)disableReloadCommand;
@end
typedef NSString * (^RCTDevMenuItemTitleBlock)(void);
@@ -29,6 +29,27 @@
NSString *const RCTShowDevMenuNotification = @"RCTShowDevMenuNotification";
@implementation RCTDevMenuConfiguration
- (instancetype)initWithDevMenuEnabled:(BOOL)devMenuEnabled
shakeGestureEnabled:(BOOL)shakeGestureEnabled
keyboardShortcutsEnabled:(BOOL)keyboardShortcutsEnabled
{
if (self = [super init]) {
_devMenuEnabled = devMenuEnabled;
_shakeGestureEnabled = shakeGestureEnabled;
_keyboardShortcutsEnabled = keyboardShortcutsEnabled;
}
return self;
}
+ (instancetype)defaultConfiguration
{
return [[self alloc] initWithDevMenuEnabled:RCT_DEV_MENU
shakeGestureEnabled:RCT_DEV_MENU
keyboardShortcutsEnabled:RCT_DEV_MENU];
}
@end
@implementation UIWindow (RCTDevMenu)
- (void)RCT_motionEnded:(__unused UIEventSubtype)motion withEvent:(UIEvent *)event
@@ -127,6 +148,8 @@ RCT_EXPORT_MODULE()
object:nil];
_extraMenuItems = [NSMutableArray new];
_keyboardShortcutsEnabled = true;
_devMenuEnabled = true;
[self registerHotkeys];
}
return self;
@@ -162,7 +185,6 @@ RCT_EXPORT_MODULE()
[commands unregisterKeyCommandWithInput:@"d" modifierFlags:UIKeyModifierCommand];
[commands unregisterKeyCommandWithInput:@"i" modifierFlags:UIKeyModifierCommand];
[commands unregisterKeyCommandWithInput:@"n" modifierFlags:UIKeyModifierCommand];
#endif
}
@@ -172,13 +194,30 @@ RCT_EXPORT_MODULE()
RCTKeyCommands *commands = [RCTKeyCommands sharedInstance];
return [commands isKeyCommandRegisteredForInput:@"d" modifierFlags:UIKeyModifierCommand] &&
[commands isKeyCommandRegisteredForInput:@"i" modifierFlags:UIKeyModifierCommand] &&
[commands isKeyCommandRegisteredForInput:@"n" modifierFlags:UIKeyModifierCommand];
[commands isKeyCommandRegisteredForInput:@"i" modifierFlags:UIKeyModifierCommand];
#else
return NO;
#endif
}
- (BOOL)isReloadCommandRegistered
{
#if TARGET_OS_SIMULATOR || TARGET_OS_MACCATALYST
RCTKeyCommands *commands = [RCTKeyCommands sharedInstance];
return [commands isKeyCommandRegisteredForInput:@"r" modifierFlags:UIKeyModifierCommand];
#else
return NO;
#endif
}
- (void)unregisterReloadCommand
{
#if TARGET_OS_SIMULATOR || TARGET_OS_MACCATALYST
RCTKeyCommands *commands = [RCTKeyCommands sharedInstance];
[commands unregisterKeyCommandWithInput:@"r" modifierFlags:UIKeyModifierCommand];
#endif
}
- (dispatch_queue_t)methodQueue
{
return dispatch_get_main_queue();
@@ -240,6 +279,17 @@ RCT_EXPORT_MODULE()
[_extraMenuItems addObject:item];
}
- (void)setKeyboardShortcutsEnabled:(BOOL)keyboardShortcutsEnabled
{
if (_keyboardShortcutsEnabled != keyboardShortcutsEnabled) {
[self setHotkeysEnabled:keyboardShortcutsEnabled];
if (!keyboardShortcutsEnabled) {
[self disableReloadCommand];
}
}
}
- (void)setDefaultJSBundle
{
[[RCTBundleURLProvider sharedSettings] resetToDefaults];
@@ -382,7 +432,7 @@ RCT_EXPORT_MODULE()
RCT_EXPORT_METHOD(show)
{
if ((_actionSheet != nullptr) || RCTRunningInAppExtension()) {
if ((_actionSheet != nullptr) || RCTRunningInAppExtension() || !_devMenuEnabled) {
return;
}
@@ -437,7 +487,7 @@ RCT_EXPORT_METHOD(show)
- (void)setShakeToShow:(BOOL)shakeToShow
{
((RCTDevSettings *)[_moduleRegistry moduleForName:"DevSettings"]).isShakeToShowDevMenuEnabled = shakeToShow;
[[_moduleRegistry moduleForName:"DevSettings"] setIsShakeToShowDevMenuEnabled:shakeToShow];
}
- (BOOL)shakeToShow
@@ -487,6 +537,13 @@ RCT_EXPORT_METHOD(setHotLoadingEnabled : (BOOL)enabled)
return [self isHotkeysRegistered];
}
- (void)disableReloadCommand
{
if ([self isReloadCommandRegistered]) {
[self unregisterReloadCommand];
}
}
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
(const facebook::react::ObjCTurboModule::InitParams &)params
{
@@ -500,6 +557,15 @@ RCT_EXPORT_METHOD(setHotLoadingEnabled : (BOOL)enabled)
@interface RCTDevMenu () <NativeDevMenuSpec>
@end
@implementation RCTDevMenuConfiguration
+ (instancetype)defaultConfiguration
{
return nil;
}
@end
@implementation RCTDevMenu
- (void)show
@@ -515,6 +581,10 @@ RCT_EXPORT_METHOD(setHotLoadingEnabled : (BOOL)enabled)
{
}
- (void)disableReloadCommand
{
}
- (BOOL)isActionSheetShown
{
return NO;
@@ -0,0 +1,23 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#import <React/RCTBridgeModule.h>
@class RCTDevMenuConfiguration;
@interface RCTDevMenuConfigurationDecorator : NSObject
#if RCT_DEV_MENU
@property (nonatomic, strong, readonly) RCTDevMenuConfiguration *__nullable devMenuConfiguration;
- (instancetype)initWithDevMenuConfiguration:(RCTDevMenuConfiguration *__nullable)devMenuConfiguration;
- (void)decorate:(id<RCTBridgeModule>)devMenuModule;
#endif
@end
@@ -0,0 +1,52 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#import "RCTDevMenuConfigurationDecorator.h"
#if RCT_DEV_MENU
#import <React/RCTDevMenu.h>
#import <React/RCTDevSettings.h>
@implementation RCTDevMenuConfigurationDecorator
- (instancetype)initWithDevMenuConfiguration:(RCTDevMenuConfiguration *__nullable)devMenuConfiguration
{
if (self = [super init]) {
_devMenuConfiguration = devMenuConfiguration;
}
return self;
}
- (void)decorate:(id<RCTBridgeModule>)bridgeModule
{
if (_devMenuConfiguration == nil) {
return;
}
if ([bridgeModule isKindOfClass:[RCTDevMenu class]]) {
RCTDevMenu *devMenu = (RCTDevMenu *)bridgeModule;
devMenu.devMenuEnabled = _devMenuConfiguration.devMenuEnabled;
devMenu.keyboardShortcutsEnabled = _devMenuConfiguration.keyboardShortcutsEnabled;
}
if ([bridgeModule isKindOfClass:[RCTDevSettings class]]) {
RCTDevSettings *devSettings = (RCTDevSettings *)bridgeModule;
devSettings.isShakeGestureEnabled = _devMenuConfiguration.shakeGestureEnabled;
}
}
@end
#else
@implementation RCTDevMenuConfigurationDecorator : NSObject
@end
#endif
@@ -65,6 +65,11 @@
*/
@property (nonatomic, assign, setter=setHotLoadingEnabled:) BOOL isHotLoadingEnabled;
/**
* Whether shake gesture is enabled.
*/
@property (nonatomic, assign) BOOL isShakeGestureEnabled;
/**
* Enables starting of profiling sampler on launch
*/
@@ -145,6 +145,7 @@ RCT_EXPORT_MODULE()
};
RCTDevSettingsUserDefaultsDataSource *dataSource =
[[RCTDevSettingsUserDefaultsDataSource alloc] initWithDefaultValues:defaultValues];
_isShakeGestureEnabled = true;
return [self initWithDataSource:dataSource];
}
@@ -262,6 +263,12 @@ RCT_EXPORT_MODULE()
return [_dataSource settingForKey:key];
}
- (void)setIsShakeGestureEnabled:(BOOL)isShakeGestureEnabled
{
_isShakeGestureEnabled = isShakeGestureEnabled;
[self setIsShakeToShowDevMenuEnabled:isShakeGestureEnabled];
}
- (BOOL)isDeviceDebuggingAvailable
{
#if RCT_ENABLE_INSPECTOR
@@ -305,7 +312,7 @@ RCT_EXPORT_METHOD(setIsShakeToShowDevMenuEnabled : (BOOL)enabled)
- (BOOL)isShakeToShowDevMenuEnabled
{
return [[self settingForKey:kRCTDevSettingShakeToShowDevMenu] boolValue];
return _isShakeGestureEnabled && [[self settingForKey:kRCTDevSettingShakeToShowDevMenu] boolValue];
}
RCT_EXPORT_METHOD(setProfilingEnabled : (BOOL)enabled)
@@ -21,8 +21,8 @@ class RCTMessageThread : public MessageQueueThread,
public:
RCTMessageThread(NSRunLoop* runLoop, RCTJavaScriptCompleteBlock errorBlock);
~RCTMessageThread() override;
void runOnQueue(std::function<void()>&&) override;
void runOnQueueSync(std::function<void()>&&) override;
void runOnQueue(std::function<void()>&& /*func*/) override;
void runOnQueueSync(std::function<void()>&& /*func*/) override;
void quitSynchronous() override;
void setRunLoop(NSRunLoop* runLoop);
@@ -90,7 +90,7 @@ class RCTObjcExecutor : public JSExecutor {
}];
}
void setBundleRegistry(std::unique_ptr<RAMBundleRegistry>) override
void setBundleRegistry(std::unique_ptr<RAMBundleRegistry> /*bundleRegistry*/) override
{
RCTAssert(NO, @"RAM bundles are not supported in RCTObjcExecutor");
}
@@ -43,7 +43,7 @@ RCT_EXTERN dispatch_queue_t RCTProfileGetQueue(void)
RCT_EXTERN NSUInteger _RCTProfileBeginFlowEvent(void)
__deprecated_msg("This API will be removed along with the legacy architecture.");
RCT_EXTERN void _RCTProfileEndFlowEvent(NSUInteger)
RCT_EXTERN void _RCTProfileEndFlowEvent(NSUInteger /*cookie*/)
__deprecated_msg("This API will be removed along with the legacy architecture.");
/**
@@ -55,7 +55,7 @@ RCT_EXTERN BOOL RCTProfileIsProfiling(void)
/**
* Start collecting profiling information
*/
RCT_EXTERN void RCTProfileInit(RCTBridge *)
RCT_EXTERN void RCTProfileInit(RCTBridge * /*bridge*/)
__deprecated_msg("This API will be removed along with the legacy architecture.");
/**
@@ -63,7 +63,7 @@ RCT_EXTERN void RCTProfileInit(RCTBridge *)
* returned is compliant with google's trace event format - the format used
* as input to trace-viewer
*/
RCT_EXTERN void RCTProfileEnd(RCTBridge *, void (^)(NSString *))
RCT_EXTERN void RCTProfileEnd(RCTBridge * /*bridge*/, void (^/*callback*/)(NSString *))
__deprecated_msg("This API will be removed along with the legacy architecture.");
/**
@@ -164,13 +164,13 @@ RCT_EXTERN void RCTProfileImmediateEvent(uint64_t tag, NSString *name, NSTimeInt
/**
* Hook into a bridge instance to log all bridge module's method calls
*/
RCT_EXTERN void RCTProfileHookModules(RCTBridge *)
RCT_EXTERN void RCTProfileHookModules(RCTBridge * /*bridge*/)
__deprecated_msg("This API will be removed along with the legacy architecture.");
/**
* Unhook from a given bridge instance's modules
*/
RCT_EXTERN void RCTProfileUnhookModules(RCTBridge *)
RCT_EXTERN void RCTProfileUnhookModules(RCTBridge * /*bridge*/)
__deprecated_msg("This API will be removed along with the legacy architecture.");
/**
@@ -215,7 +215,7 @@ typedef struct {
void (*end_async_flow)(uint64_t tag, const char *name, int cookie);
} RCTProfileCallbacks __deprecated_msg("This API will be removed along with the legacy architecture.");
RCT_EXTERN void RCTProfileRegisterCallbacks(RCTProfileCallbacks *)
RCT_EXTERN void RCTProfileRegisterCallbacks(RCTProfileCallbacks * /*cb*/)
__deprecated_msg("This API will be removed along with the legacy architecture.");
/**
@@ -184,7 +184,7 @@ RCT_EXTERN void RCTProfileTrampoline(void);
static void *RCTProfileTrampoline = NULL;
#endif
RCT_EXTERN void RCTProfileTrampolineStart(id, SEL);
RCT_EXTERN void RCTProfileTrampolineStart(id /*self*/, SEL /*cmd*/);
void RCTProfileTrampolineStart(id self, SEL cmd)
{
/**
@@ -7,11 +7,6 @@ public abstract class com/facebook/react/BaseReactPackage : com/facebook/react/R
protected fun getViewManagers (Lcom/facebook/react/bridge/ReactApplicationContext;)Ljava/util/List;
}
public class com/facebook/react/CoreModulesPackage$$ReactModuleInfoProvider : com/facebook/react/module/model/ReactModuleInfoProvider {
public fun <init> ()V
public fun getReactModuleInfos ()Ljava/util/Map;
}
public final class com/facebook/react/DebugCorePackage : com/facebook/react/BaseReactPackage, com/facebook/react/ViewManagerOnDemandReactPackage {
public fun <init> ()V
public fun createViewManager (Lcom/facebook/react/bridge/ReactApplicationContext;Ljava/lang/String;)Lcom/facebook/react/uimanager/ViewManager;
@@ -3806,6 +3801,7 @@ public abstract interface class com/facebook/react/uimanager/ReactPointerEventsV
}
public abstract interface class com/facebook/react/uimanager/ReactRoot {
public static final field Companion Lcom/facebook/react/uimanager/ReactRoot$Companion;
public static final field STATE_STARTED I
public static final field STATE_STOPPED I
public abstract fun getAppProperties ()Landroid/os/Bundle;
@@ -3823,6 +3819,11 @@ public abstract interface class com/facebook/react/uimanager/ReactRoot {
public abstract fun setShouldLogContentAppeared (Z)V
}
public final class com/facebook/react/uimanager/ReactRoot$Companion {
public static final field STATE_STARTED I
public static final field STATE_STOPPED I
}
public abstract interface class com/facebook/react/uimanager/ReactShadowNode {
public abstract fun addChildAt (Lcom/facebook/react/uimanager/ReactShadowNode;I)V
public abstract fun addNativeChildAt (Lcom/facebook/react/uimanager/ReactShadowNode;I)V
@@ -1,207 +0,0 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
package com.facebook.react
import com.facebook.react.bridge.NativeModule
import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.bridge.ReactMarker
import com.facebook.react.bridge.ReactMarkerConstants
import com.facebook.react.common.ClassFinder
import com.facebook.react.common.annotations.internal.LegacyArchitecture
import com.facebook.react.common.annotations.internal.LegacyArchitectureLogLevel
import com.facebook.react.common.annotations.internal.LegacyArchitectureLogger
import com.facebook.react.devsupport.LogBoxModule
import com.facebook.react.module.annotations.ReactModule
import com.facebook.react.module.annotations.ReactModuleList
import com.facebook.react.module.model.ReactModuleInfo
import com.facebook.react.module.model.ReactModuleInfoProvider
import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler
import com.facebook.react.modules.core.DeviceEventManagerModule
import com.facebook.react.modules.core.ExceptionsManagerModule
import com.facebook.react.modules.core.HeadlessJsTaskSupportModule
import com.facebook.react.modules.core.TimingModule
import com.facebook.react.modules.debug.DevMenuModule
import com.facebook.react.modules.debug.DevSettingsModule
import com.facebook.react.modules.debug.SourceCodeModule
import com.facebook.react.modules.deviceinfo.DeviceInfoModule
import com.facebook.react.modules.systeminfo.AndroidInfoModule
import com.facebook.react.uimanager.ViewManager
import com.facebook.react.uimanager.ViewManagerResolver
import com.facebook.systrace.Systrace
/**
* This is the basic module to support React Native. The debug modules are now in DebugCorePackage.
*/
@Suppress("DEPRECATION")
@ReactModuleList(
// WARNING: If you modify this list, ensure that the list below in method
// getReactModuleInfoByInitialization is also updated
nativeModules =
[
AndroidInfoModule::class,
DeviceEventManagerModule::class,
DeviceInfoModule::class,
DevMenuModule::class,
DevSettingsModule::class,
ExceptionsManagerModule::class,
LogBoxModule::class,
HeadlessJsTaskSupportModule::class,
SourceCodeModule::class,
TimingModule::class,
com.facebook.react.uimanager.UIManagerModule::class,
]
)
@LegacyArchitecture(logLevel = LegacyArchitectureLogLevel.ERROR)
@Deprecated(
message = "This class is part of Legacy Architecture and will be removed in a future release",
level = DeprecationLevel.WARNING,
)
internal class CoreModulesPackage(
private val reactInstanceManager: ReactInstanceManager,
private val hardwareBackBtnHandler: DefaultHardwareBackBtnHandler,
private val lazyViewManagersEnabled: Boolean,
private val minTimeLeftInFrameForNonBatchedOperationMs: Int,
) : BaseReactPackage() {
/**
* This method is overridden, since OSS does not run the annotation processor to generate
* [CoreModulesPackage.ReactModuleInfoProvider] class. Here we check if it exists with the method
* [canLoadClassesFromAnnotationProcessors]. If it does not exist, we generate one manually in
* [CoreModulesPackage.getReactModuleInfoByInitialization] and return that instead.
*/
override fun getReactModuleInfoProvider(): ReactModuleInfoProvider {
if (!ClassFinder.canLoadClassesFromAnnotationProcessors()) {
return fallbackForMissingClass()
}
try {
val reactModuleInfoProviderClass =
ClassFinder.findClass("com.facebook.react.CoreModulesPackage\$\$ReactModuleInfoProvider")
return reactModuleInfoProviderClass?.getDeclaredConstructor()?.newInstance()
as ReactModuleInfoProvider
} catch (e: ClassNotFoundException) {
return fallbackForMissingClass()
} catch (e: InstantiationException) {
throw RuntimeException(
"No ReactModuleInfoProvider for CoreModulesPackage$\$ReactModuleInfoProvider",
e,
)
} catch (e: IllegalAccessException) {
throw RuntimeException(
"No ReactModuleInfoProvider for CoreModulesPackage$\$ReactModuleInfoProvider",
e,
)
}
}
private fun fallbackForMissingClass(): ReactModuleInfoProvider {
// In OSS case, the annotation processor does not run. We fall back on creating this byhand
val moduleList: Array<Class<out NativeModule>> =
arrayOf(
AndroidInfoModule::class.java,
DeviceEventManagerModule::class.java,
DeviceInfoModule::class.java,
DevMenuModule::class.java,
DevSettingsModule::class.java,
ExceptionsManagerModule::class.java,
LogBoxModule::class.java,
HeadlessJsTaskSupportModule::class.java,
SourceCodeModule::class.java,
TimingModule::class.java,
com.facebook.react.uimanager.UIManagerModule::class.java,
)
val reactModuleInfoMap: MutableMap<String, ReactModuleInfo> = HashMap<String, ReactModuleInfo>()
for (moduleClass in moduleList) {
val reactModule: ReactModule? =
moduleClass.getAnnotation<ReactModule>(ReactModule::class.java)
if (reactModule != null) {
reactModuleInfoMap[reactModule.name] =
ReactModuleInfo(
reactModule.name,
moduleClass.name,
reactModule.canOverrideExistingModule,
reactModule.needsEagerInit,
reactModule.isCxxModule,
ReactModuleInfo.classIsTurboModule(moduleClass),
)
}
}
return ReactModuleInfoProvider { reactModuleInfoMap }
}
override fun getModule(name: String, reactContext: ReactApplicationContext): NativeModule? {
return when (name) {
AndroidInfoModule.NAME -> AndroidInfoModule(reactContext)
DeviceEventManagerModule.NAME ->
DeviceEventManagerModule(reactContext, hardwareBackBtnHandler)
DevMenuModule.NAME -> DevMenuModule(reactContext, reactInstanceManager.devSupportManager)
DevSettingsModule.NAME ->
DevSettingsModule(reactContext, reactInstanceManager.devSupportManager)
ExceptionsManagerModule.NAME ->
ExceptionsManagerModule(reactInstanceManager.devSupportManager)
LogBoxModule.NAME -> LogBoxModule(reactContext, reactInstanceManager.devSupportManager)
HeadlessJsTaskSupportModule.NAME -> HeadlessJsTaskSupportModule(reactContext)
SourceCodeModule.NAME -> SourceCodeModule(reactContext)
TimingModule.NAME -> TimingModule(reactContext, reactInstanceManager.devSupportManager)
com.facebook.react.uimanager.UIManagerModule.NAME -> createUIManager(reactContext)
DeviceInfoModule.NAME -> DeviceInfoModule(reactContext)
else ->
throw IllegalArgumentException(
"In CoreModulesPackage, could not find Native module for $name"
)
}
}
private fun createUIManager(
reactContext: ReactApplicationContext
): com.facebook.react.uimanager.UIManagerModule {
ReactMarker.logMarker(ReactMarkerConstants.CREATE_UI_MANAGER_MODULE_START)
Systrace.beginSection(Systrace.TRACE_TAG_REACT, "createUIManagerModule")
try {
if (lazyViewManagersEnabled) {
val resolver: ViewManagerResolver =
object : ViewManagerResolver {
override fun getViewManager(viewManagerName: String): ViewManager<*, *>? {
return reactInstanceManager.createViewManager(viewManagerName)
}
override fun getViewManagerNames(): Collection<String> {
return reactInstanceManager.viewManagerNames
}
}
return com.facebook.react.uimanager.UIManagerModule(
reactContext,
resolver,
minTimeLeftInFrameForNonBatchedOperationMs,
)
} else {
return com.facebook.react.uimanager.UIManagerModule(
reactContext,
reactInstanceManager.getOrCreateViewManagers(reactContext),
minTimeLeftInFrameForNonBatchedOperationMs,
)
}
} finally {
Systrace.endSection(Systrace.TRACE_TAG_REACT)
ReactMarker.logMarker(ReactMarkerConstants.CREATE_UI_MANAGER_MODULE_END)
}
}
private companion object {
init {
LegacyArchitectureLogger.assertLegacyArchitecture(
"CoreModulesPackage",
LegacyArchitectureLogLevel.ERROR,
)
}
}
}
@@ -300,17 +300,6 @@ public class ReactInstanceManager {
synchronized (mPackages) {
PrinterHolder.getPrinter()
.logMessage(ReactDebugOverlayTags.RN_CORE, "RNCore: Use Split Packages");
mPackages.add(
new CoreModulesPackage(
this,
new DefaultHardwareBackBtnHandler() {
@Override
public void invokeDefaultOnBackPressed() {
ReactInstanceManager.this.invokeDefaultOnBackPressed();
}
},
lazyViewManagersEnabled,
minTimeLeftInFrameForNonBatchedOperationMs));
if (mUseDeveloperSupport) {
mPackages.add(new DebugCorePackage());
}
@@ -381,8 +381,8 @@ public abstract class DevSupportManagerBase(
DevOptionHandler {
UiThreadUtil.runOnUiThread {
if (reactInstanceDevHelper is PerfMonitorDevHelper) {
reactInstanceDevHelper.inspectorTarget?.let {
if (it.pauseAndAnalyzeBackgroundTrace()) {
reactInstanceDevHelper.inspectorTarget?.let { target ->
if (!target.pauseAndAnalyzeBackgroundTrace()) {
openDebugger(DebuggerFrontendPanelName.PERFORMANCE.toString())
}
}
@@ -543,7 +543,14 @@ public abstract class DevSupportManagerBase(
!disabledItemKeys.contains(getItem(position))
override fun getView(position: Int, convertView: View?, parent: ViewGroup): View =
super.getView(position, convertView, parent).apply { isEnabled = isEnabled(position) }
super.getView(position, convertView, parent).apply {
isEnabled = isEnabled(position)
if (this is TextView) {
setTextColor(
if (isEnabled) android.graphics.Color.WHITE else android.graphics.Color.GRAY
)
}
}
}
devOptionsDialog =
@@ -558,6 +565,24 @@ public abstract class DevSupportManagerBase(
devOptionsDialog?.show()
// Prior to Android 12, the list view in AlertDialogs did not match
// their content size.
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.R) {
devOptionsDialog?.getListView()?.let { listView ->
val displayMetrics = context.resources.displayMetrics
val maxHeight = (displayMetrics.heightPixels * 0.7).toInt()
val layoutParams =
listView.layoutParams
?: ViewGroup.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT,
)
layoutParams.height = maxHeight
listView.layoutParams = layoutParams
}
}
val reactContext = currentReactContext
reactContext?.getJSModule(RCTNativeAppEventEmitter::class.java)?.emit("RCTDevMenuShown", null)
}
@@ -567,8 +592,10 @@ public abstract class DevSupportManagerBase(
perfMonitorOverlayManager?.let { manager ->
reactInstanceDevHelper.inspectorTarget?.addPerfMonitorListener(manager)
}
perfMonitorOverlayManager?.enable()
perfMonitorOverlayManager?.startBackgroundTrace()
if (isPackagerConnected) {
perfMonitorOverlayManager?.enable()
perfMonitorOverlayManager?.startBackgroundTrace()
}
perfMonitorInitialized = true
}
@@ -896,11 +923,13 @@ public abstract class DevSupportManagerBase(
override fun onPackagerConnected() {
isPackagerConnected = true
perfMonitorOverlayManager?.enable()
perfMonitorOverlayManager?.startBackgroundTrace()
}
override fun onPackagerDisconnected() {
isPackagerConnected = false
perfMonitorOverlayManager?.disable()
perfMonitorOverlayManager?.stopBackgroundTrace()
}
override fun onPackagerReloadCommand() {
@@ -10,6 +10,7 @@ package com.facebook.react.devsupport.inspector
import com.facebook.jni.HybridData
import com.facebook.proguard.annotations.DoNotStrip
import com.facebook.proguard.annotations.DoNotStripAny
import com.facebook.soloader.SoLoader
/**
* JNI wrapper for `jsinspectormodern::NetworkRequestListener`. Handles the `ScopedExecutor`
@@ -26,4 +27,10 @@ internal class InspectorNetworkRequestListener(
external fun onError(message: String?)
external fun onCompletion()
companion object {
init {
SoLoader.loadLibrary("reactnativejni")
}
}
}
@@ -25,4 +25,7 @@ internal interface PerfMonitorInspectorTargetBinding {
/** Attempt to start a new background performance trace. */
public fun resumeBackgroundTrace()
/** Attempt to stop the current performance trace. */
public fun stopBackgroundTrace()
}
@@ -58,6 +58,18 @@ internal class PerfMonitorOverlayManager(
}
}
/** Stop background trace recording. */
fun stopBackgroundTrace() {
if (!enabled) {
return
}
devHelper.inspectorTarget?.let { target ->
target.stopBackgroundTrace()
onRecordingStateChanged(target.getTracingState())
}
}
override fun onRecordingStateChanged(state: TracingState) {
tracingState = state
UiThreadUtil.runOnUiThread {
@@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<f707e26d09b6f7962ec97296a1a215b6>>
* @generated SignedSource<<8af0aea8bbf4cffaad7d312032bef0e4>>
*/
/**
@@ -456,6 +456,12 @@ public object ReactNativeFeatureFlags {
@JvmStatic
public fun useShadowNodeStateOnClone(): Boolean = accessor.useShadowNodeStateOnClone()
/**
* Use shared animation backend in C++ Animated
*/
@JvmStatic
public fun useSharedAnimatedBackend(): Boolean = accessor.useSharedAnimatedBackend()
/**
* In Bridgeless mode, should legacy NativeModules use the TurboModule system?
*/
@@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<e7cfc5135c7b3c731324297e92e41e3f>>
* @generated SignedSource<<5c2aa1e15e7fbe129b8f774d2dc7be70>>
*/
/**
@@ -91,6 +91,7 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
private var useOptimizedEventBatchingOnAndroidCache: Boolean? = null
private var useRawPropsJsiValueCache: Boolean? = null
private var useShadowNodeStateOnCloneCache: Boolean? = null
private var useSharedAnimatedBackendCache: Boolean? = null
private var useTurboModuleInteropCache: Boolean? = null
private var useTurboModulesCache: Boolean? = null
private var viewCullingOutsetRatioCache: Double? = null
@@ -736,6 +737,15 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
return cached
}
override fun useSharedAnimatedBackend(): Boolean {
var cached = useSharedAnimatedBackendCache
if (cached == null) {
cached = ReactNativeFeatureFlagsCxxInterop.useSharedAnimatedBackend()
useSharedAnimatedBackendCache = cached
}
return cached
}
override fun useTurboModuleInterop(): Boolean {
var cached = useTurboModuleInteropCache
if (cached == null) {
@@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<3254fef626b10ef21d8d9ee1bdbb1880>>
* @generated SignedSource<<0bd8796f4580322a78690ec4469c07ce>>
*/
/**
@@ -170,6 +170,8 @@ public object ReactNativeFeatureFlagsCxxInterop {
@DoNotStrip @JvmStatic public external fun useShadowNodeStateOnClone(): Boolean
@DoNotStrip @JvmStatic public external fun useSharedAnimatedBackend(): Boolean
@DoNotStrip @JvmStatic public external fun useTurboModuleInterop(): Boolean
@DoNotStrip @JvmStatic public external fun useTurboModules(): Boolean
@@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<9f7eb1bb5e24fd8ee87accf60209cce3>>
* @generated SignedSource<<7c7796cbe2722f0f6e5b2cc4ed43a0d5>>
*/
/**
@@ -165,6 +165,8 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi
override fun useShadowNodeStateOnClone(): Boolean = false
override fun useSharedAnimatedBackend(): Boolean = false
override fun useTurboModuleInterop(): Boolean = false
override fun useTurboModules(): Boolean = false
@@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<9e6e04ca37edd1ad9265b74e251ff4de>>
* @generated SignedSource<<f3420de2307aab53b885fa491183d84b>>
*/
/**
@@ -95,6 +95,7 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
private var useOptimizedEventBatchingOnAndroidCache: Boolean? = null
private var useRawPropsJsiValueCache: Boolean? = null
private var useShadowNodeStateOnCloneCache: Boolean? = null
private var useSharedAnimatedBackendCache: Boolean? = null
private var useTurboModuleInteropCache: Boolean? = null
private var useTurboModulesCache: Boolean? = null
private var viewCullingOutsetRatioCache: Double? = null
@@ -811,6 +812,16 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
return cached
}
override fun useSharedAnimatedBackend(): Boolean {
var cached = useSharedAnimatedBackendCache
if (cached == null) {
cached = currentProvider.useSharedAnimatedBackend()
accessedFeatureFlags.add("useSharedAnimatedBackend")
useSharedAnimatedBackendCache = cached
}
return cached
}
override fun useTurboModuleInterop(): Boolean {
var cached = useTurboModuleInteropCache
if (cached == null) {
@@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<65e895433fc609bd7c2b5d7faa507f46>>
* @generated SignedSource<<d4370bcde97d3c2b0b8d2a77e42a6031>>
*/
/**
@@ -165,6 +165,8 @@ public interface ReactNativeFeatureFlagsProvider {
@DoNotStrip public fun useShadowNodeStateOnClone(): Boolean
@DoNotStrip public fun useSharedAnimatedBackend(): Boolean
@DoNotStrip public fun useTurboModuleInterop(): Boolean
@DoNotStrip public fun useTurboModules(): Boolean
@@ -89,10 +89,10 @@ internal class AccessibilityInfoModule(context: ReactApplicationContext) :
init {
val appContext = context.applicationContext
accessibilityManager =
appContext.getSystemService(Context.ACCESSIBILITY_SERVICE) as AccessibilityManager
appContext.getSystemService(Context.ACCESSIBILITY_SERVICE) as AccessibilityManager?
contentResolver = reactApplicationContext.contentResolver
touchExplorationEnabled = accessibilityManager.isTouchExplorationEnabled
accessibilityServiceEnabled = accessibilityManager.isEnabled
touchExplorationEnabled = accessibilityManager?.isTouchExplorationEnabled ?: false
accessibilityServiceEnabled = accessibilityManager?.isEnabled ?: false
reduceMotionEnabled = isReduceMotionEnabledValue
highTextContrastEnabled = isHighTextContrastEnabledValue
grayscaleModeEnabled = isGrayscaleEnabledValue
@@ -20,6 +20,7 @@ import com.facebook.react.bridge.JavaScriptModuleRegistry
import com.facebook.react.bridge.NativeArray
import com.facebook.react.bridge.NativeModule
import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.bridge.ReactSoftExceptionLogger.logSoftException
import com.facebook.react.bridge.UIManager
import com.facebook.react.common.annotations.FrameworkAPI
import com.facebook.react.common.annotations.UnstableReactNativeAPI
@@ -30,6 +31,8 @@ import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler
import com.facebook.react.turbomodule.core.interfaces.CallInvokerHolder
import com.facebook.react.uimanager.events.EventDispatcher
import com.facebook.react.uimanager.events.EventDispatcherProvider
import com.facebook.react.uimanager.events.RCTEventEmitter
import java.lang.IllegalArgumentException
import java.lang.reflect.InvocationHandler
import java.lang.reflect.Method
import java.lang.reflect.Proxy
@@ -124,6 +127,14 @@ internal class BridgelessReactContext(context: Context, private val reactHost: R
override fun <T : JavaScriptModule> getJSModule(jsInterface: Class<T>): T? {
mInteropModuleRegistry?.getInteropModule(jsInterface)?.let {
if (jsInterface == RCTEventEmitter::class.java) {
logSoftException(
TAG,
IllegalArgumentException(
"getJSModule(RCTEventEmitter) is not recommended in the new architecture and will stop working with interop disabled. Please use UIManagerHelper.getEventDispatcher or UIManagerHelper.getEventDispatcherForReactTag instead"
),
)
}
return it
}
@@ -61,6 +61,7 @@ import com.facebook.react.runtime.internal.bolts.Task
import com.facebook.react.runtime.internal.bolts.TaskCompletionSource
import com.facebook.react.turbomodule.core.interfaces.CallInvokerHolder
import com.facebook.react.uimanager.DisplayMetricsHolder
import com.facebook.react.uimanager.PixelUtil
import com.facebook.react.uimanager.events.BlackHoleEventDispatcher
import com.facebook.react.uimanager.events.EventDispatcher
import com.facebook.react.views.imagehelper.ResourceDrawableIdHelper
@@ -647,10 +648,14 @@ public class ReactHostImpl(
val currentReactContext = this.currentReactContext
if (currentReactContext != null) {
if (ReactNativeFeatureFlags.enableFontScaleChangesUpdatingLayout()) {
val previousFontScale = PixelUtil.toPixelFromSP(1.0)
DisplayMetricsHolder.initDisplayMetrics(currentReactContext)
val newFontScale = PixelUtil.toPixelFromSP(1.0)
synchronized(attachedSurfaces) {
attachedSurfaces.forEach { surface -> surface.view?.requestLayout() }
if (previousFontScale != newFontScale) {
synchronized(attachedSurfaces) {
attachedSurfaces.forEach { surface -> surface.view?.requestLayout() }
}
}
}
@@ -67,6 +67,13 @@ internal class ReactHostInspectorTarget(reactHostImpl: ReactHostImpl) :
}
}
override fun stopBackgroundTrace() {
stopAndDiscardBackgroundTrace()
perfMonitorListeners.forEach { listener ->
listener.onRecordingStateChanged(TracingState.DISABLED)
}
}
override fun close() {
mHybridData.resetNative()
}
@@ -1,76 +0,0 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
package com.facebook.react.uimanager;
import android.os.Bundle;
import android.view.ViewGroup;
import androidx.annotation.Nullable;
import com.facebook.infer.annotation.Nullsafe;
import com.facebook.react.uimanager.common.UIManagerType;
import java.util.concurrent.atomic.AtomicInteger;
/** Interface for the root native view of a React native application */
@Nullsafe(Nullsafe.Mode.LOCAL)
public interface ReactRoot {
/** This constant represents that ReactRoot hasn't started yet or it has been destroyed. */
int STATE_STOPPED = 0;
/** This constant represents that ReactRoot has started. */
int STATE_STARTED = 1;
/** Return cached launch properties for app */
@Nullable
Bundle getAppProperties();
String getJSModuleName();
/** Fabric or Default UI Manager, see {@link UIManagerType} */
@UIManagerType
int getUIManagerType();
int getRootViewTag();
void setRootViewTag(int rootViewTag);
/** Calls into JS to start the React application. */
void runApplication();
/** Handler for stages {@link com.facebook.react.surface.ReactStage} */
void onStage(@ReactStage int stage);
/** Return native view for root */
ViewGroup getRootViewGroup();
/**
* @return Cached values for widthMeasureSpec.
*/
int getWidthMeasureSpec();
/**
* @return Cached values for and heightMeasureSpec.
*/
int getHeightMeasureSpec();
/** Sets a flag that determines whether to log that content appeared on next view added. */
void setShouldLogContentAppeared(boolean shouldLogContentAppeared);
/**
* @return a {@link String} that represents the root js application that is being rendered with
* this {@link ReactRoot}
* @deprecated We recommend to not use this method as it is will be replaced in the near future.
*/
@Deprecated
@Nullable
String getSurfaceID();
/**
* @return an {@link AtomicInteger} that represents the state of the ReactRoot object.
*/
AtomicInteger getState();
}
@@ -0,0 +1,66 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
package com.facebook.react.uimanager
import android.os.Bundle
import android.view.ViewGroup
import com.facebook.react.uimanager.common.UIManagerType
import java.util.concurrent.atomic.AtomicInteger
/** Interface for the root native view of a React native application */
public interface ReactRoot {
public companion object {
/** This constant represents that ReactRoot hasn't started yet or it has been destroyed. */
public const val STATE_STOPPED: Int = 0
/** This constant represents that ReactRoot has started. */
public const val STATE_STARTED: Int = 1
}
/** Return cached launch properties for app */
public fun getAppProperties(): Bundle?
public fun getJSModuleName(): String
/** Fabric or Default UI Manager, see [UIManagerType] */
@UIManagerType public fun getUIManagerType(): Int
public fun getRootViewTag(): Int
public fun setRootViewTag(rootViewTag: Int)
/** Calls into JS to start the React application. */
public fun runApplication()
/** Handler for stages [com.facebook.react.surface.ReactStage] */
public fun onStage(@ReactStage stage: Int)
/** Return native view for root */
public fun getRootViewGroup(): ViewGroup
/** @return Cached values for widthMeasureSpec. */
public fun getWidthMeasureSpec(): Int
/** @return Cached values for and heightMeasureSpec. */
public fun getHeightMeasureSpec(): Int
/** Sets a flag that determines whether to log that content appeared on next view added. */
public fun setShouldLogContentAppeared(shouldLogContentAppeared: Boolean)
/**
* @return a [String] that represents the root js application that is being rendered with this
* [ReactRoot]
* @deprecated We recommend to not use this method as it is will be replaced in the near future.
*/
@Deprecated("We recommend to not use this method as it is will be replaced in the near future.")
public fun getSurfaceID(): String?
/** @return an [AtomicInteger] that represents the state of the ReactRoot object. */
public fun getState(): AtomicInteger
}
@@ -194,7 +194,8 @@ public object UIManagerHelper {
public fun getSurfaceId(view: View): Int {
if (view is ReactRoot) {
val rootView = view as ReactRoot
return if (rootView.uiManagerType == UIManagerType.FABRIC) rootView.rootViewTag else -1
return if (rootView.getUIManagerType() == UIManagerType.FABRIC) rootView.getRootViewTag()
else -1
}
val reactTag = view.id
@@ -528,11 +528,24 @@ public class ReactScrollView extends ScrollView
}
private void scrollToChild(View child) {
// Only scroll the nearest ReactScrollView ancestor into view, rather than the focused child.
// Nested ScrollView instances will handle scrolling the child into their respective viewports.
View parent = child;
View scrollViewAncestor = null;
while (parent != null && parent != this) {
if (parent instanceof ReactScrollView) {
scrollViewAncestor = parent;
}
parent = (View) parent.getParent();
}
View scrollIntoViewTarget = scrollViewAncestor != null ? scrollViewAncestor : child;
Rect tempRect = new Rect();
child.getDrawingRect(tempRect);
scrollIntoViewTarget.getDrawingRect(tempRect);
/* Offset from child's local coordinates to ScrollView coordinates */
offsetDescendantRectToMyCoords(child, tempRect);
offsetDescendantRectToMyCoords(scrollIntoViewTarget, tempRect);
int scrollDelta = computeScrollDeltaToGetChildRectOnScreen(tempRect);
@@ -49,7 +49,7 @@ class JCxxInspectorPackagerConnection
jni::alias_ref<JDelegateImpl::javaobject> delegate);
static jni::local_ref<jhybriddata> initHybrid(
jni::alias_ref<jclass>,
jni::alias_ref<jclass> /*unused*/,
const std::string& url,
const std::string& deviceName,
const std::string& packageName,
@@ -19,8 +19,8 @@ class JInspectorFlags : public jni::JavaClass<JInspectorFlags> {
static constexpr auto kJavaDescriptor =
"Lcom/facebook/react/devsupport/InspectorFlags;";
static bool getFuseboxEnabled(jni::alias_ref<jclass>);
static bool getIsProfilingBuild(jni::alias_ref<jclass>);
static bool getFuseboxEnabled(jni::alias_ref<jclass> /*unused*/);
static bool getIsProfilingBuild(jni::alias_ref<jclass> /*unused*/);
static void registerNatives();
@@ -25,7 +25,8 @@ class ComponentFactory : public jni::HybridClass<ComponentFactory> {
ComponentRegistryFactory buildRegistryFunction;
private:
static jni::local_ref<jhybriddata> initHybrid(jni::alias_ref<jclass>);
static jni::local_ref<jhybriddata> initHybrid(
jni::alias_ref<jclass> /*unused*/);
};
} // namespace facebook::react
@@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<7a0a26494846d6b4881bea01beabb9d6>>
* @generated SignedSource<<740fec2589997816f17778f57b1d4abf>>
*/
/**
@@ -465,6 +465,12 @@ class ReactNativeFeatureFlagsJavaProvider
return method(javaProvider_);
}
bool useSharedAnimatedBackend() override {
static const auto method =
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("useSharedAnimatedBackend");
return method(javaProvider_);
}
bool useTurboModuleInterop() override {
static const auto method =
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("useTurboModuleInterop");
@@ -854,6 +860,11 @@ bool JReactNativeFeatureFlagsCxxInterop::useShadowNodeStateOnClone(
return ReactNativeFeatureFlags::useShadowNodeStateOnClone();
}
bool JReactNativeFeatureFlagsCxxInterop::useSharedAnimatedBackend(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
return ReactNativeFeatureFlags::useSharedAnimatedBackend();
}
bool JReactNativeFeatureFlagsCxxInterop::useTurboModuleInterop(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
return ReactNativeFeatureFlags::useTurboModuleInterop();
@@ -1123,6 +1134,9 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
makeNativeMethod(
"useShadowNodeStateOnClone",
JReactNativeFeatureFlagsCxxInterop::useShadowNodeStateOnClone),
makeNativeMethod(
"useSharedAnimatedBackend",
JReactNativeFeatureFlagsCxxInterop::useSharedAnimatedBackend),
makeNativeMethod(
"useTurboModuleInterop",
JReactNativeFeatureFlagsCxxInterop::useTurboModuleInterop),
@@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<ad2e322ef177ced7eb07412552596a5b>>
* @generated SignedSource<<2d4ccbeed5ffafd40715357ff98d83b1>>
*/
/**
@@ -243,6 +243,9 @@ class JReactNativeFeatureFlagsCxxInterop
static bool useShadowNodeStateOnClone(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
static bool useSharedAnimatedBackend(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
static bool useTurboModuleInterop(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
@@ -19,10 +19,10 @@ class HermesSamplingProfiler : public jni::JavaClass<HermesSamplingProfiler> {
public:
constexpr static auto kJavaDescriptor =
"Lcom/facebook/hermes/instrumentation/HermesSamplingProfiler;";
static void enable(jni::alias_ref<jclass>);
static void disable(jni::alias_ref<jclass>);
static void enable(jni::alias_ref<jclass> /*unused*/);
static void disable(jni::alias_ref<jclass> /*unused*/);
static void dumpSampledTraceToFile(
jni::alias_ref<jclass>,
jni::alias_ref<jclass> /*unused*/,
const std::string& filename);
static void registerNatives();
@@ -43,7 +43,8 @@ class [[deprecated(
static constexpr auto kJavaDescriptor =
"Lcom/facebook/react/bridge/CatalystInstanceImpl;";
static jni::local_ref<jhybriddata> initHybrid(jni::alias_ref<jclass>);
static jni::local_ref<jhybriddata> initHybrid(
jni::alias_ref<jclass> /*unused*/);
static void registerNatives();
@@ -62,7 +62,7 @@ class ReactInstanceManagerInspectorTarget
jsinspector_modern::HostTargetMetadata getMetadata() override;
void onReload(const PageReloadRequest& request) override;
void onSetPausedInDebuggerMessage(
const OverlaySetPausedInDebuggerMessageRequest&) override;
const OverlaySetPausedInDebuggerMessageRequest& /*request*/) override;
void loadNetworkResource(
const jsinspector_modern::LoadNetworkResourceRequest& params,
jsinspector_modern::ScopedExecutor<
@@ -39,7 +39,9 @@ void processTransform(
}
auto result = BaseViewProps::resolveTransform(
Size(viewWidth, viewHeight), transform, transformOrigin);
Size{.width = viewWidth, .height = viewHeight},
transform,
transformOrigin);
// Convert from matrix of floats to double matrix
constexpr size_t MatrixSize = std::tuple_size_v<decltype(result.matrix)>;
@@ -33,7 +33,7 @@ class DefaultComponentsRegistry
private:
static void setRegistryRunction(
jni::alias_ref<jclass>,
jni::alias_ref<jclass> /*unused*/,
ComponentFactory* delegate);
};
@@ -25,8 +25,9 @@ class DefaultTurboModuleManagerDelegate : public jni::HybridClass<
"Lcom/facebook/react/defaults/DefaultTurboModuleManagerDelegate;";
static jni::local_ref<jhybriddata> initHybrid(
jni::alias_ref<jclass>,
jni::alias_ref<jni::JList<CxxReactPackage::javaobject>::javaobject>);
jni::alias_ref<jclass> /*unused*/,
jni::alias_ref<jni::JList<
CxxReactPackage::javaobject>::javaobject> /*cxxReactPackages*/);
static void registerNatives();
@@ -24,7 +24,7 @@ class BlobCollector : public jni::HybridClass<BlobCollector>,
"Lcom/facebook/react/modules/blob/BlobCollector;";
static void nativeInstall(
jni::alias_ref<jclass>,
jni::alias_ref<jclass> /*unused*/,
jni::alias_ref<jobject> blobModule,
jlong jsContextNativePointer);
@@ -37,7 +37,7 @@ class JReactInstance : public jni::HybridClass<JReactInstance> {
"Lcom/facebook/react/runtime/ReactInstance;";
static jni::local_ref<jhybriddata> initHybrid(
jni::alias_ref<jhybridobject>,
jni::alias_ref<jhybridobject> /*unused*/,
jni::alias_ref<JJSRuntimeFactory::javaobject> jsRuntimeFactory,
jni::alias_ref<JavaMessageQueueThread::javaobject> jsMessageQueueThread,
jni::alias_ref<JavaMessageQueueThread::javaobject>
@@ -98,7 +98,7 @@ class RootViewTest {
val rootViewId = 11
val rootView = ReactRootView(reactContext)
rootView.id = rootViewId
rootView.rootViewTag = rootViewId
rootView.setRootViewTag(rootViewId)
rootView.startReactApplication(instanceManager, "")
rootView.simulateAttachForTesting()
val ts = SystemClock.currentTimeMillis()
@@ -54,12 +54,23 @@ Pod::Spec.new do |s|
depend_on_js_engine(s)
add_rn_third_party_dependencies(s)
add_rncore_dependency(s)
s.subspec "animated" do |ss|
ss.source_files = podspec_sources("react/renderer/animated/**/*.{m,mm,cpp,h}", "react/renderer/animated/**/*.{h}")
ss.exclude_files = "react/renderer/animated/tests"
ss.header_dir = "react/renderer/animated"
end
s.subspec "animations" do |ss|
ss.source_files = podspec_sources("react/renderer/animations/**/*.{m,mm,cpp,h}", "react/renderer/animations/**/*.{h}")
ss.exclude_files = "react/renderer/animations/tests"
ss.header_dir = "react/renderer/animations"
end
s.subspec "animationbackend" do |ss|
ss.source_files = podspec_sources("react/renderer/animationbackend/**/*.{m,mm,cpp,h}", "react/renderer/animationbackend/**/*.{h}")
ss.header_dir = "react/renderer/animationbackend"
end
s.subspec "attributedstring" do |ss|
ss.source_files = podspec_sources("react/renderer/attributedstring/**/*.{m,mm,cpp,h}", "react/renderer/attributedstring/**/*.{h}")
@@ -110,7 +110,7 @@ class CxxModule {
Method(
std::string aname,
std::function<void(folly::dynamic, Callback, Callback)>&& afunc,
AsyncTagType)
AsyncTagType /*unused*/)
: name(std::move(aname)),
callbacks(2),
isPromise(false),
@@ -163,7 +163,7 @@ class CxxModule {
std::string aname,
T* t,
void (T::*method)(folly::dynamic, Callback, Callback),
AsyncTagType)
AsyncTagType /*unused*/)
: name(std::move(aname)),
callbacks(2),
isPromise(false),
@@ -183,7 +183,7 @@ class CxxModule {
Method(
std::string aname,
std::function<folly::dynamic()>&& afunc,
SyncTagType)
SyncTagType /*unused*/)
: name(std::move(aname)),
callbacks(0),
isPromise(false),
@@ -194,7 +194,7 @@ class CxxModule {
Method(
std::string aname,
std::function<folly::dynamic(folly::dynamic)>&& afunc,
SyncTagType)
SyncTagType /*unused*/)
: name(std::move(aname)),
callbacks(0),
isPromise(false),
@@ -190,7 +190,7 @@ std::optional<ModuleConfig> ModuleRegistry::getConfig(const std::string& name) {
// no constants or methods
return std::nullopt;
} else {
return ModuleConfig{index, std::move(config)};
return ModuleConfig{.index = index, .config = std::move(config)};
}
}
@@ -70,8 +70,8 @@ JSModulesUnbundle::Module RAMBundleRegistry::getModule(
}
return {
"seg-" + std::to_string(bundleId) + '_' + module.name,
std::move(module.code),
.name = "seg-" + std::to_string(bundleId) + '_' + module.name,
.code = std::move(module.code),
};
}
@@ -27,8 +27,8 @@ class ArgsConverter;
class JSCRuntime;
struct Lock {
void lock(const jsc::JSCRuntime&) const {}
void unlock(const jsc::JSCRuntime&) const {}
void lock(const jsc::JSCRuntime& /*unused*/) const {}
void unlock(const jsc::JSCRuntime& /*unused*/) const {}
};
class JSCRuntime : public jsi::Runtime {
@@ -158,78 +158,88 @@ class JSCRuntime : public jsi::Runtime {
override;
jsi::PropNameID createPropNameIDFromString(const jsi::String& str) override;
jsi::PropNameID createPropNameIDFromSymbol(const jsi::Symbol& sym) override;
std::string utf8(const jsi::PropNameID&) override;
bool compare(const jsi::PropNameID&, const jsi::PropNameID&) override;
std::string utf8(const jsi::PropNameID& /*sym*/) override;
bool compare(const jsi::PropNameID& /*a*/, const jsi::PropNameID& /*b*/)
override;
std::string symbolToString(const jsi::Symbol&) override;
std::string symbolToString(const jsi::Symbol& /*sym*/) override;
jsi::BigInt createBigIntFromInt64(int64_t) override;
jsi::BigInt createBigIntFromUint64(uint64_t) override;
bool bigintIsInt64(const jsi::BigInt&) override;
bool bigintIsUint64(const jsi::BigInt&) override;
uint64_t truncate(const jsi::BigInt&) override;
jsi::String bigintToString(const jsi::BigInt&, int) override;
jsi::BigInt createBigIntFromInt64(int64_t /*unused*/) override;
jsi::BigInt createBigIntFromUint64(uint64_t /*unused*/) override;
bool bigintIsInt64(const jsi::BigInt& /*unused*/) override;
bool bigintIsUint64(const jsi::BigInt& /*unused*/) override;
uint64_t truncate(const jsi::BigInt& /*unused*/) override;
jsi::String bigintToString(const jsi::BigInt& /*unused*/, int /*unused*/)
override;
jsi::String createStringFromAscii(const char* str, size_t length) override;
jsi::String createStringFromUtf8(const uint8_t* utf8, size_t length) override;
std::string utf8(const jsi::String&) override;
std::string utf8(const jsi::String& /*str*/) override;
jsi::Object createObject() override;
jsi::Object createObject(std::shared_ptr<jsi::HostObject> ho) override;
virtual std::shared_ptr<jsi::HostObject> getHostObject(
const jsi::Object&) override;
jsi::HostFunctionType& getHostFunction(const jsi::Function&) override;
const jsi::Object& /*obj*/) override;
jsi::HostFunctionType& getHostFunction(const jsi::Function& /*obj*/) override;
bool hasNativeState(const jsi::Object&) override;
std::shared_ptr<jsi::NativeState> getNativeState(const jsi::Object&) override;
void setNativeState(const jsi::Object&, std::shared_ptr<jsi::NativeState>)
override;
bool hasNativeState(const jsi::Object& /*obj*/) override;
std::shared_ptr<jsi::NativeState> getNativeState(
const jsi::Object& /*obj*/) override;
void setNativeState(
const jsi::Object& /*obj*/,
std::shared_ptr<jsi::NativeState> /*nativeState*/) override;
jsi::Value getProperty(const jsi::Object&, const jsi::String& name) override;
jsi::Value getProperty(const jsi::Object&, const jsi::PropNameID& name)
jsi::Value getProperty(const jsi::Object& /*obj*/, const jsi::String& name)
override;
jsi::Value getProperty(
const jsi::Object& /*obj*/,
const jsi::PropNameID& name) override;
bool hasProperty(const jsi::Object& /*obj*/, const jsi::String& name)
override;
bool hasProperty(const jsi::Object& /*obj*/, const jsi::PropNameID& name)
override;
bool hasProperty(const jsi::Object&, const jsi::String& name) override;
bool hasProperty(const jsi::Object&, const jsi::PropNameID& name) override;
void setPropertyValue(
const jsi::Object&,
const jsi::Object& /*object*/,
const jsi::String& name,
const jsi::Value& value) override;
void setPropertyValue(
const jsi::Object&,
const jsi::Object& /*object*/,
const jsi::PropNameID& name,
const jsi::Value& value) override;
bool isArray(const jsi::Object&) const override;
bool isArrayBuffer(const jsi::Object&) const override;
bool isFunction(const jsi::Object&) const override;
bool isHostObject(const jsi::Object&) const override;
bool isHostFunction(const jsi::Function&) const override;
jsi::Array getPropertyNames(const jsi::Object&) override;
bool isArray(const jsi::Object& /*obj*/) const override;
bool isArrayBuffer(const jsi::Object& /*obj*/) const override;
bool isFunction(const jsi::Object& /*obj*/) const override;
bool isHostObject(const jsi::Object& /*obj*/) const override;
bool isHostFunction(const jsi::Function& /*obj*/) const override;
jsi::Array getPropertyNames(const jsi::Object& /*obj*/) override;
// TODO: revisit this implementation
jsi::WeakObject createWeakObject(const jsi::Object&) override;
jsi::Value lockWeakObject(const jsi::WeakObject&) override;
jsi::WeakObject createWeakObject(const jsi::Object& /*obj*/) override;
jsi::Value lockWeakObject(const jsi::WeakObject& /*obj*/) override;
jsi::Array createArray(size_t length) override;
jsi::ArrayBuffer createArrayBuffer(
std::shared_ptr<jsi::MutableBuffer> buffer) override;
size_t size(const jsi::Array&) override;
size_t size(const jsi::ArrayBuffer&) override;
uint8_t* data(const jsi::ArrayBuffer&) override;
jsi::Value getValueAtIndex(const jsi::Array&, size_t i) override;
void setValueAtIndexImpl(const jsi::Array&, size_t i, const jsi::Value& value)
override;
size_t size(const jsi::Array& /*arr*/) override;
size_t size(const jsi::ArrayBuffer& /*obj*/) override;
uint8_t* data(const jsi::ArrayBuffer& /*obj*/) override;
jsi::Value getValueAtIndex(const jsi::Array& /*arr*/, size_t i) override;
void setValueAtIndexImpl(
const jsi::Array& /*arr*/,
size_t i,
const jsi::Value& value) override;
jsi::Function createFunctionFromHostFunction(
const jsi::PropNameID& name,
unsigned int paramCount,
jsi::HostFunctionType func) override;
jsi::Value call(
const jsi::Function&,
const jsi::Function& /*f*/,
const jsi::Value& jsThis,
const jsi::Value* args,
size_t count) override;
jsi::Value callAsConstructor(
const jsi::Function&,
const jsi::Function& /*f*/,
const jsi::Value* args,
size_t count) override;
@@ -238,7 +248,8 @@ class JSCRuntime : public jsi::Runtime {
bool strictEquals(const jsi::String& a, const jsi::String& b) const override;
bool strictEquals(const jsi::Object& a, const jsi::Object& b) const override;
bool instanceOf(const jsi::Object& o, const jsi::Function& f) override;
void setExternalMemoryPressure(const jsi::Object&, size_t) override;
void setExternalMemoryPressure(const jsi::Object& /*obj*/, size_t /*amount*/)
override;
private:
// Basically convenience casts
@@ -605,7 +616,7 @@ jsi::Runtime::PointerValue* JSCRuntime::cloneSymbol(
}
jsi::Runtime::PointerValue* JSCRuntime::cloneBigInt(
const Runtime::PointerValue*) {
const Runtime::PointerValue* /*pv*/) {
throw std::logic_error("Not implemented");
}
@@ -683,27 +694,29 @@ std::string JSCRuntime::symbolToString(const jsi::Symbol& sym) {
return jsi::Value(*this, sym).toString(*this).utf8(*this);
}
jsi::BigInt JSCRuntime::createBigIntFromInt64(int64_t) {
jsi::BigInt JSCRuntime::createBigIntFromInt64(int64_t /*unused*/) {
throw std::logic_error("Not implemented");
}
jsi::BigInt JSCRuntime::createBigIntFromUint64(uint64_t) {
jsi::BigInt JSCRuntime::createBigIntFromUint64(uint64_t /*unused*/) {
throw std::logic_error("Not implemented");
}
bool JSCRuntime::bigintIsInt64(const jsi::BigInt&) {
bool JSCRuntime::bigintIsInt64(const jsi::BigInt& /*unused*/) {
throw std::logic_error("Not implemented");
}
bool JSCRuntime::bigintIsUint64(const jsi::BigInt&) {
bool JSCRuntime::bigintIsUint64(const jsi::BigInt& /*unused*/) {
throw std::logic_error("Not implemented");
}
uint64_t JSCRuntime::truncate(const jsi::BigInt&) {
uint64_t JSCRuntime::truncate(const jsi::BigInt& /*unused*/) {
throw std::logic_error("Not implemented");
}
jsi::String JSCRuntime::bigintToString(const jsi::BigInt&, int) {
jsi::String JSCRuntime::bigintToString(
const jsi::BigInt& /*unused*/,
int /*unused*/) {
throw std::logic_error("Not implemented");
}
@@ -1047,7 +1060,14 @@ void JSCRuntime::setPropertyValue(
}
bool JSCRuntime::isArray(const jsi::Object& obj) const {
return JSValueIsArray(ctx_, objectRef(obj));
// JSValueIsArray only returns true if the object is a JS array. There's no
// public JSC API equivalent to Array.isArray, so we call the JS function
// through JSI directly.
auto constRt = const_cast<JSCRuntime*>(this);
auto isArrayFn = constRt->global()
.getPropertyAsObject(*constRt, "Array")
.getPropertyAsFunction(*constRt, "isArray");
return isArrayFn.call(*constRt, obj).asBool();
}
bool JSCRuntime::isArrayBuffer(const jsi::Object& obj) const {
@@ -1419,7 +1439,9 @@ bool JSCRuntime::instanceOf(const jsi::Object& o, const jsi::Function& f) {
return res;
}
void JSCRuntime::setExternalMemoryPressure(const jsi::Object&, size_t) {}
void JSCRuntime::setExternalMemoryPressure(
const jsi::Object& /*obj*/,
size_t /*amount*/) {}
jsi::Runtime::PointerValue* JSCRuntime::makeSymbolValue(
JSValueRef symbolRef) const {
File diff suppressed because it is too large Load Diff
@@ -45,7 +45,10 @@ class JSIExecutor::NativeModuleProxy : public jsi::HostObject {
return nativeModules->getModule(rt, name);
}
void set(Runtime&, const PropNameID&, const Value&) override {
void set(
Runtime& /*unused*/,
const PropNameID& /*name*/,
const Value& /*value*/) override {
throw std::runtime_error(
"Unable to put on NativeModules: Operation unsupported");
}
@@ -83,7 +83,7 @@ class [[deprecated(
std::unique_ptr<const JSBigString> script,
std::string sourceURL) override;
#ifndef RCT_REMOVE_LEGACY_ARCH
void setBundleRegistry(std::unique_ptr<RAMBundleRegistry>) override;
void setBundleRegistry(std::unique_ptr<RAMBundleRegistry> r) override;
#endif // RCT_REMOVE_LEGACY_ARCH
void registerBundle(uint32_t bundleId, const std::string& bundlePath)
override;
@@ -137,8 +137,10 @@ class Stream : public NetworkRequestListener,
// called with it.
if (initCb_) {
auto cb = std::move(initCb_);
(*cb)(
InitStreamResult{httpStatusCode, headers, this->shared_from_this()});
(*cb)(InitStreamResult{
.httpStatusCode = httpStatusCode,
.headers = headers,
.stream = this->shared_from_this()});
}
}
@@ -18,22 +18,28 @@ namespace facebook::react::jsinspector_modern {
*/
template <size_t key>
struct UniqueMonostate {
constexpr bool operator==(const UniqueMonostate<key>&) const noexcept {
constexpr bool operator==(
const UniqueMonostate<key>& /*unused*/) const noexcept {
return true;
}
constexpr bool operator!=(const UniqueMonostate<key>&) const noexcept {
constexpr bool operator!=(
const UniqueMonostate<key>& /*unused*/) const noexcept {
return false;
}
constexpr bool operator<(const UniqueMonostate<key>&) const noexcept {
constexpr bool operator<(
const UniqueMonostate<key>& /*unused*/) const noexcept {
return false;
}
constexpr bool operator>(const UniqueMonostate<key>&) const noexcept {
constexpr bool operator>(
const UniqueMonostate<key>& /*unused*/) const noexcept {
return false;
}
constexpr bool operator<=(const UniqueMonostate<key>&) const noexcept {
constexpr bool operator<=(
const UniqueMonostate<key>& /*unused*/) const noexcept {
return true;
}
constexpr bool operator>=(const UniqueMonostate<key>&) const noexcept {
constexpr bool operator>=(
const UniqueMonostate<key>& /*unused*/) const noexcept {
return true;
}
};
@@ -45,8 +51,8 @@ namespace std {
template <size_t key>
struct hash<::facebook::react::jsinspector_modern::UniqueMonostate<key>> {
size_t operator()(
const ::facebook::react::jsinspector_modern::UniqueMonostate<key>&)
const noexcept {
const ::facebook::react::jsinspector_modern::UniqueMonostate<
key>& /*unused*/) const noexcept {
return key;
}
};
@@ -51,8 +51,8 @@ bool BoundedRequestBuffer::put(
// `data` is copied at the point of insertion
responses_.emplace(
requestId,
std::make_shared<ResponseBody>(
ResponseBody{std::string(data), base64Encoded}));
std::make_shared<ResponseBody>(ResponseBody{
.data = std::string(data), .base64Encoded = base64Encoded}));
order_.push_back(requestId);
return true;
@@ -175,7 +175,7 @@ class MockRuntimeAgentDelegate : public RuntimeAgentDelegate {
inline MockRuntimeAgentDelegate(
FrontendChannel frontendChannel,
SessionState& sessionState,
std::unique_ptr<RuntimeAgentDelegate::ExportedState>,
std::unique_ptr<RuntimeAgentDelegate::ExportedState> /*unused*/,
ExecutionContextDescription executionContextDescription,
const RuntimeExecutor& /*runtimeExecutor*/)
: frontendChannel(std::move(frontendChannel)),

Some files were not shown because too many files have changed in this diff Show More