refactor(core): tree-shake application_module providers (#23477)
PR Close #23477
This commit is contained in:

committed by
Igor Minar

parent
b4c252bcc5
commit
eb031c6ff1
@ -6,13 +6,11 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {ApplicationInitStatus} from './application_init';
|
||||
import {ApplicationRef} from './application_ref';
|
||||
import {APP_ID_RANDOM_PROVIDER} from './application_tokens';
|
||||
import {IterableDiffers, KeyValueDiffers, defaultIterableDiffers, defaultKeyValueDiffers} from './change_detection/change_detection';
|
||||
import {Inject, Optional, SkipSelf} from './di/metadata';
|
||||
import {APP_ROOT} from './di/scope';
|
||||
import {LOCALE_ID} from './i18n/tokens';
|
||||
import {Compiler} from './linker/compiler';
|
||||
import {NgModule} from './metadata';
|
||||
|
||||
export function _iterableDiffersFactory() {
|
||||
@ -28,17 +26,14 @@ export function _localeFactory(locale?: string): string {
|
||||
}
|
||||
|
||||
/**
|
||||
* This module includes the providers of @angular/core that are needed
|
||||
* to bootstrap components via `ApplicationRef`.
|
||||
*
|
||||
* @experimental
|
||||
*/
|
||||
@NgModule({
|
||||
providers: [
|
||||
ApplicationRef,
|
||||
ApplicationInitStatus,
|
||||
Compiler,
|
||||
APP_ID_RANDOM_PROVIDER,
|
||||
// wen-workers need this value to be here since WorkerApp is defined
|
||||
// ontop of this application
|
||||
{provide: APP_ROOT, useValue: true},
|
||||
{provide: IterableDiffers, useFactory: _iterableDiffersFactory},
|
||||
{provide: KeyValueDiffers, useFactory: _keyValueDiffersFactory},
|
||||
{
|
||||
@ -49,6 +44,4 @@ export function _localeFactory(locale?: string): string {
|
||||
]
|
||||
})
|
||||
export class ApplicationModule {
|
||||
// Inject ApplicationRef to make it eager...
|
||||
constructor(appRef: ApplicationRef) {}
|
||||
}
|
||||
|
Reference in New Issue
Block a user