Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49439
This is the next part of a series of diff needed to enable G. Configuration Cache:
https://docs.gradle.org/current/userguide/configuration_cache.html
as it will make our CI faster (and will be the default in the future Gradle version).
Here I'm removing the `onlyIf` lambdas to make some tasks CC friendly.
The problem is that some `onlyIf` lambdas can't easily be serialized. Here I'm cleaning up
the problematic one to move the condition checks at execution time
Changelog:
[Internal] [Changed] -
Reviewed By: cipolleschi
Differential Revision: D69664732
fbshipit-source-id: a457b2fae8114568ec4e04d772c9944022b1e1a5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49438
This is the second part of a series of diff needed to enable G. Configuration Cache:
https://docs.gradle.org/current/userguide/configuration_cache.html
as it will make our CI faster (and will be the default in the future Gradle version).
Here I'm making the exec tasks CC friendly.
The problem is that previously we were using explicit streams which are not CC friendly
for stderr/stdout. The solution is to create a custom task and handle files as input
properties.
Changelog:
[Internal] [Changed] -
Reviewed By: cipolleschi
Differential Revision: D69662246
fbshipit-source-id: ad7e82e52b12d508ee15b68408882fdc3516d287
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49421
This is a first part of a series of diff needed to enable G. Configuration Cache:
https://docs.gradle.org/current/userguide/configuration_cache.html
as it will make our CI faster (and will be the default in the future Gradle version).
Here I'm making all those tasks `prepare*` CC friendly.
Those tasks were not CC friendly as they were referencing an external variable inside their body.
We don't need to know the library version, we can just substring after the first folder
and the tasks will behave as before.
Changelog:
[Internal] [Changed] -
Reviewed By: cipolleschi
Differential Revision: D69655168
fbshipit-source-id: 801d7817c7e2d7380342f175565cc9b1ff30c5d0
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48585
[Changelog] [Internal] - Align logic in BaseTextInputShadowNode to determine updateStateIfNeeded with AndroidTextInputShadowNode
As a preparation for https://github.com/facebook/react-native/pull/48165 this aligns the implementation of those 2 methods
Reviewed By: javache
Differential Revision: D68004755
fbshipit-source-id: 519247de0d081f37b5ef8ad6093b43d2c735a50e
Summary:
An internal crash report notified us that we were getting an `IllegalArgumentException` in Android's `BlurMaskFilter` used in Box Shadows. The only requirement for the arguments there are that the blur radius is positive. We ensure that, but pass to `sigmaToRadius` afterwards, which does NOT ensure that. This updates that conversion so that
* We will never return negative numbers, regardless of what `PixelUtil.toDIPFromPixel` is doing
* Small enough numbers ( < 0.5) will just go through as 0.0, which is what Android does in https://cs.android.com/android/platform/superproject/main/+/main:frameworks/base/libs/hwui/utils/Blur.cpp;l=34
* Ensure shadows check that we have a POSITIVE blur radius AFTER conversion. sigmaToRadius can still return 0 which with also throw, so gotta make sure we change our checks. Filter blurs and dropShadow should be ok, renderEffect does not mention anything about being > 0 in the docs.
Changelog: [Android] [Fixed] - Fix issue where boxShadow crashes with small blur radius
Facebook
Post alerting us of this: https://fb.workplace.com/groups/rn.panelapps/permalink/1136446121310146/
Reviewed By: NickGerleman
Differential Revision: D69683031
fbshipit-source-id: 92f0938fea65e1af280bdb12b6c3d2b9014e89c0
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49445
This diff marks a subset of LayoutAnimations classes with LegacyArchitecture, since these classes should not be called, loaded nor included in apk that are running in new archtictecture by default
changelog: [internal] internal
Reviewed By: shwanton
Differential Revision: D69674674
fbshipit-source-id: 84c71c7491064abf8d70f52b14ddb81bd0515227
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49443
This diff introduces an internal annotation called LegacyArchitecture that will be used to document what classes are part of Legacy or new architecture
changelog: [internal] internal
Reviewed By: cortinico
Differential Revision: D69538444
fbshipit-source-id: 5037ba03cd3b1675544f432c3981503c28606f19
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49435
This change adds a Package.swift file that allows to consume the binary from a local path.
As soon as we publish this on Maven, we will update the path to the url.
## Changelog:
[Internal] - Add the Package.swift file to consume the binary
Reviewed By: cortinico
Differential Revision: D69660943
fbshipit-source-id: c76ff3272d106236b6cf713b7e054070a3d45176
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48724
changelog: [internal]
A change in D68154908 caused issues where AnimatedValue would oversubscribe to native module, bring apps to halt.
This is unit test to prevent that.
Reviewed By: yungsters
Differential Revision: D68265033
fbshipit-source-id: 60cc93a619a5c654dc1bf77b00b2d9be2c482894
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49402
## Motivation
Modernising the RN codebase to allow for modern Flow tooling to process it.
## This diff
- Migrates `Utilities/dismissKeyboard.js`, `Utilities/GlobalPerformanceLogger.js` and `Utilities/SceneTracker.js` to use the export syntax.
- Updates deep-imports of these files to use `.default`
- Updates jest mocks
- Updates the current iteration of API snapshots (intended).
Changelog:
[General][Breaking] - Deep imports to `Utilities/dismissKeyboard.js`, `Utilities/GlobalPerformanceLogger.js` or `Utilities/SceneTracker.js` with `require` syntax need to be appended with '.default'.
Reviewed By: huntie
Differential Revision: D69599636
fbshipit-source-id: 0c450996f908d8139dd0c48677f58e07243d6150
Summary:
Fix `react-native-community/cli` not being found in pnpm setups
## Changelog:
[GENERAL] [FIXED] - Fix `react-native-community/cli` not being found in pnpm setups
Pull Request resolved: https://github.com/facebook/react-native/pull/47304
Test Plan:
1. Clone/check out this branch: https://github.com/microsoft/rnx-kit/pull/3409
2. Run `yarn react-native config`
Reviewed By: cortinico
Differential Revision: D65209065
Pulled By: robhogan
fbshipit-source-id: 2ceb73ad140b4afe193e879779c2d8a4b9adf3fc
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49400
We should not invoke anything on the `project` property inside thet task.
That will break Gradle Configuration Caching which is becoming the default in the next version of Gradle.
This fixes it for the `GenerateCodegenArtifactsTask` task.
Changelog:
[Internal] [Changed] -
Reviewed By: cipolleschi
Differential Revision: D69592464
fbshipit-source-id: 72bab3f29299313875f2e7abd1b701c9d74bd2a1
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49399
We should not invoke anything on the `project` property inside thet task.
That will break Gradle Configuration Caching which is becoming the default in the next version of Gradle.
This fixes it for the `GenerateCodegenSchemaTask` task.
Changelog:
[Internal] [Changed] -
Reviewed By: cipolleschi
Differential Revision: D69592463
fbshipit-source-id: 56e78b1bdc113ae402cc90960faa05cd73d5b97d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49398
We should not invoke anything on the `project` property inside thet task.
That will break Gradle Configuration Caching which is becoming the default in the next version of Gradle.
This fixes it for the `BuildCodegenCLITask` task.
Changelog:
[Internal] [Changed] -
Reviewed By: cipolleschi
Differential Revision: D69592465
fbshipit-source-id: fc69896b61968ace7b7762f873cfa7eaa50c8b17
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49417
In this diff I'm introducing a fantom benchmarking test to verify impact of props parsing in Fabric (testing for 100, 1000 and 1500 nested views)
changelog: [internal] internal
Reviewed By: lenaic
Differential Revision: D69624243
fbshipit-source-id: fe71668fe97558d2b6072fe49c9910cb978f7f78
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49415
Refactoring NAME -> TAG for consistency with other classes
changelog: [internal] internal
Reviewed By: Abbondanzo
Differential Revision: D69622546
fbshipit-source-id: 314db29ddfdbbd7fc614b355b9b18c0a8afe31df
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49414
In this we are enforcing that that ViewManagers using codegen override getDelegate() method.
For now we are logging a softException to get signal from production without crashing the app
changelog: [internal] internal
Reviewed By: javache
Differential Revision: D69621301
fbshipit-source-id: 1434fb3f3c7e5ebebee172ec1d7ad6c21eb453ae
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49361
This change adds the Package.swift file that we will use to build the dependencies for React Native
## Changelog:
[Internal] - Swift PM file to build ReactNativeDependencies
Reviewed By: cortinico
Differential Revision: D69518776
fbshipit-source-id: 85006c3c5933cc6a5fd772f7b014a823d7bb99b3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49408
## Motivation
Modernising the RN codebase to allow for modern Flow tooling to process it.
## This diff
- Migrates Utilities/deepFreezeAndThrowOnMutationInDev.js, Utilities/defineLazyObjectProperty.js, Utilities/DeviceInfo.js & Utilities/FeatureDetection.js to use the export syntax.
- Updates deep-imports of files that were migrated to a single export default to use `.default`
- Updates the current iteration of API snapshots (intended).
Changelog:
[General][Breaking] - Deep imports to `Utilities/deepFreezeAndThrowOnMutationInDev`, `Utilities/defineLazyObjectProperty`, `Utilities/DeviceInfo` or `Utilities/FeatureDetection` with `require` syntax may need to be appended with '.default'.
Reviewed By: huntie
Differential Revision: D69602536
fbshipit-source-id: 7ec06995a1d244b95d4f970551955d9e6013de13
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49306
## Motivation
Modernising the RN codebase to allow for modern Flow tooling to process it.
## This diff
- Migrates `Libraries/Utilities/Platform.*.js` to use the export syntax.
- Updates deep-imports of these files to use `.default`
- Updates jest mocks
- Updates the current iteration of API snapshots (intended).
Changelog:
[General][Breaking] - Deep imports to `Libraries/Utilities/Platform` with `require` syntax needs to be appended with '.default'.
Reviewed By: huntie
Differential Revision: D69404025
fbshipit-source-id: f21501ca5b7e8e6a9e3e501781ed36e7d2bfd4a4
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49406
## Motivation
Modernising the RN codebase to allow for modern Flow tooling to process it.
## This diff
- Migrates Utilities/infoLog, Utilities/logError, Utilities/mapWithSeparator & Utilities/warnOnce to use the export syntax.
- Updates deep-imports of these files to use `.default`
- Updates the current iteration of API snapshots (intended).
Changelog:
[General][Breaking] - Deep imports to `Utilities/infoLog`, `Utilities/logError`, `Utilities/mapWithSeparator` or `Utilities/warnOnce` with `require` syntax need to be appended with '.default'.
Reviewed By: huntie
Differential Revision: D69601174
fbshipit-source-id: 821f9ae59d4f898c95631eb7a9aeed138ace3567
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49403
## Motivation
Modernising the RN codebase to allow for modern Flow tooling to process it.
## This diff
- Migrates `Utilities/binaryToBase64`, `Utilities/DevSettings`, `Utilities/PolyfillFunctions` & `Utilities/RCTLog` to use the export syntax.
- Updates deep-imports of these files to use `.default`
- Updates the current iteration of API snapshots (intended).
Changelog:
[General][Breaking] - Deep imports to `Utilities/binaryToBase64`, `Utilities/DevSettings`, `Utilities/PolyfillFunctions` or `Utilities/RCTLog` with `require` syntax need to be appended with '.default'.
Reviewed By: huntie
Differential Revision: D69600476
fbshipit-source-id: 3f8ac3a35031e8b20446abc8f52a2817cb31b6d2
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49369
## Motivation
Modernising the RN codebase to allow for modern Flow tooling to process it.
## This diff
- Migrates `Libraries/Utilities/BackHandler.*.js`, `Utilities/DevLoadingView.js` and `Utilities/HMRClient*.js` to use the export syntax.
- Updates deep-imports of these files to use `.default`
- Updates jest mocks
- Updates the current iteration of API snapshots (intended).
Changelog:
[General][Breaking] - Deep imports to `Libraries/Utilities/BackHandler`, `Utilities/DevLoadingView.js` or `Utilities/HMRClient*.js` with `require` syntax needs to be appended with '.default'.
Reviewed By: huntie
Differential Revision: D69539527
fbshipit-source-id: c10b3523bbcc52bba5b6c27721c33b1e0d9d5104
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49405
This diff removes legacy codegen of $PropSetter classes for ShadowNode classes when the app has UNSTABLE_ENABLE_MINIFY_LEGACY_ARCHITECTURE enabled
These classes are not used in the new architecture, let's just remove them from the apk.
This change won't affect OSS
changelog: [internal] internal
Reviewed By: javache
Differential Revision: D69569205
fbshipit-source-id: 178051b9f10576226fd746f9eab1b56b2934ea0b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49404
This diff disables codegen of legacy $PropSetter for viewManagers that implement the interface com.facebook.react.uimanager.ViewManagerWithGeneratedInterface.
This logic will only be enabled for apps that are configured with BuildConfig.UNSTABLE_ENABLE_MINIFY_LEGACY_ARCHITECTURE = true
changelog: [internal] internal
Reviewed By: javache
Differential Revision: D67412734
fbshipit-source-id: 682725714dc41f5f34d95d4d9a13ab09726b28f7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49386
It appears that `currentActivity.decorView` sometime is not attached to a window during the process of creating a Dialog for currently unknown reasons causing a crash.
Add check to skip call to `syncSystemBarsVisibility()` in such case as current code cannot function without valid RootWindowInsets.
Changelog:
[Android][Fixed] - fixed crash with Modal when trying to call syncSystemBarsVisibility()
Reviewed By: cortinico
Differential Revision: D69578581
fbshipit-source-id: de23e2ba9f485e38b7014dd7151253e56976ad43
Summary:
On the new architecture the `RCTParagraphTextView` is used to draw text on iOS but React doesn't know about it. The hit test stops propagation on the first encountered UIView of this type. The suggested solution is to add a dummy hit test for `RCTParagraphTextView` that returns always `null`, allowing further search of the touch target.
## 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
-->
[IOS][FIXED] - Fixed onPress for Text with nested View.
Pull Request resolved: https://github.com/facebook/react-native/pull/49393
Test Plan:
| Before | After |
|--------------|--------------|
|<video src="https://github.com/user-attachments/assets/745f555a-d4b6-4285-91a7-0e9ea9f43d84"> | <video src="https://github.com/user-attachments/assets/9896848f-13ca-4b57-bcc9-bead478ab078"> |
<details>
<summary>code</summary>
```ts
import {SafeAreaView, StyleSheet, Text, View, findNodeHandle} from 'react-native';
function App() {
return (
<SafeAreaView style={styles.container}>
<Text
ref={e => console.log(`Outer Text: ${findNodeHandle(e)}`)}
>
With Nested View
<View ref={e => console.log(`View: ${findNodeHandle(e)}`)}>
<Text
ref={e => console.log(`Inner Text: ${findNodeHandle(e)}`)}
onPress={() => {
console.log('1. text pressed');
}}
style={styles.pressableText}
>
Pressable Text
</Text>
</View>
</Text>
<Text>
Without Nested View
<Text
onPress={() => {
console.log('2. text pressed');
}}
style={styles.pressableText}
>
Pressable Text
</Text>
</Text>
</SafeAreaView>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
gap: 10,
},
pressableText: {
fontSize: 18,
color: 'blue',
backgroundColor: 'transparent',
},
nestedView: {
backgroundColor: 'red',
height: 100,
},
pressable: {
backgroundColor: 'blue',
height: 100,
width: 100,
},
});
export default App;
```
</details>
Reviewed By: cipolleschi
Differential Revision: D69591520
Pulled By: coado
fbshipit-source-id: eb75c2d8a01a82d4493a1a982e98ca74efc9d94f
Summary:
> [!NOTE]
> This PR is part of JavaScriptCore Extraction to this repository: https://github.com/react-native-community/javascriptcore
This PR adds `jsitooling` package that third party JS engines can use (in that case javascriptcore). It's required because React-Runtime needs to depend on third-party engine on iOS, and the third-party engine needed to depend on React-Runtime to get access to the `JSRuntimeFactory` and Cocoapods doesn't support circular dependencies...
Now third-party engine can depenend on jsitooling package and provide JSRuntimeFactory
## Changelog:
[INTERNAL] [ADDED] - jsitooling package
Pull Request resolved: https://github.com/facebook/react-native/pull/49348
Test Plan: CI Green
Reviewed By: cortinico
Differential Revision: D69535475
Pulled By: cipolleschi
fbshipit-source-id: f8d68b7957b7d69c13246ce3040a08256f2ebcd6
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49364
We're not actively using/maintaining this package. Let's clean it up.
We can still restore if necessary.
Changelog:
[Internal] [Changed] -
bypass-github-export-checks
Reviewed By: cipolleschi
Differential Revision: D69533629
fbshipit-source-id: 940057df9a5fffa738435c92136e95a764ec98ff
Summary:
This PR encapsulates device info listeners removing additional logic from RCTAppDelegate which is a prerequisite for https://github.com/facebook/react-native/pull/49078
Now we use KVO (Key Value Observation) to listen to window size changes making this module's logic encapsulated + allows to use it in brownfield scenarios.
To keep backward compatibility RCTDeviceInfo still emits `RCTWindowFrameDidChangeNotification`
## Changelog:
[IOS] [ADDED] - encapsulate device info listeners
Pull Request resolved: https://github.com/facebook/react-native/pull/49162
Test Plan: Check if window size change listener is fired
Reviewed By: sammy-SC
Differential Revision: D69116660
Pulled By: cipolleschi
fbshipit-source-id: b9a57c70826b10cd27d102337eb1e35da1b365c9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49303
Changelog: [General][Breaking] Deep imports to modules inside `Libraries/StyleSheet` using `require` may need to be appended with `.default`
Reviewed By: huntie
Differential Revision: D69400980
fbshipit-source-id: 053f40a8677ac877b93c27e87422ea0ef540c272
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49358
When the network is under strain, the code responsible for detecting if the inspector proxy's connection to the client has been lost may incorrectly assume the connection is dead. This false positive occurs because the system assumes that if a pong is not received within 5 seconds of a ping, the other side has disconnected. However, I was able to consistently reproduce scenarios where a delay of more than 5 seconds (even more than 20 seconds) was followed by a return to normal ping-pong communication without any issues.
Since I can't think of any issues with increasing this number, I'm increasing it to 60s.
Changelog:
[General][Fixed] - Disconnections of DevTools when the network is under significant strain.
Reviewed By: robhogan, huntie
Differential Revision: D69523906
fbshipit-source-id: 50db1e7bbe690b42421bc226aa30fd6571ba2257