TNS
VOXPOP
What’s Slowing You Down?
What is your biggest inhibitor to shipping software faster?
Complicated codebase and technical debt.
0%
QA, writing tests, and debugging.
0%
Waiting for PR review or stakeholder approval.
0%
I'm always waiting due to long build times.
0%
Rework due to unclear or incomplete specifications.
0%
Inadequate tooling or infrastructure.
0%
Other.
0%
Frontend Development / Serverless / Software Development

2022 a Golden Year as JavaScript Moves to the Edge

We look at how JavaScript evolved in 2022, as it moved to the edge and frameworks proliferated. We also explore what might come in 2023.
Dec 14th, 2022 10:40am by
Featued image for: 2022 a Golden Year as JavaScript Moves to the Edge
Feature image via Shutterstock

In Jan. 2022, The New Stack raised the question: “Will 2022 Be a Golden Age for Full-Stack JavaScript? The article drew on the work of developer and Best of JS creator Michael Rambeau, who tracks trending projects in the JavaScript ecosystem and assembles them into his yearly JavaScript Rising Stars, which ranks projects according to stars given on GitHub.

It’s a compelling idea, this notion that JavaScript might be in a Golden Age. Despite early and frequent rumblings that WebAssembly or the htmx framework might shake JavaScript loose from its throne, those predictions are still that … predictions.

JavaScript, meanwhile, had arguably another golden year, as it spread to the edge and its frameworks proliferated.

Javascript Goes to the Edge

One big trend that will likely only accelerate in 2023 is JavaScript’s shift to the edge. More companies — including Cloudflare, Netlify, Deno and Vercel — embraced this paradigm, making it easier than ever for developers to deploy on the edge.

“One more [trend] that is really, really interesting is the rise of edge computing, and this is primarily led by CloudFlare and Deno,” Shawn “@swyx” Wang told The New Stack earlier this year.

Edge has traditionally meant Internet of Things technologies, but when developers use the term, they tend to mean a content delivery network (CDN), which is a geographically distributed group of servers that deliver content from the location closest to the user. It’s even used as a synonym for serverless.

“They try to cache the content close to the user,” Wang explained. “So when I’m sitting in San Francisco and I’m requesting content from U.S. east one, I’m not actually paying for the U.S. east one, I’m actually pinging my local CDN data center.” These CDN serves can be as small — small enough to sit on a cell tower, he added. Wang contends that there’s a big push to rewrite code to take advantage of the edge.

“Because you’re deploying your code to more servers, essentially, they’re just smaller servers everywhere. The new center — the new generation of […] edge compute companies — they have found a way to deploy it in sort of V8 isolates, which are actually taking the JavaScript engine from Chrome and running that as a server,” he said. “Chrome is super-light compared to an entire operating system, [so you’re] just running that as a server; and when you shrink it down that much, you can make it a lot cheaper.”

As a result, edge servers tend to be cheaper than serving a page from a central location, he added.

Wang isn’t the only one who touts the value of the edge. It took center stage at this year’s Jamstack Conference, where Sunil Pai, a former senior system engineer at Cloudflare, suggested developers put part of their website on the edge within the last quarter of 2022.

“We’re working on the rest of it at the moment. There’s a lot of work to do, but you should use a lot of it today,” Pai said. Pai is now a founder of Cool Computer Club, which builds developer tools for edge applications.

Netlify co-founder and CEO Matt Biilmann said his cloud-based development company has seen approximately three times month-over-month growth in edge use cases recently. According to a survey conducted by Netlify of nearly 7,000 developers in the Jamstack community, more than half are testing the edge by building edge-dynamic sites. The survey defined edge-dynamic sites “as sites that are fully dynamic, and render all their content at the edge (i.e. using serverless functions or edge functions).”

The Beginning of the End for Static Pages

One reason for the drive to the edge is that it promises some level of personalization that can’t be realized by a static, server-side site.

Wang contended that static side generation (SSG) is “basically dead” in a talk at Reactathon this year. He also noted a movement towards incremental rendering, along with edge routing. He pointed out that “Next.js is winning so hard” as a framework that supports these trends.

Wang outlined the “ages” of JavaScript at the conference, claiming that we’re now in the third age. He predicted a “re-skilling” away from JavaScript by the end of the 2020s. While he didn’t specify what might take the place of JavaScript, he did remark that WebAssembly is “in its first age” currently.

You Get a Framework! And You Get a Framework!

Well, not quite. The same Jamstack Community survey found the most used framework is React, at more than 71% usage on some or most projects in the ranking of 29 frameworks that made the list. While React is technically a JavaScript library, it forms the basis of many JS frameworks.

“The most obvious story in our framework data is the continued growth of React,” the survey stated. “While there are many options for building a reactive web app, the enormous ecosystem around React continues to make it an easy choice for many.”

That didn’t stop alternative frameworks from entering this crowded field, including Fresh.

Fresh is a full-stack JavaScript framework created by Deno software engineer Luca Casonato. It is based on Preact, a JavaScript library that promotes itself as an alternative to Meta’s React. It also uses Deno, rather than the more common NodeJS.

Continuing the trend of moving to the edge, Fresh is optimized for edge computing, with most of the rendering done on the server, Casonato told The New Stack. That translates into a great performance all over the world, Casonato claimed, even on slow devices. Other JavaScript frameworks that send more code to the client often struggle in comparison on slow devices, he said.

He compared it to Node.js or Vercel, which he said might have serverless functions that run on Amazon Web Services in a single region. Why create another framework, though? Casonato said that speed and developer experience were two aspects he felt were missing from other frameworks. The combination, he contended, is a better framework with fewer downsides than existing frameworks.

“The framework is really built for server-side rendering, so it sends very little JavaScript, very little code to the clients, and keeps as much as possible on the server, to make it a really snappy experience for users,” he said.

Redwood also released this year. It’s another JavaScript-based full-stack framework that uses React, but it targets startups and businesses wanting a complete stack based on popular tools. Tom Preston-Warner, the founder and former CEO of Github, is one of the four founders and 300 contributors to the open source web development framework.

“What I wanted to do was collect together a set of tools that was already commonly used, but do the hard work of really beautifully integrating them so that people could just get to work building what’s special about their application,” Preston-Warner told The New Stack.

It’s unlikely we’ve seen the end of new JavaScript frameworks, according to Kelsey Hightower, a Google distinguished engineer and frequent conference speaker. Hightower told The New Stack there will never be just one JavaScript framework.

“There will never be one because the experience keeps changing,” Hightower said. “We like that, as humans, because we want to hear something new. … It will never stop. But do we want it to? I don’t think we actually want it to.”

ECMAScript Progress

JavaScript, the open standard, also experienced eight updates this year, with the release of ECMAScript 2022. Several developers pointed to the error.cause features as a key upgrade.

One change Wang is looking forward to in 2023 is the temporal proposal, which is in stage three of the four-stage proposal process. This would address data formatting problems that can complicate and sometimes be ambiguous, he told The New Stack.

So all in all, JavaScript continues to be the driver of web application innovation on the web. Only now, it’s more prominent on the edge and there are even more frameworks to choose from.

Group Created with Sketch.
TNS owner Insight Partners is an investor in: Pragma, Deno.
TNS DAILY NEWSLETTER Receive a free roundup of the most recent TNS articles in your inbox each day.