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
Summary:
When generating documentation using dokka, I found out that some references to classes in the comments were not linking correctly anymore after the files were migrated to Kotlin. In this PR I'm migrating the JavaDoc `link` references to Kotlin KDoc `[]` syntax.
## Changelog:
[INTERNAL] - Fix up KDoc annotations post Kotlin migrations
Pull Request resolved: https://github.com/facebook/react-native/pull/49375
Test Plan: Manually review that the references link correctly in the Kotlin files
Reviewed By: arushikesarwani94
Differential Revision: D69549229
Pulled By: mdvacca
fbshipit-source-id: 6b7727f00a28ecfe2fca86948245d1f4e88e935c
Summary:
Migrate com.facebook.react.modules.network.OkHttpClientProvider to Kotlin. Also, as follow up from https://github.com/facebook/react-native/pull/48958 I'm cleaning up the reflection on `OkHttpClientProviderTest` as we can make `sClient` and `sFactory` internal.
## Changelog:
[INTERNAL] - Migrate com.facebook.react.modules.network.OkHttpClientProvider to Kotlin
Pull Request resolved: https://github.com/facebook/react-native/pull/49108
Test Plan:
```bash
yarn test-android
yarn android
```
Reviewed By: cortinico
Differential Revision: D69050956
Pulled By: javache
fbshipit-source-id: 62dcf8e8f999f3b687c57ed02e9ac1f2db8183ea
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49340
This tool enables checking the boundary between JavaScript and Native for
backwards incompatible changes to protect against crashes.
This is useful for:
- Local Development
- Over the Air updates on platforms that support it
- Theoretically: Server Components with React Native
Check out the Readme for more information
Changelog: [General][Added] Open Sourcing React Native's Compatibility Check
Reviewed By: panagosg7
Differential Revision: D69476742
fbshipit-source-id: 8af6039839c5475c1258fa82d9750a9320cf0751
Summary:
This updates the Issue Triaging bot to ping the oncall
## Changelog:
[INTERNAL] -
Pull Request resolved: https://github.com/facebook/react-native/pull/49359
Test Plan: Nothing to test
Reviewed By: cipolleschi
Differential Revision: D69527137
Pulled By: cortinico
fbshipit-source-id: 7291054a734bf9f7240002773b716b2057aa8eca
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49353
This change adds an opt-in to restore JavaScript log streaming via the Metro dev server, [removed from React Native core in 0.77](https://reactnative.dev/blog/2025/01/21/version-0.77#removal-of-consolelog-streaming-in-metro).
Users can opt into this legacy behaviour by adding the `--client-logs` flag to `npx react-native-community/cli start`.
- The default experience remains without streamed JS logs.
- The existing "JavaScript logs have moved! ..." notice is printed in all cases, and we do not advertise the new flag for new users.
- Under non-Community CLI dev servers (i.e. Expo), log streaming is restored implicitly.
We will clean up this functionality again when we eventually remove JS log streaming over `HMRClient`, tasked in T214991636.
**Implementation notes**
- Logs are always sent over `HMRClient` (previous status quo), even with log streaming off in the dev server. This is a necessary evil to be able to flag this functionality in a user-accessible place, and to move fast for 0.78.
- Necessarily, emitting `fusebox_console_notice` moves to the dev server itself, on first device (Fusebox) connection.
Changelog:
[General][Added] - Add opt in for legacy Metro log streaming via `--client-logs` flag
Reviewed By: robhogan
Differential Revision: D69469039
fbshipit-source-id: be99d02a3b1c977a59bf7d2726f0e6cf2e60b28a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49275
This is a copied guava class and is only used in one spot. Remove it and just count directly in ProgressRequestBody.
Changelog: [Internal]
Reviewed By: Abbondanzo
Differential Revision: D69323277
fbshipit-source-id: 5260004a4431f03733882b6ee83a341d8bf29bb0
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49332
## Motivation
Modernising the RN codebase to allow for modern Flow tooling to process it.
## This diff
- Migrates `Libraries/Utilities/differ/*.js` to use the export syntax.
- Updates deep-imports of these files to use `.default`
- Updates codegen with a compat layer
- Updates the current iteration of API snapshots (intended).
Changelog:
[General][Breaking] - Deep imports to `Libraries/Utilities/differ/...` with `require` syntax need to be appended with '.default'.
Reviewed By: yungsters
Differential Revision: D69467423
fbshipit-source-id: 2e58a0b9711e9bdf5ca907a5b2252584f6fec9bc
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49349
Follow-up on D69454101 to add more test coverage for `$ReadOnlyArray<UnsafeMixed>` as a component prop. The new type was missing from the CodegenSchema, which revealed some gaps in tests.
Changelog: [Internal]
Reviewed By: fabriziocucci
Differential Revision: D69488035
fbshipit-source-id: 19895e55e5ec4d89a790f1c388de9eea025a316c
Summary:
Fix `react-native-community/cli-platform-*` packages not being found in monorepos.
Note that we are making the assumption that `process.cwd()` returns the project root. This is the same assumption that `react-native-community/cli` makes. Specifically, `findProjectRoot()` has an optional argument that defaults to `process.cwd()`:
- [`findProjectRoot()`](https://github.com/react-native-community/cli/blob/14.x/packages/cli-tools/src/findProjectRoot.ts)
- Which gets called without arguments in [`loadConfig()`](https://github.com/react-native-community/cli/blob/14.x/packages/cli-config/src/loadConfig.ts#L89)
- `loadConfig()` gets called from [`setupAndRun()`](https://github.com/react-native-community/cli/blob/14.x/packages/cli/src/index.ts#L196), also without project root set
As far as I can see, the project root argument is only ever used in tests.
## Changelog:
[GENERAL] [FIXED] - Fix `react-native-community/cli-platform-*` packages not being found in monorepos
Pull Request resolved: https://github.com/facebook/react-native/pull/47308
Test Plan:
1. Clone/check out this branch: https://github.com/microsoft/rnx-kit/pull/3409
2. Cherry-pick https://github.com/facebook/react-native/pull/47304
3. Cherry-pick https://github.com/facebook/react-native/pull/47308
4. Run `react-native config` inside `packages/test-app`
5. Verify that `projects` is populated
**Before:**
```js
"healthChecks": [],
"platforms": {},
"assets": [],
"project": {}
}
```
**After:**
```js
"healthChecks": [],
"platforms": {
"ios": {},
"android": {}
},
"assets": [],
"project": {
"ios": {
"sourceDir": "/~/packages/test-app/ios",
"xcodeProject": {
"name": "SampleCrossApp.xcworkspace",
"path": ".",
"isWorkspace": true
},
"automaticPodsInstallation": false,
"assets": []
},
"android": {
"sourceDir": "/~/packages/test-app/android",
"appName": "app",
"packageName": "com.msft.identity.client.sample.local",
"applicationId": "com.msft.identity.client.sample.local",
"mainActivity": "com.microsoft.reacttestapp.MainActivity",
"assets": []
}
}
}
```
Reviewed By: cortinico
Differential Revision: D69465533
Pulled By: robhogan
fbshipit-source-id: 3d6cf32752a7a41d9c7e84f35b0f26ae7d7a971f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49345
This diff is causing an error to be logged for every user. Even if it's noise, its more trouble than its worth. Let's revert until feature flags check fixed.
Changelog: [Internal]
Reviewed By: makovkastar
Differential Revision: D69504966
fbshipit-source-id: 13caf715cef9a4cc6c9b7c68d3003fbced870d34
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49338
This doesn't cover all cases, but is a good start.
Where relevant, I call out inline places where there are KPs with LogBox that will be fixed separately.
## Changelog
Changelog: [internal]
Reviewed By: rubennorte
Differential Revision: D69443040
fbshipit-source-id: 7281f30aa705ae812d5b5f5f9ad03b37358de059
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49337
*Note: This diff adds helpers and updates the one test we have. The next diff adds a bunch of tests, see that diff for how these helpers are used to scale to a large number of tests.*
-----
## Overview
Adds helpers for the LogBox e2e test to make it easier to write simple, readable, tests with a healthy level of abstraction over the e2e APIs.
## API
The helpers expose an ability to render a component, and return methods to get the UI state:
```
// Returns the LogBox inspector UI as an object.
getInspectorUI: () => ?InspectorUI,
// Returns the LogBox notification UI as an object.
getNotificationUI: () => ?NotificationUI,
```
These return objects that represent the main text elements in the UI like `title` and `message`.
The helpers also provide methods for interacting with the LogBox UI:
```
// True if the LogBox inspector is open.
isOpen: () => boolean,
// Tap the notification to open the LogBox inspector.
openNotification: () => void,
// Tap to close the notification.
dimissNotification: () => void,
// Tap the minimize button to collapse the LogBox inspector.
mimimizeInspector: () => void,
// Tap the dismiss button to close the LogBox inspector.
dismissInspector: () => void,
// Tap the next button to go to the next log.
nextLog: () => void,
// Tap the previous button to go to the previous log.
previousLog: () => void,
```
## Example test
This allows writing tests like:
```
test('should log error', () => {
const logBox = renderLogBox(<ComponentThatErrors />);
// Should show notification
expect(logBox.isOpen()).toBe(false);
expect(logBox.getNotifciationUI()).toEqual({
count: '!',
message: 'error message',
});
// Tap the notification
logBox.openNotification();
// Should show log
expect(logBox.isOpen()).toBe(true);
expect(logBox.getInspectorUI()).toEqual({
header: 'Log 1 of 1',
title: 'Console Error',
message: 'error message',
stackFrames: [
'ComponentThatErrors'
],
componentStackFrames: [
'<ComponentThatErrors />',
],
isDismissable: true,
});
})
```
## Changelog
Changelog: [internal]
Reviewed By: rubennorte
Differential Revision: D69443041
fbshipit-source-id: c81ccd56a39d01d61814d29515b587096c0509c0
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49343
Raise source and target version of annotation processor from 7 to 11
This is unused in OSS
changelog: [internal] internal
Reviewed By: NickGerleman
Differential Revision: D69478025
fbshipit-source-id: 28c6ed5889db423c43a36ccee396083ae7e78e5f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49317
This hooks into `enableNativeCSSParsing()` to optionally bypass viewconfig processor, and lets us parse the raw strings (or objects composed of string) in native.
Right now, to not disturb too much while this is in experimentation, this is just a facade over existing types and props storage, and we ignore any non-px lengths.
Also need to prepend
Changelog: [Internal]
Reviewed By: joevilches
Differential Revision: D69337482
fbshipit-source-id: 6093e312e0d1dc1855713da20b72bf75b98af3ea
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49316
This hooks up some build logic for `react/renderer/css`. A bit funky right now since header only, and might need to change later (it isn't neccesarily guaranteed to be header only in the future).
Changelog: [Internal]
Reviewed By: cortinico, cipolleschi
Differential Revision: D69426450
fbshipit-source-id: 77e0ef409f34daf003d28a5cd70de935bd180440