The Third Age of JavaScript

Bookmark

The way we write JavaScript in 2030 will be completely different than in 2020. Here's why: the slow death of IE11 and rollout of ES Modules will converge toward a new generation of JavaScript tooling. These tools are faster, typesafer, and polyglot, leading to both a better developer and user experience. Change is afoot!


Transcript


Intro


Hi everyone. My name is Shawn, also known as Swyx on the Internet. And I'm here to present this idea, this decade long thesis that I have, that's called The Third Age of JavaScript.

So what's the story so far? You can break JavaScript's periods up into two or three different ages. The first age was from 1997 to 2007. There was a lot that was happening in 2008. There was a world crisis going on. So you could vaguely start picking things up again in 2009, going onto 2019. 2020 was another random mix of events, but there were still a lot of news going on. And now we're well into the 2020s. And I want to talk about that. I want to try to categorize things in a neat little bow. Obviously, history is never as neat as historians put it. But, we can actually talk about different themes and speculate on what themes are to come.


Ages of JavaScript


[01:13] So the rough table of contents that we're going to cover today, we're going to cover the first age, the second age, and then the two components of the third age I really would like to talk about, which is ES modules and the death of IE11, as well as polyglot tooling, and collapsing layers of tooling. And then the death of JavaScript. Potentially what comes after the third age of JavaScript because the story doesn't end there. But, maybe it transitions into a different story.


The First Age


So the first age of JavaScript, 1997 to 2007. For those who want to know more about the origins of the JavaScript, you should actually hear it straight from the horse's mouth from Brendan Eich. He gave this really great talk at Dot Conf on a brief history of JavaScript. And the real insight here is that JavaScript was based on a lie. Netscape actually attracted him to build JavaScript telling him that he could build scheme in the browser. And when he arrived, they told him, no, you actually have to build a Java like clone that really isn't Java at all.

[02:17] So it's a very interesting period in JavaScript's history, which is a very formative period, as well. So there was this very hot period of formalization. So I marked the start a JavaScript in 1987, technically went back a few years before that, but ECMAScript 1, 2, and 3 were pumped out in fairly short order. And then there was a long period of silence where, essentially, there was a civil war where we didn't really agree on the direction of ECMAScript 3.1 or ECMAScript 4.

And, essentially, the way that the community started dealing with it was to have two tracks. So one was, they started building compile to JS dialects of Java. So, there's some straight up forks like ActionScript Qt, JScript, or a WMLScript.

[03:05] These are not compatible with JavaScript at all. Or you could stay within the bounds of JavaScript and just modify the heck out of it. So you can have jQuery, dojo, and MooTools. Obviously, jQuery did end up winning in the end.

But I think 2008 was still a pivotal year, despite not being a gray zone in terms of the way that I view my time chronology. I really liked this idea of the Oslo Meeting, where, they actually, everyone who was prominent in JavaScript at the time got together in Norway and resolve this dispute between or the schism between ECMAScript 3.1 and ECMAScript 4. And had some kind of roadmap towards harmony, which is ECMAScript 5. So they said, all right, instead of this evolutionary approach of 3.1 or a revolutionary approach of 4, let's take the best of each world and just come to some kind of concession so that browsers can start making a step ahead again.

[04:05] If you want more details on this, you should check out the manuscripts of JavaScript: The First 20 Years. It's just kind of a book slash talk that was submitted for the proceedings of ECM on programming languages that was supposed to happen last year. And, it's 200 pages. So no one's read it. I've only skimmed it a little bit. But this is the story of JavaScript from the authoritative authors, Brendan, who made JavaScript and Alan Morris Bach, who was the principal editor for ES 5 and 6.


The Second Age


[04:37] Then we'll talk about the second age of JavaScript. So if the first age of JavaScript was about forming the language, the second age of JavaScript is about the community, the ecosystem. In 2009, all these things happened in the same year. We reach ECMAScript 5, the harmony specification, but then we also had this weirdly common JS syntax that was proposed that became the eventual dominant module syntax in Node.JS and in the browser. There was Node.JS itself was launched in 2009. And as well as npm was also launched in 2009. So all these things that we take for granted today was invented in the same year.

There are different sections to the community. So I'm going to break out a few of them. So the first was runtimes. You can track the gradual evolution of being able to run JS everywhere. You could run JS in a browser. Chrome OS was started in 2009, which is wild to think it's that young. Electron, you can run in a desktop, you can run it on phones, and then you can have specialized runtimes just for Android. And, that's a really interesting low-level engineering thing that's going on. Obviously, there's probably other runtimes that I don't even know about. So let me know in the comments, if there are, that you think I should touch on.

[05:49] The second part of the ecosystem I want to touch on is the emergence of build tools. So the way to help you compile and build and bundle your JavaScript. So Google Closure compiler and CoffeeScript both have emerged in 2009, as well. Very, very significant year for innovation. There was Grunt, Webpack and TypeScript round about the same time in 2012ish, 2011. Gulp and Traceur came out in 2014. And Rollup. And Babel replaced Traceur well as the newer versions of Bundler's Rollup, Parcel, and Bazel came out in the subsequent three years.


Forming the ecosystem: frameworks


[06:24] Frameworks also came out. So we had, before Angular and Backbone, we had a bunch of others. But, let's just call it the start of the second age of JavaScript with Angular and Backbone. Meteor came on and tried to be full stack with its own UI layer called Blaze. React and Vue came out 2013 and '14 and Svelte came out in 2017 but was essentially reinvented in 2019. That's the history. It's over 10 years of runtimes and build tools and frameworks.


The shift left in JS tooling


And there's one more trend, which I like to call out, which is this idea of a shift left in JavaScript tooling. I've done two separate talks on this. One on Svelte and The Great Space Elevator, talking about the evolution towards compile upfront, or compiler only frameworks, as well as growing a meta language, the importance of developer experience and developer tools for frameworks. So this was presented at React Rally 2020.


The Third Age


[07:23] So now we come to the third age where we basically do an rm -rf on legacy JavaScript. Some kind of leader actually did a nice mock image of this. I never played this game but I heard it's lots of fun. But, essentially the two assumptions here, that are going away, is that common JS, there's the build target for all of our tooling, which introduces a lot of bloat. So we're going to move to ESModules and it's going to be assisted the slow death of IE11. And I'll give you my updates on those trends. And then the second theme that we talk about is JavaScript tooling. That we start writing JavaScript tooling, not in JavaScript anymore. We now write it, most of it, in TypeScript, but also increasingly in Rust and Go, as well as the collapsing layers of the different jobs of the tool.


The Third Age: ES Modules


[08:14] So first I'll talk about the ESModules and the death of IE11. So for those who don't know, what is an ESModule, is really just to import and export syntax that you might be seeing in a lot of your code that you might not actually know is being compiled away Webpack. So Webpack is acting as a sort of interpreter into environments that don't actually have the import and export ESModule native language.

But, now both browsers and no JS have essentially this capability unflagged. There's still some nuances like using MJS, the Michael Jackson script, if you want to specify that you're working in modules. And there's some kinks to work out there. But and large, this ecosystem is moving over. If you want to read a really good primer on this, you should check out the MDN docs on ESModules. And I think the V8 team also has a really good document on ESModules, according to them, as well.

[09:18] So there's some nuance here and there's some more development to be done. But it's coming along and it's looking really good. So there are limitations that people should be aware of. For example, you can't really just build a ESModules and ship them in production in any of significant size. Even the VA team recommends that there's a bottleneck of a loading pipeline when you're loading 300 modules in. So, if you start building any significant kind of app, you probably don't want to do this. But it probably will be fine for a website. But you can still use a dev only, un-bundler, like Snowpack or Vite, or WMR. And I think that's also a really good solution. So that's something that you see refreshing a lot of the tooling in JavaScript, now, today. That you don't have to bundle for development so your development refresh cycles can be a lot faster. It can be constant time refresh instead of having to rebuild the entire projects every single time you save.

The one hurdle with this, of course, is IE11, the elephant in the room. There's support across the board for the ESModules native spec, but not for IE11. So part of the adoption of IE11 is very contingent on the death of IE11. So on the top left, this is a screenshot of analytics.gov.us. And the key number to watch is the percentage visits from Internet Explorer. The US digital service has actually identified the 2% mark as the critical benchmark level where they support browsers. It used to be 3.6% in November 2020 when I first started writing about this thesis. It is now fallen to 2%. So it's fallen steadily and we're probably at about the time. And I think that the US government could drop IE11 this year. And I think that's a very big deal because that's a catalyst to say that, okay, if the US government has dropped IE11, we can drop it now at work. Obviously, a lot of other people in the ecosystem have gone ahead and agreed with that decision. So the Vue ecosystem has agreed to drop IE11 support. Agular has agreed to drop IE11 support as well as a bunch of other peer companies like Skillshare, Twitter, GoDaddy, WordPress, Drupal, Daily Motion, LinkedIn, and of course, Microsoft itself. It's also really helps this setting an edge. So the new Microsoft Edge where they have IE11 compatibility mode. So even if your app needs to be running IE11, you don't have to visit IE11, you don't have to use IE11 most of the time.

[12:03] And I think that's a really big catalyst for adoption as this gets rolled out across some of the larger enterprises that require all these IE11 apps and don't have the budget to rewrite all those things just to upgrade browsers.

So adoption is slowly happening for ESModules, both in the browser. So here's a screenshot of some stats from browser adoption of ESModules. It tripled in 2020. And I think it's going to do very well in 2021, as well. As well as in Node.js because it's mostly driven Sindre Sorhus who authors half of the ecosystem in Node.js, where he's just going to just transition all of his libraries over to ESModules. So if you want to use his stuff, you have to use ESModules inside of node. And I think it's happening in a coordinated fashion because everyone senses that the time is now. It's been a long, long time coming, ever since the first idea of standardization was floated in whenever this picture was taken with Addy Osmani. But, it's coming. It's really coming.


Third Age: New tooling


[13:09] Okay. The next part of the third age of JavaScript is the change in tooling. So Brandon Dail, used to be from Facebook, called it, in 2018, saying that in less than five years, most popular JavaScript tooling will not be written in JavaScript. And I think this is mostly come to pass, but in different degrees. So the two assumptions that were being cleared right now is that JavaScript tools should be written for JS developers JS developers so that they can contribute. The reality is that they do not. So we should optimize for hot paths and speed rather than ease of contribution people who don't actually end up contributing. And the other assumption is that of the Unix philosophy. Each tool should do one thing well.

So let's talk about those in turn. So the first is that whether we should only write JavaScript. The easy answer is most people have just opted into writing TypeScript. So here's an example of how much of the React ecosystem has switched over to TypeScript. I've been monitoring it. So React router, Next.js, Yarn, Storybook, Apollo, Gats as well, have all switched over to TypeScript. And yeah, these are the results from the state of JavaScript surveys. And, the adoption of TypeScript has been extremely strong. You can basically say that TypeScript has won at this point. But TypeScript is, design, very JavaScript like.

[14:32] So what about the other languages that we want to optimize even further? Here's ESBuild benchmark. ESBuild is a Webpack competitor. And it's about a hundred times faster than the next fastest alternative, according to their own benchmarks. So take it with a grain of salt. But, it is somewhat faster, for sure. And, that basically comes from having a compiled language at its core.

And that's a very interesting observation because you also see that in Rust. You see that being adopted in Deno, in Relay, and in Volta. And these all have significant Rust percentages in their code base. And I think what's happening is this idea that we should explore polyglot tooling. So we used to have this concept of pure tooling, where you will write the external API in JavaScript, and you write the core JavaScript, as well. But it doesn't make sense to write the core in JavaScript because it's a hot path that gets executed again and again. And no matter how much optimization you can do, you can probably do better compiling it to binaries or you can also do stronger type checking. So, it's more stable core. So whatever it is, you can switch over your core tool to a systems language and benefit from optimization there. But you still leave your external API in a scripting language like JavaScript. So this idea, I call systems core scripting shell, I think this is the pattern that we're going to move towards for a lot of our core tooling. That we're going to have Goal, Rust or maybe TypeScript if we have to, and then a JavaScript exterior.

[16:04] If this sounds like heresy to you, I think it's because we're changing our concept of what exactly a tool, one tool, for one job means. So, this is a really good blog post that I found from Benedict Evans on platforms and bundling, where when word processors came out, they actually had different functionality and different plugins for word counts, footnotes, and charts. These are all separate products from separate companies that you have to go out and buy for 50 to $100 each. Can you imagine buying a word processor today and not having word counts and not having footnotes? No. So today it just comes all bundled. How many plugins and how many different little tooling do you want in a word counter? I think the definition of what the one job is changes over time. And that's what we're seeing happening in JavaScript today.

So when you look at all these tools that we're so used to putting together, why are they all different tools? And why do they have different plugins for each of them? Why do I have eslint, Babel, Prettier, TypeScript plug in, instead of just having one set of ecosystem tooling that just works well together and has single EST passes and all that optimization that can happen if you have a holistic view of what the job of JavaScript bundling is. So that's a little bit of what happens.

[17:25] So our first reaction for this was actually very simple. This is something I covered in a previous talk called Creating Create React App, which is that we just swept everything under a rug. We will say, sitting on Webpack is too hard to make a React App. So let's just sweep everything under a single dependency. And then you would just install Create React App. And, that's a magical improvement in developer experience, but we just swept the complexity under the rug. The moment we need to deviate from it, you had to eject and now you're left with all that complexity again on that configuration.

I think that's continuing to happen. This is my other thesis called React Distros, swyx.io/react-distros, if you read that blog post. But we're continuing to do that. We're sweeping that complexity under more rugs. So Create React App does that, NextGen and Gats does that for routing. And then Blitz.js And RedwoodJS does that including other custom components and state and data frameworks. But, we're starting to build on top of React as a stable boundary, rather than trying to reinvent frameworks all the time.

[18:29] As we're collapsing tooling, I think this pitch is actually really cool. This is another blog post that I have, but essentially if you look at Rome's investor slide deck, you can see the exact same chart of why all these different tools. Let's just combine them into one tool. And you can see this in Deno as well, which tries to collapse that into the no JS layer, which I think is a super interesting approach.

These two, I think it's no coincidence, that these two are now venture capital funded. And I think that's another interesting innovation as well. In the first and second age of JavaScript, it was very independent, open source, volunteer movement. But, now in the third age of JavaScript, I think there is some sense that we need a sustainable business model for great open source to be built. And I think the money is there to back it up. So if you want to start at third age of JS developer tool project, talk to me, I can put you in touch with everyone and I would be interested in funding you myself.


The death of JS?


[19:26] Finally, we'll talk a little bit about the death of JavaScript because what happens after the third age of JavaScript? And I think the best source on this is actually a joke talk Gary Bernhardt on the birth and death of JavaScript, which is an excellent, excellent exploration of what happens after JavaScript, essentially. I think that's something that Brendan Nike started to talk about as well. I had this conversation with him about what the universal virtual machine could be. And he says, it's probably WebAssembly. He has started, instead of saying always better JavaScript, he started saying, always better JavaScript and WebAssembly.

And you're starting to see that it's some of the tools that we push out. But WebAssembly is also not a magic pixie dust. I don't think it will completely do away with JavaScript forever. But it is very appropriate for some use cases. And I think it's worth exploring for large apps like Figma.

[20:24] So that's the overall thesis. This is a very short talk, but hopefully it's given you some perspective on where we've been, what we're going through right now, and hopefully where we'll end up. So I love your comments and questions. So I will be in the chat for this conference. And if you want to learn more about how to spot trends and also bet on technologies for your career, you can check out my book at learningpublic.org. Thanks very much for having me and enjoy the rest of the conference.


Questions


[20:51] Liz Parody: The first one is to speak in standups, meetups, and conference with 36%. One, you can practice those just applying to a conference like this. JS Nation, Git Nation, React Conference. You can apply to conference. That's a good way to improve that skill. Self care and prioritization. Very important, too. Writing, blogging, documentation, design, and docs. That's one of the skills I want to improve. And negotiation is the last one with 12%. It seems that there's a lot of good negotiators watching this conference. So, that's really good. The number one is speaking. Now, let's see some of the questions. One is Brian Hough: How do you master technical blog writing? I find it's hard to balance the high level versus the technical. What do you define as a technical blog post? Shawn?

[21:50] Shawn Swyx Wang: That's an interesting question. I don't think you ever master it. Just do it a lot and try to be better than you were yesterday. And after a few years of doing it, you'll be really good. Why are you trying to be perfect or master it? Just do it better than you were before.

[22:12] Liz Parody: Yeah, that's, that's a great answer. Practicing, everything you get better and improving. Another question from Stark Anderson is: Keeping your code smaller in terms of file size can keep decrease the loading times. How do you balance between keeping your code short and keeping it actually readable?

[22:31] Shawn Swyx Wang: I see. I love this question. So I think the React core team's answer of composability really resonates with me here. You should be able to break down your code into logical code blocks. And if it's too long, then you have too much going on in your head. So you should be able to abstract things into reusable functions. Actually, you don't even need to reuse them. You can just take chunks of code out and separate them so that you can abstract them into a single function that you don't have to break that obstruction nicely until you need to look into the implementation detail. Composability of code is my answer of keeping code short and readable.

[23:14] Liz Parody: That's a good answer. Composability. Now, you know. What's actually the conclusion of the death of JavaScript composer?

[23:34] Shawn Swyx Wang: There is none. It's just an observation. I view myself as a JavaScript journalist. And the goal of a journalist is to write the first draft of history in the sense that, when we look at our web dev careers, 20, 30 years down the road, when we're retired and we're sick of programming anymore, what are we going to say about the 2020s? This 10 year period from 2020 to 2030. We can already see some hints of what's going on. And I think my role here is just as call out. I think there some trends that are very interesting. And these are things that I would invest in personally. So I would just share them. And if you agree, then that's great. If you disagree, let me know and we can have a conversation about it. I'm not trying to push some conclusion onto you.

[24:17] Liz Parody: Okay. Thank you. Leah Cheek, ask: Thank you. Very interesting. When do you get feedback in early stage of plugin?

[24:27] Shawn Swyx Wang: Where do you get... Oh, okay. Twitter is a big source of my feedback. I prototype a lot of blog ideas on Twitter. And, if I see some traction, then I flesh a tweet into a full blog post. But, sometimes a lot of people have questions on where to start if you don't have any followers. And this is called the cold start problem. I would say you can join blogging accountability groups. Together with my book, I have a community that, where we support each other with our learning in public and our writing efforts. You can join a community, whether it's a paid community or a free community just among your friends to share a feedback.

The other thing I encourage people is to, I have this essay called pickup what they put down, which means if you want other people to care about what you write, then make sure you're writing about something that they care about. And one way to guarantee that they care about stuff is just look at something that they've just released. Let's say the React core team, yesterday, just released their roadmap for React Suspense. If you want to write something, they'll probably read it and they'll probably give you feedback on it. So, that's a way just to respond quickly to something that someone else wrote. And you have a much higher chance of feedback than if you just publish some random document that nobody really was looking for, asking for.

[25:50] Liz Parody: Thank you. That was a really great answer. Daniel Burch ask: How can you improve... Sorry. How can you improve explaining complicated technical ideas during daily meetings of code reviews?

[26:05] Shawn Swyx Wang: Oh wow. That's interesting. I don't really know if I have figured that out. I think the venue of a daily meeting, or a daily standup, is not the right place to explain complicated ideas. I really like the Amazon way of having a one pager or a six pager to write down the full narrative of a concept. And before what we, I worked at Amazon, we would call this a business review meeting. We would actually sit down and have 10 minutes of just reading that writeup. Basically, try to write it down instead of just coming up with it off the cuff because when you write things down, you really get to organize your thoughts.

[26:48] Liz Parody: Thank you. Buto asks: How do you balance DX and UX? Tools, providing great DX, but default, they lack of optimization in production that Gats and Next can provide. But Next and Gats are default slower than Vite and so the whole DX is diluted due to the lack of speed. How would you balance it?

[27:13] Shawn Swyx Wang: This is a more complex question than that post. Actually Gats and Next are going to move on top of the next generation build tools, like third age of JavaScript. Tools like Vite. So they'll eventually get there. We are just in a phase of transitioning tools because of this new age of JavaScript. The way I think about it is that we create better DX to create better UX. And these tools are always changing and they're always different teams trying to improve it.

[27:29] Liz Parody: Thank you. And the last question will be from Pedro Flores, who asks: Do you feel once we'll get enough traction to eventually replace JavaScript?

[28:00] Shawn Swyx Wang: Yeah. The final piece of the talk was about this question. I think the answer is, basically, no. JavaScript will always have a place. But WebAssembly will replace some of the jobs that we are using JavaScript to do. And primarily, first, it's going to be used to port over code written in other languages. But, eventually we're also going to find ways to optimize the hot paths of code that we're running in JavaScript. But ultimately, the layer around what we can do for users and to interact with the DOM is still probably going to be owned JavaScript. So eventually you'll probably have to learn a JS language. And then compile to JS language to do your work. And yeah, I think that's the natural state of things. I don't think WebAssembly will kill JavaScript.

[28:50] Liz Parody: Thank you, Shawn, for this great talk and for all these great answers. Now you have to pick your favorite questions to give the book. Thank you very much.

[29:02] Shawn Swyx Wang: I want to give a shout out to Brian Hough, I think, the first question for breaking the ice and asking a really good question. I want to answer it in more detail actually, but we don't have time.

[29:14] Liz Parody: Okay, Brian, you have a book. Yay. Thank you very much.

[29:18] Shawn Swyx Wang: We'll get in touch and I'll send you the book. Thank you so much for asking all the great questions.

Liz Parody: Thank you, Shawn.



Transcription


Hey everyone, my name is Sean, also known as Swix on the internets, and I'm here to present this idea, this decade-long thesis that I have that's called the Third Age of javascript. So what's the story so far? You can sort of break javascript's periods up into two or three different ages. The first age was from 1997 to 2007. There's a lot that was happening in 2008, there was a world crisis going on, so you could vaguely start picking things up again in 2009, going on to 2019. 2020 was another random mix of events, but there was still a lot of news going on, and now we're well into the 2020s. I want to talk about that, I want to try to categorize things in a neat little bow. Obviously history is never as neat as historians put it, but we can actually talk about different themes and speculate on what themes are to come. So the rough table of contents that we're going to cover today, we're going to cover the first age, the second age, and then the two components of the third age that I really would like to talk about, which is ES modules and the death of IE11, as well as polyglot tooling and collapsing layers of tooling. And then the death of javascript, potentially what comes after the Third Age of javascript, because the story doesn't end there, but maybe it transitions into a different story. So the First Age of javascript, 1997 to 2007. For those who want to know more about the origins of javascript, you should actually hear it straight from the horse's mouth from Ben and Ike. He gave this really great talk at dot-conf on a brief history of javascript. And the real insight here is that javascript was based on a lie. The Netscape actually attracted him to build javascript by telling him that he could build Scheme in the browser, and when he arrived, they told him, no, you actually have to build a Java-like clone that really isn't Java at all. So it's a very interesting period in javascript's history, which is a very formative period as well. So there was this very hot period of formalization. So I marked the start of javascript in 1987, technically went back a few years before that. But ECMAScript 1, 2, and 3 were prompted in fairly short order. And then there was a long period of silence where essentially there was a civil war where we didn't really agree on the direction of ECMAScript 3.1 or ECMAScript 4. And essentially the way that the community started dealing with it was have two tracks. So one was they started building compiled to JS dialects of javascript. So there's some straight up forks like ActionScript, Qt, JScript, or WMLScript. These are not compatible with javascript at all. Or you could stay within the bounds of javascript and just modify the heck out of it. So you can have jQuery, Dojo, and MoodTools. Obviously jQuery did end up winning in the end. But I think 2008 was still a pivotal year, despite it being a gray zone in terms of the way that I view my time chronology. I really like this idea of the Oslo meeting where actually everyone who was prominent in javascript at the time got together in Norway and resolved this dispute between, or this schism between ECMAScript 3.1 and ECMAScript 4. And had some kind of roadmap towards harmony, which is ECMAScript 5. So they said, all right, instead of this evolutionary approach of 3.1 or a revolutionary approach of 4, let's take the best of each world and just come to some kind of concession so that browsers can start making a step ahead again. If you want more details on this, you should check out the manuscript of javascript, the first 20 years, which is kind of a book slash talk that was submitted for the proceedings of ECM on programming languages that was supposed to happen last year. And it's 200 pages, so no one's read it. I've only skimmed it a little bit. But this is the story of javascript from the authoritative authors, Brendan, who made javascript and Alan Worsbach, who was the principal editor for ES5 and 6. Okay. Then we'll talk about the second age of javascript. So if the first age of javascript was about forming the language, the second age of javascript is about the community, the ecosystem. In 2009, all these things happened in the same year. We reached ECMAScript 5, the harmony specification. But then we also had this weird, like, common JS syntax that was proposed that became the eventual dominant module syntax in node.js and in the browser. There was node.js itself was launched in 2009, and as well as npm was also launched in 2009. So all these things that we take for granted today was invented in the same year. There are different sections of the community, so I'm gonna break out a few of them. So the first was runtimes. You can track the gradual evolution of being able to run JS everywhere. You can run JS in the browser, Chrome also started in 2009, which is wild to think it's that young. Electron, you can run it in the desktop, you can run it on phones, and then you can have specialized runtimes just for Android. And that's a really interesting low-level engineering thing that's going on. Obviously, there's probably other runtimes that I don't even know about. So let me know in the comments if there are that you think I should touch on. The second part of the ecosystem I want to touch on is the emergence of build tools, so the way to help you compile and build and bundle your javascript. So Google Compiler and CoffeeScript both emerged in 2009 as well. Very, very significant year for innovation. There was Grunt, webpack, and typescript around about the same time in 2012-ish, 2011. Gulp and Tracer came out in 2014, and Babel replaced Tracer, as well as the newer versions of bundler's rollout parcel, Bazel, came out in the subsequent three years. frameworks also came out. So we had, before angular and Backbone, we had a bunch of others. But let's just call it the start of the second age of javascript with angular and Backbone. Meteor came out and tried to be full stack with its own UI layer called Blaze. Reactive View came out in 2013 and 2014. And svelte came out in 2017, but was essentially reinvented in 2019. So that's the history. That's over 10 years of runtimes and build tools and frameworks. And there's one more trend which I like to call out, which is this idea of a shift left in javascript tooling. I've done two separate talks on this, one on svelte and the great space elevator, talking about the evolution towards compiler-only frameworks, as well as growing a meta-language, the importance of developer experience and developer tools for frameworks. So this was presented at react Rally 2020. So now we come to the third age, where we basically do an RMRF on legacy javascript. Some kind meter actually did a nice mock image of this. I never played this game, but I heard it's lots of fun. But essentially the two assumptions here that are going away is that common JS is the build target for all of our tooling, which introduces a lot of bloat. So we're going to move to ES modules, and it's going to be assisted by the slow death of IE11, and I'll give you my updates on those trends. And then the second theme that we talk about is javascript tooling, that we start writing javascript tooling not in javascript anymore. We now write most of it in typescript, but also increasingly in rust and Go, as well as the collapsing layers of the different jobs of the tool. So first we'll talk about the ES modules and the death of IE11. So for those who don't know, what is an ES module is really just the import and export syntax that you might be seeing in a lot of your code that you might not actually know is being compiled away by webpack. So webpack is acting as a sort of interpreter into environments that don't actually have the import and export ES module native language. But now both browsers and node.js have essentially this capability unflagged. There's still some nuances, like using MJS, the Michael Jackson script, if you want to specify that you're working in modules. And there's some kinks to work out there. But by and large, the ecosystem is moving over. If you want to read a really good primer on this, you should check out the MDN docs on ES modules. And I think the V8 team also has a really good document on ES modules, according to them as well. So there's some nuances here, and there's some more development to be done. But it's coming along, and it's looking really good. So there are limitations that people should be aware of. For example, you can't really just build ES modules and ship them in production in any significant size. Even the V8 team recommends that. There's a bottleneck of a loading pipeline when you're loading 300 modules. And so if you start building any significant kind of app, you probably don't want to do this. But it probably is fine for a website. But you can still use a dev-only unbundler, like Snowpack or VEET or WMR. And I think that's also a really good solution. So that's something that you see refreshing a lot of the tooling in javascript now today. That you don't have to bundle for development, so your development refresh cycles can be a lot faster. It can be constant time refresh, instead of having to rebuild the entire projects every single time you save. The one hurdle with this, of course, is IE11, the elephant in the room. There's support across the board for the ES modules native spec, but not for IE11. So part of the adoption of IE11 is very contingent on the death of IE11. So on the top left, this is a screenshot of analytics.gov.us. And the key number to watch is the percentage visits from Internet Explorer. The US Digital Service has actually identified the 2% mark as the sort of critical benchmark level where they support browsers. It used to be 3.6% in November 2020, when I first started writing about this thesis. It has now fallen to 2%. So it's fallen steadily. And we're probably at about the time. And I think that the US government could drop IE11 this year. And I think that's a very big deal, because that's a catalyst to say that, okay, if the US government has dropped IE11, we can drop it now at work. Obviously, a lot of other people in the ecosystem have gone ahead and agreed with that decision so the vue ecosystem has agreed to drop IE11 support. angular has agreed to drop IE11 support, as well as a bunch of other peer companies like Skillshare, Twitter, GoDaddy, wordpress, Drupal, Dailymotion, LinkedIn, and of course, Microsoft itself. It also really helps by this setting in Edge, so the new Microsoft Edge, where they have this IE11 compatibility mode. So even if your app needs to be run in IE11, you don't have to use IE11 most of the time. And I think that's a really big catalyst for adoption as this gets rolled out across some of the larger enterprises that require all these IE11 apps and don't have the budget to rewrite all those things just to upgrade browsers. So adoption is slowly happening for ES modules, both in the browser. So here's a screenshot of some stats from browser adoption of ES modules. It tripled in 2020, and I think it's going to do very well in 2021 as well. As well as in node.js, because it's mostly driven by Sindre Soros, who, you know, authors half of the ecosystem in node.js, where he's just going to transition all of his libraries over to ES modules. So if you want to use his stuff, you have to use ES modules inside of Node. And I think it's happening in a coordinated fashion because everyone senses that the time is now. It's been a long, long time coming, ever since the first idea of standardization was floated in whenever this picture was taken with Addy Osmani. But it's coming. It's really coming. Okay. The next part of the third-aged javascript is the change in tooling. So Brandon Dale, used to be from Facebook, called it in 2018, saying that in less than five years, most popular javascript tooling will not be written in javascript. And I think this has mostly come to pass, but in different degrees. So the two assumptions that are being cleared right now is that javascript tools should be written for JS developers by JS developers, so that they can contribute. The reality is that they do not. So we should optimize for hot paths and speed, rather than ease of contribution by people who don't actually end up contributing. And the other assumption is that of the Unix philosophy, each tool should do one thing well. So let's talk about those in turn. So the first is that whether we should only write javascript. The easy answer is, well, most people have just opted into writing typescript. So here's an example of how much of the react ecosystem has switched over to typescript. I've been monitoring it. So react Router, next.js, yarn, storybook, apollo, gatsby as well, have all switched over to typescript. And yeah, these are the results from the state of javascript surveys. And the adoption of typescript has been extremely strong. You can basically say that typescript has won at this point. But typescript is by design very javascript-like. So what about the other languages that we want to optimize even further? Here's ESBuild's benchmark. ESBuild is a webpack competitor. And it's about 100 times faster than the next fastest alternative, according to their own benchmarks. So take it with a grain of salt. But it is somewhat faster, for sure. And that basically comes from having a compiled language at its core. And that's a very interesting observation. Because you also see that in rust. You see that being adopted in Denno, in Relay, and in Volta. And these all have significant rust percentages in their code base. And I think what's happening is this idea that we should explore polyglot tooling. So we used to have this concept of pure tooling, where you would write the external api in javascript, and you write the core in javascript as well. But it doesn't make sense to write the core in javascript, because it's a hot path. It gets executed again and again. And no matter how much optimization you can do, you can probably do better by compiling it to binaries. Or you can also do stronger type checking. So it's a more stable core. So whatever it is, you can switch over your core tool to a systems language and benefit from optimization there. But you still leave your external api in a scripting language like javascript. So this idea I call systems core scripting shell. I think this is the pattern that we're going to move towards for a lot of our core tooling. That we're going to have Go, rust, or maybe typescript if we have to. And then a javascript exterior. And this sounds like heresy to you. I think it's because we're changing our concept of what exactly a tool, one tool for one job means. So this is a really good blog post that I found from Benedict Evans on platforms and bundling. When word processors came out, they actually had different functionality and different plugins for word counts, footnotes, and charts. These are all separate products from separate companies that you have to go out and buy for $50 to $100 each. Can you imagine buying a word processor today and not having word counts and not having footnotes? No. So today it just comes all bundled. How many plugins and how many different little tooling do you want in a word counter? I think the definition of what the one job is changes over time. And that's what we're seeing happening in javascript today. So when you look at all these tools that we're so used to putting together, why are they all different tools? And why do they have different plugins for each of them? Why do I have ESLint, Babel, Prettier, typescript plugin instead of just having one set of ecosystem tooling that just works well together and has single EST passes and all that optimization that can happen if you have a holistic view of what the job of javascript bundling is. So that's a little bit of what happens. So our first reaction for this was actually very simple. This is something I covered in a previous talk called creating create react app. Which is that we just swept everything under a rug. We would say, okay, setting up webpack is too hard to make a react app. So let's just sweep everything under a single dependency. And then you would just install create react app. And that's a magical improvement in developer experience. But we just swept that complexity under the rug. The moment we needed to deviate from it, you had to eject and now you're left with all that complexity again and all that configuration. I think that's continuing to happen. This is my other thesis called react distros. So switch.io. react distros. You can read that blog post. We're continuing to do that. We're sweeping that complexity under more rugs. So create react app does that. next.js and gatsby does that for routing. And then blitz.js and Redwood.js does that by including other custom components and state and data frameworks. But we're starting to build on top of react as a stable boundary rather than trying to reinvent frameworks all the time. As for collapsing tooling, I think this pitch is actually really cool. This is another blog post that I have. But essentially if you look at Rome's investor slide deck, you can see the exact same chart of why all these different tools? Let's just combine them into one tool. And you can see this in demo as well, which tries to collapse that into the node.js layer, which I think is a super interesting approach. These two, I think it's no coincidence that these two are now venture capital funded. And I think that's another interesting innovation as well. In the first and second age of javascript, it was very sort of independent, open source volunteer movement. But now in the third age of javascript, I think there is some sense that we need a sustainable business model for great open source to be built. And I think the money is there to back it up. So if you want to start a third age of JS developer tool project, talk to me. I can put you in touch with everyone and I would be interested in funding you myself. Okay. Finally, we'll talk a little bit about the death of javascript. Because what happens after the third age of javascript? And I think the best source on this is actually a joke talk by Gary Bernhardt on the birth and death of javascript, which is an excellent exploration of what happens when javascript gets...what happens after javascript, essentially. I think that's something that Brendan Knight has started to talk about as well. I had this conversation with him about what the universal virtual machine could be. And he says it's probably webassembly. He has started...instead of saying always better javascript, he started saying always better javascript and webassembly. And you're starting to see that in some of the tools that we push out. But webassembly is also not magic pixie dust. I don't think it will completely do away with javascript forever. But it is very appropriate for some use cases. And I think it's worth exploring for large apps like Figma. So that's the overall thesis. This is a very short talk. But hopefully it's given you some perspective on where we've been, what we're going through right now, and hopefully where we'll end up. So I love your comments and questions. I will be in the chat for this conference. And if you want to learn more about how to spot trends and also bet on technologies for your career, you can check out my book at learninpublic.org. Thanks very much for having me and enjoy the rest of the conference. So the first one is speaking. Standups meet us at conference with 36%. You can practice this just by applying to a conference like this. Like JNation, Gnation, react conference. So yeah, you can apply to conference. That's a good way to improve that skill. Self-care and prioritization, very important too. Writing, blogging, documentation, designs, and docs. That's one of the skills I want to improve. And negotiation is the last one with 12%. It seems that there's a lot of good negotiators watching this conference. So that's really good. So yeah, the number one is speaking. Now let's see some of the questions. One is by Brian Park. How do you master technical blog writing? I find it hard to balance the high level versus the technical. What do you define as the tech blog post? Sean? Hi. That's an interesting question. I don't think you ever master it. Just do it a lot. And try to be better than you were yesterday. And after a few years of doing it, you'll be really good. Why are you trying to be perfect or master it? Just do it better than you were before. Yeah, that's a great answer. I mean, practicing everything, you'll get better and improving. Another question from Stark Odinson. Is keeping your code smaller in terms of file size can decrease the loading times? How do you balance between keeping your code short and keeping it actually readable? I see. I love this question. So I think the react core team's answer of composability really resonates with me here. You should be able to break down your code into logical code blocks. And if it's too long, then you have too much going on in your head. So you should be able to abstract things into reusable functions. Actually, you don't even need to reuse them. You can just take chunks of code out and separate them so that you can abstract them into a single function that you don't have to break that abstraction nicely until you need to look into the implementation detail. So composability of code is my answer of keeping code short and readable. Yeah, that's a good answer. Composability. Now you know. So what's actually the conclusion of the death of javascript by Komoser? There is none. It's just an observation. I kind of view myself as a javascript journalist. And the goal of a journalist is to write the first draft of history in the sense that when we look at our web dev careers 20, 30 years down the road when we're retired and we're sick of programming anymore, what are we going to say about the 2020s? This 10 year period from 2020 to 2030? We can already see some hints of what's going on. And I think my role here is just to call out I think there's some trends that are very interesting and these are things that I would invest in personally. So I would just share them. And if you agree, then that's great. If you disagree, let me know and we can have a conversation about it. I'm not trying to push some conclusion onto you. Okay. Thank you. Leah asks, thank you, very interesting. Where do you get feedback in early stage of blogging? Where do you get? Oh, okay. You know, so Twitter is a big source of my feedback. You know, I prototype a lot of blog ideas on Twitter. And if I see some traction, then I flesh a tweet into a full blog post. But sometimes a lot of people have questions on like where to start if you don't have any followers and this is called the cold start problem. I would say you can join blogging accountability groups. So together with my book, I have a community where we support each other with our learning in public and our writing efforts. So you can join a community, like whether it's a paid community or a free community just among your friends to share feedback. The other thing I encourage people is to have this essay called pick up what they put down, which means if you want other people to care about what you write, then make sure you're writing about something that they care about. And one way to guarantee that they care about stuff is just look at something that they've just released. Like, let's say the react core team yesterday just released their roadmap for react suspense. If you want to write something, they'll probably read it and they'll probably give you feedback on it. So that's a way just to respond quickly to something that someone else wrote. And you have a much higher chance of feedback than if you just publish, you know, like some random documents that nobody really was looking for or asking for. Thank you. That's a really great answer. And Daniel asks, how can you improve explaining complicated technical ideas during daily meetings or code reviews? Oh, wow. That's interesting. I don't really know if I have figured that out. I think the venue of a daily meeting or like a daily standup is not the right place to explain complicated ideas. I really like the Amazon way of having a one pager or a six pager to write down the full narrative of a concept. And before what we so I worked at Amazon. We would call this like a business review meeting. We would actually sit down and have like 10 minutes of just reading that writeup and document. So basically try to write it down instead of just coming up with it off the cuff. You know, because when you write it down, when you write things down, you really get to organize your thoughts. Thank you. Pudo asks, how do you balance DX and UX? Like tools like byte provided great DX, but by default, the lack of optimization in production that gatsby and Next can provide. But Next and gatsby are by default slower than byte and so the whole DX is diluted due to the lack of speed. How would you balance it? This is a more complex question than post. So it's not a binary. Eventually gatsby and Next are going to move on top of Next generation build tools, like third age of javascript tools like vite. So they'll eventually get there. We're just in a phase of transitioning tools because of this new age of javascript. So yeah, the way I think about it is that we create better DX to create better UX. And these tools are always changing and there are always different teams trying to improve it. Thank you. And the last question will be from Pedro Flores, who asks, do you feel Once will get enough traction to eventually replace javascript? Ah, yeah. So the final piece of the talk was about this question. I think the answer is basically no. javascript will always have a place, but webassembly will replace some of the jobs that we are using javascript to do. And primarily, first it's going to be used to port over code written in other languages. But eventually we're also going to find ways to optimize the hot paths of code that we're running in javascript. But ultimately the layer around what we can do for users and to interact with the DOM is still probably going to be owned by javascript. So eventually you'll probably have to learn a JS language and then a compiled JS language to do your work. And yeah, I think that's the natural state of things. I don't think Wasm will kill javascript. Thank you, Sean, for this great talk and for all these great answers. Now you have to pick your favorite questions to give at the book. Thank you very much. I want to give a shout out to Brian Huff. I think the first question for breaking the ice and asking a really good question. I want to answer it in more detail, actually, but we don't have time. Okay. Brian, do you have a book? Yay. Thank you very much. We'll get in touch and I'll send you the book. Thank you so much for all the really great questions. Thank you, Sean. I'll see you next time.
30 min
08 Jun, 2021

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

Workshops on related topic