Live data from Hacker News

JavaScript in 2015

glenmaddern.com

61–70 of 129 posts

Re: JavaScript in 2015

#61
post #48
post #46

Earlier quoted context omitted.

In their current states, Webpack is for the production applications, JSPM for development / little ES6 apps, and SystemJS is used for Node.js. - Webpack supports much more than just ES6 (and more people work on it), so you probably want to use it for production apps. - JSPM allows you to load ES6 library by transpiling them on-the-fly, which is great for simplicity. - SystemJS works by itself in a Node environment, y…

This seems so fragmented, even before you consider all the other module loaders, transpilers and toolchains. I'm a senior frontend developer and I find this side of JavaScript truly bewildering.

Agreed on there being too many tools. Thankfully most of them are starting to embrace the same core feature: writing npm modules. Small bits of code that you publish once to npm, and then reuse across many projects and potentially many build/workflow systems.

Re: JavaScript in 2015

#62
post #4

God, he makes it look good. The demo does give me a few of the ol' "too much magic" heebie jeebies, but frontend JS development is so badly lacking in compelling packaage management stories that I'm going to give jspm a shot. Here's to 2015, I suppose. P.S. Glen, if you're reading this, I really would love to see a youtube of a DJ hooked up to automatically synced GIFs. Don't be a tease.

For package management why not use Bower ?

Re: JavaScript in 2015

#63
post #49

Earlier quoted context omitted.

That's assuming you want all your scripts to be loaded on the front end asynchronously which seems to be only for development. For production I think you'd still want to compile this all down for a faster load time. From the jspm page: "For production, use the jspm CLI tool to download packages locally, lock down versions and build into a bundle." So I think you're correct that there'd be no build step for developmen…

yep, the point though is that having a build step during dev adds some overhead (which can easily go into the several seconds range in my experience) into the type-save-reload cycle, which is exacerbated by hit-reload-before-build-finished-so-need-to-reload-again pattern. My understanding is that this tool removes that entire class of annoyances, and gives a no-hassle live-reload ES6-enabled environment on top.

Substack's essay applies as much to this tool as it does to webpack:

https://gist.github.com/substack/68f8d502be42d5cd4942

Importantly, overloading require like this:

  var collections = require('npm:lodash-node/modern/collections');
  var $ = require('github:components/jquery');
... means that you can't publish this module to npm and have the require statements work as expected.

Re: JavaScript in 2015

#64
post #48
post #46

Earlier quoted context omitted.

In their current states, Webpack is for the production applications, JSPM for development / little ES6 apps, and SystemJS is used for Node.js. - Webpack supports much more than just ES6 (and more people work on it), so you probably want to use it for production apps. - JSPM allows you to load ES6 library by transpiling them on-the-fly, which is great for simplicity. - SystemJS works by itself in a Node environment, y…

This seems so fragmented, even before you consider all the other module loaders, transpilers and toolchains. I'm a senior frontend developer and I find this side of JavaScript truly bewildering.

The main issue is really the lack of module concept in Javascript core. I hope things get better with ES6, because at this point it will be much, much easier to write a library to load them all, without relying on "proprietary" loaders.

Re: JavaScript in 2015

#66
post #62
post #4

God, he makes it look good. The demo does give me a few of the ol' "too much magic" heebie jeebies, but frontend JS development is so badly lacking in compelling packaage management stories that I'm going to give jspm a shot. Here's to 2015, I suppose. P.S. Glen, if you're reading this, I really would love to see a youtube of a DJ hooked up to automatically synced GIFs. Don't be a tease.

For package management why not use Bower ?

http://jspm.io

Re: JavaScript in 2015

#67
post #43

Earlier quoted context omitted.

I know what the batman example gives but I don't get how it's a WTF? I assume the expected output is "wa" but why should a string less an integer produce that?

No, it produces NaN (Not-a-Number), and then repeats it in a string 16 times. The WTF is that NaN can be concatenated to strings as "NaN".

NaN is passed to Array.prototype.join() as the separator to join strings with, so it gets coerced to String ("NaN"). It's deliberately working backward from the behaviour of Array.prototype.join() to create a contrived example for giggles, not a WTF.

It's no more a WTF than this, which follows the same principle: https://gist.github.com/insin/1183916

Re: JavaScript in 2015

#68
Looks like an interesting workflow, but I think I still prefer using a compile-to-js language like CoffeeScript over the use of shims. I know it's a silly thought, but to me, shims sort of violate the separation of responsibilities between the user and the developer. If I, as the developer, want to write more concise, scalable, and convenient code, it should be my responsibility to spend my development resources to convert that code to something the user's browser can understand.

Re: JavaScript in 2015

#69
post #41

Aside: "A DJ using Ableton Live, a huge bundle of MaxMSP emitting a UDP stream of beat information (courtesy of the immensely pro Cade), a UDP ➝ WebSockets server, and DJGif pulling hundreds of GIFs off various Tumblrs to beatmatch on two projectors makes for a hell of a good show." Does anyone know why he wouldn't have used the midi clock from Ableton (or other DJ software) to a "midi->websocket" server?

One reason might be that MIDI clock is just a repeating, identical message. It does not contain any position information (like where the next bar starts). To get positional information relating to beats and bars, you need to use MIDI Song Position Pointers, however these use a 14 bit counter which will typically overflow after about 10 minutes. In short, long-running musical clock sync over MIDI is problematic. For s…

Sweet! Thanks for the detailed run down. As a DJ myself, at my residency we have a random splattering of strange movie clips that we just play and they are never beat matched but mentally something "always" hits a beat when you are watching it. I guess he's going for stuff actually changing in musical time.

Re: JavaScript in 2015

#70
post #62
post #4

God, he makes it look good. The demo does give me a few of the ol' "too much magic" heebie jeebies, but frontend JS development is so badly lacking in compelling packaage management stories that I'm going to give jspm a shot. Here's to 2015, I suppose. P.S. Glen, if you're reading this, I really would love to see a youtube of a DJ hooked up to automatically synced GIFs. Don't be a tease.

For package management why not use Bower ?

Bower is great if you need to install jQuery or one of its plugins, or another very popular JS framework.

When you get into smaller modules, persistence, recursive or deep dependency trees, versioning, automated bundling (i.e. no manual "config" files), etc. then bower is not a strong choice.

A good writeup here: https://github.com/bionode/bionode/issues/9#issuecomment-495...

Post reply on HN