News for hackers. Stuff that matters.
Re:PR converts the Three.js codebase to ES2015 modules by apo on Saturday July 23, 2016 @10:31AM (#12149549)
I've used Rollup and it worked extremely well for bundling JS that uses modules into a single file. The documentation is very good and the community is quite responsive.

The only thing that would be better is not needing Rollup in the first place.

What's the current status of browser support for ES6 modules?

Re:PR converts the Three.js codebase to ES2015 modules by maga on Saturday July 23, 2016 @10:48AM (#12149604)
In development in all browsers[1] meaning none has them yet. IIRC, one of the major roadblocks was the need to define <script type="module"> in the HTML standard[2] as well as the whole loading routine. Hence, the feature is coming later than the rest in ES2015.

[1] https://www.chromestatus.com/features/5365692190687232

[2] https://github.com/whatwg/html/pull/443

Re:PR converts the Three.js codebase to ES2015 modules by dexwiz on Saturday July 23, 2016 @12:45PM (#12150044)
We probably won't see module, or a good module, until big HTTP2 support. Having a single file has some huge gains for HTTP, mostly in the overhead cost of a request. HTTP2 will get rid of some of that overhead via streaming files and header compression. Sending a ton of different javascript files is too costly right now.
Re:PR converts the Three.js codebase to ES2015 modules by MatthewPhillips on Saturday July 23, 2016 @11:52AM (#12149814)
It's available in Edge if you have Windows Insider (the Edge equivalent of Chrome Canary). There are some bugs there though.

Note that the browser's module support is stricter than Node's, you have to point your imports to the specific file you want to import and include `.js` on the end, for example this won't work:

https://github.com/mrdoob/three.js/blob/dev/src/materials/Ma...

in script[type=module]. So there will still need to be a refactor of THREE.js even after browser support starts coming in.