Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upmark `enableProdMode` as deprecated and output a warning that it should not be used anymore #37644
Milestone
Comments
|
Seems like it's not totally noop. It's used frequently throughout angular. Only the new ivy dev mode https://github.com/angular/angular/blob/d1ea1f4c7f3358b730b0d94e65b00bc28cae279c/packages/core/src/util/ng_dev_mode.ts is being ignored. Just wondered as the documentation says, that it turns off assertions and other checks, but those assertions are behind the |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


angular 9.1.9
enableProdMode()right now is a placebo. The only thing it does is removing theapp is running in dev modewarning to the console. So if you forgot to disable it at build time but rely onenableProdMode()to be working, your app runs in dev mode with a rather big performance hit.You could print a warning, that
enableProdMode()is deprecated and won't work and that dev mode can only be disabled at build time (or do(window as any).ngDevMode = false;as workaround). Or restore its functionality, if this is not intended.Reproduction: https://angular-ivy-bjsurx.stackblitz.io/ | see main.ts, enableProdMode() is called
Open devtools and set a breakpoint anywhere where ngDevMode is used, and observe it not being falsy. Or look at the DOM and see debug attributes & comments.