Skip to content

New children notify fragment instances in Fabric #33093

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jackpope
Copy link
Contributor

@jackpope jackpope commented May 1, 2025

When a new child of a fragment instance is inserted, we need to notify the instance to keep any relevant tracking up to date. For example, we automatically observe the new child with any active IntersectionObserver.

For mutable renderers (DOM), we reuse the existing traversal in commitPlacement that does the insertions for HostComponents. Immutable renderers (Fabric) exit this path before the traversal though, so currently we can't notify the fragment instances.

Here I've created a separate traversal in commitPlacement, specifically for immutable renders when enableFragmentRefs is on. I am wondering if this would be better called from RN itself, since I assume they will do their own insertion step somewhere.

@react-sizebot
Copy link

Comparing: f739642...9d3ddac

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.js = 6.68 kB 6.68 kB = 1.83 kB 1.82 kB
oss-stable/react-dom/cjs/react-dom-client.production.js = 528.27 kB 528.27 kB = 93.14 kB 93.14 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 6.69 kB 6.69 kB = 1.83 kB 1.83 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js = 633.90 kB 633.79 kB = 111.33 kB 111.31 kB
facebook-www/ReactDOM-prod.classic.js = 671.68 kB 671.55 kB = 117.77 kB 117.78 kB
facebook-www/ReactDOM-prod.modern.js = 661.96 kB 661.83 kB = 116.21 kB 116.22 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name +/- Base Current +/- gzip Base gzip Current gzip
react-native/implementations/ReactFabric-prod.fb.js +1.46% 385.59 kB 391.23 kB +1.23% 66.56 kB 67.38 kB
react-native/implementations/ReactFabric-profiling.fb.js +1.36% 413.77 kB 419.41 kB +1.13% 70.70 kB 71.50 kB
react-native/implementations/ReactFabric-dev.fb.js +0.91% 675.04 kB 681.21 kB +0.76% 109.54 kB 110.37 kB
facebook-www/ReactReconciler-prod.modern.js +0.20% 498.20 kB 499.21 kB +0.15% 79.51 kB 79.64 kB

Generated by 🚫 dangerJS against 9d3ddac

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants