webpack sucks, at least for now
This is an imported article from my wordpress blog. I wrote it during Jul-Aug, 2016 and everything written in it might not be 100% relevant now.
ctrl+R I expect zero latency for the new script to appear in local dev environment.
When you take that away by introducing obnoxious transpilers like
webpack – that first needs to be told how to load, then how to compile, then concat before showing me the output, well, if you weren’t already the subject of my fury yet then note that..
..the ‘wait time’ for compilation sucks
A moderately sized project on a 2014–15-isque mac book pro with 8GB takes good 40s–70s to compile.
Honestly, I can’t put up with this kind of latency. I don’t know what kind of computers people at facebook HQ use, but if you’re on your own & have a mac with 8 gigs, it doesn’t play out well. May be Java devs who’re used to such latencies won’t feel the pain, but as a JS guy I get pissed very quickly.
And I must mention — their hot module replacement isn’t appealing much.
I have spent years abhorring
sass-with-compass. It used to take some good 13s to compile a some ~10kloc file for every single line of change. Imagine, you’re a guy who loves to do trial-n-error while working with CSS and have to wait 13s every time you change a pixel value. But luckily
libsass was a perfect fix for it. It’d compile entire CSS files in the project in a matter of 3s–5s.
The reasons why I stayed all these years away from coffee script –
- The compilation time — it sucks.
Let JS remain the interpreted language we all know and love. Don’t put your compiled language genius into it. You’re not welcome here — to the interpreted world.
..the hype cycle & the tech debt
A new framework launches once in every 6 months and 20 yo’ fresh graduates are the first ones to pick it up. The oldies are often conservative & have been aware of the programmer fraternity’s shenanigans. They know it’s a fad & will disappear forever from history sooner or later.
Every app built around any well-hyped JS framework is just another framework away from being declared as tech debt.
This trap is pulling humanity back. We’ve been living with this imperative style of coding with 3GL since quite some time and we need to grow out of this 3rd generation language trap. New frameworks aren’t helping much.
Debugging is horror
you’ve to trace that line out. Imagine a project consisting of 100 small files with almost similar looking content that you concatenated and now clueless where exactly to hunt and debug.
It’s not uncommon — when you write derived components inherited from parent components, the siblings tend to look similar.
Webpack would concatenate files together. You’ve to be super familiar with the code and know exactly where to put those break points. This is never the case with Angular, where during your development builds, the build blocks serve discrete files. They can be easily identified with their name & path. Debugging is lot easier with it. Any new comer can simply jump in & get a hold of the code.
webpack – you’re a clutter builder and clarity killer. And, No. I’m not going to work in large files a.k.a monoliths just to support your existence.
Lack of build blocks
I came from an AngularJS Development environment, where I extensively used
yeoman and that allows me to work on an
index.html file locally which has references to locally kept css and JS.
That means we don’t have to wait for
compile before we hit the
Plus, the library files from
bower_components stay separate.
usemin blocks for our rescue – which simplifies local development and is a convenience for production builds.
webpack, unfortunately, everything becomes bundled together during the compilation step as if you’re directly working on a little-lenient-er version of production code.
Learn something from it. Your hotness may look tempting to fools and noobs. I ain’t one. Grow up.
Till then — happy hating.
And, I always believe there is no point in complaining, one must find a remedy. Following are some workarounds to reduce frustration:
Originally published at statusok200.wordpress.com on August 4, 2016.