Skip to content
Merged
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
11 changes: 10 additions & 1 deletion packages/react-native/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,13 @@ let reactIntersectionObserverNativeModule = RNTarget(
dependencies: [.reactNativeDependencies, .reactCxxReact, .reactFabric, .reactTurboModuleBridging, .reactTurboModuleCore, .reactGraphics, .reactGraphicsApple, .reactRuntimeScheduler, .yoga]
)

/// React-mutationobservernativemodule.podspec
let reactMutationObserverNativeModule = RNTarget(
name: .reactMutationObserverNativeModule,
path: "ReactCommon/react/nativemodule/mutationobserver",
dependencies: [.reactNativeDependencies, .reactCxxReact, .reactFabric, .reactTurboModuleBridging, .reactTurboModuleCore, .yoga]
)

/// React-featureflagnativemodule.podspec
let reactFeatureflagsNativemodule = RNTarget(
name: .reactFeatureflagsNativemodule,
Expand Down Expand Up @@ -463,7 +470,7 @@ let reactFabric = RNTarget(
"components/root/tests",
],
dependencies: [.reactNativeDependencies, .reactJsiExecutor, .rctTypesafety, .reactTurboModuleCore, .jsi, .logger, .reactDebug, .reactFeatureFlags, .reactUtils, .reactRuntimeScheduler, .reactCxxReact, .reactRendererDebug, .reactGraphics, .yoga],
sources: ["animations", "attributedstring", "core", "componentregistry", "componentregistry/native", "components/root", "components/view", "components/view/platform/cxx", "components/scrollview", "components/scrollview/platform/cxx", "components/legacyviewmanagerinterop", "dom", "scheduler", "mounting", "observers/events", "observers/intersection", "telemetry", "consistency", "leakchecker", "uimanager", "uimanager/consistency"]
sources: ["animations", "attributedstring", "core", "componentregistry", "componentregistry/native", "components/root", "components/view", "components/view/platform/cxx", "components/scrollview", "components/scrollview/platform/cxx", "components/legacyviewmanagerinterop", "dom", "scheduler", "mounting", "observers/events", "observers/intersection", "observers/mutation", "telemetry", "consistency", "leakchecker", "uimanager", "uimanager/consistency"]
)

let reactFabricInputAccessory = RNTarget(
Expand Down Expand Up @@ -699,6 +706,7 @@ let targets = [
reactIdleCallbacksNativeModule,
reactWebPerformanceNativeModule,
reactIntersectionObserverNativeModule,
reactMutationObserverNativeModule,
reactFeatureflagsNativemodule,
reactNativeModuleDom,
reactAppDelegate,
Expand Down Expand Up @@ -887,6 +895,7 @@ extension String {
static let reactIdleCallbacksNativeModule = "React-idlecallbacksnativemodule"
static let reactWebPerformanceNativeModule = "React-webperformancenativemodule"
static let reactIntersectionObserverNativeModule = "React-intersectionobservernativemodule"
static let reactMutationObserverNativeModule = "React-mutationobservernativemodule"
static let reactFeatureflagsNativemodule = "React-featureflagsnativemodule"
static let reactNativeModuleDom = "React-domnativemodule"
static let reactAppDelegate = "React-RCTAppDelegate"
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<<26dfce17f8149372c967e83a1e55b497>>
* @generated SignedSource<<b700a02133f84260647574d2f7a0f165>>
*/

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

/**
* Enables the MutationObserver Web API in React Native.
*/
@JvmStatic
public fun enableMutationObserverByDefault(): Boolean = accessor.enableMutationObserverByDefault()

/**
* Parse CSS strings using the Fabric CSS parser instead of ViewConfig processing
*/
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<<7523b02820a1f77c0a851ed051770f51>>
* @generated SignedSource<<d9309c7f772c314b78b329e5d1ad7216>>
*/

/**
Expand Down Expand Up @@ -56,6 +56,7 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
private var enableLayoutAnimationsOnIOSCache: Boolean? = null
private var enableMainQueueCoordinatorOnIOSCache: Boolean? = null
private var enableModuleArgumentNSNullConversionIOSCache: Boolean? = null
private var enableMutationObserverByDefaultCache: Boolean? = null
private var enableNativeCSSParsingCache: Boolean? = null
private var enableNetworkEventReportingCache: Boolean? = null
private var enablePreparedTextLayoutCache: Boolean? = null
Expand Down Expand Up @@ -434,6 +435,15 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
return cached
}

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

override fun enableNativeCSSParsing(): Boolean {
var cached = enableNativeCSSParsingCache
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<<0fa0febd40941c466222d1af82f677cf>>
* @generated SignedSource<<1081d2d4673967a11e8f9ac287c89f02>>
*/

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

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

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

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

@DoNotStrip @JvmStatic public external fun enableNetworkEventReporting(): 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<<9158a8f1750ec5e9e530399fe09f52cf>>
* @generated SignedSource<<bc4cd6eafbf14cd91755900db1956238>>
*/

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

override fun enableModuleArgumentNSNullConversionIOS(): Boolean = false

override fun enableMutationObserverByDefault(): Boolean = false

override fun enableNativeCSSParsing(): Boolean = false

override fun enableNetworkEventReporting(): Boolean = true
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<<9feb91e31a7d54e4b3f7737fb524800b>>
* @generated SignedSource<<6deac57c7f55d6d7406f7dffb1abe487>>
*/

/**
Expand Down Expand Up @@ -60,6 +60,7 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
private var enableLayoutAnimationsOnIOSCache: Boolean? = null
private var enableMainQueueCoordinatorOnIOSCache: Boolean? = null
private var enableModuleArgumentNSNullConversionIOSCache: Boolean? = null
private var enableMutationObserverByDefaultCache: Boolean? = null
private var enableNativeCSSParsingCache: Boolean? = null
private var enableNetworkEventReportingCache: Boolean? = null
private var enablePreparedTextLayoutCache: Boolean? = null
Expand Down Expand Up @@ -474,6 +475,16 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
return cached
}

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

override fun enableNativeCSSParsing(): Boolean {
var cached = enableNativeCSSParsingCache
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<<5425bfe01cb2aaecc61b65b8c2f7dad0>>
* @generated SignedSource<<99e9d1149773ffdb867c2abed02b0302>>
*/

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

@DoNotStrip public fun enableModuleArgumentNSNullConversionIOS(): Boolean

@DoNotStrip public fun enableMutationObserverByDefault(): Boolean

@DoNotStrip public fun enableNativeCSSParsing(): Boolean

@DoNotStrip public fun enableNetworkEventReporting(): Boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ add_react_common_subdir(react/renderer/components/safeareaview)
add_react_common_subdir(react/renderer/leakchecker)
add_react_common_subdir(react/renderer/observers/events)
add_react_common_subdir(react/renderer/observers/intersection)
add_react_common_subdir(react/renderer/observers/mutation)
add_react_common_subdir(react/renderer/textlayoutmanager)
add_react_common_subdir(react/utils)
add_react_common_subdir(react/bridging)
Expand All @@ -126,6 +127,7 @@ add_react_common_subdir(react/nativemodule/featureflags)
add_react_common_subdir(react/nativemodule/microtasks)
add_react_common_subdir(react/nativemodule/idlecallbacks)
add_react_common_subdir(react/nativemodule/intersectionobserver)
add_react_common_subdir(react/nativemodule/mutationobserver)
add_react_common_subdir(react/nativemodule/webperformance)
add_react_common_subdir(react/networking)
add_react_common_subdir(jserrorhandler)
Expand Down Expand Up @@ -195,6 +197,7 @@ add_library(reactnative
$<TARGET_OBJECTS:react_nativemodule_idlecallbacks>
$<TARGET_OBJECTS:react_nativemodule_intersectionobserver>
$<TARGET_OBJECTS:react_nativemodule_microtasks>
$<TARGET_OBJECTS:react_nativemodule_mutationobserver>
$<TARGET_OBJECTS:react_nativemodule_webperformance>
$<TARGET_OBJECTS:react_networking>
$<TARGET_OBJECTS:react_newarchdefaults>
Expand All @@ -215,6 +218,7 @@ add_library(reactnative
$<TARGET_OBJECTS:react_renderer_mounting>
$<TARGET_OBJECTS:react_renderer_observers_events>
$<TARGET_OBJECTS:react_renderer_observers_intersection>
$<TARGET_OBJECTS:react_renderer_observers_mutation>
$<TARGET_OBJECTS:react_renderer_runtimescheduler>
$<TARGET_OBJECTS:react_renderer_scheduler>
$<TARGET_OBJECTS:react_renderer_telemetry>
Expand Down Expand Up @@ -288,6 +292,7 @@ target_include_directories(reactnative
$<TARGET_PROPERTY:react_nativemodule_idlecallbacks,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:react_nativemodule_intersectionobserver,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:react_nativemodule_microtasks,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:react_nativemodule_mutationobserver,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:react_nativemodule_webperformance,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:react_networking,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:react_newarchdefaults,INTERFACE_INCLUDE_DIRECTORIES>
Expand All @@ -309,6 +314,8 @@ target_include_directories(reactnative
$<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_observers_intersection,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:react_renderer_observers_mutation,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>
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<<986de1b799ad8bc22a323365aef3533b>>
* @generated SignedSource<<9e684659117f413b92bcd0469fae37ba>>
*/

/**
Expand Down Expand Up @@ -255,6 +255,12 @@ class ReactNativeFeatureFlagsJavaProvider
return method(javaProvider_);
}

bool enableMutationObserverByDefault() override {
static const auto method =
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("enableMutationObserverByDefault");
return method(javaProvider_);
}

bool enableNativeCSSParsing() override {
static const auto method =
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("enableNativeCSSParsing");
Expand Down Expand Up @@ -757,6 +763,11 @@ bool JReactNativeFeatureFlagsCxxInterop::enableModuleArgumentNSNullConversionIOS
return ReactNativeFeatureFlags::enableModuleArgumentNSNullConversionIOS();
}

bool JReactNativeFeatureFlagsCxxInterop::enableMutationObserverByDefault(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
return ReactNativeFeatureFlags::enableMutationObserverByDefault();
}

bool JReactNativeFeatureFlagsCxxInterop::enableNativeCSSParsing(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
return ReactNativeFeatureFlags::enableNativeCSSParsing();
Expand Down Expand Up @@ -1161,6 +1172,9 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
makeNativeMethod(
"enableModuleArgumentNSNullConversionIOS",
JReactNativeFeatureFlagsCxxInterop::enableModuleArgumentNSNullConversionIOS),
makeNativeMethod(
"enableMutationObserverByDefault",
JReactNativeFeatureFlagsCxxInterop::enableMutationObserverByDefault),
makeNativeMethod(
"enableNativeCSSParsing",
JReactNativeFeatureFlagsCxxInterop::enableNativeCSSParsing),
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<<f5aa0f101192f55b7ac12705d7667424>>
* @generated SignedSource<<bf1f3b156e29c081684a9bada7e81a4b>>
*/

/**
Expand Down Expand Up @@ -138,6 +138,9 @@ class JReactNativeFeatureFlagsCxxInterop
static bool enableModuleArgumentNSNullConversionIOS(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);

static bool enableMutationObserverByDefault(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);

static bool enableNativeCSSParsing(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);

Expand Down
6 changes: 6 additions & 0 deletions packages/react-native/ReactCommon/React-Fabric.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,12 @@ Pod::Spec.new do |s|
sss.exclude_files = "react/renderer/observers/intersection/tests"
sss.header_dir = "react/renderer/observers/intersection"
end

ss.subspec "mutation" do |sss|
sss.source_files = podspec_sources("react/renderer/observers/mutation/**/*.{m,mm,cpp,h}", "react/renderer/observers/mutation/**/*.h")
sss.exclude_files = "react/renderer/observers/mutation/tests"
sss.header_dir = "react/renderer/observers/mutation"
end
end

s.subspec "templateprocessor" do |ss|
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<<9ceab23bb1cb8d569411222993ef9f1e>>
* @generated SignedSource<<c7d08e6d97766cbb68db8772611530b5>>
*/

/**
Expand Down Expand Up @@ -170,6 +170,10 @@ bool ReactNativeFeatureFlags::enableModuleArgumentNSNullConversionIOS() {
return getAccessor().enableModuleArgumentNSNullConversionIOS();
}

bool ReactNativeFeatureFlags::enableMutationObserverByDefault() {
return getAccessor().enableMutationObserverByDefault();
}

bool ReactNativeFeatureFlags::enableNativeCSSParsing() {
return getAccessor().enableNativeCSSParsing();
}
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<<26b7504c2446d37c6540609a620854cb>>
* @generated SignedSource<<f8bd95ee62cd377756a0ca08caf3027a>>
*/

/**
Expand Down Expand Up @@ -219,6 +219,11 @@ class ReactNativeFeatureFlags {
*/
RN_EXPORT static bool enableModuleArgumentNSNullConversionIOS();

/**
* Enables the MutationObserver Web API in React Native.
*/
RN_EXPORT static bool enableMutationObserverByDefault();

/**
* Parse CSS strings using the Fabric CSS parser instead of ViewConfig processing
*/
Expand Down
Loading
Loading