@angular/core 16.2.1 → 17.0.0-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/esm2022/src/application_ref.mjs +2 -3
  2. package/esm2022/src/application_tokens.mjs +1 -1
  3. package/esm2022/src/core_render3_private_export.mjs +2 -2
  4. package/esm2022/src/metadata/di.mjs +1 -1
  5. package/esm2022/src/r3_symbols.mjs +2 -2
  6. package/esm2022/src/render3/deps_tracker/api.mjs +1 -1
  7. package/esm2022/src/render3/deps_tracker/deps_tracker.mjs +10 -3
  8. package/esm2022/src/render3/index.mjs +4 -3
  9. package/esm2022/src/render3/instructions/all.mjs +12 -11
  10. package/esm2022/src/render3/instructions/control_flow.mjs +61 -0
  11. package/esm2022/src/render3/instructions/defer.mjs +87 -5
  12. package/esm2022/src/render3/interfaces/definition.mjs +1 -1
  13. package/esm2022/src/render3/jit/directive.mjs +79 -83
  14. package/esm2022/src/render3/jit/environment.mjs +16 -1
  15. package/esm2022/src/render3/jit/module.mjs +13 -2
  16. package/esm2022/src/render3/jit/util.mjs +38 -1
  17. package/esm2022/src/render3/local_compilation.mjs +12 -0
  18. package/esm2022/src/render3/metadata.mjs +35 -1
  19. package/esm2022/src/version.mjs +1 -1
  20. package/esm2022/testing/src/logger.mjs +3 -3
  21. package/esm2022/testing/src/test_bed.mjs +6 -1
  22. package/esm2022/testing/src/test_bed_compiler.mjs +47 -6
  23. package/fesm2022/core.mjs +14141 -13676
  24. package/fesm2022/core.mjs.map +1 -1
  25. package/fesm2022/rxjs-interop.mjs +1 -1
  26. package/fesm2022/testing.mjs +18112 -17598
  27. package/fesm2022/testing.mjs.map +1 -1
  28. package/index.d.ts +156 -11
  29. package/package.json +1 -1
  30. package/rxjs-interop/index.d.ts +1 -1
  31. package/schematics/ng-generate/standalone-migration/bundle.js +6232 -5551
  32. package/schematics/ng-generate/standalone-migration/bundle.js.map +4 -4
  33. package/testing/index.d.ts +1 -1
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v16.2.1
2
+ * @license Angular v17.0.0-next.0
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -270,7 +270,7 @@ export declare const ANIMATION_MODULE_TYPE: InjectionToken<"NoopAnimations" | "B
270
270
  *
271
271
  * @publicApi
272
272
  */
273
- export declare const APP_BOOTSTRAP_LISTENER: InjectionToken<((compRef: ComponentRef<any>) => void)[]>;
273
+ export declare const APP_BOOTSTRAP_LISTENER: InjectionToken<readonly ((compRef: ComponentRef<any>) => void)[]>;
274
274
 
275
275
  /**
276
276
  * A [DI token](guide/glossary#di-token "DI token definition") representing a string ID, used
@@ -1738,8 +1738,6 @@ export declare interface ContentChildDecorator {
1738
1738
  * If the content DOM changes, and a new child matches the selector,
1739
1739
  * the property will be updated.
1740
1740
  *
1741
- * Content queries are set before the `ngAfterContentInit` callback is called.
1742
- *
1743
1741
  * Does not retrieve elements or directives that are in other components' templates,
1744
1742
  * since a component's template is always a black box to its ancestors.
1745
1743
  *
@@ -1770,6 +1768,17 @@ export declare interface ContentChildDecorator {
1770
1768
  * * Any provider defined through a string token (e.g. `{provide: 'token', useValue: 'val'}`)
1771
1769
  * * `TemplateRef`, `ElementRef`, and `ViewContainerRef`
1772
1770
  *
1771
+ * Difference between dynamic and static queries:
1772
+ *
1773
+ * | Queries | Details |
1774
+ * |:--- |:--- |
1775
+ * | Dynamic queries \(`static: false`\) | The query resolves before the `ngAfterContentInit()`
1776
+ * callback is called. The result will be updated for changes to your view, such as changes to
1777
+ * `ngIf` and `ngFor` blocks. | | Static queries \(`static: true`\) | The query resolves once
1778
+ * the view has been created, but before change detection runs (before the `ngOnInit()` callback
1779
+ * is called). The result, though, will never be updated to reflect changes to your view, such as
1780
+ * changes to `ngIf` and `ngFor` blocks. |
1781
+ *
1773
1782
  * @usageNotes
1774
1783
  *
1775
1784
  * {@example core/di/ts/contentChild/content_child_howto.ts region='HowTo'}
@@ -4053,6 +4062,7 @@ declare namespace i0 {
4053
4062
  ɵɵInjectorDeclaration,
4054
4063
  ɵɵNgModuleDeclaration,
4055
4064
  ɵsetClassMetadata as setClassMetadata,
4065
+ ɵsetClassMetadataAsync as setClassMetadataAsync,
4056
4066
  ɵNgModuleFactory as NgModuleFactory,
4057
4067
  ɵnoSideEffects,
4058
4068
  ITS_JUST_ANGULAR
@@ -6640,7 +6650,7 @@ export declare const PLATFORM_ID: InjectionToken<Object>;
6640
6650
  * A function that is executed when a platform is initialized.
6641
6651
  * @publicApi
6642
6652
  */
6643
- export declare const PLATFORM_INITIALIZER: InjectionToken<(() => void)[]>;
6653
+ export declare const PLATFORM_INITIALIZER: InjectionToken<readonly (() => void)[]>;
6644
6654
 
6645
6655
  /**
6646
6656
  * This platform has to be included in any other platform
@@ -7202,6 +7212,8 @@ declare class R3Injector extends EnvironmentInjector {
7202
7212
  private removeOnDestroy;
7203
7213
  }
7204
7214
 
7215
+ declare type RawScopeInfoFromDecorator = Type<any> | ModuleWithProviders<any> | (() => Type<any>) | (() => ModuleWithProviders<any>);
7216
+
7205
7217
  declare interface RComment extends RNode {
7206
7218
  textContent: string | null;
7207
7219
  }
@@ -9965,14 +9977,12 @@ export declare interface ViewChildDecorator {
9965
9977
  * in the view DOM. If the view DOM changes, and a new child matches the selector,
9966
9978
  * the property is updated.
9967
9979
  *
9968
- * View queries are set before the `ngAfterViewInit` callback is called.
9969
- *
9970
9980
  * **Metadata Properties**:
9971
9981
  *
9972
9982
  * * **selector** - The directive type or the name used for querying.
9973
9983
  * * **read** - Used to read a different token from the queried elements.
9974
- * * **static** - True to resolve query results before change detection runs,
9975
- * false to resolve after change detection. Defaults to false.
9984
+ * * **static** - `true` to resolve query results before change detection runs,
9985
+ * `false` to resolve after change detection. Defaults to `false`.
9976
9986
  *
9977
9987
  *
9978
9988
  * The following selectors are supported.
@@ -9993,6 +10003,17 @@ export declare interface ViewChildDecorator {
9993
10003
  * * Any provider defined through a string token (e.g. `{provide: 'token', useValue: 'val'}`)
9994
10004
  * * `TemplateRef`, `ElementRef`, and `ViewContainerRef`
9995
10005
  *
10006
+ * Difference between dynamic and static queries**:
10007
+ *
10008
+ * | Queries | Details |
10009
+ * |:--- |:--- |
10010
+ * | Dynamic queries \(`static: false`\) | The query resolves before the `ngAfterViewInit()`
10011
+ * callback is called. The result will be updated for changes to your view, such as changes to
10012
+ * `ngIf` and `ngFor` blocks. | | Static queries \(`static: true`\) | The query resolves once
10013
+ * the view has been created, but before change detection runs (before the `ngOnInit()` callback
10014
+ * is called). The result, though, will never be updated to reflect changes to your view, such as
10015
+ * changes to `ngIf` and `ngFor` blocks. |
10016
+ *
9996
10017
  * @usageNotes
9997
10018
  *
9998
10019
  * {@example core/di/ts/viewChild/view_child_example.ts region='Component'}
@@ -11828,6 +11849,16 @@ export declare function ɵsetClassMetadata(type: Type<any>, decorators: any[] |
11828
11849
  [field: string]: any;
11829
11850
  } | null): void;
11830
11851
 
11852
+ /**
11853
+ * Handles the process of applying metadata info to a component class in case
11854
+ * component template had `{#defer}` blocks (thus some dependencies became deferrable).
11855
+ *
11856
+ * @param type Component class where metadata should be added
11857
+ * @param dependencyLoaderFn Function that loads dependencies
11858
+ * @param metadataSetterFn Function that forms a scope in which the `setClassMetadata` is invoked
11859
+ */
11860
+ export declare function ɵsetClassMetadataAsync(type: Type<any>, dependencyLoaderFn: () => Array<Promise<Type<unknown>>>, metadataSetterFn: (...types: Type<unknown>[]) => void): Promise<Array<Type<unknown>>>;
11861
+
11831
11862
  export declare function ɵsetCurrentInjector(injector: Injector | null | undefined): Injector | undefined | null;
11832
11863
 
11833
11864
 
@@ -12799,6 +12830,20 @@ export declare type ɵɵComponentDeclaration<T, Selector extends String, ExportA
12799
12830
  [key: string]: string;
12800
12831
  }, QueryFields extends string[], NgContentSelectors extends string[], IsStandalone extends boolean = false, HostDirectives = never, IsSignal extends boolean = false> = unknown;
12801
12832
 
12833
+
12834
+ /**
12835
+ * The conditional instruction represents the basic building block on the runtime side to support
12836
+ * built-in "if" and "switch". On the high level this instruction is responsible for adding and
12837
+ * removing views selected by a conditional expression.
12838
+ *
12839
+ * @param containerIndex index of a container in a host view (indexed from HEADER_OFFSET) where
12840
+ * conditional views should be inserted.
12841
+ * @param matchingTemplateIndex index of a template TNode representing a conditional view to be
12842
+ * inserted; -1 represents a special case when there is no view to insert.
12843
+ * @codeGenApi
12844
+ */
12845
+ export declare function ɵɵconditional<T>(containerIndex: number, matchingTemplateIndex: number, value?: T): void;
12846
+
12802
12847
  /**
12803
12848
  * Registers a QueryList, associated with a content query, for later refresh (part of a view
12804
12849
  * refresh).
@@ -12834,12 +12879,110 @@ export declare function ɵɵCopyDefinitionFeature(definition: ɵDirectiveDef<any
12834
12879
  /**
12835
12880
  * Creates runtime data structures for `{#defer}` blocks.
12836
12881
  *
12837
- * @param index The index of the defer block in the data array
12882
+ * @param deferIndex Index of the underlying deferred block data structure.
12883
+ * @param primaryTemplateIndex Index of the template function with the block's content.
12838
12884
  * @param deferredDepsFn Function that contains dependencies for this defer block
12885
+ * @param loadingIndex Index of the template with the `{:loading}` block content.
12886
+ * @param placeholderIndex Index of the template with the `{:placeholder}` block content.
12887
+ * @param error Index of the template with the `{:error}` block content.
12888
+ * @param loadingConfigIndex Index in the constants array of the configuration of the `{:loading}`
12889
+ * block.
12890
+ * @param placeholderConfigIndexIndex in the constants array of the configuration of the
12891
+ * `{:placeholder}` block.
12839
12892
  *
12840
12893
  * @codeGenApi
12841
12894
  */
12842
- export declare function ɵɵdefer(index: number, deferredDepsFn: DeferredDepsFn | null): void;
12895
+ export declare function ɵɵdefer(deferIndex: number, primaryTemplateIndex: number, deferredDepsFn?: DeferredDepsFn | null, loadingIndex?: number | null, placeholderIndex?: number | null, errorIndex?: number | null, loadingConfigIndex?: number | null, placeholderConfigIndex?: number | null): void;
12896
+
12897
+ /**
12898
+ * Creates runtime data structures for the `on hover` deferred trigger.
12899
+ * @codeGenApi
12900
+ */
12901
+ export declare function ɵɵdeferOnHover(): void;
12902
+
12903
+ /**
12904
+ * Creates runtime data structures for the `on idle` deferred trigger.
12905
+ * @codeGenApi
12906
+ */
12907
+ export declare function ɵɵdeferOnIdle(): void;
12908
+
12909
+ /**
12910
+ * Creates runtime data structures for the `on immediate` deferred trigger.
12911
+ * @codeGenApi
12912
+ */
12913
+ export declare function ɵɵdeferOnImmediate(): void;
12914
+
12915
+ /**
12916
+ * Creates runtime data structures for the `on interaction` deferred trigger.
12917
+ * @param target Optional element on which to listen for hover events.
12918
+ * @codeGenApi
12919
+ */
12920
+ export declare function ɵɵdeferOnInteraction(target?: unknown): void;
12921
+
12922
+ /**
12923
+ * Creates runtime data structures for the `on timer` deferred trigger.
12924
+ * @param delay Amount of time to wait before loading the content.
12925
+ * @codeGenApi
12926
+ */
12927
+ export declare function ɵɵdeferOnTimer(delay: number): void;
12928
+
12929
+ /**
12930
+ * Creates runtime data structures for the `on viewport` deferred trigger.
12931
+ * @param target Optional element on which to listen for hover events.
12932
+ * @codeGenApi
12933
+ */
12934
+ export declare function ɵɵdeferOnViewport(target?: unknown): void;
12935
+
12936
+ /**
12937
+ * Creates runtime data structures for the `prefetech on hover` deferred trigger.
12938
+ * @codeGenApi
12939
+ */
12940
+ export declare function ɵɵdeferPrefetchOnHover(): void;
12941
+
12942
+ /**
12943
+ * Creates runtime data structures for the `prefetech on idle` deferred trigger.
12944
+ * @codeGenApi
12945
+ */
12946
+ export declare function ɵɵdeferPrefetchOnIdle(): void;
12947
+
12948
+ /**
12949
+ * Creates runtime data structures for the `prefetech on immediate` deferred trigger.
12950
+ * @codeGenApi
12951
+ */
12952
+ export declare function ɵɵdeferPrefetchOnImmediate(): void;
12953
+
12954
+ /**
12955
+ * Creates runtime data structures for the `prefetch on interaction` deferred trigger.
12956
+ * @param target Optional element on which to listen for hover events.
12957
+ * @codeGenApi
12958
+ */
12959
+ export declare function ɵɵdeferPrefetchOnInteraction(target?: unknown): void;
12960
+
12961
+ /**
12962
+ * Creates runtime data structures for the `prefetch on timer` deferred trigger.
12963
+ * @param delay Amount of time to wait before prefetching the content.
12964
+ * @codeGenApi
12965
+ */
12966
+ export declare function ɵɵdeferPrefetchOnTimer(delay: number): void;
12967
+
12968
+ /**
12969
+ * Creates runtime data structures for the `prefetch on viewport` deferred trigger.
12970
+ * @param target Optional element on which to listen for hover events.
12971
+ * @codeGenApi
12972
+ */
12973
+ export declare function ɵɵdeferPrefetchOnViewport(target?: unknown): void;
12974
+
12975
+ /**
12976
+ * Prefetches the deferred content when a value becomes truthy.
12977
+ * @codeGenApi
12978
+ */
12979
+ export declare function ɵɵdeferPrefetchWhen(value: unknown): void;
12980
+
12981
+ /**
12982
+ * Loads the deferred content when a value becomes truthy.
12983
+ * @codeGenApi
12984
+ */
12985
+ export declare function ɵɵdeferWhen(value: unknown): void;
12843
12986
 
12844
12987
  /**
12845
12988
  * Create a component definition object.
@@ -13148,6 +13291,8 @@ export declare enum ɵɵFactoryTarget {
13148
13291
  NgModule = 4
13149
13292
  }
13150
13293
 
13294
+ export declare function ɵɵgetComponentDepsFactory(type: Type<any>, rawImports?: RawScopeInfoFromDecorator): () => DependencyTypeList;
13295
+
13151
13296
  /**
13152
13297
  * Returns the current OpaqueViewState instance.
13153
13298
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/core",
3
- "version": "16.2.1",
3
+ "version": "17.0.0-next.0",
4
4
  "description": "Angular - the core framework",
5
5
  "author": "angular",
6
6
  "license": "MIT",
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v16.2.1
2
+ * @license Angular v17.0.0-next.0
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */