@angular/core 16.2.2 → 17.0.0-next.1

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 (35) 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/definition.mjs +2 -34
  7. package/esm2022/src/render3/deps_tracker/api.mjs +1 -1
  8. package/esm2022/src/render3/deps_tracker/deps_tracker.mjs +11 -7
  9. package/esm2022/src/render3/index.mjs +6 -4
  10. package/esm2022/src/render3/instructions/all.mjs +12 -11
  11. package/esm2022/src/render3/instructions/control_flow.mjs +61 -0
  12. package/esm2022/src/render3/instructions/defer.mjs +87 -5
  13. package/esm2022/src/render3/interfaces/definition.mjs +1 -1
  14. package/esm2022/src/render3/jit/directive.mjs +79 -83
  15. package/esm2022/src/render3/jit/environment.mjs +17 -1
  16. package/esm2022/src/render3/jit/module.mjs +13 -2
  17. package/esm2022/src/render3/jit/util.mjs +38 -1
  18. package/esm2022/src/render3/local_compilation.mjs +14 -0
  19. package/esm2022/src/render3/metadata.mjs +35 -1
  20. package/esm2022/src/render3/scope.mjs +61 -0
  21. package/esm2022/src/version.mjs +1 -1
  22. package/esm2022/testing/src/logger.mjs +3 -3
  23. package/esm2022/testing/src/test_bed.mjs +6 -1
  24. package/esm2022/testing/src/test_bed_compiler.mjs +47 -6
  25. package/fesm2022/core.mjs +10508 -10028
  26. package/fesm2022/core.mjs.map +1 -1
  27. package/fesm2022/rxjs-interop.mjs +1 -1
  28. package/fesm2022/testing.mjs +12482 -11953
  29. package/fesm2022/testing.mjs.map +1 -1
  30. package/index.d.ts +174 -16
  31. package/package.json +1 -1
  32. package/rxjs-interop/index.d.ts +1 -1
  33. package/schematics/ng-generate/standalone-migration/bundle.js +6415 -5579
  34. package/schematics/ng-generate/standalone-migration/bundle.js.map +4 -4
  35. package/testing/index.d.ts +1 -1
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v16.2.2
2
+ * @license Angular v17.0.0-next.1
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
@@ -6058,18 +6068,26 @@ export declare abstract class NgModuleRef<T> {
6058
6068
  }
6059
6069
 
6060
6070
  /**
6061
- * NgModule scope info as provided by NgModule decorator.
6071
+ * NgModule scope info as provided by AoT compiler
6072
+ *
6073
+ * In full compilation Ivy resolved all the "module with providers" and forward refs the whole array
6074
+ * if at least one element is forward refed. So we end up with type `Type<any>[]|(() =>
6075
+ * Type<any>[])`.
6076
+ *
6077
+ * In local mode the compiler passes the raw info as they are to the runtime functions as it is not
6078
+ * possible to resolve them any further due to limited info at compile time. So we end up with type
6079
+ * `RawScopeInfoFromDecorator[]`.
6062
6080
  */
6063
6081
  declare interface NgModuleScopeInfoFromDecorator {
6064
6082
  /** List of components, directives, and pipes declared by this module. */
6065
- declarations?: Type<any>[] | (() => Type<any>[]);
6066
- /** List of modules or `ModuleWithProviders` imported by this module. */
6067
- imports?: Type<any>[] | (() => Type<any>[]);
6083
+ declarations?: Type<any>[] | (() => Type<any>[]) | RawScopeInfoFromDecorator[];
6084
+ /** List of modules or `ModuleWithProviders` or standalone components imported by this module. */
6085
+ imports?: Type<any>[] | (() => Type<any>[]) | RawScopeInfoFromDecorator[];
6068
6086
  /**
6069
6087
  * List of modules, `ModuleWithProviders`, components, directives, or pipes exported by this
6070
6088
  * module.
6071
6089
  */
6072
- exports?: Type<any>[] | (() => Type<any>[]);
6090
+ exports?: Type<any>[] | (() => Type<any>[]) | RawScopeInfoFromDecorator[];
6073
6091
  }
6074
6092
 
6075
6093
  /**
@@ -6640,7 +6658,7 @@ export declare const PLATFORM_ID: InjectionToken<Object>;
6640
6658
  * A function that is executed when a platform is initialized.
6641
6659
  * @publicApi
6642
6660
  */
6643
- export declare const PLATFORM_INITIALIZER: InjectionToken<(() => void)[]>;
6661
+ export declare const PLATFORM_INITIALIZER: InjectionToken<readonly (() => void)[]>;
6644
6662
 
6645
6663
  /**
6646
6664
  * This platform has to be included in any other platform
@@ -7202,6 +7220,13 @@ declare class R3Injector extends EnvironmentInjector {
7202
7220
  private removeOnDestroy;
7203
7221
  }
7204
7222
 
7223
+ /**
7224
+ * The array element type passed to:
7225
+ * - NgModule's annotation imports/exports/declarations fields
7226
+ * - standalone component annotation imports field
7227
+ */
7228
+ declare type RawScopeInfoFromDecorator = Type<any> | ModuleWithProviders<any> | (() => Type<any>) | (() => ModuleWithProviders<any>);
7229
+
7205
7230
  declare interface RComment extends RNode {
7206
7231
  textContent: string | null;
7207
7232
  }
@@ -9965,14 +9990,12 @@ export declare interface ViewChildDecorator {
9965
9990
  * in the view DOM. If the view DOM changes, and a new child matches the selector,
9966
9991
  * the property is updated.
9967
9992
  *
9968
- * View queries are set before the `ngAfterViewInit` callback is called.
9969
- *
9970
9993
  * **Metadata Properties**:
9971
9994
  *
9972
9995
  * * **selector** - The directive type or the name used for querying.
9973
9996
  * * **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.
9997
+ * * **static** - `true` to resolve query results before change detection runs,
9998
+ * `false` to resolve after change detection. Defaults to `false`.
9976
9999
  *
9977
10000
  *
9978
10001
  * The following selectors are supported.
@@ -9993,6 +10016,17 @@ export declare interface ViewChildDecorator {
9993
10016
  * * Any provider defined through a string token (e.g. `{provide: 'token', useValue: 'val'}`)
9994
10017
  * * `TemplateRef`, `ElementRef`, and `ViewContainerRef`
9995
10018
  *
10019
+ * Difference between dynamic and static queries**:
10020
+ *
10021
+ * | Queries | Details |
10022
+ * |:--- |:--- |
10023
+ * | Dynamic queries \(`static: false`\) | The query resolves before the `ngAfterViewInit()`
10024
+ * callback is called. The result will be updated for changes to your view, such as changes to
10025
+ * `ngIf` and `ngFor` blocks. | | Static queries \(`static: true`\) | The query resolves once
10026
+ * the view has been created, but before change detection runs (before the `ngOnInit()` callback
10027
+ * is called). The result, though, will never be updated to reflect changes to your view, such as
10028
+ * changes to `ngIf` and `ngFor` blocks. |
10029
+ *
9996
10030
  * @usageNotes
9997
10031
  *
9998
10032
  * {@example core/di/ts/viewChild/view_child_example.ts region='Component'}
@@ -11828,6 +11862,16 @@ export declare function ɵsetClassMetadata(type: Type<any>, decorators: any[] |
11828
11862
  [field: string]: any;
11829
11863
  } | null): void;
11830
11864
 
11865
+ /**
11866
+ * Handles the process of applying metadata info to a component class in case
11867
+ * component template had `{#defer}` blocks (thus some dependencies became deferrable).
11868
+ *
11869
+ * @param type Component class where metadata should be added
11870
+ * @param dependencyLoaderFn Function that loads dependencies
11871
+ * @param metadataSetterFn Function that forms a scope in which the `setClassMetadata` is invoked
11872
+ */
11873
+ export declare function ɵsetClassMetadataAsync(type: Type<any>, dependencyLoaderFn: () => Array<Promise<Type<unknown>>>, metadataSetterFn: (...types: Type<unknown>[]) => void): Promise<Array<Type<unknown>>>;
11874
+
11831
11875
  export declare function ɵsetCurrentInjector(injector: Injector | null | undefined): Injector | undefined | null;
11832
11876
 
11833
11877
 
@@ -12799,6 +12843,20 @@ export declare type ɵɵComponentDeclaration<T, Selector extends String, ExportA
12799
12843
  [key: string]: string;
12800
12844
  }, QueryFields extends string[], NgContentSelectors extends string[], IsStandalone extends boolean = false, HostDirectives = never, IsSignal extends boolean = false> = unknown;
12801
12845
 
12846
+
12847
+ /**
12848
+ * The conditional instruction represents the basic building block on the runtime side to support
12849
+ * built-in "if" and "switch". On the high level this instruction is responsible for adding and
12850
+ * removing views selected by a conditional expression.
12851
+ *
12852
+ * @param containerIndex index of a container in a host view (indexed from HEADER_OFFSET) where
12853
+ * conditional views should be inserted.
12854
+ * @param matchingTemplateIndex index of a template TNode representing a conditional view to be
12855
+ * inserted; -1 represents a special case when there is no view to insert.
12856
+ * @codeGenApi
12857
+ */
12858
+ export declare function ɵɵconditional<T>(containerIndex: number, matchingTemplateIndex: number, value?: T): void;
12859
+
12802
12860
  /**
12803
12861
  * Registers a QueryList, associated with a content query, for later refresh (part of a view
12804
12862
  * refresh).
@@ -12834,12 +12892,110 @@ export declare function ɵɵCopyDefinitionFeature(definition: ɵDirectiveDef<any
12834
12892
  /**
12835
12893
  * Creates runtime data structures for `{#defer}` blocks.
12836
12894
  *
12837
- * @param index The index of the defer block in the data array
12895
+ * @param deferIndex Index of the underlying deferred block data structure.
12896
+ * @param primaryTemplateIndex Index of the template function with the block's content.
12838
12897
  * @param deferredDepsFn Function that contains dependencies for this defer block
12898
+ * @param loadingIndex Index of the template with the `{:loading}` block content.
12899
+ * @param placeholderIndex Index of the template with the `{:placeholder}` block content.
12900
+ * @param error Index of the template with the `{:error}` block content.
12901
+ * @param loadingConfigIndex Index in the constants array of the configuration of the `{:loading}`
12902
+ * block.
12903
+ * @param placeholderConfigIndexIndex in the constants array of the configuration of the
12904
+ * `{:placeholder}` block.
12839
12905
  *
12840
12906
  * @codeGenApi
12841
12907
  */
12842
- export declare function ɵɵdefer(index: number, deferredDepsFn: DeferredDepsFn | null): void;
12908
+ 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;
12909
+
12910
+ /**
12911
+ * Creates runtime data structures for the `on hover` deferred trigger.
12912
+ * @codeGenApi
12913
+ */
12914
+ export declare function ɵɵdeferOnHover(): void;
12915
+
12916
+ /**
12917
+ * Creates runtime data structures for the `on idle` deferred trigger.
12918
+ * @codeGenApi
12919
+ */
12920
+ export declare function ɵɵdeferOnIdle(): void;
12921
+
12922
+ /**
12923
+ * Creates runtime data structures for the `on immediate` deferred trigger.
12924
+ * @codeGenApi
12925
+ */
12926
+ export declare function ɵɵdeferOnImmediate(): void;
12927
+
12928
+ /**
12929
+ * Creates runtime data structures for the `on interaction` deferred trigger.
12930
+ * @param target Optional element on which to listen for hover events.
12931
+ * @codeGenApi
12932
+ */
12933
+ export declare function ɵɵdeferOnInteraction(target?: unknown): void;
12934
+
12935
+ /**
12936
+ * Creates runtime data structures for the `on timer` deferred trigger.
12937
+ * @param delay Amount of time to wait before loading the content.
12938
+ * @codeGenApi
12939
+ */
12940
+ export declare function ɵɵdeferOnTimer(delay: number): void;
12941
+
12942
+ /**
12943
+ * Creates runtime data structures for the `on viewport` deferred trigger.
12944
+ * @param target Optional element on which to listen for hover events.
12945
+ * @codeGenApi
12946
+ */
12947
+ export declare function ɵɵdeferOnViewport(target?: unknown): void;
12948
+
12949
+ /**
12950
+ * Creates runtime data structures for the `prefetech on hover` deferred trigger.
12951
+ * @codeGenApi
12952
+ */
12953
+ export declare function ɵɵdeferPrefetchOnHover(): void;
12954
+
12955
+ /**
12956
+ * Creates runtime data structures for the `prefetech on idle` deferred trigger.
12957
+ * @codeGenApi
12958
+ */
12959
+ export declare function ɵɵdeferPrefetchOnIdle(): void;
12960
+
12961
+ /**
12962
+ * Creates runtime data structures for the `prefetech on immediate` deferred trigger.
12963
+ * @codeGenApi
12964
+ */
12965
+ export declare function ɵɵdeferPrefetchOnImmediate(): void;
12966
+
12967
+ /**
12968
+ * Creates runtime data structures for the `prefetch on interaction` deferred trigger.
12969
+ * @param target Optional element on which to listen for hover events.
12970
+ * @codeGenApi
12971
+ */
12972
+ export declare function ɵɵdeferPrefetchOnInteraction(target?: unknown): void;
12973
+
12974
+ /**
12975
+ * Creates runtime data structures for the `prefetch on timer` deferred trigger.
12976
+ * @param delay Amount of time to wait before prefetching the content.
12977
+ * @codeGenApi
12978
+ */
12979
+ export declare function ɵɵdeferPrefetchOnTimer(delay: number): void;
12980
+
12981
+ /**
12982
+ * Creates runtime data structures for the `prefetch on viewport` deferred trigger.
12983
+ * @param target Optional element on which to listen for hover events.
12984
+ * @codeGenApi
12985
+ */
12986
+ export declare function ɵɵdeferPrefetchOnViewport(target?: unknown): void;
12987
+
12988
+ /**
12989
+ * Prefetches the deferred content when a value becomes truthy.
12990
+ * @codeGenApi
12991
+ */
12992
+ export declare function ɵɵdeferPrefetchWhen(value: unknown): void;
12993
+
12994
+ /**
12995
+ * Loads the deferred content when a value becomes truthy.
12996
+ * @codeGenApi
12997
+ */
12998
+ export declare function ɵɵdeferWhen(value: unknown): void;
12843
12999
 
12844
13000
  /**
12845
13001
  * Create a component definition object.
@@ -13148,6 +13304,8 @@ export declare enum ɵɵFactoryTarget {
13148
13304
  NgModule = 4
13149
13305
  }
13150
13306
 
13307
+ export declare function ɵɵgetComponentDepsFactory(type: ɵComponentType<any>, rawImports?: RawScopeInfoFromDecorator[]): () => DependencyTypeList;
13308
+
13151
13309
  /**
13152
13310
  * Returns the current OpaqueViewState instance.
13153
13311
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/core",
3
- "version": "16.2.2",
3
+ "version": "17.0.0-next.1",
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.2
2
+ * @license Angular v17.0.0-next.1
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */