Discussions: HN | Twitter | Dev.to
The Story So Far
The second age of JS, from 2009-2019, started with the annus mirabilis of 2009, where npm, Node.js, and ES5 were born. With Doug Crockford showing us its good parts, users built a whole host of JS Build Tools and libraries, and extended JS' reach to both desktop and new fangled smart phones. Towards 2019 we even saw the emergence of specialized runtimes for JS on phones like Facebook's Hermes as well as compiler first frontend frameworks like Svelte 3.
The Third Age
2020 feels like the start of a new Age. If the First Age was about building out a language, and the Second Age was about users exploring and expanding the language, the Third Age is about clearing away legacy assumptions and collapsing layers of tooling.
Note: I have pitched the Collapsing Layers thesis before!
The main legacy assumption being cleared away is the JS ecosystem's reliance on CommonJS, which evolved as a series of compromises. Its replacement, ES Modules, has been waiting in the wings for a while, but lacked the momentum to truly take a leap because existing tooling was slow but "good enough". On the frontend, modern browsers are equipped to handle these in small amounts too, but important details haven't yet been resolved. The Pika/Snowpack project is positioned to accelerate this future by providing a facade that can disappear as ES Modules get worked out. As a final bonus, IE11 will begin its slow march to end of life starting this year and ending in 2029.
Note - this is contested, and Python's PyPy indicates this isn't a foregone conclusion.
Layers are also collapsing in interesting ways. Deno (now a startup) takes a radical approach of writing a whole new runtime, collapsing a bunch of common tools doing tasks like testing, formatting, linting and bundling into one binary, speaking TypeScript, and even including a standard lib. Rome (now a startup, pitch deck here) takes a different tack, collapsing all those layers atop of Node.js (as far as I know, I'm not too close to it).
Even in frontend frameworks, the activity going on is fascinating. Svelte collapsed everything from animations to state management into a compiler. React is exploring metaframeworks and client-server integration. And Vue is working on an "unbundler" dev server project named Vite.
In summary: Third Age JS tools will be
- ESM first
- Collapsed Layers (One thing doing many things well instead of many things doing one thing well)
- Typesafe-er (built with a strongly typed language at core, and supporting TS in user code with zero config)
- Secure-er (from dependency attacks, or lax permissions)
- Neo-Isomorphic (recognizing that much, if not most, JS should run first at buildtime or on server-side before ever reaching the client)
If so - we're in the Endgame now.
Edits from the future:
interesting projects to track (Robin Cussol maintains a repo here for JS tools not in JS)
- Axel Rauschmeyer: https://2ality.com/2020/10/js-plus-other-languages.html
Top comments (9)
Very nice piece Shawn! Node.js has identified the desire to start "collapsing layers" of legacy things, but of course doing so in a way that will not break anything in the wild.
I think WebAssembly will be a bigger piece in the next decade than any of us actually realize.
I agree with the other comment - some level of AOT compilation will be useful for performance areas. IE11 finally dies as a significant platform for business web apps on 31/12/2029 and the next decade requires a lot less bundling.
I also think the Svelte model of framework as a compiler has some real legs over the next few years.
Most Likely to Occur
Chrome manages to convince everyone to implement a browser filesystem API. If that happens, then the web is unleashed even more. But haven't seen other browsers play ball on this one.
Wild 'Fantasy Land' Guess
The day rust becomes the norm for frontend web development, I think I'll stop building things for the web. For a server, sure, even though I much prefer go over rust, but for the frontend? I sure don't hope so.
I think in the next years we should go back to the roots - get rid of the node_modules massive bloat (even the hello world app in any JS framework nowadays requires tens of MB of node_modules, including is-number, is-even and is-odd!), abandon very often failing node-gyp, use lightweight and ultrafast JS libraries like Riot.js, parallelize JS using Web Workers, simplify web development like in good old days of a single
<script src="jquery.min.js"></script>. Deno and Vite are small steps in a good direction.
chart source, for future editing excalidraw.com/#json=4802174517248... feel free to fork it and prettify/add stuff