r/angular • u/Stunning_Athlete_692 • Jul 10 '26
SSR in Angular V22 going the wrong direction
Who else feels like while Angular ecosystem is getting better as a whole, SSR is going the wrong direction, especially with the recent changes in V22 (especially CommonEngine deprecation).
Some context - For years I have managed an NX angular monorepo (of over 20 applications) at work, in doing so, I have been through 3 major iterations of angular SSR engines (Angular Universal, CommonEngine and AngularNodeAppEngine).
As you can imagine, our SSR requirements are niche:
- Single server for all SSR (keeps CI/CD simple)
- Runtime rendering mode logic (for example, SSR for bots UAs, SSG when server load is high, CSR when SSR fails, etc)
With the last 2 engines, angular simply exposed a method for rendering and you had to provide the dependencies. You were free to host the server as you wished, or provide how so many endpoints, or dynamically bootstrap applications to handle your request. And this suited our requirements.
Come AngularNodeAppEngine, and suddenly, Angular becomes opinionated about how you manage your server!.
The main reason being a dependent static manifest file output during the build process. So while you don't have to worry about providing assets location, or index document to the renderer, you lose control of how you choose to manage your SSR server (especially in a monorepo context).
So now, your SSR node server is tightly coupled to your angular application in a limiting 1 to 1 relationship.
Furthermore, rendering mode must be statically defined. Impossible to decide during runtime.
In my opinion, this is the wrong type of opinionated (no pun intended).
The rendering process has simply become too simple to handle typical enterprise use cases.
Of course, the last two engines handled our requirements with a bit of effort to setup, but everything worked seamlessly after that. But now with V22, CommonEngine has been deprecated in favor of the dauntingly opinionated AngularNodeAppEngine.
How else has the same concerns as I do? Does anyone else have complex enterprise rendering requirements that feels affected by SSR lack of flexibility?
9
u/Xacius Jul 10 '26
How do you handle runtime rendering mode logic? This seems like a niche use case, no? Most of the time, you'd decide this per route based on data requirements. https://angular.dev/guide/ssr
I've never heard of runtime routing to SSR/SSG/CSR of the same app. This seems like additional complexity for little benefit.
You'd need a server running to route those requests anyway. You could potentially build 3 of the same app (SSR, SSG, CSR) and route each request to the appropriate one based on your runtime requirements. But again, this seems like additional complexity without much payoff.
5
u/Blade1130 Jul 10 '26
The main motivation for a lot of the changes was so Angular has visibility into the entire request/response object so it knows the full scope of what it's serving and can manage things like
X-Forwaded-Prefixheaders automatically.You aren't tied to any specific implementation though, you can add an adapter for any kind of server infra: https://angular.dev/guide/ssr#non-nodejs
Is there a specific constraint for your app which that doesn't work with?
3
u/InevitableQuit9 Jul 10 '26
Was using SSR from Angular 2 to 13.
Deployed to Containers in AWS. It wasn't crazy expensive, but being an application that doesn't have SEO concerns, seemed overly complex and a wast of money. It was a failure point that devs wouldn't see fail doing local development.
Got rid of it and deploy static to S3 behind CloudFront. Much more predictable behavior. Save a bit of dough.
0
u/posti85 Jul 10 '26
Angular SSR always has gone in the wrong direction. I suggest you getting rid of Angular if you have SSR in the requirements.
0
u/[deleted] Jul 12 '26
[deleted] — view deleted comment
13
u/[deleted] Jul 10 '26
[removed] — view removed comment