Files
react-native/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp
T
Rubén NorteandFacebook GitHub Bot 5030f4e015 Move feature flag definitions to JS file instead of JSON (#42815)
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
2024-02-05 11:02:48 -08:00

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