Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

delete state alignment mechanism #46658

Closed
wants to merge 1 commit into from
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<<70e68165b567734a2609b77656b2c183>>
* @generated SignedSource<<346573dc832f9de6a2e29a4cfde558c5>>
*/

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

/**
* When enabled, it uses optimised state reconciliation algorithm.
*/
@JvmStatic
public fun useStateAlignmentMechanism(): Boolean = accessor.useStateAlignmentMechanism()

/**
* In Bridgeless mode, should legacy NativeModules use the TurboModule system?
*/
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<<2f8da8585f1ac040bd26953263b08392>>
* @generated SignedSource<<71fd4a070f4eb1429f38221e34135062>>
*/

/**
Expand Down Expand Up @@ -70,7 +70,6 @@ public class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAccesso
private var useOptimizedEventBatchingOnAndroidCache: Boolean? = null
private var useRuntimeShadowNodeReferenceUpdateCache: Boolean? = null
private var useRuntimeShadowNodeReferenceUpdateOnLayoutCache: Boolean? = null
private var useStateAlignmentMechanismCache: Boolean? = null
private var useTurboModuleInteropCache: Boolean? = null
private var useTurboModulesCache: Boolean? = null

Expand Down Expand Up @@ -524,15 +523,6 @@ public class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAccesso
return cached
}

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

override fun useTurboModuleInterop(): Boolean {
var cached = useTurboModuleInteropCache
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<<4055cd2fa9070549fba3eda675e8d6f6>>
* @generated SignedSource<<c35eeb0695671be65b1543ea0664468b>>
*/

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

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

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

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

@DoNotStrip @JvmStatic public external fun useTurboModules(): 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<<340a2b27d0a0281746e3f4b02be5e1bb>>
* @generated SignedSource<<e1352f772c20f824f636f1f73a541444>>
*/

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

override fun useRuntimeShadowNodeReferenceUpdateOnLayout(): Boolean = false

override fun useStateAlignmentMechanism(): Boolean = false

override fun useTurboModuleInterop(): Boolean = false

override fun useTurboModules(): 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<<bb25a0d771f0f129ab3f224640053ac3>>
* @generated SignedSource<<0d8f65a06ed20f44e5de58b764635602>>
*/

/**
Expand Down Expand Up @@ -74,7 +74,6 @@ public class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcces
private var useOptimizedEventBatchingOnAndroidCache: Boolean? = null
private var useRuntimeShadowNodeReferenceUpdateCache: Boolean? = null
private var useRuntimeShadowNodeReferenceUpdateOnLayoutCache: Boolean? = null
private var useStateAlignmentMechanismCache: Boolean? = null
private var useTurboModuleInteropCache: Boolean? = null
private var useTurboModulesCache: Boolean? = null

Expand Down Expand Up @@ -578,16 +577,6 @@ public class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcces
return cached
}

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

override fun useTurboModuleInterop(): Boolean {
var cached = useTurboModuleInteropCache
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<<509b61021c01bf47c54724bc9ba81c9c>>
* @generated SignedSource<<6d70976da58a1120c79704210899b893>>
*/

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

@DoNotStrip public fun useRuntimeShadowNodeReferenceUpdateOnLayout(): Boolean

@DoNotStrip public fun useStateAlignmentMechanism(): Boolean

@DoNotStrip public fun useTurboModuleInterop(): Boolean

@DoNotStrip public fun useTurboModules(): 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<<8b39b99e91976d5bf63956e6501e180f>>
* @generated SignedSource<<1f027e4e66bce1536fb259a547bb6a00>>
*/

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

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

bool useTurboModuleInterop() override {
static const auto method =
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("useTurboModuleInterop");
Expand Down Expand Up @@ -611,11 +605,6 @@ bool JReactNativeFeatureFlagsCxxInterop::useRuntimeShadowNodeReferenceUpdateOnLa
return ReactNativeFeatureFlags::useRuntimeShadowNodeReferenceUpdateOnLayout();
}

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

bool JReactNativeFeatureFlagsCxxInterop::useTurboModuleInterop(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
return ReactNativeFeatureFlags::useTurboModuleInterop();
Expand Down Expand Up @@ -793,9 +782,6 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
makeNativeMethod(
"useRuntimeShadowNodeReferenceUpdateOnLayout",
JReactNativeFeatureFlagsCxxInterop::useRuntimeShadowNodeReferenceUpdateOnLayout),
makeNativeMethod(
"useStateAlignmentMechanism",
JReactNativeFeatureFlagsCxxInterop::useStateAlignmentMechanism),
makeNativeMethod(
"useTurboModuleInterop",
JReactNativeFeatureFlagsCxxInterop::useTurboModuleInterop),
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<<896ca4611f7fa5de92279fbbf2095e3e>>
* @generated SignedSource<<b99b1f3a29b875f4c456f77a276f4db3>>
*/

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

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

static bool useTurboModuleInterop(
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<<6e2b92ee7e4fb51de5286792004f649d>>
* @generated SignedSource<<4efee607ab3716723debee8a451604ef>>
*/

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

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

bool ReactNativeFeatureFlags::useTurboModuleInterop() {
return getAccessor().useTurboModuleInterop();
}
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<<646023269f07d6ae792b8aad5ef2d3c1>>
* @generated SignedSource<<d2afeedcfb81ca31bd7f0c19fd406ae6>>
*/

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

/**
* When enabled, it uses optimised state reconciliation algorithm.
*/
RN_EXPORT static bool useStateAlignmentMechanism();

/**
* In Bridgeless mode, should legacy NativeModules use the TurboModule system?
*/
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<<e35262c26447dec6e71e20f6a4fd8984>>
* @generated SignedSource<<1bbb59bff4ce77b34ee94d0a2095d71f>>
*/

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

bool ReactNativeFeatureFlagsAccessor::useStateAlignmentMechanism() {
auto flagValue = useStateAlignmentMechanism_.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(50, "useStateAlignmentMechanism");

flagValue = currentProvider_->useStateAlignmentMechanism();
useStateAlignmentMechanism_ = flagValue;
}

return flagValue.value();
}

bool ReactNativeFeatureFlagsAccessor::useTurboModuleInterop() {
auto flagValue = useTurboModuleInterop_.load();

Expand All @@ -956,7 +938,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(51, "useTurboModuleInterop");
markFlagAsAccessed(50, "useTurboModuleInterop");

flagValue = currentProvider_->useTurboModuleInterop();
useTurboModuleInterop_ = flagValue;
Expand All @@ -974,7 +956,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(52, "useTurboModules");
markFlagAsAccessed(51, "useTurboModules");

flagValue = currentProvider_->useTurboModules();
useTurboModules_ = 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<<261b4e8fae45ad2780f0bd2b17c86d5c>>
* @generated SignedSource<<5c64457d2fbe154d7e57b3e3e2e6a33a>>
*/

/**
Expand Down Expand Up @@ -81,7 +81,6 @@ class ReactNativeFeatureFlagsAccessor {
bool useOptimizedEventBatchingOnAndroid();
bool useRuntimeShadowNodeReferenceUpdate();
bool useRuntimeShadowNodeReferenceUpdateOnLayout();
bool useStateAlignmentMechanism();
bool useTurboModuleInterop();
bool useTurboModules();

Expand All @@ -94,7 +93,7 @@ class ReactNativeFeatureFlagsAccessor {
std::unique_ptr<ReactNativeFeatureFlagsProvider> currentProvider_;
bool wasOverridden_;

std::array<std::atomic<const char*>, 53> accessedFeatureFlags_;
std::array<std::atomic<const char*>, 52> accessedFeatureFlags_;

std::atomic<std::optional<bool>> commonTestFlag_;
std::atomic<std::optional<bool>> allowRecursiveCommitsWithSynchronousMountOnAndroid_;
Expand Down Expand Up @@ -146,7 +145,6 @@ class ReactNativeFeatureFlagsAccessor {
std::atomic<std::optional<bool>> useOptimizedEventBatchingOnAndroid_;
std::atomic<std::optional<bool>> useRuntimeShadowNodeReferenceUpdate_;
std::atomic<std::optional<bool>> useRuntimeShadowNodeReferenceUpdateOnLayout_;
std::atomic<std::optional<bool>> useStateAlignmentMechanism_;
std::atomic<std::optional<bool>> useTurboModuleInterop_;
std::atomic<std::optional<bool>> useTurboModules_;
};
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<<c08358e66009eff69107a684681feba9>>
* @generated SignedSource<<001d0b39664b190385442ca8661a08a8>>
*/

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

bool useStateAlignmentMechanism() override {
return false;
}

bool useTurboModuleInterop() 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<<eca1f4ea2447e754c5cfa8998c2e7903>>
* @generated SignedSource<<ddd6b6977c8ee0e40d710947b4a23c3c>>
*/

/**
Expand Down Expand Up @@ -75,7 +75,6 @@ class ReactNativeFeatureFlagsProvider {
virtual bool useOptimizedEventBatchingOnAndroid() = 0;
virtual bool useRuntimeShadowNodeReferenceUpdate() = 0;
virtual bool useRuntimeShadowNodeReferenceUpdateOnLayout() = 0;
virtual bool useStateAlignmentMechanism() = 0;
virtual bool useTurboModuleInterop() = 0;
virtual bool useTurboModules() = 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<<cfb1dc3fb447f3e4b014533a757e6c23>>
* @generated SignedSource<<74bbe88f1a61cca088a504bb2a1bc19c>>
*/

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

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

bool NativeReactNativeFeatureFlags::useTurboModuleInterop(
jsi::Runtime& /*runtime*/) {
return ReactNativeFeatureFlags::useTurboModuleInterop();
Expand Down
Loading
Loading