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<<049cc0a1aa5ab53ad2ab11c359f49827>>
* @generated SignedSource<<4549fc9a4f431306b7dc70ef3903b8fd>>
*/

/**
Expand Down Expand Up @@ -504,6 +504,12 @@ public object ReactNativeFeatureFlags {
@JvmStatic
public fun viewCullingOutsetRatio(): Double = accessor.viewCullingOutsetRatio()

/**
* Enable the View Transition API for animating transitions between views.
*/
@JvmStatic
public fun viewTransitionEnabled(): Boolean = accessor.viewTransitionEnabled()

/**
* Initial prerender ratio for VirtualView.
*/
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<<6d1fc28e24576c1a63dceaa8c974cc1f>>
* @generated SignedSource<<0db6bbb173a96ab07c80a3fbe43671b3>>
*/

/**
Expand Down Expand Up @@ -99,6 +99,7 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
private var useTurboModuleInteropCache: Boolean? = null
private var useTurboModulesCache: Boolean? = null
private var viewCullingOutsetRatioCache: Double? = null
private var viewTransitionEnabledCache: Boolean? = null
private var virtualViewPrerenderRatioCache: Double? = null

override fun commonTestFlag(): Boolean {
Expand Down Expand Up @@ -812,6 +813,15 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
return cached
}

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

override fun virtualViewPrerenderRatio(): Double {
var cached = virtualViewPrerenderRatioCache
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<<26410c9e406969734991456f635be4af>>
* @generated SignedSource<<ec247759261e831159a6f7781bf44998>>
*/

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

@DoNotStrip @JvmStatic public external fun viewCullingOutsetRatio(): Double

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

@DoNotStrip @JvmStatic public external fun virtualViewPrerenderRatio(): Double

@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<<b088aaa5805b084d234c20bed0dec3ab>>
* @generated SignedSource<<102ac98a8c3f2c1a2150c223a099cf72>>
*/

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

override fun viewCullingOutsetRatio(): Double = 0.0

override fun viewTransitionEnabled(): Boolean = false

override fun virtualViewPrerenderRatio(): Double = 5.0
}
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<<ee633c2c40fc07aa6cbb5601dfb36cf6>>
* @generated SignedSource<<b7b29f2e01fd0bd43e6509587c862d31>>
*/

/**
Expand Down Expand Up @@ -103,6 +103,7 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
private var useTurboModuleInteropCache: Boolean? = null
private var useTurboModulesCache: Boolean? = null
private var viewCullingOutsetRatioCache: Double? = null
private var viewTransitionEnabledCache: Boolean? = null
private var virtualViewPrerenderRatioCache: Double? = null

override fun commonTestFlag(): Boolean {
Expand Down Expand Up @@ -895,6 +896,16 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
return cached
}

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

override fun virtualViewPrerenderRatio(): Double {
var cached = virtualViewPrerenderRatioCache
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<<fa7f50fd466b7cb65b208c0b0aaec704>>
* @generated SignedSource<<50f2ea7e87e80a247b6c6ce8e2afd0ec>>
*/

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

@DoNotStrip public fun viewCullingOutsetRatio(): Double

@DoNotStrip public fun viewTransitionEnabled(): Boolean

@DoNotStrip public fun virtualViewPrerenderRatio(): Double
}
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<<698b775afb6ad9295c181ea3d12118d3>>
* @generated SignedSource<<0460a8b25bfb176e47fb12dc091b1961>>
*/

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

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

double virtualViewPrerenderRatio() override {
static const auto method =
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jdouble()>("virtualViewPrerenderRatio");
Expand Down Expand Up @@ -918,6 +924,11 @@ double JReactNativeFeatureFlagsCxxInterop::viewCullingOutsetRatio(
return ReactNativeFeatureFlags::viewCullingOutsetRatio();
}

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

double JReactNativeFeatureFlagsCxxInterop::virtualViewPrerenderRatio(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
return ReactNativeFeatureFlags::virtualViewPrerenderRatio();
Expand Down Expand Up @@ -1191,6 +1202,9 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
makeNativeMethod(
"viewCullingOutsetRatio",
JReactNativeFeatureFlagsCxxInterop::viewCullingOutsetRatio),
makeNativeMethod(
"viewTransitionEnabled",
JReactNativeFeatureFlagsCxxInterop::viewTransitionEnabled),
makeNativeMethod(
"virtualViewPrerenderRatio",
JReactNativeFeatureFlagsCxxInterop::virtualViewPrerenderRatio),
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<<7be3a44c6ffc2c9d390f66902ef80d30>>
* @generated SignedSource<<88f40502abd13f8f57015429dd087519>>
*/

/**
Expand Down Expand Up @@ -267,6 +267,9 @@ class JReactNativeFeatureFlagsCxxInterop
static double viewCullingOutsetRatio(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);

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

static double virtualViewPrerenderRatio(
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<<88b22330e8486a820eb42b59fb7279e4>>
* @generated SignedSource<<d96b2f1e4083046cfc061317d117e762>>
*/

/**
Expand Down Expand Up @@ -342,6 +342,10 @@ double ReactNativeFeatureFlags::viewCullingOutsetRatio() {
return getAccessor().viewCullingOutsetRatio();
}

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

double ReactNativeFeatureFlags::virtualViewPrerenderRatio() {
return getAccessor().virtualViewPrerenderRatio();
}
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<<af0f34b904e1e555e18f186fb44ca089>>
* @generated SignedSource<<51a4817654c04c979a33f44e42312dd5>>
*/

/**
Expand Down Expand Up @@ -434,6 +434,11 @@ class ReactNativeFeatureFlags {
*/
RN_EXPORT static double viewCullingOutsetRatio();

/**
* Enable the View Transition API for animating transitions between views.
*/
RN_EXPORT static bool viewTransitionEnabled();

/**
* Initial prerender ratio for VirtualView.
*/
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<<65ca2267e4bd81dcc21f35bbfc880ba8>>
* @generated SignedSource<<fe15bc49fc0e101efb3f7a42f0c3312f>>
*/

/**
Expand Down Expand Up @@ -1451,6 +1451,24 @@ double ReactNativeFeatureFlagsAccessor::viewCullingOutsetRatio() {
return flagValue.value();
}

bool ReactNativeFeatureFlagsAccessor::viewTransitionEnabled() {
auto flagValue = viewTransitionEnabled_.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(79, "viewTransitionEnabled");

flagValue = currentProvider_->viewTransitionEnabled();
viewTransitionEnabled_ = flagValue;
}

return flagValue.value();
}

double ReactNativeFeatureFlagsAccessor::virtualViewPrerenderRatio() {
auto flagValue = virtualViewPrerenderRatio_.load();

Expand All @@ -1460,7 +1478,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(79, "virtualViewPrerenderRatio");
markFlagAsAccessed(80, "virtualViewPrerenderRatio");

flagValue = currentProvider_->virtualViewPrerenderRatio();
virtualViewPrerenderRatio_ = 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<<1aed21628664154ea7f66f15b1f760c2>>
* @generated SignedSource<<545708e361d01a42b3aef51ba71d646d>>
*/

/**
Expand Down Expand Up @@ -111,6 +111,7 @@ class ReactNativeFeatureFlagsAccessor {
bool useTurboModuleInterop();
bool useTurboModules();
double viewCullingOutsetRatio();
bool viewTransitionEnabled();
double virtualViewPrerenderRatio();

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

std::array<std::atomic<const char*>, 80> accessedFeatureFlags_;
std::array<std::atomic<const char*>, 81> accessedFeatureFlags_;

std::atomic<std::optional<bool>> commonTestFlag_;
std::atomic<std::optional<bool>> cdpInteractionMetricsEnabled_;
Expand Down Expand Up @@ -204,6 +205,7 @@ class ReactNativeFeatureFlagsAccessor {
std::atomic<std::optional<bool>> useTurboModuleInterop_;
std::atomic<std::optional<bool>> useTurboModules_;
std::atomic<std::optional<double>> viewCullingOutsetRatio_;
std::atomic<std::optional<bool>> viewTransitionEnabled_;
std::atomic<std::optional<double>> virtualViewPrerenderRatio_;
};

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<<f76c973356dda6266d01ed105c62572c>>
* @generated SignedSource<<777478fa4d8beba140a30edb68cc34d9>>
*/

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

bool viewTransitionEnabled() override {
return false;
}

double virtualViewPrerenderRatio() override {
return 5.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<<c4c17217a988345ecea40923a944712b>>
* @generated SignedSource<<55247339124401e105501f3d9d3b5b92>>
*/

/**
Expand Down Expand Up @@ -756,6 +756,15 @@ class ReactNativeFeatureFlagsDynamicProvider : public ReactNativeFeatureFlagsDef
return ReactNativeFeatureFlagsDefaults::viewCullingOutsetRatio();
}

bool viewTransitionEnabled() override {
auto value = values_["viewTransitionEnabled"];
if (!value.isNull()) {
return value.getBool();
}

return ReactNativeFeatureFlagsDefaults::viewTransitionEnabled();
}

double virtualViewPrerenderRatio() override {
auto value = values_["virtualViewPrerenderRatio"];
if (!value.isNull()) {
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<<0308cb63246c4576859383adc3cc9593>>
* @generated SignedSource<<05c9d90f759f2a6116219a1e61eeee82>>
*/

/**
Expand Down Expand Up @@ -104,6 +104,7 @@ class ReactNativeFeatureFlagsProvider {
virtual bool useTurboModuleInterop() = 0;
virtual bool useTurboModules() = 0;
virtual double viewCullingOutsetRatio() = 0;
virtual bool viewTransitionEnabled() = 0;
virtual double virtualViewPrerenderRatio() = 0;
};

Expand Down
Loading
Loading