Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50760
Changelog: [internal]
This updates all Excalidraw SVG diagrams in the repository to use the latest format exported by Excalidraw after the fix in https://github.com/excalidraw/excalidraw/pull/9386.
I basically opened every image in Excalidraw and re-exported it.
Reviewed By: lenaic
Differential Revision: D73107703
fbshipit-source-id: 4432e952f9e6ee29f59ef8a9ff05479552744a31
Summary:
## Changelog:
[Android] [Internal] - As in the title
Reviewed By: cortinico
Differential Revision: D72971263
fbshipit-source-id: 8bd0c4e29e48f7e3d47a97f1a4e988e7b0282646
Summary:
We have a different version of OkHttp internally and in OSS so we need to suppress these for now.
Only Error was supressed in previous diff, also suppress warning.
Changelog: [Internal]
Reviewed By: fkgozali
Differential Revision: D73085528
fbshipit-source-id: a38a6e15e8ca33d4e93678c54d337ad9e86c2bbe
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50748
We have a different version of OkHttp internally and in OSS so we need to suppress these for now.
Changelog: [Internal]
Reviewed By: Abbondanzo
Differential Revision: D73079163
fbshipit-source-id: 1928b00acbba5bc6577a248bc46a091d5b970f10
Summary:
const val NAME had quotes around it breaking native module loading from CoreReactPackage
This error was uncaught in previous diff.
Changelog:
[Internal]
Reviewed By: makovkastar
Differential Revision: D73070533
fbshipit-source-id: a7f14f4b4bd25003529c625d9182554dd2c2ee3e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50744
Crash was discovered after converting source code from Java to Kotlin.
This was due to type checking against Kotlin types instead of Java types.
Also added minor refactoring of code
Changelog:
[Internal]
Reviewed By: Abbondanzo
Differential Revision: D73064216
fbshipit-source-id: 3429f0627740438be3bbc345c9e7b2c4a535da7e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50586
# Changelog: [Internal]
We are going to record microtasks phase of the Event Loop.
RAII reporter that was added in D69399955 will be updated to support phase as a parameter.
There is one downside of the current implementation. Every Event Loop task will have a corresponding "Run Microtasks" block displayed, even if the microtasks queue was empty. There is no API in `jsi` that would allow us to get the size of the queue. If we had that, we could emit this event only when there is something in a microtasks queue.
The good this is that these frames usually have duration of 1-2 microseconds, so they are not visible, until user fully zooms in.
Reviewed By: rubennorte
Differential Revision: D72649816
fbshipit-source-id: d597f5b75aaf0975b14f61d2aa28b9c8bc34f4d5
Summary:
*Hi,*
I made a small update to the dependency array in `useLayoutEffect`, changing it from `[native]` to `[native.value]` for better precision. Since JavaScript compares objects by reference, this change can lead to a minor performance improvement. Additionally, as `useLayoutEffect` is render-blocking, I wanted to ensure we optimize its usage as much as possible.
As a micro-optimization and in line with good coding practices, I also changed a `let + if` variable to `const`. While the performance gain is minimal, it contributes to cleaner and more consistent code.
Please feel free to review, and I sincerely apologize if I made any mistakes in the process.
## 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
-->
*[General] [Changed]* – Refined `useLayoutEffect` dependency array from `[native]` to `[native.value]` for improved precision and efficiency in re-renders.
*[General] [Changed]* – Replaced `let` with `const` where applicable for better code standards and micro-optimization.
Pull Request resolved: https://github.com/facebook/react-native/pull/50682
Reviewed By: huntie
Differential Revision: D72979663
Pulled By: yungsters
fbshipit-source-id: 64ac09811b78ca67be903d8cd91da8cd6f0a45fa
Summary:
Implemented ReactLifecycleStateManager.java in Kotlin as part of Kotlin-ifying RN Round 3
## Changelog:
[ANDROID] [CHANGED] - Migrate ReactLifecycleStateManager to Kotlin
Pull Request resolved: https://github.com/facebook/react-native/pull/50685
Test Plan: Run RN-Tester and interacted with Mulitple components(Image, Flatlist, Input ) with both new architecture enabled and disabled
Reviewed By: rshest
Differential Revision: D73003097
Pulled By: cortinico
fbshipit-source-id: 27b90a0b94c17aa42cbb1665ca6fcf06db7cbf96
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50718
On Windows `path.join` returns path with separators unsupported by resolution mechanism. This change enforces the use of `/` separators in `no-deep-imports` rule tests.
Changelog:
[Internal]
Reviewed By: robhogan
Differential Revision: D73021185
fbshipit-source-id: d4799c01a5aef5b27fad961d774b58627115d213
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50714
This diff changes the category used by LegacyArchitectureLogger soft errors to be SOFT_ASSERTIONS
changelog: [internal] internal
Reviewed By: makovkastar
Differential Revision: D72999455
fbshipit-source-id: b5378fb92b22a3d06dda550192c7eba0db97ddcb
Summary:
Migrated ReactClippingViewGroupHelper.java to Kotlin as part of the React Native Kotlin migration initiative.
This change helps modernize the React Native Android codebase and improve maintainability.
No functional changes were introduced—only a language conversion while preserving the original logic and behavior.
## Changelog:
[ANDROID] [CHANGED] - Migrated ReactClippingViewGroupHelper.java to Kotlin
Pull Request resolved: https://github.com/facebook/react-native/pull/50679
Test Plan:
✅ Ran yarn && yarn android in the root directory and verified RNTester builds successfully.
✅ Opened RNTester on an Android emulator/device and navigated through various screens to ensure the app works as expected.
✅ Specifically tested views with removeClippedSubviews enabled to confirm runtime behavior remains unchanged.
✅ Used [KtFmt](https://github.com/facebook/ktfmt) to format the Kotlin file properly.
Reviewed By: arushikesarwani94
Differential Revision: D72973621
Pulled By: cortinico
fbshipit-source-id: e6f426a0cb7eb583935a560660900b29786df4c3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50105
Pull Request resolved: https://github.com/facebook/react-native/pull/49543
When using `ReactScrollView` or `ReactHorizontalScrollView` Views with `removeClippedSubviews` keyboard navigation didn't work.
This is because keyboard navigation relies on Android's View hierarchy to find the next focusable element. With `removeClippedSubviews` the next View might've been removed from the hierarchy.
With this change we delegate the job of figuring out the next focusable element to the Shadow Tree, which will always contain layout information of the next element of the ScrollView.
We then prevent the clipping of the topmost parent of the next focusable view to lay out the entire containing element in case we have some necessary context in the parent
Changelog: [Android][Fixed] - Fix keyboard navigation on lists with `removeClippedSubviews` enabled
Reviewed By: joevilches
Differential Revision: D71324219
fbshipit-source-id: b55b7735a30714b2a5e1c9e0ed4ae84ab43f6694
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50404
Add another function to fabric to get the topmost stacking context parent given a root and a child.
This is to be used on focus searching algorithm in the case where the next focusable child is deeper in the hierarchy meaning we need to find the top most parent in the Android hierarchy and lay that out as well before transferring focus.
If we don't lay out the parent as well as the next focusable view:
- The next focusable view might lack context given by the parent
- If the parent is a scrollview and has removeClippedSubviews enabled then laying out the next focusable view will not work
- If the view is deeper in the android hierarchy in some cases it won't be layed out unless the parent is
Changelog: [Internal]
Reviewed By: joevilches
Differential Revision: D72178408
fbshipit-source-id: 7b91ea695e236f3a92f9703bcc9ca943bf0dec24
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50196
Currently when `removeClippedSubviews` is enabled on Android keyboard navigation breaks and we can never focus the elements that are clipped. iOS has a similar issue but not as drastic, it only happens when elements on the FlatList have a lot of margin between them.
This algorithm aims to find the next focusable view and return it to native so that we can prevent the clipping of the view on the view clipping algorithm and hence fix keyboard navigation. For more information see D71324219
Fabric algorithm to find the next focusable view given:
`parentTag`: Top most relevant parent of the focused view
`focusedTag`: Tag of the currently focused view
`direction`: Direction in which focus is moving
Changelog: [Internal]
Reviewed By: joevilches
Differential Revision: D71558965
fbshipit-source-id: 1a13c82d067834337e7f7936860780f467c9a15d
Summary:
Introduce a trait to be able to tell if a ShadowNode is focusable by keyboard. This will be used for focus ordering that delegates the work to the shadow tree when Native platforms don't have enough information to define the next focusable node
Changelog: [Internal]
Reviewed By: joevilches
Differential Revision: D72258544
fbshipit-source-id: dcc2410b408eab5dbefc4512e0680cbe7f18c811
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50638
There were two issues with inset shadows here that I fixed
* If spread was big enough it would "invert" the clear region. [RectF's inset](https://developer.android.com/reference/android/graphics/RectF#inset(float,%20float)) method does not bound to a 0x0 rect, it will instead start making the rect bigger if the inset value is large enough.
* If the clear region was outside the rect the shadow disappeared. This is because [Canvas's drawDoubleRoundRect](https://developer.android.com/reference/android/graphics/Canvas#drawDoubleRoundRect(android.graphics.RectF,%20float[],%20android.graphics.RectF,%20float[],%20android.graphics.Paint)) will fail to draw if the inner rect is not completely inside of the outer.
Changelog: [Android][Fixed] - Fix inset shadow edge cases
Reviewed By: GijsWeterings
Differential Revision: D72833275
fbshipit-source-id: 3f42fb767630319c51a380f8ea28d682df9771a6
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50666
This diff updates the assert message in ReactNativeNewArchitectureFeatureFlags to reflect the behavior required by the assert
changelog: [internal] internal
Reviewed By: mlord93
Differential Revision: D72868428
fbshipit-source-id: 7a43aa9d3b3a2ee60e88cf77d117d97edc955af3
Summary:
Fixes https://github.com/facebook/react-native/issues/45857
The general idea behind this PR is the same for both platforms: dirty all nodes with `MeasurableYogaNode` trait when the layout is constrained with a new `fontSizeMultiplier`. There were a few caveats:
- `ParagraphShadowNode` marks its layout as clean in the constructor in most cases. To prevent that from using a stale measurement I'm using the font scale multiplier stored in `content_` property of the node. That value is then compared with the scale used to create the attributed string kept in the node's state. If those differ, the layout is not cleared.
- On Android, font scale wasn't passed down to the `SurfaceHandler`
- On Android, text measurement relies on cached `DisplayMetrics` which were not updated when the system font scale changed.
- `AndroidTextInputShadowNode` wasn't using `fontSizeMultiplier` at all. I needed to add it in all places where an `AttributedString` is constructed.
## Changelog:
[GENERAL] [FIXED] - Fixed text not updating correctly after changing font scale in settings
Pull Request resolved: https://github.com/facebook/react-native/pull/45978
Test Plan:
So far tested on the following code:
```jsx
function App() {
const [counter,setCounter] = useState(0);
const [text,setText] = useState('TextInput');
const [flag,setFlag] = useState(true);
return (
<SafeAreaView
style={{
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
}}
>
<Text style={{fontSize: 24}}>RN 24 Label Testing {flag ? 'A' : 'B'}</Text>
<TextInput value={text} onChangeText={setText} style={{fontSize: 24, borderWidth: 1}} placeholder="Placeholder" />
<Pressable onPress={() => setCounter(prevState => prevState + 1)} style={{backgroundColor: counter % 2 === 0 ? 'red' : 'blue', width: 200, height: 50}} />
<Pressable onPress={() => setFlag(!flag)} style={{backgroundColor: 'green', width: 200, height: 50}} />
</SafeAreaView>
);
}
```
Reviewed By: NickGerleman
Differential Revision: D71727907
Pulled By: j-piasecki
fbshipit-source-id: 240fb5fa4967a9182bce7e885798b233d1e25aea
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50377
Configures the Hermes Parser to target React 19, which changes components written with Component Syntax to stop generating `forwardRef` calls (because `ref` is now a prop).
Changelog:
[General][Changed] - Configured Hermes Parser to target React 19, resulting in Component Syntax no longer producing `forwardRef` calls.
Reviewed By: javache, SamChou19815
Differential Revision: D72070021
fbshipit-source-id: b891789d4ff1cbcb8eebea3525361ab14e628b51