Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
d8722f9
feat: add enableResizeObserverByDefault feature flag
paradowstack Jul 13, 2026
e529577
feat: ResizeObserver stub implementation
paradowstack Jul 13, 2026
de64bf6
feat: JS Web API stubs
paradowstack Jul 13, 2026
7cb2315
feat: ResizeObserver TurboModule
paradowstack Jul 13, 2026
3296ee6
feat: add polyfill behind feature flag
paradowstack Jul 13, 2026
6c78168
feat: add basic implementation
paradowstack Jul 14, 2026
ed76b5c
feat: devicePixelContentBoxSize support
paradowstack Jul 14, 2026
3730577
feat: broadcast on rendering
paradowstack Jul 14, 2026
a5ca8ad
fix: handle re-observe
paradowstack Jul 15, 2026
ad1f7b7
fix: initial load + hidden cases
paradowstack Jul 15, 2026
7024d82
fix: unobserve after target unmount
paradowstack Jul 23, 2026
db47740
fix: improve unobserve logic
paradowstack Jul 23, 2026
a83989f
fix: round device-pixel-content-box dimensions
paradowstack Jul 23, 2026
0fa6d6a
fix: frozing ResizeObserverEntry getters
paradowstack Jul 23, 2026
f16f03b
refactor: simplify runResizeObservations method signature
paradowstack Jul 23, 2026
a67e5b0
feat: add observation sequence to ResizeObserver for ordered delivery
paradowstack Jul 24, 2026
00c61ee
feat: handle unmount 0x0 case
paradowstack Jul 27, 2026
46b9756
feat: add ResizeObserver Fantom tests
paradowstack Jul 27, 2026
090210e
fix: expose public wrapper
paradowstack Jul 27, 2026
330ea24
feat: update bom file
paradowstack Jul 27, 2026
03a6151
feat: add docs
paradowstack Jul 28, 2026
44b52c2
feat: rn-tester showcase page
paradowstack Jul 28, 2026
cb66f73
feat: add ResizeObserver globals test setup
paradowstack Jul 28, 2026
c836f1f
feat: update RuntimeScheduler docs
paradowstack Jul 28, 2026
2d868ed
feat: more test cases
paradowstack Jul 28, 2026
5a1f725
feat: add surfaceIdsWithPendingInitialDelivery_
paradowstack Jul 28, 2026
8e677d7
feat: new tests
paradowstack Jul 28, 2026
a902551
feat: split into three examples
paradowstack Jul 28, 2026
18f46bf
fix: flow-check changes
paradowstack Jul 28, 2026
1241267
refactor: cleanup
paradowstack Jul 28, 2026
ded2cdb
refactor: prettier
paradowstack Jul 28, 2026
09d7d9f
feat: ResizeObserver cxx api
paradowstack Jul 28, 2026
aafe81e
fix: import order
paradowstack Jul 28, 2026
fc48bbd
fix: add missing Package.swift targets
paradowstack Jul 29, 2026
087dd22
fix: add missing dependency
paradowstack Jul 29, 2026
b22cbfd
fix: baseline ResizeObserver native module include-health entries
paradowstack Jul 29, 2026
673cd66
fix: remove expensive computeRelativeLayoutMetrics call
paradowstack Jul 30, 2026
93b83d7
fix: change type to class
paradowstack Jul 30, 2026
a3e9067
feat: use resize loop (gather / broadcast / depth)
paradowstack Jul 31, 2026
3e4d142
feat: snapshots
paradowstack Jul 31, 2026
afea976
fix: correct types
paradowstack Jul 31, 2026
e05fcb9
fix: snapshots update
paradowstack Jul 31, 2026
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 @@ -352,6 +352,13 @@ let reactMutationObserverNativeModule = RNTarget(
dependencies: [.reactNativeDependencies, .reactCxxReact, .reactFabric, .reactTurboModuleBridging, .reactTurboModuleCore, .yoga]
)

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

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

let reactFabricInputAccessory = RNTarget(
Expand Down Expand Up @@ -720,6 +727,7 @@ let targets = [
reactWebPerformanceNativeModule,
reactIntersectionObserverNativeModule,
reactMutationObserverNativeModule,
reactResizeObserverNativeModule,
reactViewTransitionNativeModule,
reactFeatureflagsNativemodule,
reactNativeModuleDom,
Expand Down Expand Up @@ -912,6 +920,7 @@ extension String {
static let reactWebPerformanceNativeModule = "React-webperformancenativemodule"
static let reactIntersectionObserverNativeModule = "React-intersectionobservernativemodule"
static let reactMutationObserverNativeModule = "React-mutationobservernativemodule"
static let reactResizeObserverNativeModule = "React-resizeobservernativemodule"
static let reactViewTransitionNativeModule = "React-viewtransitionnativemodule"
static let reactFeatureflagsNativemodule = "React-featureflagsnativemodule"
static let reactNativeModuleDom = "React-domnativemodule"
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<<2fc347cdb33327437d29e5fd91e24011>>
* @generated SignedSource<<077468a30d16df93a0e61fd24ebba831>>
*/

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

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

/**
* When enabled, RuntimeScheduler_Modern clears pending tasks and rendering updates before handling an error.
*/
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<<a506d2515fce404e19bd61099cc60117>>
* @generated SignedSource<<3a37118e535c901ca606aeef0d6add1e>>
*/

/**
Expand Down Expand Up @@ -63,6 +63,7 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
private var enableNativeCSSParsingCache: Boolean? = null
private var enablePreparedTextLayoutCache: Boolean? = null
private var enablePropsUpdateReconciliationAndroidCache: Boolean? = null
private var enableResizeObserverByDefaultCache: Boolean? = null
private var enableRuntimeSchedulerQueueClearingOnErrorCache: Boolean? = null
private var enableSchedulerDelegateInvalidationCache: Boolean? = null
private var enableSwiftUIBasedFiltersCache: Boolean? = null
Expand Down Expand Up @@ -495,6 +496,15 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
return cached
}

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

override fun enableRuntimeSchedulerQueueClearingOnError(): Boolean {
var cached = enableRuntimeSchedulerQueueClearingOnErrorCache
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<<1ef72233f02973021b83bd2e2aa1f69b>>
* @generated SignedSource<<c8562e0841fba1429c24e7a648cb08e2>>
*/

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

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

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

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

@DoNotStrip @JvmStatic public external fun enableSchedulerDelegateInvalidation(): 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<<eb9958ddc04dd1cd8d1add366f5f7741>>
* @generated SignedSource<<3b1eca96cc82c17fadc0ab9ee428b780>>
*/

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

override fun enablePropsUpdateReconciliationAndroid(): Boolean = false

override fun enableResizeObserverByDefault(): Boolean = false

override fun enableRuntimeSchedulerQueueClearingOnError(): Boolean = false

override fun enableSchedulerDelegateInvalidation(): 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<<9ae32c46a5a6310ef96eb91c9ea5b12e>>
* @generated SignedSource<<4885541294d35171c8d1b876ebc1e706>>
*/

/**
Expand Down Expand Up @@ -67,6 +67,7 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
private var enableNativeCSSParsingCache: Boolean? = null
private var enablePreparedTextLayoutCache: Boolean? = null
private var enablePropsUpdateReconciliationAndroidCache: Boolean? = null
private var enableResizeObserverByDefaultCache: Boolean? = null
private var enableRuntimeSchedulerQueueClearingOnErrorCache: Boolean? = null
private var enableSchedulerDelegateInvalidationCache: Boolean? = null
private var enableSwiftUIBasedFiltersCache: Boolean? = null
Expand Down Expand Up @@ -542,6 +543,16 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
return cached
}

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

override fun enableRuntimeSchedulerQueueClearingOnError(): Boolean {
var cached = enableRuntimeSchedulerQueueClearingOnErrorCache
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<<1a1d47f2d85404c776e55db40f7dbc6e>>
* @generated SignedSource<<6a5878b6269cd8ca9f763a1262518957>>
*/

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

@DoNotStrip public fun enablePropsUpdateReconciliationAndroid(): Boolean

@DoNotStrip public fun enableResizeObserverByDefault(): Boolean

@DoNotStrip public fun enableRuntimeSchedulerQueueClearingOnError(): Boolean

@DoNotStrip public fun enableSchedulerDelegateInvalidation(): Boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ 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/observers/resize)
add_react_common_subdir(react/renderer/textlayoutmanager)
add_react_common_subdir(react/utils)
add_react_common_subdir(react/bridging)
Expand All @@ -130,6 +131,7 @@ 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/resizeobserver)
add_react_common_subdir(react/nativemodule/viewtransition)
add_react_common_subdir(react/nativemodule/webperformance)
add_react_common_subdir(react/networking)
Expand Down Expand Up @@ -202,6 +204,7 @@ add_library(reactnative
$<TARGET_OBJECTS:react_nativemodule_intersectionobserver>
$<TARGET_OBJECTS:react_nativemodule_microtasks>
$<TARGET_OBJECTS:react_nativemodule_mutationobserver>
$<TARGET_OBJECTS:react_nativemodule_resizeobserver>
$<TARGET_OBJECTS:react_nativemodule_viewtransition>
$<TARGET_OBJECTS:react_nativemodule_webperformance>
$<TARGET_OBJECTS:react_networking>
Expand All @@ -226,6 +229,7 @@ add_library(reactnative
$<TARGET_OBJECTS:react_renderer_observers_events>
$<TARGET_OBJECTS:react_renderer_observers_intersection>
$<TARGET_OBJECTS:react_renderer_observers_mutation>
$<TARGET_OBJECTS:react_renderer_observers_resize>
$<TARGET_OBJECTS:react_renderer_runtimescheduler>
$<TARGET_OBJECTS:react_renderer_scheduler>
$<TARGET_OBJECTS:react_renderer_telemetry>
Expand Down Expand Up @@ -302,6 +306,7 @@ target_include_directories(reactnative
$<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_resizeobserver,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:react_nativemodule_viewtransition,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:react_nativemodule_webperformance,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:react_networking,INTERFACE_INCLUDE_DIRECTORIES>
Expand All @@ -328,6 +333,7 @@ target_include_directories(reactnative
$<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_observers_resize,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<<28de1e205f30135e96d5cb94a902faec>>
* @generated SignedSource<<8f62bacdc7d44c6c7583e87bd3f9a6a9>>
*/

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

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

bool enableRuntimeSchedulerQueueClearingOnError() override {
static const auto method =
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("enableRuntimeSchedulerQueueClearingOnError");
Expand Down Expand Up @@ -780,6 +786,11 @@ bool JReactNativeFeatureFlagsCxxInterop::enablePropsUpdateReconciliationAndroid(
return ReactNativeFeatureFlags::enablePropsUpdateReconciliationAndroid();
}

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

bool JReactNativeFeatureFlagsCxxInterop::enableRuntimeSchedulerQueueClearingOnError(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
return ReactNativeFeatureFlags::enableRuntimeSchedulerQueueClearingOnError();
Expand Down Expand Up @@ -1160,6 +1171,9 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
makeNativeMethod(
"enablePropsUpdateReconciliationAndroid",
JReactNativeFeatureFlagsCxxInterop::enablePropsUpdateReconciliationAndroid),
makeNativeMethod(
"enableResizeObserverByDefault",
JReactNativeFeatureFlagsCxxInterop::enableResizeObserverByDefault),
makeNativeMethod(
"enableRuntimeSchedulerQueueClearingOnError",
JReactNativeFeatureFlagsCxxInterop::enableRuntimeSchedulerQueueClearingOnError),
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<<535898dd9498c65f30d56122c06b408b>>
* @generated SignedSource<<25a4d67d5f41cecdb3194eac15d91ddb>>
*/

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

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

static bool enableRuntimeSchedulerQueueClearingOnError(
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 @@ -200,6 +200,12 @@ Pod::Spec.new do |s|
sss.exclude_files = "react/renderer/observers/mutation/tests"
sss.header_dir = "react/renderer/observers/mutation"
end

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

s.subspec "telemetry" 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<<8fd664cb106945e5c6e436a0cf36120d>>
* @generated SignedSource<<ba7ae83ef2affb2685c129d3ce23a20b>>
*/

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

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

bool ReactNativeFeatureFlags::enableRuntimeSchedulerQueueClearingOnError() {
return getAccessor().enableRuntimeSchedulerQueueClearingOnError();
}
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<<196ba25b807fd064ca6150c7d2cd741c>>
* @generated SignedSource<<2c96707eeaf5b5c0164a6c5f4fda3cd8>>
*/

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

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

/**
* When enabled, RuntimeScheduler_Modern clears pending tasks and rendering updates before handling an error.
*/
Expand Down
Loading
Loading