mhart / aws4

Signs and prepares Node.js requests using AWS Signature Version 4
MIT License
703 stars 176 forks source link

LRU as separate module for reuse? #116

Closed gitcatrat closed 4 years ago

gitcatrat commented 4 years ago

This might be controversial and opinionated but could we use 3rd-party LRU or publish it as separate package?

https://github.com/mhart/aws4/issues/19

I personally really don't like the "zero dependency library" trend (especially if only to brag about it in readme) because everyone is reimplementing same behaviours again and again thinking that they make code smaller by removing the unused code but in reality it's the exact opposite because everyone has their own "cleaned" version instead of reusing the same great modules out there. The other point is that many of us need to include some kind of LRU package for our own logic as well and again - we have multiple versions of the same thing. Does it make sense or am I just yelling at clouds?

mhart commented 4 years ago

I can definitively tell you the reality is not the exact opposite. In reality deps aren't shared anywhere near as much as you think. Here's just one of our projects:

find node_modules -name lodash | wc -l
      19

That's 19 copies of a 5MB dependency which we don't even use ourselves. Why? Because different sub-deps depend on different versions of that library, so you can't dedupe.

In any case, grumbling about "zero dependency libraries" and "bragging in readmes", when this project does no such thing, is definitely yelling at clouds.