8000 Root import types from react-native in ReactNativeTypes by coado · Pull Request #33063 · facebook/react · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Root import types from react-native in ReactNativeTypes #33063

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

Merged
merged 11 commits into from
May 8, 2025

Conversation

coado
Copy link
Contributor
@coado coado commented Apr 30, 2025

Summary

This PR migrates deep import from react-native to the root import. The motivation behind this is that the newly introduced package exports in react native are more strict, and this import breaks type resolution for ReactNativePrivateInterface.

After adding HostInstance, PublicTextInstance, and PublicRootInstance to the react-native module, CIs failed due to different opaque types in react-native and ReactNativePrivateInterface. Moving their declarations to the global scope fixed the issue. It is not entirely possible to migrate react-native-renderer to root imports, as not all used identifiers are root exported in react-native.

Imported react types are changed to be used under the React namespace. This is required for Flow tooling to translate them into TypeScript equivalents correctly.

How did you test this change?

Signals, react-native main

@react-sizebot
Copy link
react-sizebot commented Apr 30, 2025

Comparing: 0ca8420...1b8d205

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 +0.05% 1.83 kB 1.83 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.90 kB = 111.33 kB 111.33 kB
facebook-www/ReactDOM-prod.classic.js = 671.68 kB 671.68 kB = 117.77 kB 117.77 kB
facebook-www/ReactDOM-prod.modern.js = 661.96 kB 661.96 kB = 116.21 kB 116.21 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against 1b8d205

@coado coado marked this pull request as ready for review May 5, 2025 14:21
Copy link
Member
@huntie huntie left a comment

Choose a reason for hiding this comment

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

LGTM :)

@huntie huntie merged commit 9518f11 into facebook:main May 8, 2025
239 checks passed
github-actions bot pushed a commit that referenced this pull request May 9, 2025
github-actions bot pushed a commit that referenced this pull request May 9, 2025
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
0