DEV Community

Cover image for How I brought down my project's dependency tree from 36 packages to 4 packages

How I brought down my project's dependency tree from 36 packages to 4 packages

Saurabh Daware 🌻 on September 22, 2019

Before you npm install package or <script src="https://coolframework.com/file.js"> do you ever ask yourself if you really need this package/f...
Collapse
 
tyrrrz profile image
Oleksii Holub

Just make sure to cover all of your handwritten functionality with tests now

Collapse
 
saurabhdaware profile image
Saurabh Daware 🌻

yes working on it :D thanks for reading 🌻

Collapse
 
johanalkstal profile image
Johan Alkstål

This is the right kind of thinking. Thumbs up.

Collapse
 
saurabhdaware profile image
Saurabh Daware 🌻

Thank you :)

Collapse
 
jamesthomson profile image
James Thomson

I'll always have a look through a packages dependencies list before considering adding it to a project.

A tool that's helpful when doing this: bundlephobia.com

Collapse
 
saurabhdaware profile image
Saurabh Daware 🌻

Oh I didn't know about bundlephobia thank you for sharing

Collapse
 
pavelloz profile image
Paweł Kowalski

Good investigation and solution from your part.

Its so refreshing to see someone caring about how much junk they ship with the app.

I hope more people will take care about it.

Collapse
 
saurabhdaware profile image
Saurabh Daware 🌻

Thank you so much🌻🌻 and yes every developer should spend some time deciding what frameworks or libraries are actually needed :D

Collapse
 
zaidrehman profile image
Zaid Rehman • Edited

I used almost a similar approach to remove lodash completely from my project 😅😅

Personally I feel it's a right approach.

Collapse
 
saurabhdaware profile image
Saurabh Daware 🌻

Do you have a link to this commit or PR? Would love to see how you did :D

Collapse
 
zaidrehman profile image
Zaid Rehman

Sorry bro it was a private repo of my employer.

Thread Thread
 
saurabhdaware profile image
Saurabh Daware 🌻

oh ok no problem. good job though :D

Collapse
 
azeem2793 profile image
Agha Azeem

👍 that’s brilliant

Collapse
 
saurabhdaware profile image
Saurabh Daware 🌻

thank you so much :D

Collapse
 
syntaxseed profile image
SyntaxSeed (Sherri W)

I do the same with my PHP dependencies. I give preference to packages without a ton of sub dependencies.

Collapse
 
saurabhdaware profile image
Saurabh Daware 🌻

Yes I feel this is right approach and applies to any domain and any language and even on the frontend