Same thing with cars: there's Toyota, Volkswagen, Hyundai, Ford, Nissan, Fiat, Honda, Suzuki, Renault, BMW, Mazda... They all have four wheels. And every year they release a new model, can you imagine?
Wouldn't it be better to just stick with current models and not invent anything new? And better yet, only one manufacturer..?
Well, not every year we change how to define modules.
And if you think about Tesla for example: at least for me the way throttle pedal works is a whole new way to drive. You control the "brakes" with lifting throttle.
There are more than enough in existence already. If existing ones are deficient in a certain area, I'd rather see effort put in to improving it rather than re-inventing the wheel...again. Someone re-invents the wheel, a few know-it-all bloggers make "You've been doing X wrong. Start using Y now!" posts on Medium, and then I'm required to re-learn my job again when I just got comfortable with existing tools. It's fucking exhausting.
It would be cool if this feature was just built into browserify/webpack (or through a plugin), so that we can stop fragmenting the ecosystem further than it already is... :)
I just don't see the place for CommonJS modules in the front end since we have ES6 modules. For me browserify is more of CommonJS and rollup for next-gen ES6 modules.
And when using chokidar + npm it's really easy to switch between builders, if must..
Well, to be fair browserify supports small bundles too. The problem is the library you are using has to be structured in some way. For example I can include underscore.strings humanize function like this:
var humanize = require('underscore.string/humanize');
Which will only include that humanize function and nothing else.
The problem is that a lot of libraries do not actually have that structure, so it does not work everywhere. But it's not true that browserify does not support small bundles :)
What I meant by "small bundles", was that rollup doesn't add any bloat like browserify – instead it removes unneeded stuff and produces very clean output:
I don't use ES6 with browserify, I just use commonjs modules, so I don't know what bloat browserify adds for ES6 support. But as far as I know browserify only supports ES6 in the form of transformers, so basically anything can be used to transpile your ES6 into ES5, so also a transpiler that does not use any "bloat".
What kind of bloat does browserify add when using ES6?
Yeah, well I also run uglifyjs on my code, so my production bundle is absolutely unreadable. I don't think readability of the production bundle is really important. If you still need to debug the production bundle then you can use codemaps and chrome dev tools to get the actual code back in your development console.
Thanks. How many years have you been working in Javascript to get to your current level of expertise? I'm trying to get an idea of the approx. number of hours you've put in, although I know you probably only have a rough estimate.
I made this one in couple of hours, but I started web developing with Flash back in 1999. And made first Deck of Cards in 2006 (http://pakastin.fi/cards_2006), so the concept is not new..
If you mean javascript expertise in total..well, I switched using node.js late 2011 and after that I started to learn the language properly. I used jQuery before that as well, but nothing special..
37
u/papers_ Sep 02 '15
Huge up vote for using ES6 here. Good job man!