Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47019
NOTE: This code is largely the same as https://github.com/facebook/react-native/pull/46847, I am merely fixing some internal issues
The original diff (D63989547) was backed out because it was causing some crashes related to some internal code that had to be changed. That code did not necessarily need to be changed - we could have just left the `RCTCreateCGColorRefFromSharedColor` function and not touched the internal code - which is what I am going to do here
Changelog: [Internal]
Reviewed By: NickGerleman
Differential Revision: D64201626
fbshipit-source-id: a8ead7a542514aee0749973e284cb7727d393c03
Summary:
App Clips are full of bugs. One such bug is how launching an App Clip from Test Flight (and perhaps other systems) will cause the user activity to be of type `NSUserActivityTypeBrowsingWeb` but with a nullish `userActivity.webpageURL` (even though it's typed as never being nullish in this mode).
## Changelog:
[IOS] [FIXED] - Fix launching App Clips with nullish URLs.
<!-- 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/47000
Test Plan:
The following was failing cryptically and required extensive debugging to get launching.
https://github.com/user-attachments/assets/ffd26297-b20b-45a2-97cc-35a48b740cb2
Reviewed By: cipolleschi
Differential Revision: D64372170
Pulled By: lunaleaps
fbshipit-source-id: 388f05530f3bccdd9b446382931f127421bc8a27
Summary:
part of https://github.com/facebook/react-native/issues/46757
closes ME2E0006, ME2E0007
## 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] - add e2e test for Legacy Style Event
Pull Request resolved: https://github.com/facebook/react-native/pull/46784
Test Plan:
```
yarn e2e-test-ios
yarn e2e-test-android
```
Reviewed By: cortinico
Differential Revision: D64172277
Pulled By: cipolleschi
fbshipit-source-id: adf3a55b354f1a293c4620dc617a6a08e3aebd2b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46953
Changelog: [internal]
This unifies all the feature flags that control the new event loop on RN. Before, we'd have granular flags for different aspects of it. With this diff, we enable the event loop by default with bridgeless, and we introduce a new flag to explicitly disable it in that case if necessary.
When we're ready to clean up this opt-out, we just need to remove the `&& !ReactNativeFeatureFlags::disableEventLoopOnBridgeless()` conditions.
Reviewed By: javache
Differential Revision: D64175216
fbshipit-source-id: b879447def8ab47c6ab772812ff1031177494069
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46972
Changelog: [internal]
I'm unifying the feature flags for the new event loop (so it's enabled by default when bridgeless is enabled, unless a feature flag is explicitly set), and I realized that the feature flags for Bridgeless, Fabric and Turbo Modules aren't being set in iOS, causing my changes to be incorrect (as we're using bridgeless but the bridgeless flag is off).
This forces the right flags when using bridgeless so the configuration is consistent.
Reviewed By: rshest, cipolleschi
Differential Revision: D64234056
fbshipit-source-id: bfdbe6742ee84c23d6d2c0c56e6ca8fce1788b26
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47027
While I was writing the documentation for extracting a module in a library, I realized that Codegen ignored the local node modules.
The reason is that `require.resolve` fails to resolve a local path.
bypass-github-export-checks
## Changelog
[General][Fixed] - Make Codegen work with local modules
Reviewed By: cortinico
Differential Revision: D64242713
fbshipit-source-id: cc5167665a49df1d09eb66a0dc9d76466f087a25
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47030
Looking at the videos from the E2E tests, it seems that the tests are pretty reliable aside from the first one that often fail. And it looks like it is failing not because the test is wrong, but because maestro hits some sort of timeout and kills the test sooner.
With these changes we are:
- giving more time to maestro to run
- not killing the emulator anymore
Killing and restarting the simulator was making this problem workse, because a newly started simulator required more time to boots and to work properly
## Changelog:
[Internal] - stop killing simulators and increase timeouts
Reviewed By: cortinico
Differential Revision: D64398111
fbshipit-source-id: 17b107fee24d0fbd4897212c1907be3761e337ab
Summary:
Part of this: https://github.com/facebook/react-native/issues/46757
Solves:
- ME2E0005
## 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 ] - Add console.log measure test in new-arch-example
Pull Request resolved: https://github.com/facebook/react-native/pull/47020
Test Plan:
```
yarn e2e-test-ios
yarn e2e-test-android
```
Reviewed By: cortinico
Differential Revision: D64397112
Pulled By: cipolleschi
fbshipit-source-id: c9192d66065038528751e2e366f58158b06eb864
Summary:
In the new architecture, if you open the soft keyboard, unmount `KeyboardAvoidingView`, close the keyboard, and then remount `KeyboardAvoidingView`, it still assumes the keyboard is open and displays the keyboard avoiding area.
We need to check if the keyboard is still open after remounting.
Fixes https://github.com/facebook/react-native/issues/46942
## Changelog:
[GENERAL] [FIXED] - Fix KeyboardAvoidingView not aware of the keyboard closing it is unmounted
Pull Request resolved: https://github.com/facebook/react-native/pull/46952
Test Plan:
Code to reproduce in RNTester:
```JSX
import type {RNTesterModuleExample} from '../../types/RNTesterTypes';
import {Button, KeyboardAvoidingView, Text, TextInput, View} from 'react-native';
import {Fragment, Suspense, useState} from "react";
const infiniteThenable = { then() {} };
function Suspender({ freeze, children }) {
if (freeze) {
throw infiniteThenable;
}
return <Fragment>{children}</Fragment>;
}
function Freeze({ freeze, children }) {
return (
<Suspense>
<Suspender freeze={freeze}>{children}</Suspender>
</Suspense>
);
}
function Playground() {
const [isFrozen, setIsFrozen] = useState(false);
return (
<>
<TextInput style={{ height: 100 }} />
<Button title="Freeze" onPress={() => setIsFrozen(true)} />
<Button title="Unfreeze" onPress={() => setIsFrozen(false)} />
<Freeze freeze={isFrozen}>
<KeyboardAvoidingView behavior="padding" style={{ flex: 1 }}>
<View style={{ backgroundColor: '#909090', flex: 1, alignItems: 'center', justifyContent: 'flex-end' }}>
<Text>Test</Text>
<Text></Text>
</View>
</KeyboardAvoidingView>
</Freeze>
</>
);
}
export default ({
title: 'Playground',
name: 'playground',
render: (): React.Node => <Playground />,
}: RNTesterModuleExample);
```
### Steps
1. Tap the text input to show the soft keyboard.
2. Tap Freeze.
3. Tap the Enter or Done button on the soft keyboard to hide it.
4. Tap Unfreeze.
5. Verify that there is no blank area at the bottom of the screen.
### Videos
#### iOS
Before | After
-- | --
<video src="https://github.com/user-attachments/assets/0c8d840e-14a6-47ad-a163-d34ac9cfbf40" /> | <video src="https://github.com/user-attachments/assets/1d88a70c-e029-433d-920d-da7582edb3f2" />
#### Android
Before | After
-- | --
<video src="https://github.com/user-attachments/assets/f29f6526-c5a4-4b6a-b3aa-7c4c7ff3ed30" /> | <video src="https://github.com/user-attachments/assets/c4e92356-694b-4fca-8897-7dfca8495db0" />
Reviewed By: andrewdacenko
Differential Revision: D64178982
Pulled By: cipolleschi
fbshipit-source-id: 8d71654aac599cec4e1928b14d87cff34f28174a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47015
CMake is complaining that this variable is set outside the build but not used.
I'm using it inside our top level .cmake file to silence this warning.
We need this variable as user projects might use it.
Changelog:
[Internal] [Changed] - Silence CMake warning caused by `PROJECT_ROOT_DIR`
Reviewed By: javache
Differential Revision: D64334462
fbshipit-source-id: 558bfc9f647e62890e3cc25628b5544880c47e4b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46990
This is a reattempt land D63643856 to fix the scroll onendreached event not firing.
Changelog:
[General][Fixed] - Fix onEndReached not being called when getItemLayout is present and we scroll past render window
Reviewed By: NickGerleman
Differential Revision: D64222424
fbshipit-source-id: 7e22f377d2f754beb39fff2b5c097cea350daa7e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47012
Update Metro from `0.81.0-alpha.2` to `0.81.0`.
This is also intended to be the final, stable release for RN 0.76.
Changelog:
[General][Changed]: Update Metro to 0.81.0
Reviewed By: blakef
Differential Revision: D64329574
fbshipit-source-id: e12bed356b46e4ed68c75b397b7f9e2228c377be
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46982
E2E test setup for each of the `resizeMethod` methods for Image on Android
Changelog: [Internal]
Reviewed By: NickGerleman
Differential Revision: D64136839
fbshipit-source-id: 876939a50243836030401c6456410f119abe01b5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46987
X-link: https://github.com/facebook/metro/pull/1371
Update `babel/register` to latest version, fixing the bug that were preventing us from updating it previously.
Changelog: [Internal]
Reviewed By: huntie
Differential Revision: D64245277
fbshipit-source-id: f3d07b06a11fbe3a0ed28e22f5b687541782dda9
Summary:
When migrating `PackagerConnectionSettings` from Java to Kotlin in https://github.com/facebook/react-native/pull/45800 the new class ended up being declared as final, causing a breaking change in 0.76.
We should add the `open` directive to `PackagerConnectionSettings.kt` to restore the old behavior. That would be crucial for the `expo-dev-client` package, given that Expo needs to be able to extend this class in order to overwrite the `debugServerHost` value.
## Changelog:
[ANDROID] [FIXED] - Make PackagerConnectionSettings class open again
Pull Request resolved: https://github.com/facebook/react-native/pull/47005
Test Plan: Run RNTester on Android
Reviewed By: huntie
Differential Revision: D64323645
Pulled By: cortinico
fbshipit-source-id: 6870a3dee929ba664e4c402f321f84af7704f892
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46979
It seems that, when the items in a virtualized list don't have a fixed size (i.e. they dynamically scale with the size of the container), we need to also take into account their size when updating the scroll position as a consequense of setting `maintainVisibleContentPosition`.
Changelog:
[Android][Fixed] - Account for items dynamically scaling with the container when using `maintainVisibleContentPosition` in virtualized lists
Reviewed By: javache, NickGerleman
Differential Revision: D64238887
fbshipit-source-id: 9f05a461d178bc191137b1a350072337ba62e224
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47001
changelog: [internal]
EventBeat::beat is only used on Windows, let's move it there.
EventBeat::induce is only called by subclasses, doesn't need to be public.
Reviewed By: christophpurrer
Differential Revision: D64287646
fbshipit-source-id: 48edceddd273b45e8a4e63f4c1d5fda6c5adf425
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46993
Calling ReactNativeFeatureFlags::enableDeletionOfUnmountedViews() from the destructor increases the chance of accessing ReactNativeFeatureFlags during the tear down of React Native.
We are moving this call into the contructor of the object which always happen on the js thread
changelog: [internal] internal
Reviewed By: rubennorte
Differential Revision: D64190029
fbshipit-source-id: 377b85e8ff0704db0f6603662f595b75a6705693
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46994
This diff makes a small refactor on Systrace.traceSection() to unblock CI, which was broken by D64141515
changelog: [internal] internal
Reviewed By: Abbondanzo
Differential Revision: D64276651
fbshipit-source-id: e35950f88cde3d547992bb700208a4d4d309710f
Summary:
Using a new JVM profiler (D64128815) to find blind spot in the early startup init markers and adding them.
Changelog: [Internal]
Reviewed By: rubennorte
Differential Revision: D64141515
fbshipit-source-id: d2968ed5dafdd891b8cc5a6115479c0678bfdc80
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46963
Changelog: [internal]
This introduces a new method in `ReactNativeFeatureFlags` to force setting overrides without triggering any errors (they're returned a string instead to be handled in userland). This is partially equivalent to calling `dangerouslyReset` and `override` but completely avoids the hard crashes that could be caused by race conditions.
Reviewed By: javache, rshest
Differential Revision: D64186262
fbshipit-source-id: 854caa03810ec78217999292a4335dad373b7fcb
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46965
Converting this class as close to 1:1 as possible.
Changelog: [Internal]
Reviewed By: NickGerleman, rshest
Differential Revision: D64124890
fbshipit-source-id: 2034ed8ecb877bb267a953b183b77daaf883a80a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46964
Graceful degradation is better than outright crashing. When rendering images that exceed Android's memory limits, React Native applications will fatally crash. This change intervenes by swallowing the exception that Android raises and forwards it to the `onError` handler. As a result, no image will be rendered instead of fatally crashing.
Fresco already intervenes by default. It will raise a `PoolSizeViolationException` if the bitmap size exceeds memory limits set by the OS and applies a 2048 pixel maximum dimension to JPEG images, but it's still possible for these configuration limits to be removed and for images to fall just short of Fresco's memory limit. The exception is raised when we attempt to draw the bitmap, not when the bitmap is allocated in memory, so we must handle the exception here and not in Fresco.
## Changelog
[Android][Fixed] - Apps will no longer fatally crash when trying to draw large images
Reviewed By: tdn120
Differential Revision: D64144596
fbshipit-source-id: 32b69ad4ecef0564c2cad7a287a31b56688f38b8
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46981
changelog: [internal]
stateUpdate with closure syntax has to be used in order to not override contentSize stored inside of C++ state.
Reviewed By: jessebwr
Differential Revision: D64242221
fbshipit-source-id: 32d55ccc03e32922f2746293ccb6c0941ca67d92
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46961
Changelog: [Internal]
Runtime Shadow Node Reference Syncing causes asserts when updating the shadow tree without passing through the JS-thread. This diff disables the feature by default to avoid the asserts encountered on RN Windows.
Reviewed By: sammy-SC
Differential Revision: D64188839
fbshipit-source-id: eb65206662d842f8150f1771c86dc8d190cbc3aa
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46955
This is a major bump of Kotlin. It comes with no breaking changes for the Kotlin API, but there are several new warnigns that I had to fix.
Most importantly several `override` methods that are overriding Deprecated API, also need to be deprecated as well in Kotlin.
Changelog:
[Android] [Changed] - Bump Kotlin 1.9.x to 2.0.x
Reviewed By: tdn120
Differential Revision: D64179842
fbshipit-source-id: 295ab2636ce9f9bb04e9d8c7ed27d9f8a1a64338
Summary:
This change move E2E tests to larger mac machines to see if we can reduce the flakyness.
Most of the time the flakyness is due to slowness in connecting to the simulator or slowness in Metro to provide the bundle to RNTester when we run the tests in Debug.
More power should speed-up those processes.
E2E tests took < 30 min in this diff
on Main, they took > 120 min
## Changelog:
[Internal] - Move the E2E tests to bigger machines
Pull Request resolved: https://github.com/facebook/react-native/pull/46960
Test Plan: GHA
Reviewed By: blakef
Differential Revision: D64237659
Pulled By: cipolleschi
fbshipit-source-id: c2458413c8de70c07fae8f2b5f202371c6293815
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46958
This will make it easier to link against custom C++ TM which will most likely live inside ./shared or
some other paths outside of ./android.
CMake will have access to `PROJECT_ROOT_DIR` which points to ./android (the folder where the settings.gradle file exists).
Changelog:
[Internal] [Changed] - RNGP - Pass PROJECT_ROOT_DIR to CMake
Reviewed By: cipolleschi
Differential Revision: D64183641
fbshipit-source-id: 347256c04f10e92cf5a13e9c70db16aa29bcb741
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46936
Let's enable box-shadow everywhere! This should be safe, now that we assume any background mutating methods in BaseViewManager go through BackgroundStyleApplicator. `boxShadow` is also already in `BaseViewConfig` instead of configs for each native component (bc we were already planning to make this change).
Changelog:
[Android][Added] - Add boxShadow support to BaseViewManager
Reviewed By: mdvacca
Differential Revision: D64140841
fbshipit-source-id: e937a4bcaa4506fd25d0916633313083c7e49333
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46934
BaseViewManagerDelegate is a handcrafted second source of truth, used specifically for codegen.
The organization here has some problems, but this diff adds the props currently missing from it, so that these work correctly in generated view managers.
Changelog:
[Android][Fixed] - Add missing BaseViewManager props to BaseViewManagerDelegate
Reviewed By: mdvacca
Differential Revision: D64137615
fbshipit-source-id: 4ff85f2524e5472f3b768e212fd5f2d4d9a36e17