by frio · 10y ago · 0 comments
... but, all these libraries are huge. I feel guilty foisting hundreds of kilobytes of JS on my users, just so I can write code that I feel is slightly more elegant. I'm avidly waiting for tree-shaking/jsnext:main to truly take hold, and make these tools more practical.
Gripes aside, congratulations to the Fantasy Land team :).
Combine it with a decent transpiler (I recommend Bublé) and Uglify and you're off to the races: tiny builds, that work wonderfully.
If you set up a concat+minifying step in your process (you should be doing this anyways if you're shipping a real amount of JS) then the total cost of a library like this might just be a couple kilobytes.
Angular.JS (which has a huge amount of functionality in its core) is only 50kb gzipped.
Yes, I have a concat/minifying step, but as I mentioned, I'd love to see broader acceptance/implementation of tree-shaking. As it is, tying together fantasy-land, Ramda/mori, React, Redux all adds up very quickly (and that's without writing any business logic!).
The trick to not breaking your build is to know which libraries GCC can optimize without breaking.
The ones it can - browserify them seperately and then ones it cannot - browserify them later.
Its a longer step I agree, but its a small price to pay to be in Fantasy Land :D
( sorry couldn't help it )
Or are you more worried about page load time, not download time?
typically unless you're like me and clear cache when the browser closes...Linking to shared libraries hosted on a CDN often ends up failing because of distinct versions.