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

Fix internal vnode typings #2015

Merged
merged 3 commits into from
Oct 17, 2019
Merged

Fix internal vnode typings #2015

merged 3 commits into from
Oct 17, 2019

Conversation

pmkroeker
Copy link
Contributor

I think #1979 causes some regression in the internal VNode typings.

The internal VNode type incorrectly extended preact.VNode.

The issue showed up in my projects webpack build. The below changes fix the issues.

pmkroeker and others added 2 commits October 17, 2019 11:55
Re update
- internal VNode type improperly extended preact.VNode
@coveralls
Copy link

coveralls commented Oct 17, 2019

Coverage Status

Coverage increased (+0.1%) to 99.768% when pulling 4f54bbb on pmkroeker:fix-internal-vnode-typings into a803e68 on preactjs:master.

@andrewiggins
Copy link
Member

Oh interesting. Does your TS build look at internal.d.ts?

@pmkroeker
Copy link
Contributor Author

I guess it must. I changed the typings in my node_modules and it ran through fine. VSCode also showed an error on the VNode line.

@andrewiggins
Copy link
Member

Oh okay, I think I see it now. This fails when using preact/compat and it appears that our TS tests for preact/compat don't run on build like our other tests, which is how this got through.

To be clear, my hesitation is that, internally, VNode.type is null sometimes and VNode.props isn't an always object so those internal types are correct in spirit (obviously still need to figure out how to express that properly in TypeScript though since what I did in #1979 doesn't compile).

Regardless, errors in internal types should never impact consumers, so why that's happening at all is concerning...

Copy link
Member

@andrewiggins andrewiggins left a comment

Choose a reason for hiding this comment

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

Thanks for the report and taking the time to submit a fix! I'll follow up with a PR to run compat TS tests on build so we can catch these before release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants