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<<4e30b8a42dfe7e041ecb30a386b54e50>>
* @generated SignedSource<<987e450aa9db1b9da0e2a5a63deae4fe>>
*/

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

/**
* When enabled, cloning shadow nodes within react native will update the reference held by the current JS fiber tree.
*/
@JvmStatic
public fun useRuntimeShadowNodeReferenceUpdate(): Boolean = accessor.useRuntimeShadowNodeReferenceUpdate()

/**
* When enabled, it uses optimised state reconciliation algorithm.
*/
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<<944fabed27a371ce2e1a86e367312c1f>>
* @generated SignedSource<<1a6f57f6bc5b8efd35d6846c71166126>>
*/

/**
Expand Down Expand Up @@ -40,6 +40,7 @@ public class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAccesso
private var setAndroidLayoutDirectionCache: Boolean? = null
private var useModernRuntimeSchedulerCache: Boolean? = null
private var useNativeViewConfigsInBridgelessModeCache: Boolean? = null
private var useRuntimeShadowNodeReferenceUpdateCache: Boolean? = null
private var useStateAlignmentMechanismCache: Boolean? = null

override fun commonTestFlag(): Boolean {
Expand Down Expand Up @@ -222,6 +223,15 @@ public class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAccesso
return cached
}

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

override fun useStateAlignmentMechanism(): Boolean {
var cached = useStateAlignmentMechanismCache
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<<d2ccaef4c75979c26327963aeee0b0ad>>
* @generated SignedSource<<1b8b3b8d140faefe9e5269b27770b235>>
*/

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

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

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

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

@DoNotStrip @JvmStatic public external fun override(provider: Any)
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<<c74b5434945f63cf42551b188b9f7a48>>
* @generated SignedSource<<656d5e2feea3ec122516b75eaacc3323>>
*/

/**
Expand Down Expand Up @@ -63,5 +63,7 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi

override fun useNativeViewConfigsInBridgelessMode(): Boolean = false

override fun useRuntimeShadowNodeReferenceUpdate(): Boolean = false

override fun useStateAlignmentMechanism(): Boolean = false
}
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<<3b94757d58e6adb2bccf4ddfb86e2080>>
* @generated SignedSource<<206771bdb2b95a893dd6a0dcba5dc48a>>
*/

/**
Expand Down Expand Up @@ -44,6 +44,7 @@ public class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcces
private var setAndroidLayoutDirectionCache: Boolean? = null
private var useModernRuntimeSchedulerCache: Boolean? = null
private var useNativeViewConfigsInBridgelessModeCache: Boolean? = null
private var useRuntimeShadowNodeReferenceUpdateCache: Boolean? = null
private var useStateAlignmentMechanismCache: Boolean? = null

override fun commonTestFlag(): Boolean {
Expand Down Expand Up @@ -246,6 +247,16 @@ public class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcces
return cached
}

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

override fun useStateAlignmentMechanism(): Boolean {
var cached = useStateAlignmentMechanismCache
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<<68ec2c046868a2cb1d2d88e4fdd9d993>>
* @generated SignedSource<<e59baa7b1764857cbd11a14853ad420a>>
*/

/**
Expand Down Expand Up @@ -63,5 +63,7 @@ public interface ReactNativeFeatureFlagsProvider {

@DoNotStrip public fun useNativeViewConfigsInBridgelessMode(): Boolean

@DoNotStrip public fun useRuntimeShadowNodeReferenceUpdate(): Boolean

@DoNotStrip public fun useStateAlignmentMechanism(): Boolean
}
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<<318ea35c5b58c968d7026dbe547200e4>>
* @generated SignedSource<<ef2907316ba5f741430090aedd47212a>>
*/

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

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

bool useStateAlignmentMechanism() override {
static const auto method =
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("useStateAlignmentMechanism");
Expand Down Expand Up @@ -269,6 +275,11 @@ bool JReactNativeFeatureFlagsCxxInterop::useNativeViewConfigsInBridgelessMode(
return ReactNativeFeatureFlags::useNativeViewConfigsInBridgelessMode();
}

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

bool JReactNativeFeatureFlagsCxxInterop::useStateAlignmentMechanism(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
return ReactNativeFeatureFlags::useStateAlignmentMechanism();
Expand Down Expand Up @@ -351,6 +362,9 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
makeNativeMethod(
"useNativeViewConfigsInBridgelessMode",
JReactNativeFeatureFlagsCxxInterop::useNativeViewConfigsInBridgelessMode),
makeNativeMethod(
"useRuntimeShadowNodeReferenceUpdate",
JReactNativeFeatureFlagsCxxInterop::useRuntimeShadowNodeReferenceUpdate),
makeNativeMethod(
"useStateAlignmentMechanism",
JReactNativeFeatureFlagsCxxInterop::useStateAlignmentMechanism),
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<<4d557dc4399d46888205165ee7ae4ab2>>
* @generated SignedSource<<b8ba23ac6a30ed059f6bb5f6b7994c9f>>
*/

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

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

static bool useStateAlignmentMechanism(
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<<2a748a0a1b92cb0514fec83668ed8b0f>>
* @generated SignedSource<<5366e268a53215419a7271cd7fac76c9>>
*/

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

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

bool ReactNativeFeatureFlags::useStateAlignmentMechanism() {
return getAccessor().useStateAlignmentMechanism();
}
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<<a75464f590c4f55e64ad2e33cfc52989>>
* @generated SignedSource<<977b87c9478cea28cbb1aff61eef1fa4>>
*/

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

/**
* When enabled, cloning shadow nodes within react native will update the reference held by the current JS fiber tree.
*/
RN_EXPORT static bool useRuntimeShadowNodeReferenceUpdate();

/**
* When enabled, it uses optimised state reconciliation algorithm.
*/
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<<3e5cb385f51ebc9f53010a901ccbb6a2>>
* @generated SignedSource<<a704a9fb56393c9ffaef917aacc26421>>
*/

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

bool ReactNativeFeatureFlagsAccessor::useRuntimeShadowNodeReferenceUpdate() {
auto flagValue = useRuntimeShadowNodeReferenceUpdate_.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(20, "useRuntimeShadowNodeReferenceUpdate");

flagValue = currentProvider_->useRuntimeShadowNodeReferenceUpdate();
useRuntimeShadowNodeReferenceUpdate_ = flagValue;
}

return flagValue.value();
}

bool ReactNativeFeatureFlagsAccessor::useStateAlignmentMechanism() {
auto flagValue = useStateAlignmentMechanism_.load();

Expand All @@ -398,7 +416,7 @@ bool ReactNativeFeatureFlagsAccessor::useStateAlignmentMechanism() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.

markFlagAsAccessed(20, "useStateAlignmentMechanism");
markFlagAsAccessed(21, "useStateAlignmentMechanism");

flagValue = currentProvider_->useStateAlignmentMechanism();
useStateAlignmentMechanism_ = flagValue;
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<<f4950ca8555466a584af00c972a38f1d>>
* @generated SignedSource<<7de49cd344ee15e49e2a1cf5e78e0139>>
*/

/**
Expand Down Expand Up @@ -51,6 +51,7 @@ class ReactNativeFeatureFlagsAccessor {
bool setAndroidLayoutDirection();
bool useModernRuntimeScheduler();
bool useNativeViewConfigsInBridgelessMode();
bool useRuntimeShadowNodeReferenceUpdate();
bool useStateAlignmentMechanism();

void override(std::unique_ptr<ReactNativeFeatureFlagsProvider> provider);
Expand All @@ -62,7 +63,7 @@ class ReactNativeFeatureFlagsAccessor {
std::unique_ptr<ReactNativeFeatureFlagsProvider> currentProvider_;
bool wasOverridden_;

std::array<std::atomic<const char*>, 21> accessedFeatureFlags_;
std::array<std::atomic<const char*>, 22> accessedFeatureFlags_;

std::atomic<std::optional<bool>> commonTestFlag_;
std::atomic<std::optional<bool>> allowCollapsableChildren_;
Expand All @@ -84,6 +85,7 @@ class ReactNativeFeatureFlagsAccessor {
std::atomic<std::optional<bool>> setAndroidLayoutDirection_;
std::atomic<std::optional<bool>> useModernRuntimeScheduler_;
std::atomic<std::optional<bool>> useNativeViewConfigsInBridgelessMode_;
std::atomic<std::optional<bool>> useRuntimeShadowNodeReferenceUpdate_;
std::atomic<std::optional<bool>> useStateAlignmentMechanism_;
};

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<<5c78cdf7676d56996ea174f08bf4b8a6>>
* @generated SignedSource<<2466d6097301e3fa9d022cc8425c7b1c>>
*/

/**
Expand Down Expand Up @@ -107,6 +107,10 @@ class ReactNativeFeatureFlagsDefaults : public ReactNativeFeatureFlagsProvider {
return false;
}

bool useRuntimeShadowNodeReferenceUpdate() override {
return false;
}

bool useStateAlignmentMechanism() override {
return 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<<a7cdc61b76e5db55c4fc54c0d93f426c>>
* @generated SignedSource<<6a05970506e696333c7480f6cf094642>>
*/

/**
Expand Down Expand Up @@ -45,6 +45,7 @@ class ReactNativeFeatureFlagsProvider {
virtual bool setAndroidLayoutDirection() = 0;
virtual bool useModernRuntimeScheduler() = 0;
virtual bool useNativeViewConfigsInBridgelessMode() = 0;
virtual bool useRuntimeShadowNodeReferenceUpdate() = 0;
virtual bool useStateAlignmentMechanism() = 0;
};

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<<4c02b68cc3b46ec214fe4552f136c5f0>>
* @generated SignedSource<<f271827befadd5040d9d9ceb773349c5>>
*/

/**
Expand Down Expand Up @@ -137,6 +137,11 @@ bool NativeReactNativeFeatureFlags::useNativeViewConfigsInBridgelessMode(
return ReactNativeFeatureFlags::useNativeViewConfigsInBridgelessMode();
}

bool NativeReactNativeFeatureFlags::useRuntimeShadowNodeReferenceUpdate(
jsi::Runtime& /*runtime*/) {
return ReactNativeFeatureFlags::useRuntimeShadowNodeReferenceUpdate();
}

bool NativeReactNativeFeatureFlags::useStateAlignmentMechanism(
jsi::Runtime& /*runtime*/) {
return ReactNativeFeatureFlags::useStateAlignmentMechanism();
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<<de8e0cd16d4190afde8280f67f6d92d8>>
* @generated SignedSource<<b42746e0a2c6e0611c8acc81502a0967>>
*/

/**
Expand Down Expand Up @@ -75,6 +75,8 @@ class NativeReactNativeFeatureFlags

bool useNativeViewConfigsInBridgelessMode(jsi::Runtime& runtime);

bool useRuntimeShadowNodeReferenceUpdate(jsi::Runtime& runtime);

bool useStateAlignmentMechanism(jsi::Runtime& runtime);
};

Expand Down
Loading