Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50796
When we render a `Switch` today we are never actually focusing on the native `UISwitch` that gets rendered. We instead focus on the parent `RCTViewComponentView` which houses the `UISwitch` as a `contentView`. That is because of [this logic](https://www.internalfb.com/code/fbsource/[b7e1547dab5a]/xplat/js/react-native-github/packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm?lines=1211-1213). This blocks the accessibility of any descendants, including the `contentView`.
What we lose here is the announcement of "on" and "off" based on the toggle state that comes built into `UISwitch`. To do this today you need to add `accessibilityState={{checked: ...}}` which is very unintuitive. Android DOES announce "on" and "off".
We can fix this with an override on the switch class.
Changelog: [iOS][Fixed] - Fix "on" and "off" announcements on `Switch`
Reviewed By: realsoelynn
Differential Revision: D73226500
fbshipit-source-id: ff4eed0b0b4b978e4b59c5e4b37d880373f6506c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50806
1. `useWindowDimensions` is already returning in DIPs, my math was just wrong before
2. Playground is marking itself as a deeplink when it shouldn't be
Changelog: [internal]
Reviewed By: cortinico, joevilches
Differential Revision: D73221335
fbshipit-source-id: 32dfa9d60609faccef8e264aa46d64b79250b64d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50782
Changelog: [IOS][FIXED] Fix TextInput `onContentSizeChange` event being dispatched only once on iOS on the new architecture
Currently, the comparison to decide whether to send event happens between the content size before and after layout metrics update. Those values turn out to be the same in all but the first call.
This updates the logic to use the previously send values in the comparison.
Reviewed By: huntie
Differential Revision: D73182563
fbshipit-source-id: 3b764a89c1844e203001d75022a3295a3fd747f2
Summary:
PR migrates DynamicFromObject class to Kotlin as part of https://github.com/facebook/react-native/issues/50513 work.
## Changelog:
[ANDROID] [CHANGED] - Migrated DynamicFromObject to Kotlin
Pull Request resolved: https://github.com/facebook/react-native/pull/50754
Test Plan: Run RN-Tester application and played around with it a bit.
Reviewed By: mlord93
Differential Revision: D73118014
Pulled By: alanleedev
fbshipit-source-id: 84958ff07ccafea9ec3dbdf06467c638eb92d49d
Summary:
unstable_hasComponent(component) first registers the component with react native, if possible. Then, it returns you whether registration succeeded.
## Problem
For unregistered components, the initial call returns false. But, all subsequent calls return true.
The reason why: After the initial call fails, react native registers unimplemented view under that component name. So, all subsequent calls return true.
## Solution
Just record the initial loopup result. And always return that initial lookup result from this method.
Changelog: [iOS][Fixed] Fix bug: unstable_hasComponent(*) = true for unregistered components for n > 1th call.
Reviewed By: yungsters
Differential Revision: D73127468
fbshipit-source-id: ee30bde486a6bb970f40f654c65a8946452f49b3
Summary:
These internals have leaked pretty far. As we are adding support for JNI reference state wrappers, lets hide this, and make functions for getting MapBuffer work automatically if state data exposes the requisite functions, instead of external users needing to worry about multiple possible `ConcreteState` types for a given state data type.
Changelog: [Internal]
Reviewed By: rshest
Differential Revision: D73158627
fbshipit-source-id: e3ac2a045368d46fab72e2017fc28d680db6a7c0
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50784
Migrates us from several `.npmignore` files to `package.json#files`, for the main `react-native` package.
This reduces the size of our npm package by 38 files — in particular, catching previously missed `__tests__` and `__docs__` directories.
```diff
- npm notice package size: 4.4 MB
- npm notice unpacked size: 23.7 MB
- npm notice total files: 4533
+ npm notice package size: 4.4 MB
+ npm notice unpacked size: 23.7 MB
+ npm notice total files: 4533
```
NOTE: `"files"` or `.npmignore` — one or the other!
- Having `.npmignore` at the package root does not behave(!). Having `"files"` as one source of truth is better and safer. See https://github.com/npm/cli/issues/6221.
Changelog: [Internal]
Reviewed By: hoxyq
Differential Revision: D73185321
fbshipit-source-id: 429c9fec4f447d63440a38bb8e3f3ce3bd155414
Summary:
parse-git-config is a transitive dep for Danger that hasn't been updated in years and has an unresolved CVE (CVE-2025-25975)
Danger has moved away from this dependency yesterday and cut a new version, so we can update to resolve
Changelog: [General][Fixed] Update Danger to 13.0.4
Reviewed By: cortinico
Differential Revision: D73181590
fbshipit-source-id: e5c512e6f381725eea71d64555018327144e23be
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50730
This is a consolidation of our "dev support" features in the `src/private/` dir.
New grouping:
- `src/private/devsupport/`
- `devmenu/` — The Dev Menu and in-app inspection features (in-app UI)
- `elementinspector/` — The Element Inspector overlay (panel with sub-features), accessed from Dev Menu → Toggle Element Inspector
- `perfmonitor/` — The Perf Monitor overlay, accessed from Dev Menu → Show Perf Monitor
- `rndevtools/` — Modules supporting React Native DevTools (external UI)
`NativeReactDevToolsRuntimeSettingsModule.js` and `NativeReactDevToolsSettingsManager.js` are also moved out of `specs_DEPRECATED/`.
Changelog: [Internal]
Reviewed By: hoxyq
Differential Revision: D73031559
fbshipit-source-id: 952a469f31f4cd05aeed27dc7023552e723ca078
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50780
This bumps Kotlin to the latest stable: 2.1.20.
I've also fixed several warnings emitted by the new compiler.
Changelog:
[Android] [Changed] - Kotlin to 2.1.20
Reviewed By: rshest
Differential Revision: D73122000
fbshipit-source-id: 019a01d085b2c115a3efcf567056e9990a1ff0ce
Summary:
PR migrates DynamicFromArray class to Kotlin as part of https://github.com/facebook/react-native/issues/50513 work.
## Changelog:
[ANDROID] [CHANGED] - Migrated DynamicFromArray to Kotlin
Pull Request resolved: https://github.com/facebook/react-native/pull/50602
Test Plan: Run RN-Tester application and played around with it a bit.
Reviewed By: rshest
Differential Revision: D73179609
Pulled By: cortinico
fbshipit-source-id: e304884fea9f57e152bca4926677d7338dc2403a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50774
Adding a Fantom test for the `useShadowNodeStateOnClone` feature flag, showing that the shadow node state is maintained after commit hook processing only when the feature flag is enabled.
Changelog: [Internal]
Reviewed By: rshest
Differential Revision: D73121159
fbshipit-source-id: bbd7f46fbf49394ca5015e825a59d2fb1b519ee5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50776
Changelog: [Internal]
Adds a lint rule that prevents the use of named imports when importing types from React. `flow-api-translator` relies on the `React` namespace being used when generating TypeScript definitions based on Flow.
Reviewed By: huntie
Differential Revision: D73170799
fbshipit-source-id: 96d014b016c7cec8d3b266447dc7a185d2b1da26
Summary:
I've migrated `FrescoBasedTextInlineImageSpan.java` to kotlin. Reference https://github.com/facebook/react-native/issues/50513.
## Changelog:
[ANDROID] [CHANGED] - Refactor class `FrescoBasedTextInlineImageSpan` from Java to Kotlin.
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
Pull Request resolved: https://github.com/facebook/react-native/pull/50532
Test Plan: Tested the RN tester app with `yarn android` on both new and old architecture.
Reviewed By: rshest
Differential Revision: D73031024
Pulled By: cortinico
fbshipit-source-id: e7208bf1103849f38c3dc26d73b31315b2326275
Summary:
I forgot to add toString and protocol in test cases last time when we merged this https://github.com/facebook/react-native/pull/50043
## Changelog:
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[INTERNAL][ADDED] More Test cases
Pull Request resolved: https://github.com/facebook/react-native/pull/50768
Test Plan: Tested with yarn jest
Reviewed By: rshest, cipolleschi
Differential Revision: D73169665
Pulled By: cortinico
fbshipit-source-id: 1115c0ccce52a67663fcd60ef376ce7bde502d1f
Summary:
This unblocks the `binary-compatibility-validator` for Kotlin 2.1.0
I've bump the tool to the latest version + re-aligned all the dependencies to the one used by the tool as well
(diff utils, asm, kotlinx-metadata-jvm).
Reviewed By: mdvacca
Differential Revision: D73057557
fbshipit-source-id: 020babea3a4032a8f9919ce7f456c3d4fb9a8e0c
Summary:
Since I enabled INTERPROCEDURAL_OPTIMIZATION last week, we're having a warning for gtest that
they're not setting this CMake policy: CMP0069
https://cmake.org/cmake/help/latest/policy/CMP0069.html
As Gtest is not a production dependency, we can safely ignore this warning. So I'm enabling the policy for all the targets.
Changelog:
[Internal] [Changed] -
Reviewed By: alanleedev
Differential Revision: D73122573
fbshipit-source-id: 319a889024f080752f0c9287d011209459dcb013
Summary:
Afacit from searching both fbsource and GitHub, this should be totally dead.
Changelog: [Internal]
Reviewed By: alanleedev
Differential Revision: D73154613
fbshipit-source-id: 1ed993ae53e7bc97232a8200b5fb4e01f0db7bb4
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50773
With shadow node syncing enabled by default, whenever a shadow node has to be cloned, we can be guaranteed that the state on the shadow node will be the most recent state in most cases.
This change fixes state updates being ignored when cloning YogaLayoutableShadowNodes from a commit hook. Since the most recent state gets updated post commit, any clone reading the most recent state might miss state changes done within the commit.
Changelog: [Internal]
Reviewed By: rshest, cipolleschi
Differential Revision: D72315898
fbshipit-source-id: 5e14d03681dd1cc5686a649caa2e8c3685042cfa
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50770
OSS CI is failing because the we forgot a deprecation message in ReactScrollViewManager.
## Changelog:
[Internal] - Add deprecation annotation to fix ci build
Reviewed By: sbuggay
Differential Revision: D73136939
fbshipit-source-id: 4f39d7c7ae60aaca1011b70135d9535b16ed58e0
Summary:
This structure is unsafe:
```
// In each native module:
+load
dispatch_once
NSBundle mainBundle
```
NSBundle mainBundle itself uses dispatch_once during initialization. If that initialization triggers a native module class load, we could end up with a circular dependency chain. This could deadlock the application.
## Changes
Just remove the dispatch_once. Getting the NSBundle mainBundle is very efficient after the first access. And NSBundle objectForInfoDictionaryKey is also very efficient.
Created from CodeHub with https://fburl.com/edit-in-codehub
Changelog: [Internal]
Reviewed By: cipolleschi
Differential Revision: D73058551
fbshipit-source-id: 9d14b5556748288227cfb93940f79d44997d7b47
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50735
This change adds a warning in JS that is printed when the app is running using the old architecture.
The assumption is that, if it is running with Fabric, it is running with the new architecture. So running without Fabric implies old architecture.
## Changelog:
[General][Added] - Add warning when the app runs with the legacy architecture
Reviewed By: cortinico, rubennorte
Differential Revision: D73041156
fbshipit-source-id: 89a14f6370ae54b9d115e0ef672f29084d009a8e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50757
We received [this issue](https://github.com/facebook/react-native/issues/50747) in OSS where the URL parsing logic does not respect node/chromium specs.
This can cause issue in usercode. This change fixes it
## Changelog:
[General][Fixed] - make sure that URLs are parsed following the node specs
Reviewed By: huntie
Differential Revision: D73101813
fbshipit-source-id: 36f1d23b3ad7882c16524843621d9ebbcc09b95d
Summary:
This diff converts the last java file inside `com.facebook.react.views.textinput` to Kotlin.
As `ReactEditText` is quite involved, reviewing this one is going to be quite critical.
I'm marking this as breaking as a number of nullability types has changed for OSS users.
Changelog:
[Android] [Breaking] - com.facebook.react.views.textinput.ReactEditText is now in Kotlin. If you're subclassing this type you'll need to adjust your signatures.
Reviewed By: rshest
Differential Revision: D72972921
fbshipit-source-id: 92ed112444cbc20daed5466ad20f651479bfac6f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50738
The implementation of this in Hermes depends on a deprecated CMake
feature. Since it just needs to run a command to generate the dSYM, it
seems simpler to eliminate the flag and move the work into the RN build
script.
## Changelog:
[Internal] - move dsym generation logic from Hermes to RN
Reviewed By: cortinico, cipolleschi
Differential Revision: D73054511
fbshipit-source-id: 4b8f9d97ef3386154bfe4030e0061f9c0791d7ea