-
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why does every colour have its own Github repo? #1
Comments
Are you really asking or did you open this to tell me your opinion? If you do in fact want to know, I can give you 5 reasons. |
I'm really asking. Curious as to what the advantages are. Actually I have two questions:
|
Okay, thanks for clarifying, totally legitimate questions. I'll add an answer here in the next day or so. |
Still waiting... yawn |
Seems the the truth is out there 😮 who knows ... 😆 |
yes, the truth is indeed out there ;) I prefer using micro-libraries that do one specific thing. I see no reason why I'd need any more justification than that. But if I'm honest, I always look for ways to optimize our projects, and with these module in particular I was doing a sort of anecdotal experiment. Around the time that I created these I was doing a lot of code coverage stuff in our projects and it occurred to me that probably 85% to 95% of the code in the dependency tree of any project would never, ever be executed. I'd love to find out some real stats about this someday, but as a really basic test I came up with the idea of breaking these into modules so that I could use NPM's download stats to tell me how much each color was actually used over time. IMO ANSI colors are a decent test case for this because there are a number of libs - like chalk, which has 6 dependencies in its tree, a huge API surface with 25+ methods, takes 8-12ms to load, and it's likely that only one or two colors are used in any given project. This won't tell us how much the actual methods are called, but at least it shows how much of the API is used in a digestible way. Here is what I found in case you're curious (this is a snapshot of the downloads for these libraries at the time this question was asked):
It's even more asymptotic than I expected. But that's it. Nothing complicated. edit: so the bottom line is that, since ~96% of projects only use one color, we can now require that color in directly and only get one extra dep and 1ms load time, versus 6 addl deps with chalk and 8-12ms load time |
Thanks, interesting explanation. That still doesn't explain the separate repos though - It just explains the separate npm packages 😛 |
It explains both. I don't see why it would be inferred that an npm repository wouldn't === a github repository. |
It seems a bit excessive. Surely every colour could live in a single repo?
The text was updated successfully, but these errors were encountered: