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 @@ -91,7 +91,7 @@ target_link_libraries(
${
libraryName !== 'rncore'
? 'reactnative'
: 'folly_runtime glog react_debug react_nativemodule_core react_render_componentregistry react_render_core react_render_debug react_render_graphics react_render_imagemanager react_render_mapbuffer react_utils rrc_image rrc_view turbomodulejsijni yoga'
: 'folly_runtime glog react_debug react_nativemodule_core react_renderer_componentregistry react_renderer_core react_renderer_debug react_renderer_graphics react_renderer_imagemanager react_renderer_mapbuffer react_utils rrc_image rrc_view turbomodulejsijni yoga'
}
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* @format
*/

import * as ReactNativeFeatureFlags from '../../src/private/featureflags/ReactNativeFeatureFlags';
import {type ViewConfig} from '../Renderer/shims/ReactNativeTypes';

export type Difference =
Expand Down Expand Up @@ -128,7 +129,10 @@ function accumulateDifferences(
}
}

if (nativeValue !== staticValue) {
if (
nativeValue !== staticValue &&
!ReactNativeFeatureFlags.enableNativeCSSParsing()
) {
differences.push({
path: [...path, nativeKey],
type: 'unequal',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,14 @@
* @oncall react_native
*/

import * as ReactNativeFeatureFlags from '../../../src/private/featureflags/ReactNativeFeatureFlags';
import * as StaticViewConfigValidator from '../StaticViewConfigValidator';

beforeAll(() => {
// $FlowExpectedError[cannot-write]
ReactNativeFeatureFlags.enableNativeCSSParsing = () => false;
});

test('passes for identical configs', () => {
const name = 'RCTView';
const nativeViewConfig = {
Expand Down
24 changes: 12 additions & 12 deletions packages/react-native/ReactAndroid/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -111,37 +111,37 @@ val preparePrefab by
Pair(
"../ReactCommon/react/devtoolsruntimesettings/",
"react/devtoolsruntimesettings/"),
// react_render_animations
// react_renderer_animations
Pair(
"../ReactCommon/react/renderer/animations/",
"react/renderer/animations/"),
// react_render_componentregistry
// react_renderer_componentregistry
Pair(
"../ReactCommon/react/renderer/componentregistry/",
"react/renderer/componentregistry/"),
// react_render_consistency
// react_renderer_consistency
Pair(
"../ReactCommon/react/renderer/consistency/",
"react/renderer/consistency/"),
// react_render_core
// react_renderer_core
Pair("../ReactCommon/react/renderer/core/", "react/renderer/core/"),
// react_debug
Pair("../ReactCommon/react/debug/", "react/debug/"),
// react_render_debug
// react_renderer_debug
Pair("../ReactCommon/react/renderer/debug/", "react/renderer/debug/"),
// react_render_graphics
// react_renderer_graphics
Pair("../ReactCommon/react/renderer/graphics/", "react/renderer/graphics/"),
Pair("../ReactCommon/react/renderer/graphics/platform/android/", ""),
// react_render_imagemanager
// react_renderer_imagemanager
Pair(
"../ReactCommon/react/renderer/imagemanager/",
"react/renderer/imagemanager/"),
Pair("../ReactCommon/react/renderer/imagemanager/platform/cxx/", ""),
// react_render_mounting
// react_renderer_mounting
Pair("../ReactCommon/react/renderer/mounting/", "react/renderer/mounting/"),
// react_render_scheduler
// react_renderer_scheduler
Pair("../ReactCommon/react/renderer/scheduler/", "react/renderer/scheduler/"),
// react_render_uimanager
// react_renderer_uimanager
Pair("../ReactCommon/react/renderer/uimanager/", "react/renderer/uimanager/"),
// react_utils
Pair("../ReactCommon/react/utils/", "react/utils/"),
Expand All @@ -160,7 +160,7 @@ val preparePrefab by
"react/renderer/components/root/"),
// runtimeexecutor
Pair("../ReactCommon/runtimeexecutor/", ""),
// react_render_textlayoutmanager
// react_renderer_textlayoutmanager
Pair(
"../ReactCommon/react/renderer/textlayoutmanager/",
"react/renderer/textlayoutmanager/"),
Expand Down Expand Up @@ -221,7 +221,7 @@ val preparePrefab by
Pair(
"../ReactCommon/react/performance/timeline/",
"react/performance/timeline/"),
// react_render_observers_events
// react_renderer_observers_events
Pair(
"../ReactCommon/react/renderer/observers/events/",
"react/renderer/observers/events/"),
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<<9b03da2a06054bb69a000da22820b3d3>>
* @generated SignedSource<<60990f71a42269290b741cd9072d21fe>>
*/

/**
Expand Down Expand Up @@ -124,6 +124,12 @@ public object ReactNativeFeatureFlags {
@JvmStatic
public fun enableLongTaskAPI(): Boolean = accessor.enableLongTaskAPI()

/**
* Parse CSS strings using the Fabric CSS parser instead of ViewConfig processing
*/
@JvmStatic
public fun enableNativeCSSParsing(): Boolean = accessor.enableNativeCSSParsing()

/**
* Use BackgroundDrawable and BorderDrawable instead of CSSBackgroundDrawable
*/
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<<6c4aec34882502876bab914f81758f4f>>
* @generated SignedSource<<697f62ac96b2b28d64659cd77007a59b>>
*/

/**
Expand Down Expand Up @@ -36,6 +36,7 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
private var enableLayoutAnimationsOnAndroidCache: Boolean? = null
private var enableLayoutAnimationsOnIOSCache: Boolean? = null
private var enableLongTaskAPICache: Boolean? = null
private var enableNativeCSSParsingCache: Boolean? = null
private var enableNewBackgroundAndBorderDrawablesCache: Boolean? = null
private var enablePreciseSchedulingForPremountItemsOnAndroidCache: Boolean? = null
private var enablePropsUpdateReconciliationAndroidCache: Boolean? = null
Expand Down Expand Up @@ -207,6 +208,15 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
return cached
}

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

override fun enableNewBackgroundAndBorderDrawables(): Boolean {
var cached = enableNewBackgroundAndBorderDrawablesCache
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<<ca2bdc1f77774cd424f43430f7e59c2d>>
* @generated SignedSource<<9e28e6e3e2e7ef27761e3410ea4613a4>>
*/

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

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

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

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

@DoNotStrip @JvmStatic public external fun enablePreciseSchedulingForPremountItemsOnAndroid(): Boolean
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<<0a7b92a63576665376f0c3deaed210ab>>
* @generated SignedSource<<6db30b8e6ac5778ae5ff333a12c6c17d>>
*/

/**
Expand Down Expand Up @@ -55,6 +55,8 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi

override fun enableLongTaskAPI(): Boolean = false

override fun enableNativeCSSParsing(): Boolean = false

override fun enableNewBackgroundAndBorderDrawables(): Boolean = false

override fun enablePreciseSchedulingForPremountItemsOnAndroid(): Boolean = false
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<<674940401c20b6c88d8616890d8f5116>>
* @generated SignedSource<<a3e5efb627b5821c18833184e1399303>>
*/

/**
Expand Down Expand Up @@ -40,6 +40,7 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
private var enableLayoutAnimationsOnAndroidCache: Boolean? = null
private var enableLayoutAnimationsOnIOSCache: Boolean? = null
private var enableLongTaskAPICache: Boolean? = null
private var enableNativeCSSParsingCache: Boolean? = null
private var enableNewBackgroundAndBorderDrawablesCache: Boolean? = null
private var enablePreciseSchedulingForPremountItemsOnAndroidCache: Boolean? = null
private var enablePropsUpdateReconciliationAndroidCache: Boolean? = null
Expand Down Expand Up @@ -227,6 +228,16 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
return cached
}

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

override fun enableNewBackgroundAndBorderDrawables(): Boolean {
var cached = enableNewBackgroundAndBorderDrawablesCache
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<<5736c271e7289f1f621672d1340426b7>>
* @generated SignedSource<<7fb143a0fdf58bc1242ae076cf275037>>
*/

/**
Expand Down Expand Up @@ -55,6 +55,8 @@ public interface ReactNativeFeatureFlagsProvider {

@DoNotStrip public fun enableLongTaskAPI(): Boolean

@DoNotStrip public fun enableNativeCSSParsing(): Boolean

@DoNotStrip public fun enableNewBackgroundAndBorderDrawables(): Boolean

@DoNotStrip public fun enablePreciseSchedulingForPremountItemsOnAndroid(): Boolean
Expand Down
108 changes: 54 additions & 54 deletions packages/react-native/ReactAndroid/src/main/jni/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -181,26 +181,26 @@ add_library(reactnative
$<TARGET_OBJECTS:react_nativemodule_microtasks>
$<TARGET_OBJECTS:react_newarchdefaults>
$<TARGET_OBJECTS:react_performance_timeline>
$<TARGET_OBJECTS:react_render_animations>
$<TARGET_OBJECTS:react_render_attributedstring>
$<TARGET_OBJECTS:react_render_componentregistry>
$<TARGET_OBJECTS:react_render_consistency>
$<TARGET_OBJECTS:react_render_core>
$<TARGET_OBJECTS:react_render_debug>
$<TARGET_OBJECTS:react_render_dom>
$<TARGET_OBJECTS:react_render_element>
$<TARGET_OBJECTS:react_render_graphics>
$<TARGET_OBJECTS:react_render_imagemanager>
$<TARGET_OBJECTS:react_render_leakchecker>
$<TARGET_OBJECTS:react_render_mapbuffer>
$<TARGET_OBJECTS:react_render_mounting>
$<TARGET_OBJECTS:react_render_observers_events>
$<TARGET_OBJECTS:react_render_runtimescheduler>
$<TARGET_OBJECTS:react_render_scheduler>
$<TARGET_OBJECTS:react_render_telemetry>
$<TARGET_OBJECTS:react_render_textlayoutmanager>
$<TARGET_OBJECTS:react_render_uimanager>
$<TARGET_OBJECTS:react_render_uimanager_consistency>
$<TARGET_OBJECTS:react_renderer_animations>
$<TARGET_OBJECTS:react_renderer_attributedstring>
$<TARGET_OBJECTS:react_renderer_componentregistry>
$<TARGET_OBJECTS:react_renderer_consistency>
$<TARGET_OBJECTS:react_renderer_core>
$<TARGET_OBJECTS:react_renderer_debug>
$<TARGET_OBJECTS:react_renderer_dom>
$<TARGET_OBJECTS:react_renderer_element>
$<TARGET_OBJECTS:react_renderer_graphics>
$<TARGET_OBJECTS:react_renderer_imagemanager>
$<TARGET_OBJECTS:react_renderer_leakchecker>
$<TARGET_OBJECTS:react_renderer_mapbuffer>
$<TARGET_OBJECTS:react_renderer_mounting>
$<TARGET_OBJECTS:react_renderer_observers_events>
$<TARGET_OBJECTS:react_renderer_runtimescheduler>
$<TARGET_OBJECTS:react_renderer_scheduler>
$<TARGET_OBJECTS:react_renderer_telemetry>
$<TARGET_OBJECTS:react_renderer_textlayoutmanager>
$<TARGET_OBJECTS:react_renderer_uimanager>
$<TARGET_OBJECTS:react_renderer_uimanager_consistency>
$<TARGET_OBJECTS:react_utils>
$<TARGET_OBJECTS:reactnativeblob>
$<TARGET_OBJECTS:reactnativejni>
Expand Down Expand Up @@ -264,27 +264,27 @@ target_include_directories(reactnative
$<TARGET_PROPERTY:react_nativemodule_microtasks,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:react_newarchdefaults,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:react_performance_timeline,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:react_render_animations,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:react_render_attributedstring,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:react_render_componentregistry,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:react_render_componentregistry,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:react_render_consistency,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:react_render_core,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:react_render_debug,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:react_render_dom,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:react_render_element,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:react_render_graphics,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:react_render_imagemanager,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:react_render_leakchecker,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:react_render_mapbuffer,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:react_render_mounting,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:react_render_observers_events,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:react_render_runtimescheduler,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:react_render_scheduler,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:react_render_telemetry,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:react_render_textlayoutmanager,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:react_render_uimanager,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:react_render_uimanager_consistency,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:react_renderer_animations,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:react_renderer_attributedstring,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:react_renderer_componentregistry,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:react_renderer_componentregistry,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:react_renderer_consistency,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:react_renderer_core,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:react_renderer_debug,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:react_renderer_dom,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:react_renderer_element,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:react_renderer_graphics,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:react_renderer_imagemanager,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:react_renderer_leakchecker,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:react_renderer_mapbuffer,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:react_renderer_mounting,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:react_renderer_observers_events,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:react_renderer_runtimescheduler,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:react_renderer_scheduler,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:react_renderer_telemetry,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:react_renderer_textlayoutmanager,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:react_renderer_uimanager,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:react_renderer_uimanager_consistency,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:react_utils,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:reactnativeblob,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:reactnativejni,INTERFACE_INCLUDE_DIRECTORIES>
Expand Down Expand Up @@ -378,19 +378,19 @@ target_link_libraries(reactnative_unittest
react_codegen_rncore
react_cxxreact
react_debug
react_render_animations
react_render_attributedstring
react_render_core
react_render_debug
react_render_dom
react_render_element
react_render_graphics
react_render_mapbuffer
react_render_mounting
react_render_telemetry
react_render_textlayoutmanager
react_render_uimanager
react_render_uimanager_consistency
react_renderer_animations
react_renderer_attributedstring
react_renderer_core
react_renderer_debug
react_renderer_dom
react_renderer_element
react_renderer_graphics
react_renderer_mapbuffer
react_renderer_mounting
react_renderer_telemetry
react_renderer_textlayoutmanager
react_renderer_uimanager
react_renderer_uimanager_consistency
react_utils
reactnative
rrc_legacyviewmanagerinterop
Expand Down
Loading
Loading