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

Simplify 'CreateElement', remove potential error in 'AsyncComponent' … #1

Conversation

DanielRosenwasser
Copy link

I encountered a few situations where passing in an array of number for children caused some sub-optimal error messages because TypeScript falls back to the last overload for error reporting. You end up with something like "string is not assignable to AsyncComponent" which is misleading. So I simplified the overloads in for CreateElement, though this broke a few test cases.

It seemed like the root of the break was that type for AsyncComponent was slightly inaccurate, which I corrected, but this broke a different test case. I tried it out, and it turns out that test case actually causes Vue to hang, so I've removed it.

@HerringtonDarkholme
Copy link
Owner

HerringtonDarkholme commented Sep 12, 2017

Thank Daniel!

Indeed! AsyncComponent doesn't accept component as returning value!

I will look at failing tests.

@HerringtonDarkholme HerringtonDarkholme merged commit 8901752 into HerringtonDarkholme:new-type Sep 12, 2017
@DanielRosenwasser DanielRosenwasser deleted the simplifyCreateElement branch September 14, 2017 21:29
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.

2 participants