question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeScript as optional dependency?

See original GitHub issue

The 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:open
  • Created 4 years ago
  • Reactions:2
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
zwaldowskicommented, Mar 8, 2020

won’t have any impact on anything…

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!

1reaction
sindresorhuscommented, Mar 1, 2020

This doubles XO. 40MB -> 90MB

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found