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

[RN] Add support for document instance in React Native #32260

Merged
merged 1 commit into from
Jan 29, 2025

Conversation

rubennorte
Copy link
Contributor

Summary

We're adding support for Document instances in React Native (as ReactNativeDocument instances) in facebook/react-native#49012 , which requires the React Fabric renderer to handle its lifecycle.

This modifies the renderer to create those document instances and associate them with the React root, and provides a new method for React Native to access them given its containerTag / rootTag.

How did you test this change?

Tested e2e in facebook/react-native#49012 manually syncing these changes.

@react-sizebot
Copy link

react-sizebot commented Jan 29, 2025

Comparing: c492f97...a39a621

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.10 kB 515.10 kB = 91.81 kB 91.81 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.79 kB 558.79 kB = 99.13 kB 99.12 kB
facebook-www/ReactDOM-prod.classic.js = 597.07 kB 597.07 kB = 104.95 kB 104.95 kB
facebook-www/ReactDOM-prod.modern.js = 587.50 kB 587.50 kB = 103.41 kB 103.41 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name +/- Base Current +/- gzip Base gzip Current gzip
react-native/shims/ReactNativeTypes.js +0.56% 8.32 kB 8.37 kB +0.37% 2.19 kB 2.19 kB

Generated by 🚫 dangerJS against 1d4d7e6

Comment on lines 169 to 170
// Remove the reference to the public instance to prevent memory leaks.
root.containerInfo.publicInstance = null;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this wait until after the updateContainer call?

@rubennorte rubennorte force-pushed the react-native-document-creation branch from 5c88297 to 1d4d7e6 Compare January 29, 2025 16:56
rubennorte added a commit to rubennorte/react-native that referenced this pull request Jan 29, 2025
Summary: This is a manual sync of facebook/react#32260 for internal testing

Differential Revision: D68561175
@rubennorte rubennorte merged commit b2357ec into facebook:main Jan 29, 2025
188 checks passed
@rubennorte rubennorte deleted the react-native-document-creation branch January 29, 2025 17:07
github-actions bot pushed a commit that referenced this pull request Jan 29, 2025
## Summary

We're adding support for `Document` instances in React Native (as
`ReactNativeDocument` instances) in
facebook/react-native#49012 , which requires the
React Fabric renderer to handle its lifecycle.

This modifies the renderer to create those document instances and
associate them with the React root, and provides a new method for React
Native to access them given its containerTag / rootTag.

## How did you test this change?

Tested e2e in facebook/react-native#49012
manually syncing these changes.

DiffTrain build for [b2357ec](b2357ec)
github-actions bot pushed a commit to code/lib-react that referenced this pull request Jan 29, 2025
## Summary

We're adding support for `Document` instances in React Native (as
`ReactNativeDocument` instances) in
facebook/react-native#49012 , which requires the
React Fabric renderer to handle its lifecycle.

This modifies the renderer to create those document instances and
associate them with the React root, and provides a new method for React
Native to access them given its containerTag / rootTag.

## How did you test this change?

Tested e2e in facebook/react-native#49012
manually syncing these changes.

DiffTrain build for [b2357ec](facebook@b2357ec)
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.

4 participants