Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45197
With React 19, `forwardRef` is no longer necessary because `ref` is available on props. However, this only holds true for functional components — not class components.
This eliminates the `forwardRef` invocation in `ScrollView`, while retaining the wrapper component to map `ref` to `scrollViewRef` for the class component. For now...
Changelog:
[Internal]
Reviewed By: javache
Differential Revision: D59091873
fbshipit-source-id: 60afcd441aec82fa050738b5c09083f3a26378d6
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45203
Configures a `REACT_NATIVE_ENABLE_FUSEBOX_DEBUG` flag, and exposes this flag in the Buck target via a [constraint setting](https://www.internalfb.com/intern/wiki/Buck-users/select-and-friends/#constraint-setting-and-c). This is an additional hook to enable the new debugger stack (codename Fusebox) as part of our internal rollout.
NOTE: This approach replaces D59014161 (reverted).
Changelog: [Internal]
Reviewed By: hoxyq
Differential Revision: D59109110
fbshipit-source-id: 7d23d9d402569b00d8dd17b9c8f3bcc108f0365f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45151
This change was missed when fixing hue-rotate and adding drop-shadow. I believe the only issue with this was stacking context was not being created for these two filters.
Changelog: [Internal]
Reviewed By: NickGerleman
Differential Revision: D58965245
fbshipit-source-id: e6bfdb738a8bc8caa878f60420cfe8b421f64aa4
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45161
This is part of a bigger refactoring of the Android pipelines.
As `build_android` is already building everything, let's save the maven-local
so it can be reused by other jobs (test_android_helloworld and build_npm_package).
Changelog:
[Internal] [Changed] - Let build_android produce a signed maven-local.zip archive
Reviewed By: cipolleschi, blakef
Differential Revision: D59002893
fbshipit-source-id: db03946c975b2ce91dae0c4011981b2fe9dd6113
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45133
Recently, CircleCI has failed pretty often due to these tests.
The reason is that we migrated these jobs to M1 machines, as circleCI is deprecating intel ones, and on these machines the simulators tend to freeze. Hence, every often we get stuck when running the tests. :(
We are going to move to GHA, so that should not be a big issue.
## Changelog:
[Internal] - Disable unit tests in CircleCI to improve CI robustness
Reviewed By: cortinico
Differential Revision: D58948614
fbshipit-source-id: 5420bdf0fda325779a4e287e7b00c623de822ccb
Summary:
This PR refactors `supportedInterfaceOrientations` to use RCTKeyWindow instead of `[RCTSharedApplication() keyWindow]`.
## Changelog:
[IOS] [CHANGED] - Refactor supportedInterfaceOrientations method to use RCTKeyWindow()
Pull Request resolved: https://github.com/facebook/react-native/pull/43026
Test Plan: CI Green
Reviewed By: dmytrorykun
Differential Revision: D59109614
Pulled By: cipolleschi
fbshipit-source-id: 025534c419078dce29e1e5caacf8a1b15de1abcc
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45196
Currently, `mockComponent` makes a false assumption that if a component is a function, it extends `React.Component`.
There's a bunch of problems with this mocking setup with requiring mock components that extend `React.Component`, but this change does not attemp to solve that.
This change unblocks future refactors to make native components export functional components (that are neither class component nor `forwardRef` results).
Changelog:
[General][Changed] - Fixed native component mocking in Jest unit tests to support functional components
Reviewed By: javache
Differential Revision: D59097730
fbshipit-source-id: ca2784ac3baa9ab4ab6a503c5fd6437c60179352
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45195
Configure `Modal-test.js` to reset modules between test cases so that there is better isolation, making the tests easier to reason about and to debug.
Changelog:
[Internal]
Reviewed By: javache
Differential Revision: D59097729
fbshipit-source-id: 3b9260283e171ff7fa6b7ffc56685f703875291e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45174
As per title, this port bck to main the changes we made in the release testing script.
## Changelog:
[Internal] - Update release testing script to work with the new template
Reviewed By: blakef
Differential Revision: D59054045
fbshipit-source-id: 0e93c2db94499407845b4fb2c98c8b44310e770f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45175
This change ports the CI improvements we made on stable branch to main.
## Changelog:
[Internal] - Port back to main improvements we made in GHA
Reviewed By: cortinico
Differential Revision: D59053873
fbshipit-source-id: 73eb7e33b9bbdc5d8c3a9294f487ad969b144bf3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45190
Just a small follow up from the previous change to `IntersectionObserverManager`.
Changelog: [internal]
Reviewed By: javache
Differential Revision: D59065041
fbshipit-source-id: 2944299143e6a0fe53fe64083db85635e72d71af
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45162
Previously we would crash in ReactInstance#callFunctionOnModule (P1443291303) when reloading (due to the onHostPause call) because we removed a source of synchronization by using the immediate executor.
Workaround it by making sure we always null out references to `mReactInstance` before we actually start destroying it.
Changelog: [Internal]
Reviewed By: RSNara
Differential Revision: D59002404
fbshipit-source-id: 3ee14cd1fe7d423bb6158356bb99b3d2d6af8d6f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45170
Reimplements `unstable_subscribeToOnScroll` so it does not invalidate all descendant children upon first invocation per `ScrollView` instance.
Previously, the state update would cause the entire `ScrollView` component to re-render. This refactors the `enableSyncOnScroll` boolean state so that it resides in a lower level component that implicitly memoizes all of its `props` (including the `ScrollView` children).
Changelog:
[Internal]
Reviewed By: javache
Differential Revision: D59033393
fbshipit-source-id: 5a4b75aebdcbd0dd1dfa28511862bee495816250
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45194
Makes a couple improvmeents to `LogBoxInspectorHeader`:
- Avoid eagerly initializing the `StatusBar` TurboModule until it is actually needed (which is only when the inspector is rendered on Android).
- Switch to `SafeAreaView` on iOS, for more accurate spacing (instead of the hardcoded iPhone X notch size).
Changelog:
[General][Changed] - Improve LogBox initialization performance
[iOS][Changed] - Improve LogBox safe area insets styling
Reviewed By: lyahdav
Differential Revision: D59081529
fbshipit-source-id: 01cc351fa9267f96b7a3c13cf1db80de3e597f93
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45186
Changelog: [internal]
(this is an internal change because `IntersectionObserver` hasn't been released yet).
When testing IntersectionObserver, I realized that it wasn't triggering notifications for elements not intersecting when the surface that contained them was completely deallocated.
This is unexpected because IntersectionObserver notifications are delivered when the element is removed from the root, but not when the root itself is removed.
This fixes that behavior by:
1. Adding a method in `UIManagerMountHooks` to get a notification about the surface being unmounted. This is necessary to keep the API backwards compatible.
2. Using that method in `IntersectionObserverManager` to notify all observers (and report a change if necessary).
Reviewed By: javache
Differential Revision: D59061136
fbshipit-source-id: ef5669f9d6b08d98652489e6731902d192ec28f8
Summary:
Tests were failing on windows due to parsing CRLF line endings. This change enables the API tests for windows by normalizing line endings before parsing the file.
## Changelog:
[INTERNAL] [ADDED] - `public-api-test` now runs on Windows.
<!-- 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/45145
Test Plan: Build-time-only change; relying on CircleCI
Reviewed By: cipolleschi
Differential Revision: D59001867
Pulled By: huntie
fbshipit-source-id: a7a41945e8c93288be1d5b7b59df7f621e467657
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45185
Follow-up to D59058085.
Since the release branch for 0.75 has been cut, we are able to simplify this step.
Changelog: [Internal]
Reviewed By: christophpurrer
Differential Revision: D59058084
fbshipit-source-id: 21b77a74e13bb196336a63b984f921f0c9fde587
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45184
This is a follow-up to D59055522.
> NOTE:This diff will be followed up by a merge of the set-rn-version script into set-version. (I had considered a rename to version-rn-artifacts, intentionally keeping this script separate and distinct from a future [lerna version + this script] setup — however the current UX and confusion with this naming would be too confusing. It can move into a util 👍🏻.)
- Rename `set-rn-version` to `set-rn-artifacts-version` (more accurate).
- Mark this script as deprecated.
- For now, there are too many references to this script in CI test jobs to refactor away this entry point, so I am avoiding this — these should later be standardised to `set-version`.
Changelog: [Internal]
Reviewed By: christophpurrer
Differential Revision: D59058085
fbshipit-source-id: 4123ac73b5c7a2e07a1d1b6da61e0ad94fc31f84
Summary:
While developing React Server Component support for React Native, I've been adding this patch to the `react-native` package. It opts the entire `react-native` package out of being server rendered.
In the future, we'll want to circle back and refactor the `react-native` package to be more isomorphic so we can allow for utilities like `processColor` to be used in server bundles that target native platforms.
## Changelog:
[GENERAL] [ADDED] - Added support for importing `react-native` in a `react-server` environment for React Server Components support.
<!-- 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/43986
Test Plan:
Using react-native with this patch in a framework that supports React Server Components for native platforms, such as my unreleased branch of Expo Router, will allow for server rendering views from `react-native` to RSC Flight code with client references to the `react-native` package, e.g.
```js
import { View } from 'react-native';
export default function App() {
return <View testID="basic-view" style={{ "backgroundColor":"#191A20" }}/>
}
```
Can be server rendered to ↓
```
2:I["/node_modules/react-native/index.bundle?platform=ios&dev=true#798513620",["..."],"View"]
1:["$","$L2",null,{"testID":"basic-view","style":{"backgroundColor":"#191A20"}}]
```
> The client boundaries (URL paths) are specific to the current Expo CLI implementation (based on Metro) and may look different in other implementations.
Reviewed By: rickhanlonii
Differential Revision: D55891243
Pulled By: TheSavior
fbshipit-source-id: d8dc9590039181ebf2c013dacca5f255d7a8f625
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45180
- Simplifies the responsibilities of `scripts/releases/set-rn-version.js`.
- This no longer modifies `packages/react-native/package.json`, delegating this to `set-version`.
- Simplifies logic in `set-version`, **fixing behaviour** against deps in `packages/react-native/package.json`.
- This also acts as cleanup since D58469912 (template removal) — removing the unreferenced `update-template-package.js` util.
NOTE: This diff will be followed up by a merge of the `set-rn-version` script into `set-version`. (I had considered a rename to `version-rn-artifacts`, intentionally keeping this script separate and distinct from a future [`lerna version` + this script] setup — however the current UX and confusion with this naming would be too confusing. It can move into a util 👍🏻.)
Changelog: [Internal]
Reviewed By: cipolleschi
Differential Revision: D59055522
fbshipit-source-id: 79b937f9e0ac790512b180ab4147aefef7f5202c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45028
Since the addition of new workspaces to the repo which introduce interdependencies on `react-native` (`helloworld`, `react-native-test-library`), this fix is needed to preserve our current versioning strategy and bump the repo after yesterday's `0.75-stable` branch cut.
Changelog: [Internal]
Reviewed By: cipolleschi
Differential Revision: D58725561
fbshipit-source-id: ab282806560f47dc5acf7e694302ca6b85649b14
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44814
We needed this workaround to import the paper renderer in the New Architecture to make sure that the event emitter is properly registered before we use it.
With the previous change, we don't need this lines of code anymore as we are using a different mechanism for the events.
## Changelog:
[Internal] - Avoid to import the old Renderer in the New Architecture
## Facebook:
This diff was initially part of D57097880, but I split them for the OTA
Reviewed By: cortinico
Differential Revision: D58234325
fbshipit-source-id: 1335992460635e9e97ee83615f9fd2651936b32c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45167
Configures a `REACT_NATIVE_ENABLE_FUSEBOX_DEBUG` flag, and exposes this flag in the Buck target. This is an additional hook to enable the new debugger stack (codename Fusebox) as part of our internal rollout.
Changelog: [Internal]
Reviewed By: hoxyq
Differential Revision: D59014161
fbshipit-source-id: f05e8b01ed07da90ef6d7a66ade05f462dd82023
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45156
We don't want to bubble up exceptions from props parsing, so match the behaviour from convertRawProp and fall back to the default value when an exception is encountered.
Changelog: [Internal]
Reviewed By: NickGerleman
Differential Revision: D59000397
fbshipit-source-id: f6f64a80fed98525cdd2a5b5d360c2d6ede76a12
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45160
This should optimize the Gradle cache, so that only `build_android` which
effectively builds everything Android related, should be allowed to write there.
More info on this strategy here:
https://github.com/gradle/actions/blob/main/docs/setup-gradle.md
Changelog:
[Internal] [Changed] - Only build_android should write to the Gradle Cache
Reviewed By: cipolleschi
Differential Revision: D59002323
fbshipit-source-id: 31b815747efdf93bfc7baf97799e287c8dcd7f02
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45165
This is a fix for https://github.com/facebook/react-native/issues/45112
This diff changes the codegen so that the output path is computed relative to project root (or `path` if provided) instead of current working directory.
Changelog: [General][Fixed] - Codegen computes output path relative to project root instead of current working directory.
Reviewed By: fkgozali
Differential Revision: D59009821
fbshipit-source-id: 3a138a3508fc239c8600b8c9f242f1c665f8e3c0
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45049
WithRuntimeDecorator is missing many methods that were added after it.
Add implementations for them.
The underlying issue here is that because this inherits from
RuntimeDecorator, which implements all methods, there is no compilation
error for this runtime when we add new methods.
Changelog:
[GENERAL] [FIXED] - Add missing methods to the WithRuntimeDecorator class.
Reviewed By: avp
Differential Revision: D58752127
fbshipit-source-id: d80b4ed1c38698ed3850d0cd961bf7ddde2449a0
Summary:
This PR adds missing `WithRuntimeDecorator` methods related to `NativeState`. This pattern is used by reanimated to ensure no concurrent access to the runtime. Without this `override` the `RuntimeDecorator` implementation was used, bypassing our mutex.
Changelog:
[GENERAL] [FIXED] - Add missing `NativeState` methods to the `WithRuntimeDecorator` class.
Pull Request resolved: https://github.com/facebook/react-native/pull/45042
Reviewed By: fbmal7
Differential Revision: D58744051
Pulled By: neildhar
fbshipit-source-id: 3f5c85d0bf7cd6445d0c434ac4ae7ed54df203ba
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45168
Refactors the native component imports in `ScrollView` so that 1) they create less clutter in the `ScrollView` implementation file, and 2) they offer more efficient import inlining.
Currently, `ScrollView` has to evaluate both horizontal and vertical components even though only one may be used. Now this optimization is possible.
Changelog: [Internal]
Reviewed By: lyahdav
Differential Revision: D59015990
fbshipit-source-id: 963009821a7d3019d36a43269e9792ac1f2f38ec
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45164
Some changes have been made to the codegen since `react-native-test-library` was published. This diff updates the generated artifacts in that library.
Changelog: [Internal]
Reviewed By: fkgozali
Differential Revision: D59010093
fbshipit-source-id: f11ccd3645da72d45c70581e485f8546166ca182
Summary:
## Summary
Right now, the only way to load the javascript bundle is through the assets:// directory.
But, legacy react native also supports loading bundles via regular file urls.
If present, those file urls override the assets:// bundle urls.
This diff implements that support in bridgeless.
Changelog: [Android][Added] Allow js bundle file urls
Reviewed By: christophpurrer
Differential Revision: D58977143
fbshipit-source-id: 6f1a170546c8bbeac3a1b9d2dd5633177e33a688