refactor(core): clean up isDevMode for tree-shaking (#44210)

Removing the usage of isDevMode with ngDevMode flag. This will make the
dev-mode code tree-shakable from the production builds.

PR Close #44210
This commit is contained in:
Ramesh Thiruchelvam
2021-11-18 22:51:09 +05:30
committed by Jessica Janiuk
parent 40eb2f57f4
commit 2772eea649
2 changed files with 4 additions and 4 deletions
@@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.io/license
*/
import {Compiler, CompilerOptions, Injector, isDevMode, NgModule, NgModuleRef, NgZone, resolveForwardRef, StaticProvider, Testability, Type} from '@angular/core';
import {Compiler, CompilerOptions, Injector, NgModule, NgModuleRef, NgZone, resolveForwardRef, StaticProvider, Testability, Type} from '@angular/core';
import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
import {bootstrap, element as angularElement, IAngularBootstrapConfig, IAugmentedJQuery, IInjectorService, IModule, IProvideService, IRootScopeService, ITestabilityService, module_ as angularModule} from '../../common/src/angular1';
@@ -605,7 +605,7 @@ export class UpgradeAdapter {
let subscription = this.ngZone.onMicrotaskEmpty.subscribe({
next: () => {
if (rootScope.$$phase) {
if (isDevMode()) {
if (typeof ngDevMode === 'undefined' || ngDevMode) {
console.warn(
'A digest was triggered while one was already in progress. This may mean that something is triggering digests outside the Angular zone.');
}
@@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.io/license
*/
import {Injector, isDevMode, NgModule, NgZone, PlatformRef, Testability} from '@angular/core';
import {Injector, NgModule, NgZone, PlatformRef, Testability} from '@angular/core';
import {bootstrap, element as angularElement, IInjectorService, IIntervalService, IProvideService, ITestabilityService, module_ as angularModule} from '../../src/common/src/angular1';
import {$$TESTABILITY, $DELEGATE, $INJECTOR, $INTERVAL, $PROVIDE, INJECTOR_KEY, LAZY_MODULE_REF, UPGRADE_APP_TYPE_KEY, UPGRADE_MODULE_NAME} from '../../src/common/src/constants';
@@ -279,7 +279,7 @@ export class UpgradeModule {
setTimeout(() => {
const subscription = this.ngZone.onMicrotaskEmpty.subscribe(() => {
if ($rootScope.$$phase) {
if (isDevMode()) {
if (typeof ngDevMode === 'undefined' || ngDevMode) {
console.warn(
'A digest was triggered while one was already in progress. This may mean that something is triggering digests outside the Angular zone.');
}