Remove OneKeyFrom type check to reduce compile time.#7115
Conversation
Save 16 seconds from typescript compile step.
tephenavies
left a comment
There was a problem hiding this comment.
I agree. This is a good tradeoff
|
If duplicate packages are an issue for type analyzer performance, I believe #7105 eliminates version 1.4.2 of d3-color listed at the bottom of the analyzer report in this PR. |
|
@na9da oh, that link provided a really clear explanation. My PR was for security issues, so I'm glad it killed two birds with one stone. If the type analyzer wants as few duplicate packages as possible, I'm guessing you roughly want to have the latest version of all packages (so the only duplicates are from packages that have not been updated for a long time). If you manage to bring most dependencies in package.json up to date, Dependabot can then be configured to automatically provide pull requests when there are new versions of packages released. (Dependabot can automatically send pull requests for other eco-systems too, TerriaJS/TerriaMap#665 is for having Dependabot keep the Github actions up to date.) |
|
@pjonsson We did have dependabot until sometime ago but decided to turn it off until we deal with the current backlog. We will turn it back on once we have it under control, so thanks for all the PRs. |
|
@na9da I have never used it myself, but I know Dependabot can be configured to only make pull requests for security updates. If Dependabot was turned off a long time ago, it might be worth evaluating if that strategy has served your goals well. |
What this PR does
Save 16 seconds from typescript compile step.
Running typescript analyzer reports a hotspot when compiling Terria code (see report below). Apparently the OneKeyFrom type used for typing the Text and Box component props is pretty expensive to type check.
I am not sure if there is a better fix, but for now I have removed
OneKeyFromwhich loosens the type checking a bit, but I think this is a good compromise as it:Textcomponent from further increasing the compile timeTypescript analyzer report:
Test me
Before:
After:
Checklist
There are unit tests to verify my changes are correct or unit tests aren't applicable (if so, write quick reason why unit tests don't exist)Only changes the typesdoc/.