Skip to content
Open
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
13 changes: 11 additions & 2 deletions packages/react-native/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ let reactTurboModuleCore = RNTarget(
let reactTurboModuleCoreDefaults = RNTarget(
name: .reactTurboModuleCoreDefaults,
path: "ReactCommon/react/nativemodule/defaults",
dependencies: [.reactNativeDependencies, .jsi, .reactJsiExecutor, .reactTurboModuleCore]
dependencies: [.reactNativeDependencies, .jsi, .reactJsiExecutor, .reactTurboModuleCore, .reactFabric]
)

/// React-microtasknativemodule.podspec
Expand All @@ -338,6 +338,13 @@ let reactWebPerformanceNativeModule = RNTarget(
dependencies: [.reactNativeDependencies, .reactCxxReact, .reactTurboModuleCore, .reactPerformanceTimeline]
)

/// React-intersectionobservernativemodule.podspec
let reactIntersectionObserverNativeModule = RNTarget(
name: .reactIntersectionObserverNativeModule,
path: "ReactCommon/react/nativemodule/intersectionobserver",
dependencies: [.reactNativeDependencies, .reactCxxReact, .reactFabric, .reactTurboModuleBridging, .reactTurboModuleCore, .reactGraphics, .reactGraphicsApple, .reactRuntimeScheduler, .yoga]
)

/// React-featureflagnativemodule.podspec
let reactFeatureflagsNativemodule = RNTarget(
name: .reactFeatureflagsNativemodule,
Expand Down Expand Up @@ -451,7 +458,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", "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", "telemetry", "consistency", "leakchecker", "uimanager", "uimanager/consistency"]
)

let reactFabricInputAccessory = RNTarget(
Expand Down Expand Up @@ -682,6 +689,7 @@ let targets = [
reactTurboModuleCoreMicrotasks,
reactIdleCallbacksNativeModule,
reactWebPerformanceNativeModule,
reactIntersectionObserverNativeModule,
reactFeatureflagsNativemodule,
reactNativeModuleDom,
reactAppDelegate,
Expand Down Expand Up @@ -869,6 +877,7 @@ extension String {
static let reactTurboModuleCoreMicrotasks = "ReactCommon/turbomodule/core/microtasks"
static let reactIdleCallbacksNativeModule = "React-idlecallbacksnativemodule"
static let reactWebPerformanceNativeModule = "React-webperformancenativemodule"
static let reactIntersectionObserverNativeModule = "React-intersectionobservernativemodule"
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<<19656df8ed7f6c6cc897b1110f57c78e>>
* @generated SignedSource<<93f2d4274bbd84508e8b8c96ba59ee7a>>
*/

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

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

/**
* Enables key up/down/press events to be sent to JS from components
*/
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<<9b6129ab0adfa4d0f92752f52f6d91a3>>
* @generated SignedSource<<e10cabe72063b1e35deccebbde18bc84>>
*/

/**
Expand Down Expand Up @@ -54,6 +54,7 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
private var enableImmediateUpdateModeForContentOffsetChangesCache: Boolean? = null
private var enableImperativeFocusCache: Boolean? = null
private var enableInteropViewManagerClassLookUpOptimizationIOSCache: Boolean? = null
private var enableIntersectionObserverByDefaultCache: Boolean? = null
private var enableKeyEventsCache: Boolean? = null
private var enableLayoutAnimationsOnAndroidCache: Boolean? = null
private var enableLayoutAnimationsOnIOSCache: Boolean? = null
Expand Down Expand Up @@ -414,6 +415,15 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
return cached
}

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

override fun enableKeyEvents(): Boolean {
var cached = enableKeyEventsCache
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<<573d80277c150ff74d51d23f2e1876fc>>
* @generated SignedSource<<1df6e51d322a5850a303f54c9d1a62ef>>
*/

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

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

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

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

@DoNotStrip @JvmStatic public external fun enableLayoutAnimationsOnAndroid(): 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<<e3b2da8981d8ee398f753cb76e68c976>>
* @generated SignedSource<<287bbfdc05e7655b93b768cb18c1c315>>
*/

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

override fun enableInteropViewManagerClassLookUpOptimizationIOS(): Boolean = false

override fun enableIntersectionObserverByDefault(): Boolean = false

override fun enableKeyEvents(): Boolean = false

override fun enableLayoutAnimationsOnAndroid(): 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<<092b55220901732f9f21d4ccf74206e5>>
* @generated SignedSource<<df2133421c219d1418555f403e4d1242>>
*/

/**
Expand Down Expand Up @@ -58,6 +58,7 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
private var enableImmediateUpdateModeForContentOffsetChangesCache: Boolean? = null
private var enableImperativeFocusCache: Boolean? = null
private var enableInteropViewManagerClassLookUpOptimizationIOSCache: Boolean? = null
private var enableIntersectionObserverByDefaultCache: Boolean? = null
private var enableKeyEventsCache: Boolean? = null
private var enableLayoutAnimationsOnAndroidCache: Boolean? = null
private var enableLayoutAnimationsOnIOSCache: Boolean? = null
Expand Down Expand Up @@ -452,6 +453,16 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
return cached
}

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

override fun enableKeyEvents(): Boolean {
var cached = enableKeyEventsCache
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<<f82b5905d822f8009c054a9443f86e39>>
* @generated SignedSource<<2912fe4c90e3b493770bf14e70264656>>
*/

/**
Expand All @@ -27,6 +27,8 @@ public open class ReactNativeFeatureFlagsOverrides_RNOSS_Canary_Android : ReactN

override fun enableFabricRenderer(): Boolean = true

override fun enableIntersectionObserverByDefault(): Boolean = true

override fun useNativeViewConfigsInBridgelessMode(): Boolean = true

override fun useTurboModuleInterop(): 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<<f9edd04c2228dfbbe5a1dc36ceb48688>>
* @generated SignedSource<<26ec323f6b9475a6da06462bb4a4777a>>
*/

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

@DoNotStrip public fun enableInteropViewManagerClassLookUpOptimizationIOS(): Boolean

@DoNotStrip public fun enableIntersectionObserverByDefault(): Boolean

@DoNotStrip public fun enableKeyEvents(): Boolean

@DoNotStrip public fun enableLayoutAnimationsOnAndroid(): Boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ add_react_common_subdir(react/renderer/components/scrollview)
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/textlayoutmanager)
add_react_common_subdir(react/utils)
add_react_common_subdir(react/bridging)
Expand All @@ -124,6 +125,7 @@ add_react_common_subdir(react/nativemodule/dom)
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/webperformance)
add_react_common_subdir(react/networking)
add_react_common_subdir(jserrorhandler)
Expand Down Expand Up @@ -191,6 +193,7 @@ add_library(reactnative
$<TARGET_OBJECTS:react_nativemodule_dom>
$<TARGET_OBJECTS:react_nativemodule_featureflags>
$<TARGET_OBJECTS:react_nativemodule_idlecallbacks>
$<TARGET_OBJECTS:react_nativemodule_intersectionobserver>
$<TARGET_OBJECTS:react_nativemodule_microtasks>
$<TARGET_OBJECTS:react_nativemodule_webperformance>
$<TARGET_OBJECTS:react_networking>
Expand All @@ -211,6 +214,7 @@ add_library(reactnative
$<TARGET_OBJECTS:react_renderer_mapbuffer>
$<TARGET_OBJECTS:react_renderer_mounting>
$<TARGET_OBJECTS:react_renderer_observers_events>
$<TARGET_OBJECTS:react_renderer_observers_intersection>
$<TARGET_OBJECTS:react_renderer_runtimescheduler>
$<TARGET_OBJECTS:react_renderer_scheduler>
$<TARGET_OBJECTS:react_renderer_telemetry>
Expand Down Expand Up @@ -282,6 +286,7 @@ target_include_directories(reactnative
$<TARGET_PROPERTY:react_nativemodule_dom,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:react_nativemodule_featureflags,INTERFACE_INCLUDE_DIRECTORIES>
$<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_webperformance,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:react_networking,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<<33a06b98052c7ea82006d28b04328fa7>>
* @generated SignedSource<<28be0fdc25ea4724d28426f7564eba98>>
*/

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

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

bool enableKeyEvents() override {
static const auto method =
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("enableKeyEvents");
Expand Down Expand Up @@ -735,6 +741,11 @@ bool JReactNativeFeatureFlagsCxxInterop::enableInteropViewManagerClassLookUpOpti
return ReactNativeFeatureFlags::enableInteropViewManagerClassLookUpOptimizationIOS();
}

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

bool JReactNativeFeatureFlagsCxxInterop::enableKeyEvents(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
return ReactNativeFeatureFlags::enableKeyEvents();
Expand Down Expand Up @@ -1133,6 +1144,9 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
makeNativeMethod(
"enableInteropViewManagerClassLookUpOptimizationIOS",
JReactNativeFeatureFlagsCxxInterop::enableInteropViewManagerClassLookUpOptimizationIOS),
makeNativeMethod(
"enableIntersectionObserverByDefault",
JReactNativeFeatureFlagsCxxInterop::enableIntersectionObserverByDefault),
makeNativeMethod(
"enableKeyEvents",
JReactNativeFeatureFlagsCxxInterop::enableKeyEvents),
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<<838a569cfd4e917233fdbfb5b090907b>>
* @generated SignedSource<<7b5bcf6b40af3c210ea11fe14bbfd402>>
*/

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

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

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

Expand Down
10 changes: 8 additions & 2 deletions packages/react-native/ReactCommon/React-Fabric.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Pod::Spec.new do |s|
depend_on_js_engine(s)
add_rn_third_party_dependencies(s)
add_rncore_dependency(s)

s.subspec "animated" do |ss|
ss.source_files = podspec_sources("react/renderer/animated/**/*.{m,mm,cpp,h}", "react/renderer/animated/**/*.{h}")
ss.exclude_files = "react/renderer/animated/tests"
Expand All @@ -66,7 +66,7 @@ Pod::Spec.new do |s|
ss.exclude_files = "react/renderer/animations/tests"
ss.header_dir = "react/renderer/animations"
end

s.subspec "animationbackend" do |ss|
ss.source_files = podspec_sources("react/renderer/animationbackend/**/*.{m,mm,cpp,h}", "react/renderer/animationbackend/**/*.{h}")
ss.header_dir = "react/renderer/animationbackend"
Expand Down Expand Up @@ -179,6 +179,12 @@ Pod::Spec.new do |s|
sss.exclude_files = "react/renderer/observers/events/tests"
sss.header_dir = "react/renderer/observers/events"
end

ss.subspec "intersection" do |sss|
sss.source_files = podspec_sources("react/renderer/observers/intersection/**/*.{m,mm,cpp,h}", "react/renderer/observers/intersection/**/*.h")
sss.exclude_files = "react/renderer/observers/intersection/tests"
sss.header_dir = "react/renderer/observers/intersection"
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<<3c93056dbbf315ef24520f770ccb1b6f>>
* @generated SignedSource<<2f39caf3c4304447dc62106885448a30>>
*/

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

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

bool ReactNativeFeatureFlags::enableKeyEvents() {
return getAccessor().enableKeyEvents();
}
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<<4b1e0adaaee9856feb290d0ba5e18147>>
* @generated SignedSource<<4cb63de2815c46bc907e80d37823f20c>>
*/

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

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

/**
* Enables key up/down/press events to be sent to JS from components
*/
Expand Down
Loading
Loading