feat(core): manually annotate de-sugarred core tree-shakable providers with @pureOrBreakMyCode (#41096)
This is necessary for closure compiler in order to support cross chunk code motion. I'm intentionally not annotating these call sites with @__PURE__ at the moment because build-optimizer does it within the Angular CLI build. In the future we might want to consider having both annotations here in case we change how build-optimizer works. PR Close #41096
This commit is contained in:
parent
9c210281d4
commit
03d47d5701
|
@ -21,7 +21,7 @@ export abstract class ViewportScroller {
|
|||
// De-sugared tree-shakable injection
|
||||
// See #23917
|
||||
/** @nocollapse */
|
||||
static ɵprov = ɵɵdefineInjectable({
|
||||
static ɵprov = /** @pureOrBreakMyCode */ ɵɵdefineInjectable({
|
||||
token: ViewportScroller,
|
||||
providedIn: 'root',
|
||||
factory: () => new BrowserViewportScroller(ɵɵinject(DOCUMENT), window)
|
||||
|
|
|
@ -145,7 +145,7 @@ export function defaultIterableDiffersFactory() {
|
|||
*/
|
||||
export class IterableDiffers {
|
||||
/** @nocollapse */
|
||||
static ɵprov = ɵɵdefineInjectable(
|
||||
static ɵprov = /** @pureOrBreakMyCode */ ɵɵdefineInjectable(
|
||||
{token: IterableDiffers, providedIn: 'root', factory: defaultIterableDiffersFactory});
|
||||
|
||||
/**
|
||||
|
|
|
@ -122,7 +122,7 @@ export function defaultKeyValueDiffersFactory() {
|
|||
*/
|
||||
export class KeyValueDiffers {
|
||||
/** @nocollapse */
|
||||
static ɵprov = ɵɵdefineInjectable(
|
||||
static ɵprov = /** @pureOrBreakMyCode */ ɵɵdefineInjectable(
|
||||
{token: KeyValueDiffers, providedIn: 'root', factory: defaultKeyValueDiffersFactory});
|
||||
|
||||
/**
|
||||
|
|
|
@ -105,7 +105,7 @@ export abstract class Injector {
|
|||
}
|
||||
|
||||
/** @nocollapse */
|
||||
static ɵprov = ɵɵdefineInjectable({
|
||||
static ɵprov = /** @pureOrBreakMyCode */ ɵɵdefineInjectable({
|
||||
token: Injector,
|
||||
providedIn: 'any' as any,
|
||||
factory: () => ɵɵinject(INJECTOR),
|
||||
|
|
|
@ -17,7 +17,7 @@ import {SecurityContext} from './security';
|
|||
export abstract class Sanitizer {
|
||||
abstract sanitize(context: SecurityContext, value: {}|string|null): string|null;
|
||||
/** @nocollapse */
|
||||
static ɵprov = ɵɵdefineInjectable({
|
||||
static ɵprov = /** @pureOrBreakMyCode */ ɵɵdefineInjectable({
|
||||
token: Sanitizer,
|
||||
providedIn: 'root',
|
||||
factory: () => null,
|
||||
|
|
Loading…
Reference in New Issue