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/48093 Changelog: [internal] We're going to add support for specifying feature flags in Fantom tests in pragmas. E.g.: ``` /** * fantom_flags commonTestFlag:true */ ``` Users will be able to specify any feature flags in their tests, so we need a way to pass that information from the test file to the runner, and the runner has to be able to apply this dynamic configuration. Because the API is statically typed in C++, we need to define a method for every possible feature flag configurable through this API. We could do it in userland, but we'd have to manually add a method every time there was a new feature flag we wanted to support. Instead of doing that, this introduces a new abstraction in the feature flag system that codegens it for you. The API is basically: ``` folly::dynamic values = folly::dynamic::object(); values["commonTestFlag"] = true; ReactNativeFeatureFlags::override( std::make_unique<ReactNativeFeatureFlagsDynamicProvider>(values)); EXPECT_EQ(ReactNativeFeatureFlags::commonTestFlag(), true); ``` Then we can use this abstraction in Fantom to pass all the configured flags as `folly::dynamic` through this API. Reviewed By: javache Differential Revision: D66760118 fbshipit-source-id: c32329e5ca76923c3e0b9c0eb1fe8c3268e1f57b
Where is the template?
The React Native Template has moved from being shipping inside the react-native package to it's own package: @react-native-community/template.
Why has it moved?
The React Native Frameworks RFC0759 provides background information.
When was it moved?
The 0.75 release.