Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51619
RNTester Android is currently instacrashing in OSS due to 3rd-party packages not having the `RN_SERIALIZABLE_STATE` definition.
That's because the `INTERFACE` definition is not properly propagated on the prefab boundaries.
This was happening for `react-native-popup-menu-android` and `react-native-test-library` and will also happen for Codegen libraries.
This fixes it. 3p developers with custom CMake files will also have to use the `target_compile_reactnative_options` functions to make sure the compilation flag are properly populated.
Changelog:
[Android] [Breaking] - Correctly propagate RN_SERIALIZABLE_STATE to 3rd party CMake targets. Users with custom CMake and C++ code should update to use `target_compile_reactnative_options` inside their CMakeLists.txt files. See the 0.81 release notes for more information.
Reviewed By: cipolleschi
Differential Revision: D75441245
fbshipit-source-id: 3855fdf11cbe7f4b01f68e0dde68b63b3240ad35
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51616
changelog: [internal]
doesn't seem to be used by anything. let's delete it.
Reviewed By: javache
Differential Revision: D75218695
fbshipit-source-id: eeb3a826f06456be8de6941fa95d6ffc7917dcf8
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51615
changelog: [internal]
rename methods to reflect that they are getters and mark them as noexcept const
Reviewed By: rshest
Differential Revision: D75217535
fbshipit-source-id: c7d77060d0f54f8043a7552eec7e2b231cb5b7bf
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51618
Changelog: [internal]
This sets the argument to `pullTransaction` to `true` in the cases where the call is done from the JS thread and the transactions are mounted asynchronously in the UI thread (basically platforms using the push model for mounting coordinator).
It was missing on an experiment for Android (compatibility mode for Props 2.0)
Reviewed By: lenaic
Differential Revision: D75439105
fbshipit-source-id: a106a3a674e44b0cf2603782302343f60ee5450e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51620
The spirit of "Decouple Hermes from JSI nd simplify dependencies" is good, but the problem is that when we ships prebuilds of hermes-engine, it tries to load `libjsi.dylib` and that library is not available.
{F1978594163}
I'll have to investigate more how to properly decouple Hermes prebuilds and how to pass jsi to Hermes and react-native. We might have to decouple it further and have a separate job that builds jsi and feed it to hermes.
This problem will go away with SwiftPM, though, so probably not worth solving this.
## Changelog:
[Internal] - Fix nightlies with a backout
Reviewed By: cortinico
Differential Revision: D75442056
fbshipit-source-id: f1085be8247c0974854254c6bd631ca258488beb
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51614
`JSEventLoopWatchdog` is not used in react-native package. This diff moves it to rn-tester which previously deep imported it from react-native (which we want to avoid).
Changelog:
[Internal]
Reviewed By: huntie
Differential Revision: D75410548
fbshipit-source-id: d4996742578e3b068e7acad9479394388b1907ac
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51603
In `rn-tester` TextAncestor was used to create a inlineView wrapper:
```js
function InlineView(props) {
return (
<TextAncestor.Provider value={false}>
<View {...props} />
</TextAncestor.Provider>
);
}
```
however, it is already done in View.js and TextAncestor shouldn't be used outside of react-native package:
```js
if (hasTextAncestor) {
return <TextAncestor value={false}>{actualView}</TextAncestor>;
}
return actualView;
```
Changelog:
[Internal]
Reviewed By: huntie
Differential Revision: D75408231
fbshipit-source-id: 7f12278296dcfe56246f6b7065f5a094e4099f7a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51602
Changelog: [GENERAL][FIXED] - Fixed the generated type definitions for `Animated.FlatList` and `Animated.SectionList` to correctly infer item types.
Current definitions for animated list components cast away their generic definitions, preventing the types to be inferred from usage. This diff addresses that.
Reviewed By: huntie
Differential Revision: D75407762
fbshipit-source-id: c86f20298ded707971c05a78d025a63e82fe2a64
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51611
changelog: [internal]
AnimationDriver does not use enable_shared_from_this, let's remove it. Also mark a few methods as noexcept and const.
This helps with C++ binary size.
Reviewed By: rshest
Differential Revision: D75172851
fbshipit-source-id: d6552cd577371a51c3fa3b394b451d7ed2b61e44
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51610
changelog: [internal]
No need to store uiManagerBinding in a shared_ptr. Let's just get it, pass it to classes that need it and not store it.
This helps with C++ binary size a little bit.
Reviewed By: rshest
Differential Revision: D75174567
fbshipit-source-id: 1d4e5a9f89ba2f2d2eb733eac9d103ee97550d0f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51609
changelog: [internal]
NativeAnimatedNodesManagerProvider is not subclassed. Let's remove virtual methods and make it a final class.
Reviewed By: lenaic
Differential Revision: D75169108
fbshipit-source-id: 32121cf372ba94c8a7b86c61fd96efd75560f789
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51517
The Props 2.0 implementation for ScrollView added two missing props which were Android specific.
This diff moves these to a separate HostPlatformScrollViewProps class so that other platforms wouldn't include them
Changelog: [Internal]
Reviewed By: mdvacca
Differential Revision: D75183132
fbshipit-source-id: 44d0e0aa974e69f8584ad6bd681fad100c3493d8
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51605
changelog: [internal]
folly::dynamic can be constructed with nullptr and it creates a null folly::dynamic. Let's use that to indicate missing value instead of std::optional to lower C++ binary size.
Reviewed By: rshest
Differential Revision: D75174590
fbshipit-source-id: f2dfef00975686f6ac4c14b42539e700e967075b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51606
changelog: [internal]
When native module is destroyed, ui queue is also torn down.
this helps with C++ binary size a little bit
Reviewed By: rshest
Differential Revision: D75149437
fbshipit-source-id: 1df061db26b4fb5026114e00bbc6846bf38d83a9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51600
The `infoLog` is a `console.log` wrapper to separate ad-hoc console debug logging, however console logs are already used in some files in rn-tester (ex. RNTesterAppShared.js). The same applies to files in react-native package.
Changelog:
[General][Changed] - Removed `infoLog` from react-native package
Reviewed By: huntie
Differential Revision: D75402930
fbshipit-source-id: 1a14a9122552130415f058d3647d715225321ab8
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51591
This change decouples Hermes from JSI and simplify the dependency graph.
Prior to this change, Hermes was building and providing JSI to React Native.
Hermes and React Native shares the same version of JSI, so that's was not a problem, but this choice added an unnecessary dependency on hermes-engine for some pods. For example, `React-utils` was depending on hermes, although it only needs JSI.
## Changelog:
[Internal] - Decouple hermes-engine from jsi
Reviewed By: cortinico
Differential Revision: D75374285
fbshipit-source-id: 3af6846032e81b6461420dd4f4a9c34b741f31ae
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51599
Adds `deprecated` to 2x API exports via `index.js.flow`. This will flag these APIs appropriately to the developer under TypeScript.
Changelog: [Internal]
Reviewed By: cortinico
Differential Revision: D75403796
fbshipit-source-id: 670c4bd0c262a58413e7703f09d6db2927d51408
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51261
Cleanup to use the new public type / API exports from `metro` landed in Metro 0.82.3, which is RN's minimum as of D74181990 / [PR](https://github.com/facebook/react-native/pull/51122), in preference to deep imports.
Changelog: [Internal]
Reviewed By: huntie
Differential Revision: D74141939
fbshipit-source-id: 9405f88a85e248abe8a92be1dd5a5f1ea6ceeb87
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51124
Metro 0.82.3's `runBuild` API now supports retrieving assets and passing through `unstable_transformProfile`, and fine control of output paths via `bundleOut`/`sourcemapOut`, so we can use it directly in the implementation of `community-cli-plugin`'s `bundle` command with no loss of function or API change.
This simplifies the implementation by re-using Metro's, and removes use of Metro internal APIs.
Changelog: [Internal]
Reviewed By: huntie
Differential Revision: D74151840
fbshipit-source-id: 3dcadaf8d38e7e77d21bacdf29e5d40467139d88
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51589
changelog: [internal]
With D75140890, there is a guarantee that `startOnRenderCallback_` won't be called after the owning class is destroyed.
There shouldn't be any events flowing through Fabric when the RN instance is torn down. Passing this to eventEmitterListener_ should be safe.
This helps with C++ binary size a little bit.
Reviewed By: rshest
Differential Revision: D75148616
fbshipit-source-id: 5110736c2ddcff738fce395bd0b9844d44e8dcb2
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51588
changelog: [internal]
AnimatedNode never outlive NativeAnimatedNodesManager. We can safely use raw pointer here instead of shared_ptr.
This improves a C++ binary size a little bit.
Reviewed By: rshest
Differential Revision: D75148487
fbshipit-source-id: 4c2f6dc6e4de670be37dd3b65dc3a8d63d546150
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51587
changelog: [internal]
use unique_ptr instead of shared_ptr to manage memory of activeAnimations_.
Active animations are only owned by NativeAnimatedNodesManager and their ownership isn't shared with any other class.
This saves a little bit of C++ binary size.
Reviewed By: rshest
Differential Revision: D75142643
fbshipit-source-id: c09753b68e70e95fedcb7b2b8fb19a0fd7010059
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51586
changelog: [internal]
using shared_ptr here is not necessary because AnimatedNodes are not shared between multiple entities, they are only owned by NativeAnimatedNodesManager.
This saves a little bit C++ binary size.
Reviewed By: rshest
Differential Revision: D75148952
fbshipit-source-id: 18b8231061cda970ad96842ee6ca3135c2ec5d68
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51566
changelog: [internal]
Expose [revision](https://github.com/facebook/react-native/blob/main/packages/react-native/ReactCommon/react/renderer/core/ShadowNode.h#L229) of shadow node in Fantom tests. This makes it possible to write tests verifying that shadow nodes are only cloned when they should.
Even though excessive cloning does not usually lead to bugs, it may lead to performance problems.
Also introduce a test showing a performance problem where changing height of "Sibling" view from 1 to 2 will lead to component `D` being cloned by Yoga. Component D is not affected by the size change of Sibling and the clone is unnecessary.
```jsx
<ScrollView>
<View id="Sibling" style={{ height: 1 }} />
<View id="A">
<View id="B">
<View id="C">
<View id="D" ref={ref} />
</View>
</View>
</View>
</ScrollView>
```
Reviewed By: rshest
Differential Revision: D75287261
fbshipit-source-id: ea5acb2f5d7ba6e1e5bf895d8f82a16471122ec5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51576
This is causing some internal test failures for now, so disabling the behaviour to prevent further rollout.
Changelog: [iOS][Removed] Disable fix for #51103 until more testing can be done.
Differential Revision: D75320842
fbshipit-source-id: 39c115afd11e5b1aca6cdc1fc18ec7e83eb10382
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51508
For now, we are opting to not auto-focus `PreparedLayoutTextViews` if they have links. The reason being this would not work well with Text nested in a View which is also accessible. If that Text had links, and was set to focusable, then TalkBack would individually focus that Text, which users may not want.
So this diff removes that link detection, and fixes up accessibility in general. Since this isn't a TextView, we need to explicitly set the `text` on the `AccessibilityNodeInfo` object in the delegate so TalkBack know what to annouce.
In the future we aim to bring back auto-focusing with links, but only if a screen reader is not on, so that keyboard users can benefit from this.
Changelog: [Internal]
Reviewed By: NickGerleman
Differential Revision: D75103779
fbshipit-source-id: 05e17f4eb8d5d79ed1d84458f6d5fc6d1571e382
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51563
changelog: [internal]
Throwing errors in C++ is expensive and slow. Let's replace it with logging.
This is to reduce binary size of C++ Animated.
Reviewed By: mdvacca
Differential Revision: D75140875
fbshipit-source-id: 32909572141d8e1b51b60f317716f783aa760265
Summary:
Fixes https://github.com/facebook/react-native/issues/51083. Turbo stripped out the dictionary when the value is null. The old architecture transforms null to NSNull. The null seems useful in cases like #51803 for removing the storage of the key. cipolleschi can you please help to review?
## Changelog:
[IOS] [FIXED] - Turbo module: Fixes dictionary stripped out when value is null
Pull Request resolved: https://github.com/facebook/react-native/pull/51103
Test Plan: Repro please see https://github.com/facebook/react-native/issues/51083.
Reviewed By: rshest
Differential Revision: D74208525
Pulled By: javache
fbshipit-source-id: 53d630c265fba15d25309a3e1deb19dca24f298c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51558
changelog: [internal]
we must call stopRenderCallbackIfNeeded to prevent UI tick from being called when
`NativeAnimatedNodesManager` is deallocated.
Reviewed By: mdvacca
Differential Revision: D75140890
fbshipit-source-id: 9ad32956a877f9ee8256790ba32cb5982a5b0c2f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51519
# Changelog: [Internal]
Hermes Sampling Profiler doesn't require debugger to be enabled - we can use it in fallback Hermes Runtime target delegate. That's probably the last thing to make Hermes really run in `opt` mode.
When Hermes Target is compiled with no Debugger support, we can still define implementation for sampling profiler methods and call them on Hermes Runtime.
Reviewed By: huntie
Differential Revision: D75188276
fbshipit-source-id: e3e0dccd09e0870264e8abc65f96052735d63ad8
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51556
Excludes `packages/react-native/flow/` from being published to npm.
**As far as I know**, we already axed open source Flow support with a similar change in D46313482 (Jun 2023).
Changelog:
[General][Breaking] - The `react-native` package no longer ships with the `flow` directory
Reviewed By: cipolleschi
Differential Revision: D75060845
fbshipit-source-id: 3cb81820499383bf095abc97a9ab7e9061c870d6
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51559
Changelog: [internal]
Improves the support for multi-config benchmarks in Fantom by printing the Fantom configuration summary in the header of the table with the benchmark results for each variant.
Reviewed By: rshest
Differential Revision: D75281972
fbshipit-source-id: 80caf2e668a30ea1454cb932e91dac91192323bf
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51541
Changelog: [internal]
Now that we have support for tests with multiple configurations in Fantom, we can configure the test for IntersectionObserver to run with all the flag configurations that affect its behavior, and make sure it doesn't break for anyone while we're rolling out the changes.
Reviewed By: rshest
Differential Revision: D75231300
fbshipit-source-id: e7addf51cffad8c94bb3bf34e99272ee1dd9da2a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51543
Changelog: [internal]
For `ReactFabricPublicInstance-itest` we used a specific pattern to be able to run the same test with different feature flags (having multiple entrypoints with the configuration and a single implementation file). We can simplify this now that we have support for multiple configurations per test file in Fantom.
Reviewed By: rshest
Differential Revision: D75231301
fbshipit-source-id: ffd047b23217c06b1b15ba07da8b5c191cc652e7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51542
Changelog: [internal]
This adds support for Fantom to run specific test suites with different combinations of options/flags, using wildcards as values.
See the new documentation for this feature in this diff for more details.
Reviewed By: rshest
Differential Revision: D75231299
fbshipit-source-id: 0e953e6de68f004944ee29206af49770c8b7dd9b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51528
Changelog: [internal]
This adds some logic to the Fantom runner to display the test configuration with the test results.
Reviewed By: lenaic
Differential Revision: D75063176
fbshipit-source-id: 8371e90247c1a0c24f29a13ead25fa5dbf98ec10