laitimes

Reduce complexity!JavaScript 2024 Prediction

author:CSDN
Reduce complexity!JavaScript 2024 Prediction

CSDN Editor's Note: This is an article by Ryan Carniato on December 29, 2023 about "JavaScript Framework Trends in 2024". The authors see 2023 as an important year for the evolution of JavaScript frameworks, and 2024 is expected to continue to see even greater changes, including developments in server-first, hybrid routing, edge networking, and artificial intelligence. In addition, the maturation trend of the framework is likely to continue in 2024. The authors remain optimistic about simplification schemes, such as Astro and HTMX, and expect the framework to better deliver on its promise to focus on delivering stronger solutions and reducing complexity.

作者 | Ryan Carniato 责编 | 梦依丹

Produced by | CSDN(ID:CSDNnews)

The end of the year and the beginning of the year coincide with the time of the year's summary. Many developers are also actively participating in CSDN's annual essay contest - 2023, My Coding Journey. Reveal your technical achievements in the past year and the technological changes in your field, as well as new features and technologies you have gotten.

Recently, Ryan Carniato, a well-known front-end enthusiast, author of the SolidJS UI library, and a member of the core team of MarkoJS, wrote "JavaScript Frameworks for 2024", which summarizes the technology trends of JavaScript frameworks in 2023 and the expected changes in 2024.

Reduce complexity!JavaScript 2024 Prediction

The following is the translation:

2023 is a pretty big year for JavaScript frameworks. New technologies are finally showing their usefulness, and old frameworks are making a comeback. If you haven't noticed, you're probably missing out on a pretty big shift. I expect that 2024 will continue to bring even greater changes. This time the focus is no longer on new technologies, but on the improvement and refinement of existing ones. The foundation has been laid, and we have more content to implement and present to users.

Reduce complexity!JavaScript 2024 Prediction

Server FirstIf you were to pick a theme for the past few years, it would be Server First. This view has been controversial, but it is undeniable. Just a few short years ago, people were talking about progressive web apps and offline-first concepts. However, this discussion has all but disappeared.

Reduce complexity!JavaScript 2024 Prediction

https://twitter.com/htmx_org/status/1725241732260847914 instead, HTMX explains why JavaScript is a bug with its sharp point of view. Astro has also taken over content site development without making any secret of it. Even the React core team embraced server simplicity, as Dan Abramov eloquently expressed in his talk, where he explored what would happen if React had always been server-first. So, what has happened to our once-beloved Single Page App in such a short period of time? Does it still exist today, and are we now living in the age of multi-page apps and server-only HTML?

Reduce complexity!JavaScript 2024 Prediction

Looking back at 2023 last year, I wrote a similar article on the development of JavaScript frameworks. The three major technology trends mentioned in that article have been the focus of discussion over the past year.

Signals Everywhere Since SolidJS and Vue started adopting reactive primitives, Preact and Qwik are not far behind, and this trend has become even stronger in 2023.

Reduce complexity!JavaScript 2024 Prediction

https://github.com/angular/angular/discussions/49090

In February, the Angular team also announced the adoption of this technology. The news caused a lot of buzz on social media. Not only that, but it's one of several factors that have led to Angular's significant attention. Some even call it the revival of Angular. And, this is the first time in the last few years that the React team has joined the debate, as people have started to ask, "When will React adopt Signal?", and I've written a more detailed answer to this question in the following article (with a discussion with Dan Abramov in the discussion). To put it simply, though, the React team isn't too interested in an API like Signal, and they're more interested in the "Forget" compiler, which serves a similar purpose. Of course, Signal's app doesn't end there. Google's web component framework, Lit, has released Lit 3 with native support for signals. Rich Harris revealed the future direction of Svelte, and their new Signal-based "Runes" will be the primary source of responsiveness in the upcoming release of Svelte 5. By the end of 2023, Signal has become an essential part of most front-end JavaScript frameworks. Hybrid routing

Reduce complexity!JavaScript 2024 Prediction

Server-side routing has become increasingly important over the past year. Starting in late 2022, this model has gradually been embraced, such as using React Server Components and Astro's View Transition API integration. The basic principle is that server-side rendering shouldn't affect client-side navigation after the initial page load, and client-side navigation shouldn't mean that we need to send all the JavaScript to render parts of the page that can be statically rendered server-side. It is important to note that different solutions have different effects, and this area is still developing. We're entering a whole new realm where it's neither a traditional single-page application nor a traditional multi-page site. We need to understand new trade-offs and concepts. And we're far from solving all the problems.

Edge Networks: The Last Frontier

Reduce complexity!JavaScript 2024 Prediction

Edge functions seem to be one of the obvious success stories. Dramatically reduce latency by moving servers closer to end users. With a more lightweight runtime, cold start times can be greatly reduced. If 2023 is any different, it's the year of edge technology development. We were very enthusiastic at first. After all, Cloudflare released edge databases, all of our favorite providers started offering edge functions, and our favorite frameworks added out-of-the-box support. The vendor has set up a committee called WinterCG to discuss the standardization of the platform. The future is here.

Reduce complexity!JavaScript 2024 Prediction

We eventually realized that even in these edge functions, some Node APIs are essential. You can thank or hate Next and Vercel for rolling out AsyncLocalStorage to every runtime, but we need it. We also realized that edge databases were never enough for all applications. Even with streaming, server waterfalls are still real and impactful. Yes, even with React Server Components. But it does advance the goal I came up with last year, which is to use distributed deployments for holistic authoring. We're seeing the emergence of server functions (server$, using server) and even variants like worker functions at the beginning of the year, showing that the way we can distribute our deployment APIs is being adopted by Solid, Qwik, and Next. By the end of the year, Next 14 released new experimental partial pre-rendering that allowed a single request to serve static content from the edge while being streamed through a proxy to a serverless function closer to the database to provide an edge-like experience without having to deploy the entire application there. It's awe-inspiring to see that some ingenuity offers the best of both worlds.

Reduce complexity!JavaScript 2024 Prediction

https://twitter.com/rickhanlonii/status/1722704383064842280

Reduce complexity!JavaScript 2024 Prediction

Trends in 2024The Age of SignalsI've said a lot about Signals, but the real benefits haven't been shown yet. Fine-grained primitive functions like Signals have been in JavaScript for 15 years, so why now?

Reduce complexity!JavaScript 2024 Prediction

https://twitter.com/t3dotgg/status/1730711700805140908

It is expected that JavaScript frameworks will further integrate Signal mechanisms, such as the new reactivity model in Vue Vapor and Svelte 5. Basic implementation-driven development

Now that server-side rendering frameworks have gained a lot of support, the next logical step forward is to continue to explore how to maximize the usefulness of this new feature. Standards were slow to develop, and WinterCG took some time, but that didn't stop the momentum. In order to differentiate, I anticipate that frameworks and infrastructure providers will be under pressure to offer unique features that may only be available on specific platforms. While 2023 has seen a trend toward parity among providers in providing similar functionality, such as providing key-value storage blobs in addition to basic static and function hosting, I think competition will intensify in providing unique value. The role of the framework is to maintain a consistent authoring experience and mindset while looking for ways to take advantage of new features. This is similar to the browser wars of the early 21st century, and there is still a lot of room for growth in the future. AI

Last year, it was too early to talk about AI from a framework perspective. The same could be the same next year. But it is gradually appearing in our field of vision. Code migration and generation tools are both great ideas, but they face the same problems as the visual no-code or low-code editors that have been used for years. The interface between humans and machines remains crucial. After all, code is a living being. It continues to grow and maintain over time. Over the past year, when communicating with the authors of other frameworks, we have found that AI has aroused a great deal of interest from those around us.

Reduce complexity!JavaScript 2024 Prediction

https://twitter.com/aidenybai/status/1737616282210738650

AI is answering a long-held question about why your apps are running slow.

The impact on development tools is only one aspect of the story. We're also increasingly seeing real-time performance being built into frameworks. This doesn't just refer to Websockets for persistent backends. The API in the meta framework has evolved beyond simple JSON to enable fully streamed, cross-network JavaScript execution, which is implemented in SolidStart, Qwik, and Next via "server functions". Now, we can easily imagine what it would be like for generative technology to create your user interface in real time.

Reduce complexity!JavaScript 2024 Prediction

https://twitter.com/mhevery/status/1722928972789408240

Reduce complexity!JavaScript 2024 Prediction

Summary: 2024 is likely to continue the mature trend we've seen over the past few years. From 2020-22, we saw a lot of new JavaScript (and WASM) frameworks (Qwik, Million.js, Astro, Next 13, Remix, Hydrogen, SvelteKit, SolidStart, Leptos, Dioxus, HTMX), but that changed last year. There are no more new JavaScript frameworks, relatively few in comparison. However, we have found ways and means to solve the problem. The key now is to realize the full potential of these methods and approaches and apply them to practical development to achieve better results. I'm not sure we've managed to solve the complexity problem, which gives a lot of credit to a simplified solution like Astro or HTMX. But I'm still hopeful. It may be unlikely that everyone will be expected to agree on exactly what a "single-page application" will be and when to use the various options, but these solutions are getting stronger every day, capable of achieving their stated goals. Now there is no longer any doubt that web development as we are familiar will change. Even if the direction is not entirely clear, the revolution has come. We look forward to witnessing this change with you.

Reduce complexity!JavaScript 2024 Prediction
Reduce complexity!JavaScript 2024 Prediction