forked from google/schema-dts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rather than inlining a "leaf" type as an intersection in a big union, name it. This should hopefully help with google#34. This is based on advice from @amcasey regarding compiler performance: > I've definitely seen some impressive perf improvements from naming > intermediate types (because it can short-circuit structural type > comparison, which is very expensive). This fits neatly with my initial description of the Schema.org type system here: https://blog.eyas.sh/2019/05/modeling-schema-org-schema-with-typescript-the-power-and-limitations-of-the-typescript-type-system/ There's still some room for improvements: - Some intermediate types are simply aliases, can we remove these? - 'DataType's don't necessarily fit neatly here.
- Loading branch information
Showing
1 changed file
with
58 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters