fix(core): set ngDevMode to false when calling enableProdMode()#40124
fix(core): set ngDevMode to false when calling enableProdMode()#40124alan-agius4 wants to merge 1 commit intoangular:masterfrom alan-agius4:prod-mode-ng-dev-mode
ngDevMode to false when calling enableProdMode()#40124Conversation
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.
|
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
ngDevModeis set to false when using the Angular CLIoptimizationoption. 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
optimizationneed to manually set tofalseas otherwise they will be vulnerable to XHR attacks.The
ngDevModedescription also mentions that callingenableProdModewill set the value tofalse.angular/packages/core/src/util/ng_dev_mode.ts
Line 22 in 4610093
Closes #37644