Skip to content

mark enableProdMode as deprecated and output a warning that it should not be used anymore #37644

@sod

Description

@sod

angular 9.1.9

enableProdMode() right now is a placebo. The only thing it does is removing the app is running in dev mode warning to the console. So if you forgot to disable it at build time but rely on enableProdMode() 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.

image

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2The issue is important to a large percentage of users, with a workaroundarea: coreIssues related to the framework runtimecore: bootstrapcore: debug tools

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions