Introducing Angular 16: The Game-Changing Server Side Rendering (SSR) Feature You Need to Know About

Yunus Yerli
3 min readMay 10, 2023

--

Hey there fellow web developers! Have you heard the news? Angular Universal has just released a new Server Side Rendering (SSR) feature in version 16 that we think you’re going to love.

For those who may not be familiar, Angular Universal allows you to create server-side rendering applications with ease. But until now, we’ve had to deal with some issues with the application’s efficiency, mainly due to the destructive hydration process.

But now, with the release of Angular v16, we have real, non-destructive hydration of server rendered applications! This feature, along with http request caching, will greatly reduce the first render time, leading to improved web vitals for Angular applications.

So, what exactly is hydration in web development? Hydration refers to the process of converting server-side rendered HTML content into a fully interactive and functonal web page on the client-side by attaching JavaScript behavior and event listeners. This makes the web page more user-friendly, improves SEO, and enhances accessibility.

While frameworks like React and Next.js have offered hydrytion for some time now, it hasn’t been easy to implement in Angular. But with Angular 16, hydration will be supported out of the box, making SSR applications faster and smoother than ever before.

Real Non-Destructive Hydration for Faster, Smoother SSR Applications

The new full app non- destructive hydration means that Angular will no longer re-render the application from scratch. Instead, the framework looks up existing DOM nodes while building internal data structures and attaches event listeners to those nodes. This leads to several benefits, such as no content flickering on a page for end users, better Web Core Vitals in certain scenarios, and easy integration with existing apps with just a few lines of code.

How Angular 16’s SSR Feature Can Improve Your Web Vitals and User Experience

And the best part? In early tests, it has been seen up to a 45% improvement of Largest Contentful Paint with full app hydration! How awesome is that?

As part of the v16 release, the ng add schematics for Angular Universal have also been updated, enabling you to add server-side rendering to your projects using standalone APIs. And also introduced support for stricter Content Security Policy for inline styles.

There’s still more to be done, and we’re already looking ahead to the next steps of hydration and server-side rendering. In certain cases, we can delay loading JavaScript that isn’t essential for the page and hydrate the associated components later. This technique is known as partial hydration, and we’ll be exploring it next.

In conclusion, the release of Anglar 16 and the new SSR feature of Angular Universal is a significant step forward for the framework, providing develpers with a more efficient and user-friendly solution for server-side rendering applications. So, let’s dive in and start exploring all the possibilities of Angular 16 and its SSR feature. Happy coding!

--

--

No responses yet