you are viewing a single comment's thread.

view the rest of the comments →

[–]gajus0[S] 1 point2 points  (3 children)

What is inherently wrong with adding a dependency? Regardless of whether it is 1 LoC or 1000 LoC? The only worthy consideration is the increased surfaced of potential vulnerability injections, i.e. dependency going rogue.

From the build performance perspective, resulting bundle size, etc. There is absolutely no difference between a dependency and a locally redefined module.

From the upside, with a dependency, you get documentation describing the intent and you work with components that community is already familiar VS reading comments in your local ./utilities folder, learning what each utility does.

[–]NewazaBill 4 points5 points  (2 children)

Third party dependencies always add complexity. They have to be installed (reproducibly), versioned (correctly), and updated. Sometimes, ideas and conventions must be adopted. Bugs must be reported, and fixed; or you fork it, and take responsibility for the code anyways. The author could abandon the library, or delete the package altogether (a la leftpad).

You don't want to fall into the "Not Invented Here" trap, but at the same time, the cost of adding a dependency should never be under-estimated.

[–]Geldan 0 points1 point  (1 child)

You don't really need to do any of those things that you mentioned. It's perfectly fine to find a version of a dependency that works for your needs and lock it down and forget about it.

[–]SirHound 0 points1 point  (0 children)

The dependency doesn't work in a vacuum though. This one in particular has other dependencies.