-
Notifications
You must be signed in to change notification settings - Fork 27.1k
Closed
Description
🐞 bug report
import {enableProdMode} from '@angular/core';
enableProdMode();^ this does not really disable dev mode in ssr. The mere act of doing require '@angular/core' in node.js initializes ngDevMode inside the umd bundle of @angular/core.
What we do right now is including this as the very first line of our server:
(global as any).ngDevMode = false;This improves ssr throughput by ~44% in our case (from ~18 renders per second to ~26 renders per second). And of course reduces the response size significantly as all those ng-reflect attributes and comments disappear.
Affected Package
@angular/core version 9.1.2
Is this a regression?
I'm pretty sure enableProdMode() actually disabled the devMode before ivy.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels