Why so many @types packages for Ember but only one ember-source? #1495
-
The Installation docs and Understanding the @types Package Names Relatedly, I manage a monorepo at work (6 apps + 2 addons in a yarn workspace):
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
The short answer is: so that autocomplete works "out of the box". By default, tools powered by the TS Language Service do not auto-import from your transitive dependencies—which is as you want, because you only want to suggest completions from your direct dependencies, so that you don't get broken if your direct dependencies' relationship to their transitive dependencies change. This is essentially a knock-on effect of the fact that Ember ships the umbrella package but that you literally never import directly from There are other ways we could work around this. For example, we could bundle all the definitions with a single
All of these considerations should become substantially easier as we move to shipping types natively from the packages. |
Beta Was this translation helpful? Give feedback.
The short answer is: so that autocomplete works "out of the box".
By default, tools powered by the TS Language Service do not auto-import from your transitive dependencies—which is as you want, because you only want to suggest completions from your direct dependencies, so that you don't get broken if your direct dependencies' relationship to their transitive dependencies change.
This is essentially a knock-on effect of the fact that Ember ships the umbrella package but that you literally never import directly from
ember-source
.There are other ways we could work around this. For example, we could bundle all the definitions with a single
ember-source
package… but for auto-complete to work …