-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Add errors when providing type arguments for intrinsic JSX tags #40293
Conversation
@typescript-bot user test this |
Heya @weswigham, I've started to run the parallelized community code test suite on this PR at aadadb4. You can monitor the build here. |
Heya @weswigham, I've started to run the extended test suite on this PR at aadadb4. You can monitor the build here. |
Heya @weswigham, I've started to run the perf test suite on this PR at aadadb4. You can monitor the build here. Update: The results are in! |
@weswigham Here they are:Comparison Report - master..40293
System
Hosts
Scenarios
|
@sandersn is looks like the perf with this change is pretty good for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good; a quick test on ant-design (that is, not enough runs for significance) shows a 5% speedup, which I think makes this a clear win.
I was looking over #38515 and came up with a test case that'd fail if it was missing, and discovered that we were also missing an error on having type arguments on intrinsic elements, in both the self-closing and non-self-closing tag cases. Since that case was also the only one where the type arguments weren't checked, by doing the type argument check inline there, I can remove the call from the deferred tag check (which should reduce duplication of work between
resolveCall
andresolveErrorCall
). Now, unfortunately, the exhaustiveness of the type parameter checking isn't guaranteed in any way, so in theory it'd be easy to introduce a branch in the future where the type parameters go unchecked now... but hopefully that won't happen.So you could say this superceeds #38515 and fixes an unreported bug where we failed to report errors when you passed type parameters to jsx intrinsic tags.