DEV Community

Cover image for Check your Dependencies
Andre Reus
Andre Reus

Posted on

Check your Dependencies

The word "dependency" actually already gives a hint on what to watch out for.

What is your project "dependent" on?

This shouldn't be taken too lightly and dependencies should be considered with care. Otherwise you could end up with your project being stuck and unable to update without a massive rewrite.

I had to learn this the hard way with a UI framework that provides components. It sounds great at first because it makes it easy and fast to develop and provides features out of the box.

The problem arises when the dependency is working like a foundation you are building on or is part of an important feature that can't easily be removed.

The UI framework I was using was not updating for over a year after Vue 3 came out, so my project was stuck with Vue 2 because it was built on these components.

In the end I rewrote my entire project. Now I have normal HTML with Tailwind classes instead of predefined components from the UI framework and that makes it independent.

HTML and styling are separate with Tailwind. Additionally Tailwind is more actively maintained and more widely supported.

When considering dependencies

These things should be checked before considering a dependency:

General

  • Is it worth being dependent on it?
    • Can it be done by yourself?
  • Is it easy to remove later?
    • Is it something foundational that can't easily be removed?

Maintenance

  • Is it actively maintained?
    • When was the last update/commit?
  • How likely and fast is ongoing support?
    • How many contributors does it have?

Other factors

  • Is it widely used and supported?
    • How many stars/downloads does it have?
  • What's the license type?

In ongoing projects

These things should be checked regularly in an ongoing project:

  • Can dependencies be removed?
  • Are there updates for dependencies?
  • Are there security fixes for dependencies?

Check for outdated npm packages and update them as defined in package.json:

npm outdated

npm update --save
Enter fullscreen mode Exit fullscreen mode

Check the security of npm packages and fix the issues if possible:

npm audit

npm audit fix
Enter fullscreen mode Exit fullscreen mode

Summary

If you are carful when considering dependencies and regularly check the dependencies you are using, it's a good start to avoid them having a bad impact on your project.

Top comments (0)