Create a Server

Angular 17 SSR – Angular Server Side Rendering in a New

Angular 17 SSR – Angular Server Side Rendering in a New Way

#Angular #SSR #Angular #Server #Side #Rendering

“Monsterlessons Academy”

Angular 17 SSR completely changes how we implement Angular server side rendering. Previously we used a package Angular universal to implement it but now it’s a new angular ssr package which implements it much better.

TIMESTAMPS
0:00 Introduction
0:13 Angular 17 ssr in your project
1:43 What is changed?
4:34 Client hydration
6:29 Real example
9:29 Getting data from the backend

► CHECK MY COURSES –

MOST POPULAR COURSES
► Building real project with Angular + NgRx –
► Building real NestJS API –
► Javascript interview questions –
► Angular Interview Questions
► Building real fullstack project –
► Mastering Git –
► Mastering Docker and Docker…

source

 

To see the full content, share this page by clicking one of the buttons below

Related Articles

12 Comments

  1. So if we choose server side rendering, we need to wrap our localStorage, window, document codes in a wrapper to prove we are in a browser client. Good to know. I wonder do we still need to do it if we don't apply server side rendering? anyone knows?
    Edit: I just created a new app with no ssr. Turns out you don't need a wrapper. Wrapper function are not defined anyway.

  2. This is a well structured video and it does a great job explaining how SSR works in Angular.

    I think the RxJS part of the code should be improved to teach a better architecture. Subscribing to the data source and then setting a local component property in the callback isn’t declarative. In this case, the source observable is a HTTP request so it completes on its own, but if it’s a behavior subject or something like that, subscribing in this way without unsubscribing would cause memory leaks. To address both problems, don’t explicitly subscribe to the data stream at all. Instead set a local property equal to the source observable and subscribe in the template using the async pipe. That way, your property is completely declarative and the framework handles the subscription for you with the async pipe.

  3. Thanks, very explicit. I wanted to migrate a very large project to SSR to gain speed on the first loading (the main.js file tends towards 3MB despite multiple optimizations). But I was faced with too many errors, particularly regarding cookies/storages and certain packages seem not to be compatible. I had to put that aside for now. It would be really great if you make a video on tips for migrating a CSR to SSR project.

Leave a Reply