We got a new RFC focusing on "hybrid rendering" and a full SSR guide.
RFC SSR Hybrid Rendering
Although Angular 18.1 was released this week (coverage will follow in the next episode), a new RFC lays out future features for SSR.
The RFC foresees a separate router configuration file where we can define the rendering strategy per route.
That could be
- Pre-rendering (SSG): The rendering happens already during the build.
- Server-side rendering (SSR): The rendering occurs on the server on demand.
- Client-side rendering (CSR): This is without server, everything happens in the browser.
That's also why this RFC is called "hybrid rendering," not to be confused with hybrid change detection, which we have since Angular 18.
Pre-rendering will also allow users to define the routes dynamically via an asynchronous function. The RFC should fix some issues that users raised in the past.
RFC means that we are all invited to provide feedback.
Alan Agius, the author of the RFC, also mentioned that File-Based routing, as we find it in Analog, is not off the table but a topic for the future.
https://github.com/angular/angular/discussions/56785
Full SSR Guide
Alexander Thalhammer has written an article that covers everything you need to know when you want to start using SSR.
Starting with the configuration, how to debug it, and things you have to be aware of. For example, the two render hooks that only run on the browser and how to work around the missing document or window object on the server.
He also mentions the meta-framework analog and how SSR and Micro Frontends work together.
Top comments (0)