-
Notifications
You must be signed in to change notification settings - Fork 26.2k
fix(core): set ngDevMode
to false
when calling enableProdMode()
#40124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The `ngDevMode` description also mentions that calling `enableProdMode` will set this the value to `false`. https://github.com/angular/angular/blob/4610093c87975b6355f31a9c849351129908783a/packages/core/src/util/ng_dev_mode.ts#L22 which is currently not the case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
FYI, presubmit went well for the changes in this PR. @kyliau @alan-agius4 there are 2 target labels on this PR and the tooling does not support a single PR targeting multiple Thank you. |
Thanks @AndrewKushnir, I’ll create the PRs to target LTS branches tomorrow as I don’t have access to my laptop at the moment. |
…#40124) The `ngDevMode` description also mentions that calling `enableProdMode` will set this the value to `false`. https://github.com/angular/angular/blob/4610093c87975b6355f31a9c849351129908783a/packages/core/src/util/ng_dev_mode.ts#L22 which is currently not the case. PR Close #40124
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Currently, the global
ngDevMode
is set to false when using the Angular CLIoptimization
option. This option sets the globals via terser using the Compiler CLI private tooling APIangular/packages/compiler-cli/src/tooling.ts
Lines 25 to 34 in d39d64c
It is not documented that users not using the Angular CLI or using Angular Universal without
optimization
need to manually set tofalse
as otherwise they will be vulnerable to XHR attacks.The
ngDevMode
description also mentions that callingenableProdMode
will set the value tofalse
.angular/packages/core/src/util/ng_dev_mode.ts
Line 22 in 4610093
Closes #37644