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] Move definition of public instances to ReactNativePrivateInterface #32446

Merged

Conversation

rubennorte
Copy link
Contributor

@rubennorte rubennorte commented Feb 21, 2025

Summary

Note

This only modifies types, so shouldn't have an impact at runtime.

Some time ago we moved some type definitions from React to React Native in #26437.

This continues making progress on that so values that are created by React Native and passed to the React renderer (in this case public instances) are actually defined in React Native and not in React.

This will allow us to modify the definition of some of these types without having to make changes in the React repository (in the short term, we want to refactor PublicInstance from an object to an interface, and then modify that interface to add all the new DOM methods).

How did you test this change?

Manually synced ReactNativeTypes on top of facebook/react-native#49602 and verified Flow passes.

@react-sizebot
Copy link

Comparing: 9b042f9...77181dd

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.71 kB 515.71 kB = 92.09 kB 92.09 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 = 565.64 kB 565.64 kB = 100.84 kB 100.84 kB
facebook-www/ReactDOM-prod.classic.js = 636.70 kB 636.70 kB = 112.08 kB 112.08 kB
facebook-www/ReactDOM-prod.modern.js = 627.02 kB 627.02 kB = 110.50 kB 110.49 kB
react-native/shims/ReactNativeTypes.js = 8.73 kB 7.27 kB = 2.35 kB 2.00 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 = 8.73 kB 7.27 kB = 2.35 kB 2.00 kB

Generated by 🚫 dangerJS against ef5325e

rubennorte added a commit to rubennorte/react-native that referenced this pull request Feb 22, 2025
Summary:
Changelog: [internal]

This just prepares for the removal of some types from `ReactNativeTypes`, and defines some types in `ReactNativePrivateInterface` that `ReactNativeTypes` expects to be defined after facebook/react#32446

Differential Revision: D69996009
rubennorte added a commit to rubennorte/react-native that referenced this pull request Feb 24, 2025
Summary:
Pull Request resolved: facebook#49602

Changelog: [internal]

This just prepares for the removal of some types from `ReactNativeTypes`, and defines some types in `ReactNativePrivateInterface` that `ReactNativeTypes` expects to be defined after facebook/react#32446

Differential Revision: D69996009
rubennorte added a commit to rubennorte/react-native that referenced this pull request Feb 24, 2025
Summary:
Pull Request resolved: facebook#49602

Changelog: [internal]

This just prepares for the removal of some types from `ReactNativeTypes`, and defines some types in `ReactNativePrivateInterface` that `ReactNativeTypes` expects to be defined after facebook/react#32446

Differential Revision: D69996009
rubennorte added a commit to rubennorte/react-native that referenced this pull request Feb 24, 2025
Summary:
Pull Request resolved: facebook#49602

Changelog: [internal]

This just prepares for the removal of some types from `ReactNativeTypes`, and defines some types in `ReactNativePrivateInterface` that `ReactNativeTypes` expects to be defined after facebook/react#32446

Reviewed By: huntie

Differential Revision: D69996009
rubennorte added a commit to rubennorte/react-native that referenced this pull request Feb 24, 2025
Summary:
Pull Request resolved: facebook#49602

Changelog: [internal]

This just prepares for the removal of some types from `ReactNativeTypes`, and defines some types in `ReactNativePrivateInterface` that `ReactNativeTypes` expects to be defined after facebook/react#32446

Reviewed By: huntie

Differential Revision: D69996009
rubennorte added a commit to rubennorte/react-native that referenced this pull request Feb 24, 2025
Summary:
Pull Request resolved: facebook#49602

Changelog: [internal]

This just prepares for the removal of some types from `ReactNativeTypes`, and defines some types in `ReactNativePrivateInterface` that `ReactNativeTypes` expects to be defined after facebook/react#32446

Reviewed By: huntie

Differential Revision: D69996009
facebook-github-bot pushed a commit to facebook/react-native that referenced this pull request Feb 24, 2025
Summary:
Pull Request resolved: #49602

Changelog: [internal]

This just prepares for the removal of some types from `ReactNativeTypes`, and defines some types in `ReactNativePrivateInterface` that `ReactNativeTypes` expects to be defined after facebook/react#32446

Reviewed By: huntie

Differential Revision: D69996009

fbshipit-source-id: 3c156b4dede8e217d6a828ab310533a2f8bfd42c
@rubennorte rubennorte merged commit 9dd378f into facebook:main Feb 24, 2025
196 checks passed
github-actions bot pushed a commit that referenced this pull request Feb 24, 2025
…ce (#32446)

## Summary

> [!NOTE]
> This only modifies types, so shouldn't have an impact at runtime.

Some time ago we moved some type definitions from React to React Native
in #26437.

This continues making progress on that so values that are created by
React Native and passed to the React renderer (in this case public
instances) are actually defined in React Native and not in React.

This will allow us to modify the definition of some of these types
without having to make changes in the React repository (in the short
term, we want to refactor PublicInstance from an object to an interface,
and then modify that interface to add all the new DOM methods).

## How did you test this change?

Manually synced `ReactNativeTypes` on top of
facebook/react-native#49602 and verified Flow
passes.

DiffTrain build for [9dd378f](9dd378f)
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