Gather round for some news that’s really going to shake your tree: as of version 0.55, <blink>Rollup, the JavaScript module bundler, finally has code-splitting</blink>! This has been the most popular feature request for a long time, since it lets complex apps load quickly in smaller increments while still leveraging Rollup’s obsessive focus on efficiency. Rollup has long been the tool of choice for library authors — it powers React, Vue, D3, Moment, Three.js, …

This week, Facebook merged a monster pull request into React that replaced its existing build process with one based on Rollup, prompting several people to ask ‘why did you choose Rollup over webpack’?

Which is a completely reasonable question. Webpack is one of the modern JavaScript community’s greatest success stories, with millions of downloads every month powering tens of thousands of websites and applications. It has a large ecosystem, dozens of contributors, and — unusually for a community open source project — meaningful financial support.

By comparison, Rollup is a minnow. But React isn’t alone — Vue, Ember, Preact, D3…

Audio on the mobile web is a mess. The easy way to play sound — creating an <audio> element and calling the method — doesn’t work unless playback starts in response to a ‘user gesture’, and will only let you play one clip at a time.

The hard way — loading the audio, decoding it using the web audio API’s context.decodeAudioData(…), creating an AudioBufferSourceNode and playing that — gives you a lot more flexibility, but comes with a rather important caveat: it will crash your phone.

There’s a simple reason for that. The browser needs to store the entire…

If you write JavaScript tools or libraries, you should bundle your code before publishing.

The internet

A few hours ago, Azer Koçulu ‘liberated’ his collection of modules from npm following a trademark dispute. One of them — an 11-line utility for putting zeroes in front of strings — was heavily depended on by other modules, including Babel, which is heavily depended on by the entire internet.

And so the internet broke.

I’ve been working (albeit sporadically of late, admittedly) on a tool called Rollup, which bundles together JavaScript modules. One of its features is tree-shaking, by which I mean that it only includes the bits of code your bundle actually needs to run.

Axel Rauschmayer asked where the term came from…

…and Amjad Masad said that it’s really just a different name for dead code elimination

…which Sebastian McKenzie thinks is silly:

But they are in fact different things, even if they have the same goal (less code).

Dead code elimination is silly

Bad analogy time: imagine that you made cakes by throwing…

Long Road Photography on Flickr, used under Creative Commons license

Once again, the turkeys have voted for Christmas. The ailing news industry has rushed headlong into an alliance with Google, which is trying to stave off its own existential threats. It’s an alliance in which we are clearly the junior partner, and one that will hobble the diversity and development of digital journalism. And it could all have been avoided.

Google’s Accelerated Mobile Pages project, or AMP, is one of those ideas that’s hard to argue with at first: an open source endeavour to create a subset of HTML that allows pages to be aggressively cached, and that limits the…

There’s a post currently doing the rounds that articulates the ‘small modules’ philosophy. It’s written by Sindre Sorhus, whose npm profile is enough to make all but the most prolific developer feel wholly inadequate, and so carries with it a degree of authority.

Like a lot of ideas that seem to be self-evident and inarguable, ‘small modules’ contains a lot of truth but does not, I believe, bear close scrutiny. But because it is espoused by so many leading members of the JavaScript community, scrutiny is all too rarely applied.

I think I know why: it’s because the small modules…

If you haven’t read Trek Glowacki’s post Requiem for the “Front Ender”, you should. It’s essentially a follow-up to this answer to the question of whether Ember will continue to support users who don’t wish to use ember-cli. Both are beautifully written, and contain a lot of truth.

Stripped to its core, the argument is that web development is no longer a field for amateurs, but for Engineers with a capital E. (Often, when this subject is discussed online, there’s an ugly hint of triumphalism involved — of developers who have already climbed the ladder delighting in pulling it up…

Rich Harris

Graphics editor, @nytimes investigations team. Open sourceror

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store