From 577582e2303baa0ffce15e95cc406cf32cb5ceaa Mon Sep 17 00:00:00 2001 From: Joshua Gross Date: Wed, 15 Jun 2022 23:37:34 -0700 Subject: [PATCH] Hook up CPP props parsing and Android ViewRecycling feature flags on Android Summary: Hook up feature flags. Changelog: [Internal] Reviewed By: cortinico, ryancat Differential Revision: D37166366 fbshipit-source-id: 440acba9ee85a9ced64cd880d915044de7619584 --- .../com/facebook/react/config/ReactFeatureFlags.java | 5 +++++ .../java/com/facebook/react/fabric/jni/Binding.cpp | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java b/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java index b0d953a786866e..3bc6ed6cfc009e 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java +++ b/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java @@ -130,4 +130,9 @@ public class ReactFeatureFlags { * Feature Flag to enable View Recycling. When enabled, individual ViewManagers must still opt-in. */ public static boolean enableViewRecycling = false; + + /** + * Enable prop iterator setter-style construction of Props in C++ (this flag is not used in Java). + */ + public static boolean enableCppPropsIteratorSetter = false; } diff --git a/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Binding.cpp b/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Binding.cpp index 9957bfebdb947e..f8448b5a3f2e31 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Binding.cpp +++ b/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Binding.cpp @@ -32,6 +32,9 @@ #include #include +// Included to set BaseTextProps config; can be deleted later. +#include + #include using namespace facebook::jni; @@ -441,6 +444,13 @@ void Binding::installFabricUIManager( "EnableLargeTextMeasureCache", getFeatureFlagValue("enableLargeTextMeasureCache")); + // Props setter pattern feature + Props::enablePropIteratorSetter = + getFeatureFlagValue("enableCppPropsIteratorSetter"); + AccessibilityProps::enablePropIteratorSetter = + Props::enablePropIteratorSetter; + BaseTextProps::enablePropIteratorSetter = Props::enablePropIteratorSetter; + auto toolbox = SchedulerToolbox{}; toolbox.contextContainer = contextContainer; toolbox.componentRegistryFactory = componentsRegistry->buildRegistryFunction;