TypeScript as optional dependency?
See original GitHub issueThe additions in 0.27.0 are wonderful for my TypeScript projects; I’m so excited! However, adding an unconditional dependency to the TypeScript compiler was surprising, and ballooned the node_modules
of many of my non-TypeScript projects quite considerably while upgrading. Is there any room for us to, say, use a peer or optional dependency instead?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:8 (5 by maintainers)
Top Results From Across the Web
How do I handle optional peer dependencies when publishing ...
If the typings of foo and bar are distributed with the libraries themselves, you have to either include the libraries as dependencies (which...
Read more >What are Optional Dependencies and when should we use them
The term optional dependencies apply to dependencies that won't cause a failure during the installation of an application or project since ...
Read more >optional-typescript - npm
An optional library enabling the usage of optionals written in TypeScript. Latest version: 1.6.1, last published: 8 months ago.
Read more >What Are NPM's Optional Dependencies and When Should ...
By installing Cypress as an optional dependency, we declare it to be an optional dependency that does not necessarily need to be installed....
Read more >Optional dependency on ts-node #3221 - GitHub
Instead of statically importing cosmiconfig-typescript-loader , @commitlint/load could depend on on it using an optional peer dependency and ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Except if you have metered Internet, throttled Internet, high-latency Internet, CI with throttled Internet… the list goes on.
And, again, a trade-off can be made by the individual, and would likely make sense if the dependency was even used! But it’s not!
Why is it a problem?
XO has always favored developer convenience over size. XO bundles lots of things to make devs more productive and ensure high-quality code.
It also looks like TypeScript will soon fix the large package size: https://github.com/microsoft/TypeScript/issues/27891#issuecomment-580912889