mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/42815 Feature flags were originally defined in a JSON file for easier interoperability but we're only using the definitions in JS anyway, so having the definitions in a JS file is more flexible (e.g.: adding comments). Changelog: [internal] Reviewed By: huntie Differential Revision: D53351483 fbshipit-source-id: 23fe0a3898b4facf2f2cf9645f78c45d78937f31
71 lines
1.9 KiB
C++
71 lines
1.9 KiB
C++
/*
|
|
* 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.
|
|
*
|
|
* @generated SignedSource<<c43f5dfe4a0e12da0595071319c91e63>>
|
|
*/
|
|
|
|
/**
|
|
* IMPORTANT: Do NOT modify this file directly.
|
|
*
|
|
* To change the definition of the flags, edit
|
|
* packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js.
|
|
*
|
|
* To regenerate this code, run the following script from the repo root:
|
|
* yarn featureflags-update
|
|
*/
|
|
|
|
#include "ReactNativeFeatureFlags.h"
|
|
|
|
namespace facebook::react {
|
|
|
|
bool ReactNativeFeatureFlags::commonTestFlag() {
|
|
return getAccessor().commonTestFlag();
|
|
}
|
|
|
|
bool ReactNativeFeatureFlags::useModernRuntimeScheduler() {
|
|
return getAccessor().useModernRuntimeScheduler();
|
|
}
|
|
|
|
bool ReactNativeFeatureFlags::enableMicrotasks() {
|
|
return getAccessor().enableMicrotasks();
|
|
}
|
|
|
|
bool ReactNativeFeatureFlags::batchRenderingUpdatesInEventLoop() {
|
|
return getAccessor().batchRenderingUpdatesInEventLoop();
|
|
}
|
|
|
|
bool ReactNativeFeatureFlags::enableSpannableBuildingUnification() {
|
|
return getAccessor().enableSpannableBuildingUnification();
|
|
}
|
|
|
|
bool ReactNativeFeatureFlags::enableCustomDrawOrderFabric() {
|
|
return getAccessor().enableCustomDrawOrderFabric();
|
|
}
|
|
|
|
bool ReactNativeFeatureFlags::enableFixForClippedSubviewsCrash() {
|
|
return getAccessor().enableFixForClippedSubviewsCrash();
|
|
}
|
|
|
|
void ReactNativeFeatureFlags::override(
|
|
std::unique_ptr<ReactNativeFeatureFlagsProvider> provider) {
|
|
getAccessor().override(std::move(provider));
|
|
}
|
|
|
|
void ReactNativeFeatureFlags::dangerouslyReset() {
|
|
getAccessor(true);
|
|
}
|
|
|
|
ReactNativeFeatureFlagsAccessor& ReactNativeFeatureFlags::getAccessor(
|
|
bool reset) {
|
|
static std::unique_ptr<ReactNativeFeatureFlagsAccessor> accessor;
|
|
if (accessor == nullptr || reset) {
|
|
accessor = std::make_unique<ReactNativeFeatureFlagsAccessor>();
|
|
}
|
|
return *accessor;
|
|
}
|
|
|
|
} // namespace facebook::react
|