Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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<<99da5cf948e469e385bd70b4c59cd764>>
* @generated SignedSource<<662ad064ecdeb796979f66f0844984e8>>
*/

/**
Expand Down Expand Up @@ -238,6 +238,12 @@ public object ReactNativeFeatureFlags {
@JvmStatic
public fun traceTurboModulePromiseRejectionsOnAndroid(): Boolean = accessor.traceTurboModulePromiseRejectionsOnAndroid()

/**
* When enabled, runtime shadow node references will be updated during the commit. This allows running RSNRU from any thread without corrupting the renderer state.
*/
@JvmStatic
public fun updateRuntimeShadowNodeReferencesOnCommit(): Boolean = accessor.updateRuntimeShadowNodeReferencesOnCommit()

/**
* In Bridgeless mode, use the always available javascript error reporting pipeline.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<<5e1d8c0e728715d4110b6d1d156357c5>>
* @generated SignedSource<<18491add3d51026435eedc7b8881c17d>>
*/

/**
Expand Down Expand Up @@ -55,6 +55,7 @@ public class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAccesso
private var lazyAnimationCallbacksCache: Boolean? = null
private var loadVectorDrawablesOnImagesCache: Boolean? = null
private var traceTurboModulePromiseRejectionsOnAndroidCache: Boolean? = null
private var updateRuntimeShadowNodeReferencesOnCommitCache: Boolean? = null
private var useAlwaysAvailableJSErrorHandlingCache: Boolean? = null
private var useFabricInteropCache: Boolean? = null
private var useImmediateExecutorInAndroidBridgelessCache: Boolean? = null
Expand Down Expand Up @@ -382,6 +383,15 @@ public class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAccesso
return cached
}

override fun updateRuntimeShadowNodeReferencesOnCommit(): Boolean {
var cached = updateRuntimeShadowNodeReferencesOnCommitCache
if (cached == null) {
cached = ReactNativeFeatureFlagsCxxInterop.updateRuntimeShadowNodeReferencesOnCommit()
updateRuntimeShadowNodeReferencesOnCommitCache = cached
}
return cached
}

override fun useAlwaysAvailableJSErrorHandling(): Boolean {
var cached = useAlwaysAvailableJSErrorHandlingCache
if (cached == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<<b8035f8bf1833723858be474f7766594>>
* @generated SignedSource<<995fb2d7c8aa01df311a43b6b415eb7f>>
*/

/**
Expand Down Expand Up @@ -98,6 +98,8 @@ public object ReactNativeFeatureFlagsCxxInterop {

@DoNotStrip @JvmStatic public external fun traceTurboModulePromiseRejectionsOnAndroid(): Boolean

@DoNotStrip @JvmStatic public external fun updateRuntimeShadowNodeReferencesOnCommit(): Boolean

@DoNotStrip @JvmStatic public external fun useAlwaysAvailableJSErrorHandling(): Boolean

@DoNotStrip @JvmStatic public external fun useFabricInterop(): Boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<<11d93a900862ed8ce98f90f9af2de47b>>
* @generated SignedSource<<165c4e89bdf59200d1cbf18aac69d991>>
*/

/**
Expand Down Expand Up @@ -93,6 +93,8 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi

override fun traceTurboModulePromiseRejectionsOnAndroid(): Boolean = false

override fun updateRuntimeShadowNodeReferencesOnCommit(): Boolean = true

override fun useAlwaysAvailableJSErrorHandling(): Boolean = false

override fun useFabricInterop(): Boolean = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<<0614fa80cbc66806fa45aef70f34e2d7>>
* @generated SignedSource<<d7a9e8f63411d31f753107ca649258c5>>
*/

/**
Expand Down Expand Up @@ -59,6 +59,7 @@ public class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcces
private var lazyAnimationCallbacksCache: Boolean? = null
private var loadVectorDrawablesOnImagesCache: Boolean? = null
private var traceTurboModulePromiseRejectionsOnAndroidCache: Boolean? = null
private var updateRuntimeShadowNodeReferencesOnCommitCache: Boolean? = null
private var useAlwaysAvailableJSErrorHandlingCache: Boolean? = null
private var useFabricInteropCache: Boolean? = null
private var useImmediateExecutorInAndroidBridgelessCache: Boolean? = null
Expand Down Expand Up @@ -421,6 +422,16 @@ public class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcces
return cached
}

override fun updateRuntimeShadowNodeReferencesOnCommit(): Boolean {
var cached = updateRuntimeShadowNodeReferencesOnCommitCache
if (cached == null) {
cached = currentProvider.updateRuntimeShadowNodeReferencesOnCommit()
accessedFeatureFlags.add("updateRuntimeShadowNodeReferencesOnCommit")
updateRuntimeShadowNodeReferencesOnCommitCache = cached
}
return cached
}

override fun useAlwaysAvailableJSErrorHandling(): Boolean {
var cached = useAlwaysAvailableJSErrorHandlingCache
if (cached == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<<5f4ff90382b2d69df401535cb33e64c5>>
* @generated SignedSource<<b34465e47944cc4dcf5bbf5b3fb452f5>>
*/

/**
Expand Down Expand Up @@ -93,6 +93,8 @@ public interface ReactNativeFeatureFlagsProvider {

@DoNotStrip public fun traceTurboModulePromiseRejectionsOnAndroid(): Boolean

@DoNotStrip public fun updateRuntimeShadowNodeReferencesOnCommit(): Boolean

@DoNotStrip public fun useAlwaysAvailableJSErrorHandling(): Boolean

@DoNotStrip public fun useFabricInterop(): Boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<<28069af1f34c79e9907c85697a291c0e>>
* @generated SignedSource<<afe31f45df18b6b874ebbbdafdc7ba3e>>
*/

/**
Expand Down Expand Up @@ -249,6 +249,12 @@ class ReactNativeFeatureFlagsProviderHolder
return method(javaProvider_);
}

bool updateRuntimeShadowNodeReferencesOnCommit() override {
static const auto method =
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("updateRuntimeShadowNodeReferencesOnCommit");
return method(javaProvider_);
}

bool useAlwaysAvailableJSErrorHandling() override {
static const auto method =
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("useAlwaysAvailableJSErrorHandling");
Expand Down Expand Up @@ -494,6 +500,11 @@ bool JReactNativeFeatureFlagsCxxInterop::traceTurboModulePromiseRejectionsOnAndr
return ReactNativeFeatureFlags::traceTurboModulePromiseRejectionsOnAndroid();
}

bool JReactNativeFeatureFlagsCxxInterop::updateRuntimeShadowNodeReferencesOnCommit(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
return ReactNativeFeatureFlags::updateRuntimeShadowNodeReferencesOnCommit();
}

bool JReactNativeFeatureFlagsCxxInterop::useAlwaysAvailableJSErrorHandling(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
return ReactNativeFeatureFlags::useAlwaysAvailableJSErrorHandling();
Expand Down Expand Up @@ -685,6 +696,9 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
makeNativeMethod(
"traceTurboModulePromiseRejectionsOnAndroid",
JReactNativeFeatureFlagsCxxInterop::traceTurboModulePromiseRejectionsOnAndroid),
makeNativeMethod(
"updateRuntimeShadowNodeReferencesOnCommit",
JReactNativeFeatureFlagsCxxInterop::updateRuntimeShadowNodeReferencesOnCommit),
makeNativeMethod(
"useAlwaysAvailableJSErrorHandling",
JReactNativeFeatureFlagsCxxInterop::useAlwaysAvailableJSErrorHandling),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<<763d595784bdf31a852ebf2a492a1393>>
* @generated SignedSource<<9be70297304abaf0a7cfdea7f6c2562c>>
*/

/**
Expand Down Expand Up @@ -135,6 +135,9 @@ class JReactNativeFeatureFlagsCxxInterop
static bool traceTurboModulePromiseRejectionsOnAndroid(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);

static bool updateRuntimeShadowNodeReferencesOnCommit(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);

static bool useAlwaysAvailableJSErrorHandling(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<<511c1667fab247b77d771a7a26e87b46>>
* @generated SignedSource<<1908eb4b0357004888dbe5876aa9ef34>>
*/

/**
Expand Down Expand Up @@ -166,6 +166,10 @@ bool ReactNativeFeatureFlags::traceTurboModulePromiseRejectionsOnAndroid() {
return getAccessor().traceTurboModulePromiseRejectionsOnAndroid();
}

bool ReactNativeFeatureFlags::updateRuntimeShadowNodeReferencesOnCommit() {
return getAccessor().updateRuntimeShadowNodeReferencesOnCommit();
}

bool ReactNativeFeatureFlags::useAlwaysAvailableJSErrorHandling() {
return getAccessor().useAlwaysAvailableJSErrorHandling();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<<19cfd8b41dd429c83a5e0f0df514d1d1>>
* @generated SignedSource<<b3fc8c0e2ae394ce245090025a9659f0>>
*/

/**
Expand Down Expand Up @@ -214,6 +214,11 @@ class ReactNativeFeatureFlags {
*/
RN_EXPORT static bool traceTurboModulePromiseRejectionsOnAndroid();

/**
* When enabled, runtime shadow node references will be updated during the commit. This allows running RSNRU from any thread without corrupting the renderer state.
*/
RN_EXPORT static bool updateRuntimeShadowNodeReferencesOnCommit();

/**
* In Bridgeless mode, use the always available javascript error reporting pipeline.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<<deee1bf6d0688e6871f59c300c985305>>
* @generated SignedSource<<848eaeb01c92c48f9ffd9cb74e371c56>>
*/

/**
Expand Down Expand Up @@ -659,6 +659,24 @@ bool ReactNativeFeatureFlagsAccessor::traceTurboModulePromiseRejectionsOnAndroid
return flagValue.value();
}

bool ReactNativeFeatureFlagsAccessor::updateRuntimeShadowNodeReferencesOnCommit() {
auto flagValue = updateRuntimeShadowNodeReferencesOnCommit_.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(35, "updateRuntimeShadowNodeReferencesOnCommit");

flagValue = currentProvider_->updateRuntimeShadowNodeReferencesOnCommit();
updateRuntimeShadowNodeReferencesOnCommit_ = flagValue;
}

return flagValue.value();
}

bool ReactNativeFeatureFlagsAccessor::useAlwaysAvailableJSErrorHandling() {
auto flagValue = useAlwaysAvailableJSErrorHandling_.load();

Expand All @@ -668,7 +686,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(35, "useAlwaysAvailableJSErrorHandling");
markFlagAsAccessed(36, "useAlwaysAvailableJSErrorHandling");

flagValue = currentProvider_->useAlwaysAvailableJSErrorHandling();
useAlwaysAvailableJSErrorHandling_ = flagValue;
Expand All @@ -686,7 +704,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(36, "useFabricInterop");
markFlagAsAccessed(37, "useFabricInterop");

flagValue = currentProvider_->useFabricInterop();
useFabricInterop_ = flagValue;
Expand All @@ -704,7 +722,7 @@ bool ReactNativeFeatureFlagsAccessor::useImmediateExecutorInAndroidBridgeless()
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.

markFlagAsAccessed(37, "useImmediateExecutorInAndroidBridgeless");
markFlagAsAccessed(38, "useImmediateExecutorInAndroidBridgeless");

flagValue = currentProvider_->useImmediateExecutorInAndroidBridgeless();
useImmediateExecutorInAndroidBridgeless_ = flagValue;
Expand All @@ -722,7 +740,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(38, "useNativeViewConfigsInBridgelessMode");
markFlagAsAccessed(39, "useNativeViewConfigsInBridgelessMode");

flagValue = currentProvider_->useNativeViewConfigsInBridgelessMode();
useNativeViewConfigsInBridgelessMode_ = flagValue;
Expand All @@ -740,7 +758,7 @@ bool ReactNativeFeatureFlagsAccessor::useOptimisedViewPreallocationOnAndroid() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.

markFlagAsAccessed(39, "useOptimisedViewPreallocationOnAndroid");
markFlagAsAccessed(40, "useOptimisedViewPreallocationOnAndroid");

flagValue = currentProvider_->useOptimisedViewPreallocationOnAndroid();
useOptimisedViewPreallocationOnAndroid_ = flagValue;
Expand All @@ -758,7 +776,7 @@ bool ReactNativeFeatureFlagsAccessor::useOptimizedEventBatchingOnAndroid() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.

markFlagAsAccessed(40, "useOptimizedEventBatchingOnAndroid");
markFlagAsAccessed(41, "useOptimizedEventBatchingOnAndroid");

flagValue = currentProvider_->useOptimizedEventBatchingOnAndroid();
useOptimizedEventBatchingOnAndroid_ = flagValue;
Expand All @@ -776,7 +794,7 @@ bool ReactNativeFeatureFlagsAccessor::useRawPropsJsiValue() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.

markFlagAsAccessed(41, "useRawPropsJsiValue");
markFlagAsAccessed(42, "useRawPropsJsiValue");

flagValue = currentProvider_->useRawPropsJsiValue();
useRawPropsJsiValue_ = flagValue;
Expand All @@ -794,7 +812,7 @@ bool ReactNativeFeatureFlagsAccessor::useRuntimeShadowNodeReferenceUpdate() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.

markFlagAsAccessed(42, "useRuntimeShadowNodeReferenceUpdate");
markFlagAsAccessed(43, "useRuntimeShadowNodeReferenceUpdate");

flagValue = currentProvider_->useRuntimeShadowNodeReferenceUpdate();
useRuntimeShadowNodeReferenceUpdate_ = flagValue;
Expand All @@ -812,7 +830,7 @@ bool ReactNativeFeatureFlagsAccessor::useShadowNodeStateOnClone() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.

markFlagAsAccessed(43, "useShadowNodeStateOnClone");
markFlagAsAccessed(44, "useShadowNodeStateOnClone");

flagValue = currentProvider_->useShadowNodeStateOnClone();
useShadowNodeStateOnClone_ = flagValue;
Expand All @@ -830,7 +848,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(44, "useTurboModuleInterop");
markFlagAsAccessed(45, "useTurboModuleInterop");

flagValue = currentProvider_->useTurboModuleInterop();
useTurboModuleInterop_ = flagValue;
Expand All @@ -848,7 +866,7 @@ bool ReactNativeFeatureFlagsAccessor::useTurboModules() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.

markFlagAsAccessed(45, "useTurboModules");
markFlagAsAccessed(46, "useTurboModules");

flagValue = currentProvider_->useTurboModules();
useTurboModules_ = flagValue;
Expand Down
Loading
Loading