Why do some JS devs import tiny packages to do simple things? I don’t feel like I’ve seen this behavior in Python. Is it because browsers are an awful environment?
Why do some JS devs import tiny packages to do simple things? I don’t feel like I’ve seen this behavior in Python. Is it because browsers are an awful environment?
So, people had incentive to write and use smaller packages.
Now, the situation has improved. If you use esmodules all the way, and only import what you need, then your bundler can remove unused modules from final build
That's kinda funny. These node tools I run into these days usually take forever to install, waste a lot of space due to creating their own package mirror and generally are prone to break because of dependencies.
There is usually nothing tiny about them, even thought they only have a few lines of code.
when we make a build for the browser we bundle all dependencies into fewer files that only contain the code that is used
I got tired of copying and pasting the same classes between projects. The worse part was I'd add new features to the newer projects and when I would have to go back to work on something from a year or two ago I'd have to spend time backporting all the new code. I also don't like how bloated a bunch of the "popular" packages are. Why do something in 40kB of JS when you can do it in 3kB. Smaller is faster which is important to me because one of my main selling points is that I build modern-looking marketing websites that load and render under 5 seconds on a slow 3G connection.
Why not create your own common library and publish it to a private repo? There's a lot of options between using a stranger's package and what you're describing.
Exactly what I thought. Fascinating how they can have missed this obvious solution.