News for hackers. Stuff that matters.
Re:The state of JavaScript modules by pas on Monday May 29, 2017 @04:29AM (#14438065)
JS is backward compatible. So it got that too from Java other than the funky name. So it's stable. jQuery? Works. Good old document.getElementById? Works. And thanks to the standardization efforts of vendors (and countless volunteers, who created feature matrices and feature tests and polyfills, and so on), now using those is easy, because you can look up what's supported, what will be supported, and what is deprecated. (So for a single page interaction you don't need tools. Case in point, last week I coded up a HTML form with a simple <script> tag. I got so nostalgic I almost wanted to watch a video of FrontPage 97.)

But if you want to minify your code, and bundle it, and use SCSS/LESS/SASS and compile that to CSS, and if you don't want to execute the various tools manually every time, then you need tools. And yes, since these are pretty simple tools, it's easy to reinvent them, to try out a new mix of them. Gulp vs grunt? Yeah, grunt's config was horrible. But people still like magical config files, so we are back with them with webpack. And people want to use better state management, and shadow DOM, and so on, but they still like to view their sites in browsers, not just through TC39 glasses, so they use babel, but that itself evolved over the years. And so on.

And WebAssembly. And TypeScript. Because static typing is really helpful. And isomorphic whatever. And tools for that. And tools for development. (Nodemon, hot code replacement, unit testing, code coverage, e2e testing, and so on.)

And even though everything is a moving target, the good bits are still doing pretty well. (Yarn is pretty good thanks to the lockfile, but obviously npm is doing well. Webpack lives on but AngularCLI actually works so no need to handcraft webpack config; and gulp works too, if you want to get simple.)

And you don't need to wait for others to tell you what's best. Look at your visitors/users, think about their needs, and look at what tools can help you serve them best. Are you making sites for blind people? Use/support tools that are thinking about WAI-ARIA/semantic markup. If you deal with mobile users? Optimize for speed, service workers, write non-chatty [REST] APIs, push content to CDNs, and think about PRPL ( https://developers.google.com/web/fundamentals/performance/p... ). If you serve big enterprises, use tools that provide IE4.01 compatibility, and so on.

Re:The state of JavaScript modules by positivecomment on Monday May 29, 2017 @05:10AM (#14438199)
I generally agree, just a small nitpick:

> Are you making sites for blind people? Use/support tools that are thinking about WAI-ARIA/semantic markup.

I think developers should always have accessibility in their mind. People (or organizations they work for) may choose to use IE8 and yes, it makes sense to draw a line somewhere regards to supporting browsers. They can decide if an upgrade effort is worth to use your application. However people do not choose to have less abilities and it's possible that they can't do anything to change that. I'm not a dictator who says everyone must use all the accessibility best-practices but usually there's a small effort which can be made with huge gains.

Re:The state of JavaScript modules by pas on Monday May 29, 2017 @08:18AM (#14438717)
Absolutely. But that's still a trade off (between using a tool that might be better in some other sense, but then you might not have time to add ARIA tags, or reshape the markup a bit). And usually it's not an explicit requirement. So it's up to the developer/team.

And I agree with doing the minimum. There was a great site that shows sites as they "look" like to a screen reader, but I can't find it now. (But it was very much like WAVE http://wave.webaim.org )

Re:The state of JavaScript modules by coldtea on Monday May 29, 2017 @04:53AM (#14438149)
>JS is backward compatible. So it got that too from Java other than the funky name.

You mean forward compatible. Which is unlike in Java.

New code (e.g. with ES6 features) doesn't work in older JS engines / browsers -- that's why we have transpilers.

Re:The state of JavaScript modules by pas on Monday May 29, 2017 @08:20AM (#14438726)
Java 8 lambas don't work on Java 6 JRE/JVMs either.

But your code is "futureproof". The spec/language/VM is backward compatible with old code. (In the sense that you can drop in the new version and old code runs.)