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

Sync ReactNativeTypes from RN repo to React #21014

Closed
wants to merge 2 commits into from

Conversation

JoshuaGross
Copy link
Contributor

Summary

Syncs over changes RN edited directly.

The same as #21012 but with some $FlowFixMes and some Flow casts removed.

This might not be the right approach, I'll need some feedback.

Test Plan

yarn flow fabric && yarn flow native && yarn lint && yarn test

@sizebot
Copy link

sizebot commented Mar 16, 2021

Comparing: f8979e0...ad6145d

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.min.js = 122.83 kB 122.83 kB = 39.52 kB 39.52 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js = 129.33 kB 129.33 kB = 41.59 kB 41.58 kB
facebook-www/ReactDOM-prod.classic.js = 408.70 kB 408.70 kB = 75.80 kB 75.80 kB
facebook-www/ReactDOM-prod.modern.js = 396.96 kB 396.96 kB = 73.86 kB 73.86 kB
facebook-www/ReactDOMForked-prod.classic.js = 408.71 kB 408.71 kB = 75.80 kB 75.80 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against ad6145d

@@ -126,7 +125,4 @@ class ReactNativeFiberHostComponent {
}
}

// eslint-disable-next-line no-unused-expressions
(ReactNativeFiberHostComponent.prototype: NativeMethods);
Copy link
Member

Choose a reason for hiding this comment

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

These casts are actually quite important. They make sure that Paper host components and Fabric host components have the same API, and that they match the flow types that products use.

If the issue is that the now exact NativeMethods no longer matches the inexact class *HostComponent does this work?

*HostComponent: {...NativeMethods, ...}

Essentially saying explicitly that it will include NativeMethods, as well as other things.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That doesn't work, nor does {| ... |} and a few other things I tried

Copy link
Member

Choose a reason for hiding this comment

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

Maybe what I said but wrapped in $ReadOnly.

$ReadOnly<{...NativeMethods, ...}>

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.

5 participants