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.

Reduce dependencies where prudent

See original GitHub issue

It’s been a while since we’ve audited these 😃

screen shot 2018-11-26 at 16 18 51

https://npm.anvaka.com/#/view/2d/lighthouse

Our biggest win would be to get rid of update-notifier. It brings in 52 indirect dependencies. Yarn just does this check themselves, or we could just not do it. Removing update-notifier would bring us from 174 deps to 122.

Next would be inquirer, which we use just for the prompt on if we can use Sentry on first run of the CLI. Not sure what happened in that community, but there’s basically a reimplementation with an almost exact API match in enquirer, and it only has one dep. This would bring us from 122 deps down to 92.

Replacing yargs with commander would remove 15 dependencies.

Moving chrome-launcher’s @types deps to dependency deps would remove 4 dependencies

After that comes

Though I’m not sure if we can do much about configstore and raven, and the competitors to rimraf tend to also use its only dependency, glob, so have the same or more dependencies.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
brendankennycommented, Nov 27, 2018

That being said, what is the primary motivation for this? All of these only affect code size of the CLI and we don’t update them ever.

Sorry, should have put more of a scope on this.

More dependencies aren’t necessarily a negative, but they definitely aren’t a positive. If we can reduce the number of dependencies while maintaining the features we want and not creating pain in development or maintenance, that’s a good thing.

inquirer might have been a better first entry in the initial comment. A near drop-in replacement exists that would provide a ~30 dep/~24MB reduction after npm i. They also claim a ~250ms reduction in startup time (on some machine) due to the large number of requires needed to load it. That’s a lot of downside to the current solution for a single confirm screen seen at most once.

Testing it out, the main thing that we’d need to fix to match master would be manually bolding the question text and overriding their ctrl-c handler (which is stomping on ours in the timeout case).

I think arguably update-notifier is in a similar place with 52 deps independent of any of our other ones. It’s not a lot of functionality for a good bit of cost. It’s less clear if there’s an easy replacement or if we’d want to maintain something ourselves (we already have configstore and semver, so we’re like 2/3 of the way there 😃, but it’s worth weighing at least.

0reactions
brendankennycommented, Jun 8, 2019

this is also an issue that could live eternally. Let’s close and going forward I’ll try to focus my unease on specific ideas 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Reduce Dependency on Third-Party Platforms
Being prudent is one way of avoiding serious damage from unexpected shock. To make you understand how dangerous it is to lean on...
Read more >
PruDent: A Pruned and Confident Stacking Approach for Multi ...
This is where our paper wants to contribute. We identified two potential ways to prune unnecessary dependencies and to reduce error-propagation ...
Read more >
DevSecOps: A Prudent Programming Approach - Skyepoint Decisions
A container holds a complete runtime environment, including app, dependencies and other required files. The upshot: Developers can use containers to make their ......
Read more >
Audit dependencies v2 · Issue #550 · GoogleChrome/lighthouse ...
Here's the disc view of the current lighthouse-background script once its browserified. (Insert disclaimers that there are some differences between the ...
Read more >
Surviving Software Dependencies - ACM Queue
Future development efforts should focus on reducing the cost of the kind of evaluation and maintenance necessary to use a dependency.
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