microsoft / TypeScript

TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
https://www.typescriptlang.org
Apache License 2.0
100.76k stars 12.46k forks source link

Suggestion: Reorder properties in HtmlAttribute #38583

Open amcasey opened 4 years ago

amcasey commented 4 years ago

After discussing #38399 with @ahejlsberg, @RyanCavanaugh, and @DanielRosenwasser it sounds like one possible improvement we could make to the check time of code consuming JSX.IntrinsicElements (and related libraries) would be to reorder some of the properties in HTMLAttributes so that the ones depending on the type parameter are resolved first when comparing types structurally (i.e. so we hit the variance short-circuit ASAP). We could consider submitting PRs to that effect.

DanielRosenwasser commented 4 years ago

Related are:

though we mostly did this for error-reporting purposes.

Another similar thing I recall was adding property tags in RxJS to force a little bit of nominality: https://github.com/ReactiveX/rxjs/pull/1474/files