feat(android): add unstable_Immediate UpdateMode for synchronous state updates (#57164)

Summary:
Currently we support [unstable_Immediate](https://github.com/facebook/react-native/blob/8915341694db15d97236758a0716215129221bfe/packages/react-native/ReactCommon/react/renderer/core/ConcreteState.h#L76) mode on `updateState` for iOS. This allows us to dispatch [synchronous](https://github.com/expo/expo/blob/9bb3eec52fd94da3c4ed18dc602e01000a3e8c7d/packages/expo-modules-core/ios/Fabric/ExpoFabricViewObjC.mm#L176) shadow node size updates in Expo UI SwiftUI (communicating SwiftUI children size to Yoga. [Host](https://docs.expo.dev/versions/latest/sdk/ui/swift-ui/host/) for more details).

Since it is not enabled on android, it leads to layout shift when mixing Compose and React Native components as Compose tree currently dispatches size information [asynchronously](https://github.com/expo/expo/blob/e1f6dc9c188ab057f31234f480487fe29835ced2/packages/expo-ui/android/src/main/java/expo/modules/ui/HostView.kt#L202) to the shadow node.

Here, the video demonstrates the asynchronous vs synchronous `updateState` usage (before and after applying the changes in this PR). Repro [link](https://github.com/intergalacticspacehighway/expo-ui-compose-flicker/)

https://github.com/user-attachments/assets/53d7471d-7a85-4487-be91-6a7e2e280fc6

## More:

After enabling the `update_immediate`, I noticed the flicker was still happening. The issue is that update layout instruction triggers a follow up instruction when we set the shadow node size from Expo UI which gets [skipped](https://github.com/facebook/react-native/blob/8915341694db15d97236758a0716215129221bfe/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/MountItemDispatcher.kt#L87) to the next frame. This is handled on iOS using `_followUpTransactionRequired` flag [here](https://github.com/facebook/react-native/blob/8915341694db15d97236758a0716215129221bfe/packages/react-native/React/Fabric/Mounting/RCTMountingManager.mm#L240). This seems to be added on iOS for similar reasons [here](https://github.com/facebook/react-native/commit/5f0435fb852cbb8abfe6cab77784ebddf1ad38ac) when dispatching an instruction can lead to a follow-up instruction when synchronous update is triggered. So we also handle the sync follow up transaction in this PR using similar approach to iOS's.

## Changelog:

[ANDROID] [ADDED] - Add `unstable_Immediate` UpdateMode support in `updateState`.

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests

Pull Request resolved: https://github.com/react/react-native/pull/57164

Test Plan:
- Tested the changes in the [repro](https://github.com/intergalacticspacehighway/expo-ui-compose-flicker/). Also tested RN Tester, it should be a non breaking change.
- Added unit tests to test the follow up re-entrancy event dispatch.

Reviewed By: javache

Differential Revision: D120962440

Pulled By: jasozh

fbshipit-source-id: 2f9387bbdd591745728256c4ed65ee40f7dc6f7c
This commit is contained in:
nishan (o^▽^o) authored and meta-codesync[bot] committed 2026-10-22 19:34:21 -07:00
1 parent 99fca5fcaf
commit 0876643b91
33 files changed
+498 -120

No files matched your search

@@ -14,8 +14,10 @@ import com.facebook.proguard.annotations.DoNotStripAny
import com.facebook.react.bridge.NativeMap
import com.facebook.react.bridge.ReadableNativeMap
import com.facebook.react.bridge.WritableMap
import com.facebook.react.common.annotations.UnstableReactNativeAPI
import com.facebook.react.common.mapbuffer.ReadableMapBuffer
import com.facebook.react.uimanager.ReferenceStateWrapper
import com.facebook.react.uimanager.StateWrapper
/**
* This class holds reference to the C++ EventEmitter object. Instances of this class are created on
@@ -23,6 +25,7 @@ import com.facebook.react.uimanager.ReferenceStateWrapper
*/
@SuppressLint("MissingNativeLoadLibrary")
@DoNotStripAny
@OptIn(UnstableReactNativeAPI::class)
internal class StateWrapperImpl private constructor() : HybridClassBase(), ReferenceStateWrapper {
private external fun initHybrid()
@@ -33,7 +36,7 @@ internal class StateWrapperImpl private constructor() : HybridClassBase(), Refer
private external fun getStateDataReferenceImpl(): Any?
external fun updateStateImpl(map: NativeMap)
external fun updateStateImpl(map: NativeMap, updateMode: Int)
override val stateDataMapBuffer: ReadableMapBuffer?
get() {
@@ -67,11 +70,15 @@ internal class StateWrapperImpl private constructor() : HybridClassBase(), Refer
}
override fun updateState(map: WritableMap) {
updateState(map, StateWrapper.UpdateMode.Asynchronous)
}
override fun updateState(map: WritableMap, updateMode: StateWrapper.UpdateMode) {
if (!isValid) {
FLog.e(TAG, "Race between StateWrapperImpl destruction and updateState")
return
}
updateStateImpl(map as NativeMap)
updateStateImpl(map as NativeMap, updateMode.value)
}
override fun destroyState() {
@@ -58,6 +58,7 @@ internal class MountItemDispatcher(
}
private var inDispatch: Boolean = false
private var followUpDispatchRequired: Boolean = false
var batchedExecutionTime: Long = 0L
private set
@@ -110,24 +111,29 @@ internal class MountItemDispatcher(
@UiThread
@ThreadConfined(UI)
fun tryDispatchMountItems() {
// If we're already dispatching, don't reenter.
// Reentrance can potentially happen a lot on Android in Fabric because `updateState` from the
// mounting layer causes mount items to be dispatched synchronously. We want to 1) make sure we
// don't reenter in those cases, but 2) still execute those queued instructions synchronously.
// This is a pretty blunt tool, but we might not have better options since we really don't want
// to execute anything out-of-order.
// If we're already dispatching, don't reenter but signal that a follow-up dispatch is
// needed. This follows the same pattern as iOS's RCTMountingManager::initiateTransaction,
// which uses _followUpTransactionRequired flag to ensure mount items
// enqueued during dispatch (e.g., from synchronous state updates triggered by view layout)
// are processed in the same frame rather than deferred to the next one.
if (inDispatch) {
if (ReactNativeFeatureFlags.enableFollowUpMountItemDispatchAndroid()) {
followUpDispatchRequired = true
}
return
}
inDispatch = true
do {
followUpDispatchRequired = false
inDispatch = true
try {
dispatchMountItems()
} finally {
// Clean up after running dispatchMountItems - even if an exception was thrown
inDispatch = false
}
try {
dispatchMountItems()
} finally {
// Clean up after running dispatchMountItems - even if an exception was thrown
inDispatch = false
}
} while (followUpDispatchRequired)
// We call didDispatchMountItems regardless of whether we actually dispatched anything, since
// NativeAnimatedModule relies on this for executing any animations that may have been
@@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<b5f4608f47743d0e2e9b1db3db551227>>
* @generated SignedSource<<f8fad51e8b31224b04d7933da8affb3a>>
*/
/**
@@ -204,6 +204,12 @@ public object ReactNativeFeatureFlags {
@JvmStatic
public fun enableFlexboxAutoMinSizeInStrictMode(): Boolean = accessor.enableFlexboxAutoMinSizeInStrictMode()
/**
* When mount items are queued while MountItemDispatcher is already dispatching on Android (e.g. from a synchronous state update), dispatch them in the same frame instead of deferring them to the next one.
*/
@JvmStatic
public fun enableFollowUpMountItemDispatchAndroid(): Boolean = accessor.enableFollowUpMountItemDispatchAndroid()
/**
* Enables font scale changes updating layout for measurable nodes.
*/
@@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<d2d170d333194ce2f2a4f1d93321ac6d>>
* @generated SignedSource<<846a8685f662d66dbcdaa4324c772d51>>
*/
/**
@@ -49,6 +49,7 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
private var enableFabricCommitBranchingMergeOnMainThreadCache: Boolean? = null
private var enableFabricLogsCache: Boolean? = null
private var enableFlexboxAutoMinSizeInStrictModeCache: Boolean? = null
private var enableFollowUpMountItemDispatchAndroidCache: Boolean? = null
private var enableFontScaleChangesUpdatingLayoutCache: Boolean? = null
private var enableIOSCompressedTextFrameAdjustmentCache: Boolean? = null
private var enableIOSTextBaselineOffsetPerLineCache: Boolean? = null
@@ -378,6 +379,15 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
return cached
}
override fun enableFollowUpMountItemDispatchAndroid(): Boolean {
var cached = enableFollowUpMountItemDispatchAndroidCache
if (cached == null) {
cached = ReactNativeFeatureFlagsCxxInterop.enableFollowUpMountItemDispatchAndroid()
enableFollowUpMountItemDispatchAndroidCache = cached
}
return cached
}
override fun enableFontScaleChangesUpdatingLayout(): Boolean {
var cached = enableFontScaleChangesUpdatingLayoutCache
if (cached == null) {
@@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<ec3e384af62c0e672da53b57354bca62>>
* @generated SignedSource<<9ccf3958e1db2db295ba73dc371b5185>>
*/
/**
@@ -86,6 +86,8 @@ public object ReactNativeFeatureFlagsCxxInterop {
@DoNotStrip @JvmStatic public external fun enableFlexboxAutoMinSizeInStrictMode(): Boolean
@DoNotStrip @JvmStatic public external fun enableFollowUpMountItemDispatchAndroid(): Boolean
@DoNotStrip @JvmStatic public external fun enableFontScaleChangesUpdatingLayout(): Boolean
@DoNotStrip @JvmStatic public external fun enableIOSCompressedTextFrameAdjustment(): Boolean
@@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<cd6aa804d1c10b93775adf83419368e3>>
* @generated SignedSource<<0a04c5e0a0b418f2efd4b253646ae7c1>>
*/
/**
@@ -81,6 +81,8 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi
override fun enableFlexboxAutoMinSizeInStrictMode(): Boolean = false
override fun enableFollowUpMountItemDispatchAndroid(): Boolean = false
override fun enableFontScaleChangesUpdatingLayout(): Boolean = true
override fun enableIOSCompressedTextFrameAdjustment(): Boolean = false
@@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<c36b0b2d7173aa78b7cb175658fc89d2>>
* @generated SignedSource<<861063ef7d217992d3cecd410e25d885>>
*/
/**
@@ -53,6 +53,7 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
private var enableFabricCommitBranchingMergeOnMainThreadCache: Boolean? = null
private var enableFabricLogsCache: Boolean? = null
private var enableFlexboxAutoMinSizeInStrictModeCache: Boolean? = null
private var enableFollowUpMountItemDispatchAndroidCache: Boolean? = null
private var enableFontScaleChangesUpdatingLayoutCache: Boolean? = null
private var enableIOSCompressedTextFrameAdjustmentCache: Boolean? = null
private var enableIOSTextBaselineOffsetPerLineCache: Boolean? = null
@@ -411,6 +412,16 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
return cached
}
override fun enableFollowUpMountItemDispatchAndroid(): Boolean {
var cached = enableFollowUpMountItemDispatchAndroidCache
if (cached == null) {
cached = currentProvider.enableFollowUpMountItemDispatchAndroid()
accessedFeatureFlags.add("enableFollowUpMountItemDispatchAndroid")
enableFollowUpMountItemDispatchAndroidCache = cached
}
return cached
}
override fun enableFontScaleChangesUpdatingLayout(): Boolean {
var cached = enableFontScaleChangesUpdatingLayoutCache
if (cached == null) {
@@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<c5e9b41b76c5580c0a4ba848af4e36a5>>
* @generated SignedSource<<5fa21c808df68be4c007469040fbca2a>>
*/
/**
@@ -81,6 +81,8 @@ public interface ReactNativeFeatureFlagsProvider {
@DoNotStrip public fun enableFlexboxAutoMinSizeInStrictMode(): Boolean
@DoNotStrip public fun enableFollowUpMountItemDispatchAndroid(): Boolean
@DoNotStrip public fun enableFontScaleChangesUpdatingLayout(): Boolean
@DoNotStrip public fun enableIOSCompressedTextFrameAdjustment(): Boolean
@@ -9,6 +9,7 @@ package com.facebook.react.uimanager
import com.facebook.react.bridge.ReadableNativeMap
import com.facebook.react.bridge.WritableMap
import com.facebook.react.common.annotations.UnstableReactNativeAPI
import com.facebook.react.common.mapbuffer.ReadableMapBuffer
/**
@@ -17,6 +18,15 @@ import com.facebook.react.common.mapbuffer.ReadableMapBuffer
* by calling updateState, which communicates state back to the C++ layer.
*/
public interface StateWrapper {
/**
* Maps to EventQueue::UpdateMode in C++. Controls how state updates are flushed (Async or Sync).
*/
@UnstableReactNativeAPI
public enum class UpdateMode(public val value: Int) {
Asynchronous(0),
unstable_Immediate(1),
}
/**
* Get a ReadableMapBuffer object from the C++ layer, which is a K/V map of short keys to values.
*
@@ -35,6 +45,12 @@ public interface StateWrapper {
*/
public fun updateState(map: WritableMap)
/**
* Pass a map of values back to the C++ layer. updateMode controls whether the update is queued
* asynchronously or flushed immediately.
*/
@UnstableReactNativeAPI public fun updateState(map: WritableMap, updateMode: UpdateMode)
/**
* Mark state as unused and clean up in Java and in native. This should be called as early as
* possible when you know a StateWrapper will no longer be used. If there's ANY chance of it being
@@ -9,6 +9,7 @@
#include <fbjni/fbjni.h>
#include <react/featureflags/ReactNativeFeatureFlags.h>
#include <react/jni/ReadableNativeMap.h>
#include <react/renderer/core/EventQueue.h>
#include <react/renderer/mapbuffer/MapBuffer.h>
#include <react/renderer/mapbuffer/MapBufferBuilder.h>
@@ -50,12 +51,13 @@ jni::local_ref<jobject> StateWrapperImpl::getStateDataReferenceImpl() {
return nullptr;
}
void StateWrapperImpl::updateStateImpl(NativeMap* map) {
void StateWrapperImpl::updateStateImpl(NativeMap* map, jint updateMode) {
if (state_) {
// Get folly::dynamic from map
auto dynamicMap = map->consume();
// Set state
state_->updateState(std::move(dynamicMap));
state_->updateState(
std::move(dynamicMap), static_cast<EventQueue::UpdateMode>(updateMode));
}
}
@@ -27,7 +27,7 @@ class StateWrapperImpl : public jni::HybridClass<StateWrapperImpl, StateWrapper>
jni::local_ref<JReadableMapBuffer::jhybridobject> getStateMapBufferDataImpl();
jni::local_ref<ReadableNativeMap::jhybridobject> getStateDataImpl();
jni::local_ref<jobject> getStateDataReferenceImpl();
void updateStateImpl(NativeMap *map);
void updateStateImpl(NativeMap *map, jint updateMode);
void setState(std::shared_ptr<const State> state);
std::shared_ptr<const State> getState() const;
@@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<1ab2eec7b9c5bdd181ec5fbfd37149ab>>
* @generated SignedSource<<7e430d5b575ea983d53ecde87c4dc9f0>>
*/
/**
@@ -213,6 +213,12 @@ class ReactNativeFeatureFlagsJavaProvider
return method(javaProvider_);
}
bool enableFollowUpMountItemDispatchAndroid() override {
static const auto method =
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("enableFollowUpMountItemDispatchAndroid");
return method(javaProvider_);
}
bool enableFontScaleChangesUpdatingLayout() override {
static const auto method =
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("enableFontScaleChangesUpdatingLayout");
@@ -764,6 +770,11 @@ bool JReactNativeFeatureFlagsCxxInterop::enableFlexboxAutoMinSizeInStrictMode(
return ReactNativeFeatureFlags::enableFlexboxAutoMinSizeInStrictMode();
}
bool JReactNativeFeatureFlagsCxxInterop::enableFollowUpMountItemDispatchAndroid(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
return ReactNativeFeatureFlags::enableFollowUpMountItemDispatchAndroid();
}
bool JReactNativeFeatureFlagsCxxInterop::enableFontScaleChangesUpdatingLayout(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
return ReactNativeFeatureFlags::enableFontScaleChangesUpdatingLayout();
@@ -1217,6 +1228,9 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
makeNativeMethod(
"enableFlexboxAutoMinSizeInStrictMode",
JReactNativeFeatureFlagsCxxInterop::enableFlexboxAutoMinSizeInStrictMode),
makeNativeMethod(
"enableFollowUpMountItemDispatchAndroid",
JReactNativeFeatureFlagsCxxInterop::enableFollowUpMountItemDispatchAndroid),
makeNativeMethod(
"enableFontScaleChangesUpdatingLayout",
JReactNativeFeatureFlagsCxxInterop::enableFontScaleChangesUpdatingLayout),
@@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<2c8f9205f1de55591ede3845ba2fa877>>
* @generated SignedSource<<6b96c286c25d3c9fcb66d39d67092787>>
*/
/**
@@ -117,6 +117,9 @@ class JReactNativeFeatureFlagsCxxInterop
static bool enableFlexboxAutoMinSizeInStrictMode(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
static bool enableFollowUpMountItemDispatchAndroid(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
static bool enableFontScaleChangesUpdatingLayout(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
@@ -0,0 +1,190 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
package com.facebook.react.fabric.mounting
import com.facebook.react.fabric.mounting.MountItemDispatcher.ItemDispatchListener
import com.facebook.react.fabric.mounting.mountitems.MountItem
import com.facebook.react.internal.featureflags.ReactNativeFeatureFlags
import com.facebook.react.internal.featureflags.ReactNativeFeatureFlagsDefaults
import com.facebook.react.internal.featureflags.ReactNativeFeatureFlagsForTests
import com.facebook.react.internal.tracing.PerformanceTracer
import com.facebook.react.uimanager.ViewManagerRegistry
import com.facebook.testutils.shadows.ShadowSoLoader
import org.assertj.core.api.Assertions.assertThat
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.robolectric.RobolectricTestRunner
import org.robolectric.annotation.Config
import org.robolectric.annotation.Implementation
import org.robolectric.annotation.Implements
@RunWith(RobolectricTestRunner::class)
@Config(shadows = [ShadowSoLoader::class, MountItemDispatcherTest.ShadowPerformanceTracer::class])
class MountItemDispatcherTest {
private lateinit var dispatcher: MountItemDispatcher
private lateinit var dispatchListener: RecordingItemDispatchListener
@Before
fun setUp() {
ReactNativeFeatureFlagsForTests.setUp()
val mountingManager =
MountingManager(ViewManagerRegistry(emptyList()), MountingManager.MountItemExecutor {})
dispatchListener = RecordingItemDispatchListener()
dispatcher = MountItemDispatcher(mountingManager, dispatchListener)
}
@Test
fun tryDispatchMountItems_executesQueuedMountItem() {
val item = RecordingMountItem()
dispatcher.addMountItem(item)
dispatcher.tryDispatchMountItems()
assertThat(item.executed).isTrue()
assertThat(dispatchListener.didDispatchCount).isEqualTo(1)
}
/**
* Regression test for synchronous (`unstable_Immediate`) state updates on Android. When a mount
* item's execution synchronously updates shadow node state, it can enqueue new mount items and
* re-enter [MountItemDispatcher.tryDispatchMountItems] while a dispatch is already in progress.
*
* The re-entrant call must not drop those items: they should be flushed in the same dispatch
* pass, rather than being deferred to the next frame.
*/
@Test
fun tryDispatchMountItems_reentrantDispatch_executesFollowUpItemInSamePass() {
enableFollowUpMountItemDispatch()
val followUpItem = RecordingMountItem()
// Simulates a synchronous state update triggered while the first item is being mounted: it
// enqueues another mount item and re-enters the dispatcher.
val initialItem =
RecordingMountItem(
onExecute = {
dispatcher.addMountItem(followUpItem)
dispatcher.tryDispatchMountItems()
}
)
dispatcher.addMountItem(initialItem)
dispatcher.tryDispatchMountItems()
assertThat(initialItem.executed).isTrue()
assertThat(followUpItem.executed).isTrue()
}
@Test
fun tryDispatchMountItems_reentrantDispatch_preservesExecutionOrder() {
enableFollowUpMountItemDispatch()
val executionOrder = mutableListOf<String>()
val followUpItem = RecordingMountItem(onExecute = { executionOrder.add("followUp") })
val initialItem =
RecordingMountItem(
onExecute = {
executionOrder.add("initial")
dispatcher.addMountItem(followUpItem)
dispatcher.tryDispatchMountItems()
}
)
dispatcher.addMountItem(initialItem)
dispatcher.tryDispatchMountItems()
assertThat(executionOrder).containsExactly("initial", "followUp")
}
@Test
fun tryDispatchMountItems_reentrantDispatch_invokesDidDispatchOnceForOuterCall() {
enableFollowUpMountItemDispatch()
val initialItem =
RecordingMountItem(
onExecute = {
dispatcher.addMountItem(RecordingMountItem())
dispatcher.tryDispatchMountItems()
}
)
dispatcher.addMountItem(initialItem)
dispatcher.tryDispatchMountItems()
// The re-entrant call returns early and must not notify the listener; only the outer call does,
// once, after the follow-up loop has drained everything.
assertThat(dispatchListener.didDispatchCount).isEqualTo(1)
}
@Test
fun tryDispatchMountItems_reentrantDispatch_withFlagDisabled_defersFollowUpItem() {
val followUpItem = RecordingMountItem()
val initialItem =
RecordingMountItem(
onExecute = {
dispatcher.addMountItem(followUpItem)
dispatcher.tryDispatchMountItems()
}
)
dispatcher.addMountItem(initialItem)
dispatcher.tryDispatchMountItems()
assertThat(initialItem.executed).isTrue()
assertThat(followUpItem.executed).isFalse()
dispatcher.tryDispatchMountItems()
assertThat(followUpItem.executed).isTrue()
}
private fun enableFollowUpMountItemDispatch() {
ReactNativeFeatureFlags.override(
object : ReactNativeFeatureFlagsDefaults() {
override fun enableFollowUpMountItemDispatchAndroid(): Boolean = true
},
)
}
private class RecordingMountItem(
private val surfaceId: Int = 1,
private val onExecute: () -> Unit = {},
) : MountItem {
var executed: Boolean = false
private set
override fun execute(mountingManager: MountingManager) {
executed = true
onExecute()
}
override fun getSurfaceId(): Int = surfaceId
}
private class RecordingItemDispatchListener : ItemDispatchListener {
var didDispatchCount: Int = 0
private set
override fun willMountItems(mountItems: List<MountItem>?) = Unit
override fun didMountItems(mountItems: List<MountItem>?) = Unit
override fun didDispatchMountItems() {
didDispatchCount++
}
override fun onItemsQueued() = Unit
}
// isTracing() is a native method; its JNI library isn't loaded in JVM tests, so return false and
// let trace() just run its block. ShadowSoLoader covers the SoLoader.loadLibrary init.
@Implements(PerformanceTracer::class)
class ShadowPerformanceTracer {
companion object {
@JvmStatic @Implementation fun isTracing(): Boolean = false
}
}
}
@@ -0,0 +1,36 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
package com.facebook.react.uimanager
import com.facebook.react.common.annotations.UnstableReactNativeAPI
import com.facebook.react.uimanager.StateWrapper.UpdateMode
import org.assertj.core.api.Assertions.assertThat
import org.junit.Test
import org.junit.runner.RunWith
import org.robolectric.RobolectricTestRunner
/**
* UpdateMode.value crosses JNI and is cast straight to C++ EventQueue::UpdateMode, so the values
* must match its order (Asynchronous = 0, unstable_Immediate = 1). A mismatch silently flips
* async/sync state updates.
*/
@OptIn(UnstableReactNativeAPI::class)
@RunWith(RobolectricTestRunner::class)
class StateWrapperUpdateModeTest {
@Test
fun updateModeValues_matchCxxEventQueueUpdateMode() {
assertThat(UpdateMode.Asynchronous.value).isEqualTo(0)
assertThat(UpdateMode.unstable_Immediate.value).isEqualTo(1)
}
@Test
fun updateModeValues_areDistinct() {
assertThat(UpdateMode.entries.map { it.value }).doesNotHaveDuplicates()
}
}
@@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<7542508e6a3b0dd942557748186527b3>>
* @generated SignedSource<<493a51a28c2f55411c5c5aea374638d1>>
*/
/**
@@ -142,6 +142,10 @@ bool ReactNativeFeatureFlags::enableFlexboxAutoMinSizeInStrictMode() {
return getAccessor().enableFlexboxAutoMinSizeInStrictMode();
}
bool ReactNativeFeatureFlags::enableFollowUpMountItemDispatchAndroid() {
return getAccessor().enableFollowUpMountItemDispatchAndroid();
}
bool ReactNativeFeatureFlags::enableFontScaleChangesUpdatingLayout() {
return getAccessor().enableFontScaleChangesUpdatingLayout();
}
@@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<e3c3ccaf63fcdcf48c6f02f793f77b65>>
* @generated SignedSource<<2d7aa66f222fa01d4cc93c7d5ef2fdb7>>
*/
/**
@@ -186,6 +186,11 @@ class ReactNativeFeatureFlags {
*/
RN_EXPORT static bool enableFlexboxAutoMinSizeInStrictMode();
/**
* When mount items are queued while MountItemDispatcher is already dispatching on Android (e.g. from a synchronous state update), dispatch them in the same frame instead of deferring them to the next one.
*/
RN_EXPORT static bool enableFollowUpMountItemDispatchAndroid();
/**
* Enables font scale changes updating layout for measurable nodes.
*/
@@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<3c7ff59afd1e9e05051e888b51a39ac0>>
* @generated SignedSource<<781830e6179bb655a1ba3d955c5d2a4a>>
*/
/**
@@ -551,6 +551,24 @@ bool ReactNativeFeatureFlagsAccessor::enableFlexboxAutoMinSizeInStrictMode() {
return flagValue.value();
}
bool ReactNativeFeatureFlagsAccessor::enableFollowUpMountItemDispatchAndroid() {
auto flagValue = enableFollowUpMountItemDispatchAndroid_.load();
if (!flagValue.has_value()) {
// This block is not exclusive but it is not necessary.
// If multiple threads try to initialize the feature flag, we would only
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(29, "enableFollowUpMountItemDispatchAndroid");
flagValue = currentProvider_->enableFollowUpMountItemDispatchAndroid();
enableFollowUpMountItemDispatchAndroid_ = flagValue;
}
return flagValue.value();
}
bool ReactNativeFeatureFlagsAccessor::enableFontScaleChangesUpdatingLayout() {
auto flagValue = enableFontScaleChangesUpdatingLayout_.load();
@@ -560,7 +578,7 @@ bool ReactNativeFeatureFlagsAccessor::enableFontScaleChangesUpdatingLayout() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(29, "enableFontScaleChangesUpdatingLayout");
markFlagAsAccessed(30, "enableFontScaleChangesUpdatingLayout");
flagValue = currentProvider_->enableFontScaleChangesUpdatingLayout();
enableFontScaleChangesUpdatingLayout_ = flagValue;
@@ -578,7 +596,7 @@ bool ReactNativeFeatureFlagsAccessor::enableIOSCompressedTextFrameAdjustment() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(30, "enableIOSCompressedTextFrameAdjustment");
markFlagAsAccessed(31, "enableIOSCompressedTextFrameAdjustment");
flagValue = currentProvider_->enableIOSCompressedTextFrameAdjustment();
enableIOSCompressedTextFrameAdjustment_ = flagValue;
@@ -596,7 +614,7 @@ bool ReactNativeFeatureFlagsAccessor::enableIOSTextBaselineOffsetPerLine() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(31, "enableIOSTextBaselineOffsetPerLine");
markFlagAsAccessed(32, "enableIOSTextBaselineOffsetPerLine");
flagValue = currentProvider_->enableIOSTextBaselineOffsetPerLine();
enableIOSTextBaselineOffsetPerLine_ = flagValue;
@@ -614,7 +632,7 @@ bool ReactNativeFeatureFlagsAccessor::enableIOSViewClipToPaddingBox() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(32, "enableIOSViewClipToPaddingBox");
markFlagAsAccessed(33, "enableIOSViewClipToPaddingBox");
flagValue = currentProvider_->enableIOSViewClipToPaddingBox();
enableIOSViewClipToPaddingBox_ = flagValue;
@@ -632,7 +650,7 @@ bool ReactNativeFeatureFlagsAccessor::enableImagePrefetchingAndroid() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(33, "enableImagePrefetchingAndroid");
markFlagAsAccessed(34, "enableImagePrefetchingAndroid");
flagValue = currentProvider_->enableImagePrefetchingAndroid();
enableImagePrefetchingAndroid_ = flagValue;
@@ -650,7 +668,7 @@ bool ReactNativeFeatureFlagsAccessor::enableImageTransparentTintColor() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(34, "enableImageTransparentTintColor");
markFlagAsAccessed(35, "enableImageTransparentTintColor");
flagValue = currentProvider_->enableImageTransparentTintColor();
enableImageTransparentTintColor_ = flagValue;
@@ -668,7 +686,7 @@ bool ReactNativeFeatureFlagsAccessor::enableImmediateUpdateModeForContentOffsetC
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(35, "enableImmediateUpdateModeForContentOffsetChanges");
markFlagAsAccessed(36, "enableImmediateUpdateModeForContentOffsetChanges");
flagValue = currentProvider_->enableImmediateUpdateModeForContentOffsetChanges();
enableImmediateUpdateModeForContentOffsetChanges_ = flagValue;
@@ -686,7 +704,7 @@ bool ReactNativeFeatureFlagsAccessor::enableImperativeEvents() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(36, "enableImperativeEvents");
markFlagAsAccessed(37, "enableImperativeEvents");
flagValue = currentProvider_->enableImperativeEvents();
enableImperativeEvents_ = flagValue;
@@ -704,7 +722,7 @@ bool ReactNativeFeatureFlagsAccessor::enableImperativeFocus() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(37, "enableImperativeFocus");
markFlagAsAccessed(38, "enableImperativeFocus");
flagValue = currentProvider_->enableImperativeFocus();
enableImperativeFocus_ = flagValue;
@@ -722,7 +740,7 @@ bool ReactNativeFeatureFlagsAccessor::enableInteropViewManagerClassLookUpOptimiz
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(38, "enableInteropViewManagerClassLookUpOptimizationIOS");
markFlagAsAccessed(39, "enableInteropViewManagerClassLookUpOptimizationIOS");
flagValue = currentProvider_->enableInteropViewManagerClassLookUpOptimizationIOS();
enableInteropViewManagerClassLookUpOptimizationIOS_ = flagValue;
@@ -740,7 +758,7 @@ bool ReactNativeFeatureFlagsAccessor::enableIntersectionObserverByDefault() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(39, "enableIntersectionObserverByDefault");
markFlagAsAccessed(40, "enableIntersectionObserverByDefault");
flagValue = currentProvider_->enableIntersectionObserverByDefault();
enableIntersectionObserverByDefault_ = flagValue;
@@ -758,7 +776,7 @@ bool ReactNativeFeatureFlagsAccessor::enableKeyEvents() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(40, "enableKeyEvents");
markFlagAsAccessed(41, "enableKeyEvents");
flagValue = currentProvider_->enableKeyEvents();
enableKeyEvents_ = flagValue;
@@ -776,7 +794,7 @@ bool ReactNativeFeatureFlagsAccessor::enableLayoutAnimationsOnAndroid() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(41, "enableLayoutAnimationsOnAndroid");
markFlagAsAccessed(42, "enableLayoutAnimationsOnAndroid");
flagValue = currentProvider_->enableLayoutAnimationsOnAndroid();
enableLayoutAnimationsOnAndroid_ = flagValue;
@@ -794,7 +812,7 @@ bool ReactNativeFeatureFlagsAccessor::enableLayoutAnimationsOnIOS() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(42, "enableLayoutAnimationsOnIOS");
markFlagAsAccessed(43, "enableLayoutAnimationsOnIOS");
flagValue = currentProvider_->enableLayoutAnimationsOnIOS();
enableLayoutAnimationsOnIOS_ = flagValue;
@@ -812,7 +830,7 @@ bool ReactNativeFeatureFlagsAccessor::enableModuleArgumentNSNullConversionIOS()
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(43, "enableModuleArgumentNSNullConversionIOS");
markFlagAsAccessed(44, "enableModuleArgumentNSNullConversionIOS");
flagValue = currentProvider_->enableModuleArgumentNSNullConversionIOS();
enableModuleArgumentNSNullConversionIOS_ = flagValue;
@@ -830,7 +848,7 @@ bool ReactNativeFeatureFlagsAccessor::enableMountingCoordinatorPullModelAndroid(
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(44, "enableMountingCoordinatorPullModelAndroid");
markFlagAsAccessed(45, "enableMountingCoordinatorPullModelAndroid");
flagValue = currentProvider_->enableMountingCoordinatorPullModelAndroid();
enableMountingCoordinatorPullModelAndroid_ = flagValue;
@@ -848,7 +866,7 @@ bool ReactNativeFeatureFlagsAccessor::enableMutationObserverByDefault() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(45, "enableMutationObserverByDefault");
markFlagAsAccessed(46, "enableMutationObserverByDefault");
flagValue = currentProvider_->enableMutationObserverByDefault();
enableMutationObserverByDefault_ = flagValue;
@@ -866,7 +884,7 @@ bool ReactNativeFeatureFlagsAccessor::enableNativeCSSParsing() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(46, "enableNativeCSSParsing");
markFlagAsAccessed(47, "enableNativeCSSParsing");
flagValue = currentProvider_->enableNativeCSSParsing();
enableNativeCSSParsing_ = flagValue;
@@ -884,7 +902,7 @@ bool ReactNativeFeatureFlagsAccessor::enablePreallocatedPropsDiffOnInsertAndroid
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(47, "enablePreallocatedPropsDiffOnInsertAndroid");
markFlagAsAccessed(48, "enablePreallocatedPropsDiffOnInsertAndroid");
flagValue = currentProvider_->enablePreallocatedPropsDiffOnInsertAndroid();
enablePreallocatedPropsDiffOnInsertAndroid_ = flagValue;
@@ -902,7 +920,7 @@ bool ReactNativeFeatureFlagsAccessor::enablePreparedTextLayout() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(48, "enablePreparedTextLayout");
markFlagAsAccessed(49, "enablePreparedTextLayout");
flagValue = currentProvider_->enablePreparedTextLayout();
enablePreparedTextLayout_ = flagValue;
@@ -920,7 +938,7 @@ bool ReactNativeFeatureFlagsAccessor::enablePropsUpdateReconciliationAndroid() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(49, "enablePropsUpdateReconciliationAndroid");
markFlagAsAccessed(50, "enablePropsUpdateReconciliationAndroid");
flagValue = currentProvider_->enablePropsUpdateReconciliationAndroid();
enablePropsUpdateReconciliationAndroid_ = flagValue;
@@ -938,7 +956,7 @@ bool ReactNativeFeatureFlagsAccessor::enableResizeObserverByDefault() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(50, "enableResizeObserverByDefault");
markFlagAsAccessed(51, "enableResizeObserverByDefault");
flagValue = currentProvider_->enableResizeObserverByDefault();
enableResizeObserverByDefault_ = flagValue;
@@ -956,7 +974,7 @@ bool ReactNativeFeatureFlagsAccessor::enableSwiftUIBasedFilters() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(51, "enableSwiftUIBasedFilters");
markFlagAsAccessed(52, "enableSwiftUIBasedFilters");
flagValue = currentProvider_->enableSwiftUIBasedFilters();
enableSwiftUIBasedFilters_ = flagValue;
@@ -974,7 +992,7 @@ bool ReactNativeFeatureFlagsAccessor::enableViewCulling() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(52, "enableViewCulling");
markFlagAsAccessed(53, "enableViewCulling");
flagValue = currentProvider_->enableViewCulling();
enableViewCulling_ = flagValue;
@@ -992,7 +1010,7 @@ bool ReactNativeFeatureFlagsAccessor::enableViewRecycling() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(53, "enableViewRecycling");
markFlagAsAccessed(54, "enableViewRecycling");
flagValue = currentProvider_->enableViewRecycling();
enableViewRecycling_ = flagValue;
@@ -1010,7 +1028,7 @@ bool ReactNativeFeatureFlagsAccessor::enableViewRecyclingForImage() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(54, "enableViewRecyclingForImage");
markFlagAsAccessed(55, "enableViewRecyclingForImage");
flagValue = currentProvider_->enableViewRecyclingForImage();
enableViewRecyclingForImage_ = flagValue;
@@ -1028,7 +1046,7 @@ bool ReactNativeFeatureFlagsAccessor::enableViewRecyclingForScrollView() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(55, "enableViewRecyclingForScrollView");
markFlagAsAccessed(56, "enableViewRecyclingForScrollView");
flagValue = currentProvider_->enableViewRecyclingForScrollView();
enableViewRecyclingForScrollView_ = flagValue;
@@ -1046,7 +1064,7 @@ bool ReactNativeFeatureFlagsAccessor::enableViewRecyclingForText() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(56, "enableViewRecyclingForText");
markFlagAsAccessed(57, "enableViewRecyclingForText");
flagValue = currentProvider_->enableViewRecyclingForText();
enableViewRecyclingForText_ = flagValue;
@@ -1064,7 +1082,7 @@ bool ReactNativeFeatureFlagsAccessor::enableViewRecyclingForView() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(57, "enableViewRecyclingForView");
markFlagAsAccessed(58, "enableViewRecyclingForView");
flagValue = currentProvider_->enableViewRecyclingForView();
enableViewRecyclingForView_ = flagValue;
@@ -1082,7 +1100,7 @@ bool ReactNativeFeatureFlagsAccessor::enableVirtualViewContainerStateExperimenta
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(58, "enableVirtualViewContainerStateExperimental");
markFlagAsAccessed(59, "enableVirtualViewContainerStateExperimental");
flagValue = currentProvider_->enableVirtualViewContainerStateExperimental();
enableVirtualViewContainerStateExperimental_ = flagValue;
@@ -1100,7 +1118,7 @@ bool ReactNativeFeatureFlagsAccessor::fixBorderlessRippleAndroid() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(59, "fixBorderlessRippleAndroid");
markFlagAsAccessed(60, "fixBorderlessRippleAndroid");
flagValue = currentProvider_->fixBorderlessRippleAndroid();
fixBorderlessRippleAndroid_ = flagValue;
@@ -1118,7 +1136,7 @@ bool ReactNativeFeatureFlagsAccessor::fixMappingOfEventPrioritiesBetweenFabricAn
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(60, "fixMappingOfEventPrioritiesBetweenFabricAndReact");
markFlagAsAccessed(61, "fixMappingOfEventPrioritiesBetweenFabricAndReact");
flagValue = currentProvider_->fixMappingOfEventPrioritiesBetweenFabricAndReact();
fixMappingOfEventPrioritiesBetweenFabricAndReact_ = flagValue;
@@ -1136,7 +1154,7 @@ bool ReactNativeFeatureFlagsAccessor::fixTextLayoutOnPixelDensityChange() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(61, "fixTextLayoutOnPixelDensityChange");
markFlagAsAccessed(62, "fixTextLayoutOnPixelDensityChange");
flagValue = currentProvider_->fixTextLayoutOnPixelDensityChange();
fixTextLayoutOnPixelDensityChange_ = flagValue;
@@ -1154,7 +1172,7 @@ bool ReactNativeFeatureFlagsAccessor::fixYogaFlexBasisFitContentInMainAxis() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(62, "fixYogaFlexBasisFitContentInMainAxis");
markFlagAsAccessed(63, "fixYogaFlexBasisFitContentInMainAxis");
flagValue = currentProvider_->fixYogaFlexBasisFitContentInMainAxis();
fixYogaFlexBasisFitContentInMainAxis_ = flagValue;
@@ -1172,7 +1190,7 @@ bool ReactNativeFeatureFlagsAccessor::fuseboxAssertSingleHostState() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(63, "fuseboxAssertSingleHostState");
markFlagAsAccessed(64, "fuseboxAssertSingleHostState");
flagValue = currentProvider_->fuseboxAssertSingleHostState();
fuseboxAssertSingleHostState_ = flagValue;
@@ -1190,7 +1208,7 @@ bool ReactNativeFeatureFlagsAccessor::fuseboxEnabledRelease() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(64, "fuseboxEnabledRelease");
markFlagAsAccessed(65, "fuseboxEnabledRelease");
flagValue = currentProvider_->fuseboxEnabledRelease();
fuseboxEnabledRelease_ = flagValue;
@@ -1208,7 +1226,7 @@ bool ReactNativeFeatureFlagsAccessor::fuseboxFrameRecordingEnabled() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(65, "fuseboxFrameRecordingEnabled");
markFlagAsAccessed(66, "fuseboxFrameRecordingEnabled");
flagValue = currentProvider_->fuseboxFrameRecordingEnabled();
fuseboxFrameRecordingEnabled_ = flagValue;
@@ -1226,7 +1244,7 @@ bool ReactNativeFeatureFlagsAccessor::fuseboxScreenshotCaptureEnabled() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(66, "fuseboxScreenshotCaptureEnabled");
markFlagAsAccessed(67, "fuseboxScreenshotCaptureEnabled");
flagValue = currentProvider_->fuseboxScreenshotCaptureEnabled();
fuseboxScreenshotCaptureEnabled_ = flagValue;
@@ -1244,7 +1262,7 @@ bool ReactNativeFeatureFlagsAccessor::fuseboxWebSocketEventsEnabled() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(67, "fuseboxWebSocketEventsEnabled");
markFlagAsAccessed(68, "fuseboxWebSocketEventsEnabled");
flagValue = currentProvider_->fuseboxWebSocketEventsEnabled();
fuseboxWebSocketEventsEnabled_ = flagValue;
@@ -1262,7 +1280,7 @@ bool ReactNativeFeatureFlagsAccessor::optimizedAnimatedPropUpdates() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(68, "optimizedAnimatedPropUpdates");
markFlagAsAccessed(69, "optimizedAnimatedPropUpdates");
flagValue = currentProvider_->optimizedAnimatedPropUpdates();
optimizedAnimatedPropUpdates_ = flagValue;
@@ -1280,7 +1298,7 @@ bool ReactNativeFeatureFlagsAccessor::overrideBySynchronousMountPropsAtMountingA
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(69, "overrideBySynchronousMountPropsAtMountingAndroid");
markFlagAsAccessed(70, "overrideBySynchronousMountPropsAtMountingAndroid");
flagValue = currentProvider_->overrideBySynchronousMountPropsAtMountingAndroid();
overrideBySynchronousMountPropsAtMountingAndroid_ = flagValue;
@@ -1298,7 +1316,7 @@ bool ReactNativeFeatureFlagsAccessor::perfIssuesEnabled() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(70, "perfIssuesEnabled");
markFlagAsAccessed(71, "perfIssuesEnabled");
flagValue = currentProvider_->perfIssuesEnabled();
perfIssuesEnabled_ = flagValue;
@@ -1316,7 +1334,7 @@ bool ReactNativeFeatureFlagsAccessor::perfMonitorV2Enabled() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(71, "perfMonitorV2Enabled");
markFlagAsAccessed(72, "perfMonitorV2Enabled");
flagValue = currentProvider_->perfMonitorV2Enabled();
perfMonitorV2Enabled_ = flagValue;
@@ -1334,7 +1352,7 @@ double ReactNativeFeatureFlagsAccessor::preparedTextCacheSize() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(72, "preparedTextCacheSize");
markFlagAsAccessed(73, "preparedTextCacheSize");
flagValue = currentProvider_->preparedTextCacheSize();
preparedTextCacheSize_ = flagValue;
@@ -1352,7 +1370,7 @@ bool ReactNativeFeatureFlagsAccessor::preventShadowTreeCommitExhaustion() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(73, "preventShadowTreeCommitExhaustion");
markFlagAsAccessed(74, "preventShadowTreeCommitExhaustion");
flagValue = currentProvider_->preventShadowTreeCommitExhaustion();
preventShadowTreeCommitExhaustion_ = flagValue;
@@ -1370,7 +1388,7 @@ bool ReactNativeFeatureFlagsAccessor::redBoxV2Android() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(74, "redBoxV2Android");
markFlagAsAccessed(75, "redBoxV2Android");
flagValue = currentProvider_->redBoxV2Android();
redBoxV2Android_ = flagValue;
@@ -1388,7 +1406,7 @@ bool ReactNativeFeatureFlagsAccessor::redBoxV2IOS() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(75, "redBoxV2IOS");
markFlagAsAccessed(76, "redBoxV2IOS");
flagValue = currentProvider_->redBoxV2IOS();
redBoxV2IOS_ = flagValue;
@@ -1406,7 +1424,7 @@ bool ReactNativeFeatureFlagsAccessor::shouldPressibilityUseW3CPointerEventsForHo
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(76, "shouldPressibilityUseW3CPointerEventsForHover");
markFlagAsAccessed(77, "shouldPressibilityUseW3CPointerEventsForHover");
flagValue = currentProvider_->shouldPressibilityUseW3CPointerEventsForHover();
shouldPressibilityUseW3CPointerEventsForHover_ = flagValue;
@@ -1424,7 +1442,7 @@ bool ReactNativeFeatureFlagsAccessor::shouldTriggerResponderTransferOnScrollAndr
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(77, "shouldTriggerResponderTransferOnScrollAndroid");
markFlagAsAccessed(78, "shouldTriggerResponderTransferOnScrollAndroid");
flagValue = currentProvider_->shouldTriggerResponderTransferOnScrollAndroid();
shouldTriggerResponderTransferOnScrollAndroid_ = flagValue;
@@ -1442,7 +1460,7 @@ bool ReactNativeFeatureFlagsAccessor::skipActivityIdentityAssertionOnHostPause()
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(78, "skipActivityIdentityAssertionOnHostPause");
markFlagAsAccessed(79, "skipActivityIdentityAssertionOnHostPause");
flagValue = currentProvider_->skipActivityIdentityAssertionOnHostPause();
skipActivityIdentityAssertionOnHostPause_ = flagValue;
@@ -1460,7 +1478,7 @@ bool ReactNativeFeatureFlagsAccessor::skipUnchangedChildrenInDifferentiator() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(79, "skipUnchangedChildrenInDifferentiator");
markFlagAsAccessed(80, "skipUnchangedChildrenInDifferentiator");
flagValue = currentProvider_->skipUnchangedChildrenInDifferentiator();
skipUnchangedChildrenInDifferentiator_ = flagValue;
@@ -1478,7 +1496,7 @@ bool ReactNativeFeatureFlagsAccessor::syncAndroidClipBoundsWithOverflow() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(80, "syncAndroidClipBoundsWithOverflow");
markFlagAsAccessed(81, "syncAndroidClipBoundsWithOverflow");
flagValue = currentProvider_->syncAndroidClipBoundsWithOverflow();
syncAndroidClipBoundsWithOverflow_ = flagValue;
@@ -1496,7 +1514,7 @@ bool ReactNativeFeatureFlagsAccessor::traceTurboModulePromiseRejectionsOnAndroid
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(81, "traceTurboModulePromiseRejectionsOnAndroid");
markFlagAsAccessed(82, "traceTurboModulePromiseRejectionsOnAndroid");
flagValue = currentProvider_->traceTurboModulePromiseRejectionsOnAndroid();
traceTurboModulePromiseRejectionsOnAndroid_ = flagValue;
@@ -1514,7 +1532,7 @@ bool ReactNativeFeatureFlagsAccessor::updateRuntimeShadowNodeReferencesOnCommit(
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(82, "updateRuntimeShadowNodeReferencesOnCommit");
markFlagAsAccessed(83, "updateRuntimeShadowNodeReferencesOnCommit");
flagValue = currentProvider_->updateRuntimeShadowNodeReferencesOnCommit();
updateRuntimeShadowNodeReferencesOnCommit_ = flagValue;
@@ -1532,7 +1550,7 @@ bool ReactNativeFeatureFlagsAccessor::updateRuntimeShadowNodeReferencesOnCommitT
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(83, "updateRuntimeShadowNodeReferencesOnCommitThread");
markFlagAsAccessed(84, "updateRuntimeShadowNodeReferencesOnCommitThread");
flagValue = currentProvider_->updateRuntimeShadowNodeReferencesOnCommitThread();
updateRuntimeShadowNodeReferencesOnCommitThread_ = flagValue;
@@ -1550,7 +1568,7 @@ bool ReactNativeFeatureFlagsAccessor::useAlwaysAvailableJSErrorHandling() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(84, "useAlwaysAvailableJSErrorHandling");
markFlagAsAccessed(85, "useAlwaysAvailableJSErrorHandling");
flagValue = currentProvider_->useAlwaysAvailableJSErrorHandling();
useAlwaysAvailableJSErrorHandling_ = flagValue;
@@ -1568,7 +1586,7 @@ bool ReactNativeFeatureFlagsAccessor::useFabricInterop() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(85, "useFabricInterop");
markFlagAsAccessed(86, "useFabricInterop");
flagValue = currentProvider_->useFabricInterop();
useFabricInterop_ = flagValue;
@@ -1586,7 +1604,7 @@ bool ReactNativeFeatureFlagsAccessor::useNativeViewConfigsInBridgelessMode() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(86, "useNativeViewConfigsInBridgelessMode");
markFlagAsAccessed(87, "useNativeViewConfigsInBridgelessMode");
flagValue = currentProvider_->useNativeViewConfigsInBridgelessMode();
useNativeViewConfigsInBridgelessMode_ = flagValue;
@@ -1604,7 +1622,7 @@ bool ReactNativeFeatureFlagsAccessor::useNestedScrollViewAndroid() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(87, "useNestedScrollViewAndroid");
markFlagAsAccessed(88, "useNestedScrollViewAndroid");
flagValue = currentProvider_->useNestedScrollViewAndroid();
useNestedScrollViewAndroid_ = flagValue;
@@ -1622,7 +1640,7 @@ bool ReactNativeFeatureFlagsAccessor::useSharedAnimatedBackend() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(88, "useSharedAnimatedBackend");
markFlagAsAccessed(89, "useSharedAnimatedBackend");
flagValue = currentProvider_->useSharedAnimatedBackend();
useSharedAnimatedBackend_ = flagValue;
@@ -1640,7 +1658,7 @@ bool ReactNativeFeatureFlagsAccessor::useTraitHiddenOnAndroid() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(89, "useTraitHiddenOnAndroid");
markFlagAsAccessed(90, "useTraitHiddenOnAndroid");
flagValue = currentProvider_->useTraitHiddenOnAndroid();
useTraitHiddenOnAndroid_ = flagValue;
@@ -1658,7 +1676,7 @@ bool ReactNativeFeatureFlagsAccessor::useTurboModuleInterop() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(90, "useTurboModuleInterop");
markFlagAsAccessed(91, "useTurboModuleInterop");
flagValue = currentProvider_->useTurboModuleInterop();
useTurboModuleInterop_ = flagValue;
@@ -1676,7 +1694,7 @@ bool ReactNativeFeatureFlagsAccessor::useWindowDensityForDisplayMetricsAndroid()
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(91, "useWindowDensityForDisplayMetricsAndroid");
markFlagAsAccessed(92, "useWindowDensityForDisplayMetricsAndroid");
flagValue = currentProvider_->useWindowDensityForDisplayMetricsAndroid();
useWindowDensityForDisplayMetricsAndroid_ = flagValue;
@@ -1694,7 +1712,7 @@ double ReactNativeFeatureFlagsAccessor::viewCullingOutsetRatio() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(92, "viewCullingOutsetRatio");
markFlagAsAccessed(93, "viewCullingOutsetRatio");
flagValue = currentProvider_->viewCullingOutsetRatio();
viewCullingOutsetRatio_ = flagValue;
@@ -1712,7 +1730,7 @@ bool ReactNativeFeatureFlagsAccessor::viewTransitionEnabled() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(93, "viewTransitionEnabled");
markFlagAsAccessed(94, "viewTransitionEnabled");
flagValue = currentProvider_->viewTransitionEnabled();
viewTransitionEnabled_ = flagValue;
@@ -1730,7 +1748,7 @@ bool ReactNativeFeatureFlagsAccessor::viewTransitionUseHardwareBitmapAndroid() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(94, "viewTransitionUseHardwareBitmapAndroid");
markFlagAsAccessed(95, "viewTransitionUseHardwareBitmapAndroid");
flagValue = currentProvider_->viewTransitionUseHardwareBitmapAndroid();
viewTransitionUseHardwareBitmapAndroid_ = flagValue;
@@ -1748,7 +1766,7 @@ double ReactNativeFeatureFlagsAccessor::virtualViewPrerenderRatio() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(95, "virtualViewPrerenderRatio");
markFlagAsAccessed(96, "virtualViewPrerenderRatio");
flagValue = currentProvider_->virtualViewPrerenderRatio();
virtualViewPrerenderRatio_ = flagValue;
@@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<0b7f6d7766d1e038b3909bb7ea634f83>>
* @generated SignedSource<<66130994f415fa235df5b77405d068ee>>
*/
/**
@@ -63,6 +63,7 @@ class ReactNativeFeatureFlagsAccessor {
bool enableFabricCommitBranchingMergeOnMainThread();
bool enableFabricLogs();
bool enableFlexboxAutoMinSizeInStrictMode();
bool enableFollowUpMountItemDispatchAndroid();
bool enableFontScaleChangesUpdatingLayout();
bool enableIOSCompressedTextFrameAdjustment();
bool enableIOSTextBaselineOffsetPerLine();
@@ -141,7 +142,7 @@ class ReactNativeFeatureFlagsAccessor {
std::unique_ptr<ReactNativeFeatureFlagsProvider> currentProvider_;
bool wasOverridden_;
std::array<std::atomic<const char*>, 96> accessedFeatureFlags_;
std::array<std::atomic<const char*>, 97> accessedFeatureFlags_;
std::atomic<std::optional<bool>> commonTestFlag_;
std::atomic<std::optional<bool>> cdpInteractionMetricsEnabled_;
@@ -172,6 +173,7 @@ class ReactNativeFeatureFlagsAccessor {
std::atomic<std::optional<bool>> enableFabricCommitBranchingMergeOnMainThread_;
std::atomic<std::optional<bool>> enableFabricLogs_;
std::atomic<std::optional<bool>> enableFlexboxAutoMinSizeInStrictMode_;
std::atomic<std::optional<bool>> enableFollowUpMountItemDispatchAndroid_;
std::atomic<std::optional<bool>> enableFontScaleChangesUpdatingLayout_;
std::atomic<std::optional<bool>> enableIOSCompressedTextFrameAdjustment_;
std::atomic<std::optional<bool>> enableIOSTextBaselineOffsetPerLine_;
@@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<46e48274f8b27b9c6136b13048682252>>
* @generated SignedSource<<dec2a3dc399cbe301d5a98cb727393bd>>
*/
/**
@@ -145,6 +145,10 @@ class ReactNativeFeatureFlagsDefaults : public ReactNativeFeatureFlagsProvider {
return false;
}
bool enableFollowUpMountItemDispatchAndroid() override {
return false;
}
bool enableFontScaleChangesUpdatingLayout() override {
return true;
}
@@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<ec15d61f2d6f06c6ec5998f8524de016>>
* @generated SignedSource<<41d72ef0a42994ab19ca76c16dc04a86>>
*/
/**
@@ -308,6 +308,15 @@ class ReactNativeFeatureFlagsDynamicProvider : public ReactNativeFeatureFlagsDef
return ReactNativeFeatureFlagsDefaults::enableFlexboxAutoMinSizeInStrictMode();
}
bool enableFollowUpMountItemDispatchAndroid() override {
auto value = values_["enableFollowUpMountItemDispatchAndroid"];
if (!value.isNull()) {
return value.getBool();
}
return ReactNativeFeatureFlagsDefaults::enableFollowUpMountItemDispatchAndroid();
}
bool enableFontScaleChangesUpdatingLayout() override {
auto value = values_["enableFontScaleChangesUpdatingLayout"];
if (!value.isNull()) {
@@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<7626d25a1450564a30de026870f4d094>>
* @generated SignedSource<<96e9edf6ff0b347963cb155d59cb1005>>
*/
/**
@@ -56,6 +56,7 @@ class ReactNativeFeatureFlagsProvider {
virtual bool enableFabricCommitBranchingMergeOnMainThread() = 0;
virtual bool enableFabricLogs() = 0;
virtual bool enableFlexboxAutoMinSizeInStrictMode() = 0;
virtual bool enableFollowUpMountItemDispatchAndroid() = 0;
virtual bool enableFontScaleChangesUpdatingLayout() = 0;
virtual bool enableIOSCompressedTextFrameAdjustment() = 0;
virtual bool enableIOSTextBaselineOffsetPerLine() = 0;
@@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<ca361bb00c0b31657c5a1559a12d5f5a>>
* @generated SignedSource<<b273669cee2217f49ad63d88e3439eea>>
*/
/**
@@ -189,6 +189,11 @@ bool NativeReactNativeFeatureFlags::enableFlexboxAutoMinSizeInStrictMode(
return ReactNativeFeatureFlags::enableFlexboxAutoMinSizeInStrictMode();
}
bool NativeReactNativeFeatureFlags::enableFollowUpMountItemDispatchAndroid(
jsi::Runtime& /*runtime*/) {
return ReactNativeFeatureFlags::enableFollowUpMountItemDispatchAndroid();
}
bool NativeReactNativeFeatureFlags::enableFontScaleChangesUpdatingLayout(
jsi::Runtime& /*runtime*/) {
return ReactNativeFeatureFlags::enableFontScaleChangesUpdatingLayout();
@@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<4d3151d0ce9a022c5b9b74e2a910229d>>
* @generated SignedSource<<3f0c67926f9bc7a9973e17afe59b3ec9>>
*/
/**
@@ -96,6 +96,8 @@ class NativeReactNativeFeatureFlags
bool enableFlexboxAutoMinSizeInStrictMode(jsi::Runtime& runtime);
bool enableFollowUpMountItemDispatchAndroid(jsi::Runtime& runtime);
bool enableFontScaleChangesUpdatingLayout(jsi::Runtime& runtime);
bool enableIOSCompressedTextFrameAdjustment(jsi::Runtime& runtime);
@@ -117,9 +117,10 @@ class ConcreteState : public State {
return getData().getDynamic();
}
void updateState(folly::dynamic &&data) const override
void updateState(folly::dynamic &&data, EventQueue::UpdateMode updateMode = EventQueue::UpdateMode::Asynchronous)
const override
{
updateState(Data(getData(), std::move(data)));
updateState(Data(getData(), std::move(data)), updateMode);
}
MapBuffer getMapBuffer() const override
@@ -13,6 +13,7 @@
#include <React/MapBuffer.h>
#include <fbjni/fbjni.h>
#include <folly/dynamic.h>
#include <react/renderer/core/EventQueue.h>
#endif
#include <react/renderer/core/ShadowNodeFamily.h>
@@ -68,7 +69,9 @@ class State {
virtual folly::dynamic getDynamic() const = 0;
virtual MapBuffer getMapBuffer() const = 0;
virtual jni::local_ref<jobject> getJNIReference() const = 0;
virtual void updateState(folly::dynamic &&data) const = 0;
virtual void updateState(
folly::dynamic &&data,
EventQueue::UpdateMode updateMode = EventQueue::UpdateMode::Asynchronous) const = 0;
#endif
protected:
@@ -363,6 +363,17 @@ const definitions: FeatureFlagDefinitions = {
},
ossReleaseStage: 'experimental',
},
enableFollowUpMountItemDispatchAndroid: {
defaultValue: false,
metadata: {
dateAdded: '2026-09-29',
description:
'When mount items are queued while MountItemDispatcher is already dispatching on Android (e.g. from a synchronous state update), dispatch them in the same frame instead of deferring them to the next one.',
expectedReleaseValue: true,
purpose: 'experimentation',
},
ossReleaseStage: 'none',
},
enableFontScaleChangesUpdatingLayout: {
defaultValue: true,
metadata: {
@@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<5a79107fda7ef89a1d68594cad01b8e7>>
* @generated SignedSource<<73327eab3ccc39c8d823c9d2b110d23c>>
* @flow strict
* @noformat
*/
@@ -78,6 +78,7 @@ export type ReactNativeFeatureFlags = Readonly<{
enableFabricCommitBranchingMergeOnMainThread: Getter<boolean>,
enableFabricLogs: Getter<boolean>,
enableFlexboxAutoMinSizeInStrictMode: Getter<boolean>,
enableFollowUpMountItemDispatchAndroid: Getter<boolean>,
enableFontScaleChangesUpdatingLayout: Getter<boolean>,
enableIOSCompressedTextFrameAdjustment: Getter<boolean>,
enableIOSTextBaselineOffsetPerLine: Getter<boolean>,
@@ -337,6 +338,10 @@ export const enableFabricLogs: Getter<boolean> = createNativeFlagGetter('enableF
* Enables CSS Flexbox §4.5 automatic minimum sizing under strict layout conformance. When enabled, a flex item with an undefined main-axis `min-width`/`min-height` under strict conformance receives a content-derived minimum size (per spec) instead of an undefined (0) minimum. Defaults off so the behaviour can be ramped independently of strict conformance.
*/
export const enableFlexboxAutoMinSizeInStrictMode: Getter<boolean> = createNativeFlagGetter('enableFlexboxAutoMinSizeInStrictMode', false);
/**
* When mount items are queued while MountItemDispatcher is already dispatching on Android (e.g. from a synchronous state update), dispatch them in the same frame instead of deferring them to the next one.
*/
export const enableFollowUpMountItemDispatchAndroid: Getter<boolean> = createNativeFlagGetter('enableFollowUpMountItemDispatchAndroid', false);
/**
* Enables font scale changes updating layout for measurable nodes.
*/
@@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<a21712fc03890b45ea92ecb883fa3139>>
* @generated SignedSource<<043ccaebbb88ea3c413809d9d628d584>>
* @flow strict
* @noformat
*/
@@ -54,6 +54,7 @@ export interface Spec extends TurboModule {
readonly enableFabricCommitBranchingMergeOnMainThread?: () => boolean;
readonly enableFabricLogs?: () => boolean;
readonly enableFlexboxAutoMinSizeInStrictMode?: () => boolean;
readonly enableFollowUpMountItemDispatchAndroid?: () => boolean;
readonly enableFontScaleChangesUpdatingLayout?: () => boolean;
readonly enableIOSCompressedTextFrameAdjustment?: () => boolean;
readonly enableIOSTextBaselineOffsetPerLine?: () => boolean;
@@ -2343,7 +2343,7 @@ class facebook::react::State {
public virtual facebook::react::MapBuffer getMapBuffer() const = 0;
public virtual folly::dynamic getDynamic() const = 0;
public virtual jni::local_ref<jobject> getJNIReference() const = 0;
public virtual void updateState(folly::dynamic&& data) const = 0;
public virtual void updateState(folly::dynamic&& data, facebook::react::EventQueue::UpdateMode updateMode = facebook::react::EventQueue::UpdateMode::Asynchronous) const = 0;
public virtual ~State() = default;
}
@@ -2367,7 +2367,7 @@ class facebook::react::StateWrapperImpl : public jni::HybridClass<facebook::reac
public static void registerNatives();
public std::shared_ptr<const facebook::react::State> getState() const;
public void setState(std::shared_ptr<const facebook::react::State> state);
public void updateStateImpl(facebook::react::NativeMap* map);
public void updateStateImpl(facebook::react::NativeMap* map, jint updateMode);
}
class facebook::react::SurfaceHandlerBinding : public jni::HybridClass<facebook::react::SurfaceHandlerBinding> {
@@ -3818,7 +3818,7 @@ class facebook::react::ConcreteState : public facebook::react::State {
public virtual facebook::react::MapBuffer getMapBuffer() const override;
public virtual folly::dynamic getDynamic() const override;
public virtual jni::local_ref<jobject> getJNIReference() const override;
public virtual void updateState(folly::dynamic&& data) const override;
public virtual void updateState(folly::dynamic&& data, facebook::react::EventQueue::UpdateMode updateMode = facebook::react::EventQueue::UpdateMode::Asynchronous) const override;
public void updateState(facebook::react::ConcreteState::Data&& newData, facebook::react::EventQueue::UpdateMode updateMode = facebook::react::EventQueue::UpdateMode::Asynchronous) const;
public void updateState(std::function<facebook::react::StateData::Shared(const facebook::react::ConcreteState::Data& oldData)> callback, facebook::react::EventQueue::UpdateMode updateMode = facebook::react::EventQueue::UpdateMode::Asynchronous) const;
public ~ConcreteState() override = default;
@@ -3781,7 +3781,7 @@ class facebook::react::State {
public virtual facebook::react::MapBuffer getMapBuffer() const = 0;
public virtual folly::dynamic getDynamic() const = 0;
public virtual jni::local_ref<jobject> getJNIReference() const = 0;
public virtual void updateState(folly::dynamic&& data) const = 0;
public virtual void updateState(folly::dynamic&& data, facebook::react::EventQueue::UpdateMode updateMode = facebook::react::EventQueue::UpdateMode::Asynchronous) const = 0;
public virtual ~State() = default;
}
@@ -3805,7 +3805,7 @@ class facebook::react::StateWrapperImpl : public jni::HybridClass<facebook::reac
public static void registerNatives();
public std::shared_ptr<const facebook::react::State> getState() const;
public void setState(std::shared_ptr<const facebook::react::State> state);
public void updateStateImpl(facebook::react::NativeMap* map);
public void updateStateImpl(facebook::react::NativeMap* map, jint updateMode);
}
class facebook::react::SurfaceHandler {
@@ -6913,7 +6913,7 @@ class facebook::react::ConcreteState : public facebook::react::State {
public virtual facebook::react::MapBuffer getMapBuffer() const override;
public virtual folly::dynamic getDynamic() const override;
public virtual jni::local_ref<jobject> getJNIReference() const override;
public virtual void updateState(folly::dynamic&& data) const override;
public virtual void updateState(folly::dynamic&& data, facebook::react::EventQueue::UpdateMode updateMode = facebook::react::EventQueue::UpdateMode::Asynchronous) const override;
public void updateState(facebook::react::ConcreteState::Data&& newData, facebook::react::EventQueue::UpdateMode updateMode = facebook::react::EventQueue::UpdateMode::Asynchronous) const;
public void updateState(std::function<facebook::react::StateData::Shared(const facebook::react::ConcreteState::Data& oldData)> callback, facebook::react::EventQueue::UpdateMode updateMode = facebook::react::EventQueue::UpdateMode::Asynchronous) const;
public ~ConcreteState() override = default;
@@ -2336,7 +2336,7 @@ class facebook::react::State {
public virtual facebook::react::MapBuffer getMapBuffer() const = 0;
public virtual folly::dynamic getDynamic() const = 0;
public virtual jni::local_ref<jobject> getJNIReference() const = 0;
public virtual void updateState(folly::dynamic&& data) const = 0;
public virtual void updateState(folly::dynamic&& data, facebook::react::EventQueue::UpdateMode updateMode = facebook::react::EventQueue::UpdateMode::Asynchronous) const = 0;
public virtual ~State() = default;
}
@@ -2360,7 +2360,7 @@ class facebook::react::StateWrapperImpl : public jni::HybridClass<facebook::reac
public static void registerNatives();
public std::shared_ptr<const facebook::react::State> getState() const;
public void setState(std::shared_ptr<const facebook::react::State> state);
public void updateStateImpl(facebook::react::NativeMap* map);
public void updateStateImpl(facebook::react::NativeMap* map, jint updateMode);
}
class facebook::react::SurfaceHandlerBinding : public jni::HybridClass<facebook::react::SurfaceHandlerBinding> {
@@ -3811,7 +3811,7 @@ class facebook::react::ConcreteState : public facebook::react::State {
public virtual facebook::react::MapBuffer getMapBuffer() const override;
public virtual folly::dynamic getDynamic() const override;
public virtual jni::local_ref<jobject> getJNIReference() const override;
public virtual void updateState(folly::dynamic&& data) const override;
public virtual void updateState(folly::dynamic&& data, facebook::react::EventQueue::UpdateMode updateMode = facebook::react::EventQueue::UpdateMode::Asynchronous) const override;
public void updateState(facebook::react::ConcreteState::Data&& newData, facebook::react::EventQueue::UpdateMode updateMode = facebook::react::EventQueue::UpdateMode::Asynchronous) const;
public void updateState(std::function<facebook::react::StateData::Shared(const facebook::react::ConcreteState::Data& oldData)> callback, facebook::react::EventQueue::UpdateMode updateMode = facebook::react::EventQueue::UpdateMode::Asynchronous) const;
public ~ConcreteState() override = default;
@@ -2336,7 +2336,7 @@ class facebook::react::State {
public virtual facebook::react::MapBuffer getMapBuffer() const = 0;
public virtual folly::dynamic getDynamic() const = 0;
public virtual jni::local_ref<jobject> getJNIReference() const = 0;
public virtual void updateState(folly::dynamic&& data) const = 0;
public virtual void updateState(folly::dynamic&& data, facebook::react::EventQueue::UpdateMode updateMode = facebook::react::EventQueue::UpdateMode::Asynchronous) const = 0;
public virtual ~State() = default;
}
@@ -2360,7 +2360,7 @@ class facebook::react::StateWrapperImpl : public jni::HybridClass<facebook::reac
public static void registerNatives();
public std::shared_ptr<const facebook::react::State> getState() const;
public void setState(std::shared_ptr<const facebook::react::State> state);
public void updateStateImpl(facebook::react::NativeMap* map);
public void updateStateImpl(facebook::react::NativeMap* map, jint updateMode);
}
class facebook::react::SurfaceHandlerBinding : public jni::HybridClass<facebook::react::SurfaceHandlerBinding> {
@@ -3811,7 +3811,7 @@ class facebook::react::ConcreteState : public facebook::react::State {
public virtual facebook::react::MapBuffer getMapBuffer() const override;
public virtual folly::dynamic getDynamic() const override;
public virtual jni::local_ref<jobject> getJNIReference() const override;
public virtual void updateState(folly::dynamic&& data) const override;
public virtual void updateState(folly::dynamic&& data, facebook::react::EventQueue::UpdateMode updateMode = facebook::react::EventQueue::UpdateMode::Asynchronous) const override;
public void updateState(facebook::react::ConcreteState::Data&& newData, facebook::react::EventQueue::UpdateMode updateMode = facebook::react::EventQueue::UpdateMode::Asynchronous) const;
public void updateState(std::function<facebook::react::StateData::Shared(const facebook::react::ConcreteState::Data& oldData)> callback, facebook::react::EventQueue::UpdateMode updateMode = facebook::react::EventQueue::UpdateMode::Asynchronous) const;
public ~ConcreteState() override = default;