DEV Community

Cover image for What's new in Next.js 14
Chris Lojniewski for Pagepro

Posted on • Originally published at pagepro.co

What's new in Next.js 14

INTRODUCTION

Next.js 14 is here, and it’s a serious step towards further improvement of the web development processes. It includes concrete improvements in performance, developer experience, and scalability.

Next.js is committed to progress. Their team constantly pushes the boundaries, ensuring the framework stays at the forefront of technology. This is one of the reasons why it’s become one of the most popular web frameworks, favoured by businesses and developers, and why we love it so much!

Next.js 14 arrived with several key features and optimizations, which make it an even more powerful tool. For those of us passionate about building high-quality websites, these updates are both exciting and promising. Of course, there are still voices, that not all of the features work as expected, but we think the main reason is that most of them require some mental shift, and it always takes time.

Ready to see what Next.js 14 can do for your projects? Dive in and explore the possibilities!

NEXT.JS – CONSTANT GROWTH AND RISING POPULARITY

Next.js is an open-source web development framework created by Vercel. And it’s now the most popular React framework globally.

Next.js has seen substantial growth in recent years, establishing itself as one of the most popular frameworks for web app development. This is obvious in the Stack Overflow survey 2023, where Next.js climbed from 11th to 6th place year-to-year, indicating its increasing usage and strong position among devs globally.

Furthermore, it’s ranked as the 3rd most desired web framework and technology, just below Node.js and React, highlighting its recognition for building scalable and performant web applications.

[Source: Stack Overflow 2023](https://survey.stackoverflow.co/2023/#most-popular-technologies-webframe-learn)

Globally, tech leaders are noticing it. From CTOs to CEOs, they’re drawn into Next.js for faster development cycles, blazing-fast performance, and custom configurations and ecosystem plugins.

For example, Plex, a TV streaming platform which aimed to create a unified foundation for their web experiences, adopted Next.js on Vercel, leveraging features like Server-side Rendering (SSR), Incremental Static Regeneration (ISR), and Edge Middleware. This streamlined their development process, reduced their codebase by 40%, and enabled content delivery at the edge, reducing page load times.

At Pagepro we also see the increasing popularity of Next among our customers:

“At first, our inclination, as well as that of our clients, leaned more towards Gatsby. However, as we delved deeper, we discovered that Next.js offered an unparalleled blend of ease and power.
It wasn’t long before both we and our clients recognized its effectiveness. Today, we proudly say that around 90% of our web development projects leverage Next.js. Its adaptability, performance, and simplicity has made it the strongest player in web development strategy, consistently delivering the most benefits to our clients.” - Jakub Dakowicz, CTO at Pagepro

Below you can take a look at how Next.js improved over the years with new versions and features:

[Image description](https://pagepro.co/blog/)

WHAT ARE THE KEY FEATURES OF NEXT.JS 14?

Each Next js release arrives with improvements and groundbreaking features designed to make your life easier, faster, and more enjoyable. The release of Next js 14 took place during the Next.js conf 2023 in October and this time, the Next.js team went beyond “major update”.

Next.js 14 conference

They introduced a toolbox of features that solidify its authority as the champ of modern web applications. Sure, some characteristics have been there since Next.js 13, but the newest version further solidifies them.

Next.js features are direct responses to what developers crave and predictions of what’s next. Vercel and Next.js doubles down on its commitment to:

  • Unleashing Speed & Efficiency: Turbopack and streamlined workflows make development feel like greased lightning.
  • Flexibility & Performance, Hand in Hand: Server Actions in Next.js and Partial Prerendering let you be dynamic without sacrificing speed.
  • Developer Happiness at Heart: Image optimization and intuitive API routes put a smile on your coding face.
  • We delve here into the key features of the current version of Next.js, we’ll explore how each component contributes to a more robust, efficient, and enjoyable development experience.

TURBOPACK

In the latest release, Next.js introduces the groundbreaking Compiler, which is now turbocharged to offer significant performance enhancements and developer experience improvements.

It uses the cutting-edge Rust-based tool, SWC, to dramatically speed up JavaScript and TypeScript compilation. The result is a significant reduction in build times, directly translating into more efficient development cycles.

According to the Next.js blog, Turbopack guarantees:

  • 53% faster local server startup
  • 94% faster code updates with Fast Refresh For developers, this means faster feedback loops and the ability to iterate on projects with unprecedented speed, making the process of building and testing web applications more seamless and productive than ever before.

From a business perspective, the enhanced Next.js Compiler presents a compelling case for reduced time-to-market for new features and updates. This efficiency gains not only optimizes developer resources but also enhances the agility of businesses in responding to market demands and user feedback.

STABILITY FOR SERVER COMPONENTS

Next.js 14 introduces Server Actions as a stable feature, revolutionizing the way developers handle API routes and server-side logic. It simplifies the creation and management of server-side functions, seamlessly integrating them with the Next.js framework. A standout component of this update is the App Router, which offers a more streamlined and efficient method for handling API requests directly within Next.js applications.

The App Router in Next.js 14 introduces a structured approach to web development, with special files for layouts and error handling, making it easier to predict and structure code across projects.
But, what’s extremely important, it requires a significant mental shift, what of course results in divided opinions. Some experienced Next.js devs find it less intuitive and question its usefulness compared to traditional methods. On the other side there are young devs who learned to use that and can’t imagine anything else.
And so, even though Next.js builds their product with the community in mind, this case may brought the discussion about balancing the innovation with developer’s habits and ease of use. - Jakub Dakowicz, CTO at Pagepro

Server Actions enable developers to write API endpoints and server-side logic in a more intuitive and accessible manner, directly alongside their Next.js pages. This co-location enhances maintainability and scalability by keeping related server and client-side code together.

Next.js 14 simplifies dynamic web page development. Previously, handling server tasks like form submissions required creating separate API route files. Now, you can manage these directly within the web page code, making site development and management more straightforward. - Michał Sawicki, Next.js Expert at Pagepro

For developers, this means a significant improvement in productivity and ease of use, allowing for quicker iteration and more complex server-side capabilities with less overhead. From a business perspective, stability for server actions leads to faster development cycles, reduced costs, and the ability to more quickly adapt to changing requirements or incorporate new features, maintaining a competitive edge in the fast-paced digital marketplace.

IMPROVED IMAGE OPTIMIZATION

Next.js 14 introduces Partial Prerendering as a preview feature, offering an innovative strategy for optimizing page loading times and enhancing user experience. It allows developers to prerender parts of their application while leaving other parts to be rendered client-side or server-side as needed. It’s a flexible solution to balance between static generation and dynamic rendering, catering to the specific needs of various page content types within a single application.

Partial prerendering in Next.js 14 allows a page to include both static and dynamic content. Imagine a webpage as a partially completed puzzle: the static pieces are already in place when you open the box (similar to pre-rendered static site generation, or SSG), but the dynamic sections (like a shopping cart in an e-commerce site) are left blank, to be filled in by the user’s browser in real-time.
This means visitors immediately see a usable page, with dynamic content (like the shopping cart) loading seamlessly as needed, enhancing the user experience by providing immediate content while waiting for the rest to load dynamically. - Michał Sawicki, Next.js Expert at Pagepro

By adopting Partial Prerendering, developers gain the ability to fine-tune the performance of their Next.js applications, ensuring that users receive the fastest possible initial page load for static content, without compromising the dynamism of interactive or frequently updated sections. This is beneficial especially for pages that contain a mix of static and dynamic content, enabling a seamless user experience.

From a business perspective, Partial Prerendering can significantly improve key performance indicators such as First Contentful Paint (FCP) and Largest Contentful Paint (LCP), which are critical for SEO rankings and user retention, even for large next.js websites. Faster page loads can lead to increased engagement, lower bounce rates, and higher conversion rates, directly impacting a business’s bottom line.

METADATA IMPROVEMENTS IN NEXTJS 14

Introduced in Next.js 14 new metadata options, enhance the way we can manage and utilize metadata within the Next.js app. Features like these focus on optimizing SEO and social media sharing capabilities, ensuring that Next.js projects are more discoverable and engaging on the web.

The enhancements include more efficient and flexible ways to handle metadata, such as titles, descriptions, and social media preview images, directly within the Next.js framework. It makes it easier to specify and update metadata across different pages, ensuring that each page is optimized for search engines and social media platforms.

By streamlining the process of managing metadata, Next.js 14 not only simplifies the developer’s workflow but also significantly impacts a website’s online presence. Effective use of metadata is crucial for SEO, as it directly influences how a site appears in search results and how enticing it is to potential visitors. Additionally, it enhances content visibility and engagement on social media, driving more traffic to the site.

WHAT’S NEW IN NEXT.JS 14.1

The Next.js 14.1 update introduces a suite of enhancements aimed at improving the developer experience and offering clearer guidance for self-hosting. Key highlights include refined documentation for self-hosting with Node.js, Docker, and static exports, alongside advanced custom cache configurations for Incremental Static Regeneration.

Significant to developers, this release enhances Turbopack’s reliability and performance, particularly in local development environments, showcasing faster initial compile times and more efficient Fast Refresh.

Additionally, improvements in error messaging and stack trace clarity aid in quicker debugging. Integration of native browser functions like pushState and replaceState with the App Router now allows for smoother URL updates without reloading, enhancing the development of dynamic applications.

CONCLUSION

So, Next.js 14 and 14.1 are reaching to improve the developer’s experience and the overall speed of development, but because it’s the newest version, there are many improvements still to be implemented before it becomes a stable version to use across big projects.

We keep an eye on the discussion around the community and tested it by ourselves on many levels, to stay on track, and we assure you – once it’s all stable, we will move into it with pleasure.

Do you already have any experience with Next.js 14 Let me know in the comments section!

Top comments (0)