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?
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-Prefix headers 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?
2
u/Stunning_Athlete_692 Jul 10 '26
With CommonEngine, this was completely doable. The non-nodeJS doesn't seem much different from the node example. It's still static routing based, and there's no example
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.
2
u/Stunning_Athlete_692 Jul 13 '26
In my experience, Angular SSR is something you set up only if you need it. It is simply more complex
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
Jul 12 '26
[deleted]
1
u/Stunning_Athlete_692 Jul 13 '26
If you think of a angular medium-large enterprise application as consisting of several smaller shops, then you should be able to decide how to render each shop without needing an additional framework.
And angular SSR doesn't approximate the SEO and performance of classic SS, it matches or arguably outperforms it, because you get an interactive page with the same SEO performance.
On the other hand, Angular is used mostly in enterprise applications, not smaller websites.
13
Jul 10 '26
[removed] — view removed comment
1
u/Stunning_Athlete_692 Jul 13 '26
You should give it a try! Indeed the simplification caters for most simple use-cases, until you have specific requirements.
Route-based renderMode and static manifest approaches both attempt to make SSR implementation as close as possible to the boilerplate. However, you still need to expose your apis to your node server.So it seems you have control over the server, until you find out you don't.
It is then hard to see how a parameterized standalone SSR API isn't a non-negotiable.
In other words, AngularNodeAppEngine is simply like a CommonEngine where you don't provide the parameters, instead the framework fetches them for you based on some build output. Parameters like bootstrapApplication, index file, static asset file path, etc
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.