Skip to content
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

[Fiber] getHoistableRoot() should account for Document containers #32321

Merged
merged 1 commit into from
Feb 6, 2025

Conversation

gnoff
Copy link
Collaborator

@gnoff gnoff commented Feb 6, 2025

While modern DOM implementations all support getRootNode if you are running React in a runtime which does not the fallback logic which uses .ownerDocument works everywhere except when the container is a Document itself. This change corrects this by returning the container intsance if it is a Document type.

While modern DOM implementations all support getRootNode if you are running React in a runtime which does not the fallback logic which uses `.ownerDocument` works everywhere except when the container is a Document itself. This change corrects this by returning the container intsance if it is a Document type.
@react-sizebot
Copy link

Comparing: ff62833...c621e62

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.83 kB
oss-stable/react-dom/cjs/react-dom-client.production.js = 515.43 kB 515.48 kB +0.01% 92.03 kB 92.04 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 = 558.46 kB 558.52 kB +0.01% 99.25 kB 99.27 kB
facebook-www/ReactDOM-prod.classic.js = 636.83 kB 636.88 kB = 111.91 kB 111.92 kB
facebook-www/ReactDOM-prod.modern.js = 627.15 kB 627.20 kB = 110.33 kB 110.34 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against 6c24c14

@gnoff gnoff requested review from unstubbable and eps1lon February 6, 2025 21:26
@gnoff gnoff merged commit b48e739 into facebook:main Feb 6, 2025
193 checks passed
@gnoff gnoff deleted the fix-get-hoistable-root branch February 6, 2025 22:30
github-actions bot pushed a commit that referenced this pull request Feb 6, 2025
…32321)

While modern DOM implementations all support getRootNode if you are
running React in a runtime which does not the fallback logic which uses
`.ownerDocument` works everywhere except when the container is a
Document itself. This change corrects this by returning the container
intsance if it is a Document type.

DiffTrain build for [b48e739](b48e739)
github-actions bot pushed a commit that referenced this pull request Feb 6, 2025
…32321)

While modern DOM implementations all support getRootNode if you are
running React in a runtime which does not the fallback logic which uses
`.ownerDocument` works everywhere except when the container is a
Document itself. This change corrects this by returning the container
intsance if it is a Document type.

DiffTrain build for [b48e739](b48e739)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed React Core Team Opened by a member of the React Core Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants