@angular/core 17.0.0-next.5 → 17.0.0-next.7

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 (55) hide show
  1. package/esm2022/rxjs-interop/src/to_signal.mjs +13 -11
  2. package/esm2022/src/application_init.mjs +3 -3
  3. package/esm2022/src/application_module.mjs +3 -3
  4. package/esm2022/src/application_ref.mjs +23 -6
  5. package/esm2022/src/change_detection/differs/default_iterable_differ.mjs +1 -2
  6. package/esm2022/src/console.mjs +2 -2
  7. package/esm2022/src/core_private_export.mjs +2 -2
  8. package/esm2022/src/hydration/api.mjs +7 -8
  9. package/esm2022/src/hydration/views.mjs +3 -3
  10. package/esm2022/src/initial_render_pending_tasks.mjs +2 -2
  11. package/esm2022/src/linker/compiler.mjs +2 -2
  12. package/esm2022/src/linker/query_list.mjs +7 -10
  13. package/esm2022/src/linker/view_container_ref.mjs +12 -10
  14. package/esm2022/src/render3/deps_tracker/deps_tracker.mjs +4 -8
  15. package/esm2022/src/render3/instructions/control_flow.mjs +69 -64
  16. package/esm2022/src/render3/instructions/defer.mjs +615 -97
  17. package/esm2022/src/render3/instructions/defer_events.mjs +164 -0
  18. package/esm2022/src/render3/instructions/shared.mjs +1 -1
  19. package/esm2022/src/render3/instructions/template.mjs +9 -2
  20. package/esm2022/src/render3/interfaces/defer.mjs +9 -11
  21. package/esm2022/src/render3/interfaces/definition.mjs +1 -1
  22. package/esm2022/src/render3/interfaces/view.mjs +1 -1
  23. package/esm2022/src/render3/list_reconciliation.mjs +257 -0
  24. package/esm2022/src/render3/metadata.mjs +2 -2
  25. package/esm2022/src/render3/pipe.mjs +4 -4
  26. package/esm2022/src/render3/state.mjs +2 -11
  27. package/esm2022/src/render3/util/global_utils.mjs +3 -2
  28. package/esm2022/src/render3/util/injector_discovery_utils.mjs +35 -3
  29. package/esm2022/src/render3/util/view_utils.mjs +17 -3
  30. package/esm2022/src/render3/view_ref.mjs +11 -1
  31. package/esm2022/src/testability/testability.mjs +5 -5
  32. package/esm2022/src/util/assert.mjs +6 -1
  33. package/esm2022/src/version.mjs +1 -1
  34. package/esm2022/testing/src/component_fixture.mjs +4 -2
  35. package/esm2022/testing/src/defer.mjs +3 -3
  36. package/esm2022/testing/src/logger.mjs +4 -4
  37. package/fesm2022/core.mjs +13603 -12606
  38. package/fesm2022/core.mjs.map +1 -1
  39. package/fesm2022/rxjs-interop.mjs +13 -11
  40. package/fesm2022/rxjs-interop.mjs.map +1 -1
  41. package/fesm2022/testing.mjs +6 -4
  42. package/fesm2022/testing.mjs.map +1 -1
  43. package/index.d.ts +94 -53
  44. package/package.json +1 -1
  45. package/rxjs-interop/index.d.ts +1 -1
  46. package/schematics/migrations/block-template-entities/bundle.js +23643 -0
  47. package/schematics/migrations/block-template-entities/bundle.js.map +7 -0
  48. package/schematics/migrations.json +4 -9
  49. package/schematics/ng-generate/standalone-migration/bundle.js +3250 -2695
  50. package/schematics/ng-generate/standalone-migration/bundle.js.map +4 -4
  51. package/testing/index.d.ts +5 -3
  52. package/schematics/migrations/guard-and-resolve-interfaces/bundle.js +0 -694
  53. package/schematics/migrations/guard-and-resolve-interfaces/bundle.js.map +0 -7
  54. package/schematics/migrations/remove-module-id/bundle.js +0 -368
  55. package/schematics/migrations/remove-module-id/bundle.js.map +0 -7
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v17.0.0-next.5
2
+ * @license Angular v17.0.0-next.7
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -2492,20 +2492,18 @@ export declare class DefaultIterableDiffer<V> implements IterableDiffer<V>, Iter
2492
2492
  declare enum DeferDependenciesLoadingState {
2493
2493
  /** Initial state, dependency loading is not yet triggered */
2494
2494
  NOT_STARTED = 0,
2495
- /** Dependency loading was scheduled (e.g. `on idle`), but has not started yet */
2496
- SCHEDULED = 1,
2497
2495
  /** Dependency loading is in progress */
2498
- IN_PROGRESS = 2,
2496
+ IN_PROGRESS = 1,
2499
2497
  /** Dependency loading has completed successfully */
2500
- COMPLETE = 3,
2498
+ COMPLETE = 2,
2501
2499
  /** Dependency loading has failed */
2502
- FAILED = 4
2500
+ FAILED = 3
2503
2501
  }
2504
2502
 
2505
- /** Configuration object for a `{:loading}` block as it is stored in the component constants. */
2503
+ /** Configuration object for a loading block as it is stored in the component constants. */
2506
2504
  declare type DeferredLoadingBlockConfig = [minimumTime: number | null, afterTime: number | null];
2507
2505
 
2508
- /** Configuration object for a `{:placeholder}` block as it is stored in the component constants. */
2506
+ /** Configuration object for a placeholder block as it is stored in the component constants. */
2509
2507
  declare type DeferredPlaceholderBlockConfig = [afterTime: number | null];
2510
2508
 
2511
2509
  /**
@@ -5899,14 +5897,14 @@ declare const enum LViewFlags {
5899
5897
  HasEmbeddedViewInjector = 2048,
5900
5898
  /** Indicates that the view was created with `signals: true`. */
5901
5899
  SignalView = 4096,
5902
- /**
5903
- * Index of the current init phase on last 21 bits
5904
- */
5905
- IndexWithinInitPhaseIncrementer = 8192,
5906
5900
  /**
5907
5901
  * This is the count of the bits the 1 was shifted above (base 10)
5908
5902
  */
5909
5903
  IndexWithinInitPhaseShift = 13,
5904
+ /**
5905
+ * Index of the current init phase on last 21 bits
5906
+ */
5907
+ IndexWithinInitPhaseIncrementer = 8192,
5910
5908
  IndexWithinInitPhaseReset = 8191
5911
5909
  }
5912
5910
 
@@ -8477,7 +8475,7 @@ declare interface TContainerNode extends TNode {
8477
8475
  declare type TData = (TNode | ɵPipeDef<any> | ɵDirectiveDef<any> | ɵComponentDef<any> | number | TStylingRange | TStylingKey | ProviderToken<any> | TI18n | I18nUpdateOpCodes | TIcu | null | string | TDeferBlockDetails)[];
8478
8476
 
8479
8477
  /**
8480
- * Describes the data shared across all instances of a {#defer} block.
8478
+ * Describes the data shared across all instances of a defer block.
8481
8479
  */
8482
8480
  declare interface TDeferBlockDetails {
8483
8481
  /**
@@ -8486,32 +8484,27 @@ declare interface TDeferBlockDetails {
8486
8484
  */
8487
8485
  primaryTmplIndex: number;
8488
8486
  /**
8489
- * Index in an LView and TData arrays where a template for the `{:loading}`
8490
- * block can be found.
8487
+ * Index in an LView and TData arrays where a template for the loading block can be found.
8491
8488
  */
8492
8489
  loadingTmplIndex: number | null;
8493
8490
  /**
8494
- * Extra configuration parameters (such as `after` and `minimum`)
8495
- * for the `{:loading}` block.
8491
+ * Extra configuration parameters (such as `after` and `minimum`) for the loading block.
8496
8492
  */
8497
8493
  loadingBlockConfig: DeferredLoadingBlockConfig | null;
8498
8494
  /**
8499
- * Index in an LView and TData arrays where a template for the `{:placeholder}`
8500
- * block can be found.
8495
+ * Index in an LView and TData arrays where a template for the placeholder block can be found.
8501
8496
  */
8502
8497
  placeholderTmplIndex: number | null;
8503
8498
  /**
8504
- * Extra configuration parameters (such as `after` and `minimum`)
8505
- * for the `{:placeholder}` block.
8499
+ * Extra configuration parameters (such as `after` and `minimum`) for the placeholder block.
8506
8500
  */
8507
8501
  placeholderBlockConfig: DeferredPlaceholderBlockConfig | null;
8508
8502
  /**
8509
- * Index in an LView and TData arrays where a template for the `{:error}`
8510
- * block can be found.
8503
+ * Index in an LView and TData arrays where a template for the error block can be found.
8511
8504
  */
8512
8505
  errorTmplIndex: number | null;
8513
8506
  /**
8514
- * Compiler-generated function that loads all dependencies for a `{#defer}` block.
8507
+ * Compiler-generated function that loads all dependencies for a defer block.
8515
8508
  */
8516
8509
  dependencyResolverFn: DependencyResolverFn | null;
8517
8510
  /**
@@ -11159,19 +11152,19 @@ export declare interface ɵDeferBlockDetails {
11159
11152
  }
11160
11153
 
11161
11154
  /**
11162
- * Describes the current state of this {#defer} block instance.
11155
+ * Describes the current state of this defer block instance.
11163
11156
  *
11164
11157
  * @publicApi
11165
11158
  * @developerPreview
11166
11159
  */
11167
11160
  export declare enum ɵDeferBlockState {
11168
- /** The {:placeholder} block content is rendered */
11161
+ /** The placeholder block content is rendered */
11169
11162
  Placeholder = 0,
11170
- /** The {:loading} block content is rendered */
11163
+ /** The loading block content is rendered */
11171
11164
  Loading = 1,
11172
11165
  /** The main content block content is rendered */
11173
11166
  Complete = 2,
11174
- /** The {:error} block content is rendered */
11167
+ /** The error block content is rendered */
11175
11168
  Error = 3
11176
11169
  }
11177
11170
 
@@ -12316,7 +12309,7 @@ export declare function ɵsetClassMetadata(type: Type<any>, decorators: any[] |
12316
12309
 
12317
12310
  /**
12318
12311
  * Handles the process of applying metadata info to a component class in case
12319
- * component template had `{#defer}` blocks (thus some dependencies became deferrable).
12312
+ * component template had defer blocks (thus some dependencies became deferrable).
12320
12313
  *
12321
12314
  * @param type Component class where metadata should be added
12322
12315
  * @param dependencyLoaderFn Function that loads dependencies
@@ -12419,7 +12412,7 @@ export declare function ɵunwrapSafeValue<T>(value: T): T;
12419
12412
  *
12420
12413
  * @deprecated For migration purposes only, to be removed soon.
12421
12414
  */
12422
- export declare const ɵUSE_RUNTIME_DEPS_TRACKER_FOR_JIT = false;
12415
+ export declare const ɵUSE_RUNTIME_DEPS_TRACKER_FOR_JIT = true;
12423
12416
 
12424
12417
  export declare class ɵViewRef<T> implements EmbeddedViewRef<T>, InternalViewRef, ChangeDetectorRefInterface {
12425
12418
  /**
@@ -12453,6 +12446,11 @@ export declare class ɵViewRef<T> implements EmbeddedViewRef<T>, InternalViewRef
12453
12446
  */
12454
12447
  _cdRefInjectingView?: LView<unknown> | undefined);
12455
12448
  get context(): T;
12449
+ /**
12450
+ * @deprecated Replacing the full context object is not supported. Modify the context
12451
+ * directly, or consider using a `Proxy` if you need to replace the full object.
12452
+ * // TODO(devversion): Remove this.
12453
+ */
12456
12454
  set context(value: T);
12457
12455
  get destroyed(): boolean;
12458
12456
  destroy(): void;
@@ -12634,6 +12632,12 @@ export declare class ɵViewRef<T> implements EmbeddedViewRef<T>, InternalViewRef
12634
12632
  attachToAppRef(appRef: ViewRefTracker): void;
12635
12633
  }
12636
12634
 
12635
+ /**
12636
+ * Returns a Promise that resolves when the application becomes stable after this method is called
12637
+ * the first time.
12638
+ */
12639
+ export declare function ɵwhenStable(applicationRef: ApplicationRef): Promise<void>;
12640
+
12637
12641
  /**
12638
12642
  * Returns a set of providers required to setup hydration support
12639
12643
  * for an application that is server side rendered. This function is
@@ -12646,6 +12650,35 @@ export declare class ɵViewRef<T> implements EmbeddedViewRef<T>, InternalViewRef
12646
12650
  */
12647
12651
  export declare function ɵwithDomHydration(): EnvironmentProviders;
12648
12652
 
12653
+ /**
12654
+ * Returns a writable type version of type.
12655
+ *
12656
+ * USAGE:
12657
+ * Given:
12658
+ * ```
12659
+ * interface Person {readonly name: string}
12660
+ * ```
12661
+ *
12662
+ * We would like to get a read/write version of `Person`.
12663
+ * ```
12664
+ * const WritablePerson = Writable<Person>;
12665
+ * ```
12666
+ *
12667
+ * The result is that you can do:
12668
+ *
12669
+ * ```
12670
+ * const readonlyPerson: Person = {name: 'Marry'};
12671
+ * readonlyPerson.name = 'John'; // TypeError
12672
+ * (readonlyPerson as WritablePerson).name = 'John'; // OK
12673
+ *
12674
+ * // Error: Correctly detects that `Person` did not have `age` property.
12675
+ * (readonlyPerson as WritablePerson).age = 30;
12676
+ * ```
12677
+ */
12678
+ export declare type ɵWritable<T> = {
12679
+ -readonly [K in keyof T]: T[K];
12680
+ };
12681
+
12649
12682
  /**
12650
12683
  * URL for the XSS security documentation.
12651
12684
  */
@@ -13387,18 +13420,18 @@ export declare function ɵɵcontentQuery<T>(directiveIndex: number, predicate: P
13387
13420
  export declare function ɵɵCopyDefinitionFeature(definition: ɵDirectiveDef<any> | ɵComponentDef<any>): void;
13388
13421
 
13389
13422
  /**
13390
- * Creates runtime data structures for `{#defer}` blocks.
13423
+ * Creates runtime data structures for defer blocks.
13391
13424
  *
13392
13425
  * @param index Index of the `defer` instruction.
13393
13426
  * @param primaryTmplIndex Index of the template with the primary block content.
13394
13427
  * @param dependencyResolverFn Function that contains dependencies for this defer block.
13395
- * @param loadingTmplIndex Index of the template with the `{:loading}` block content.
13396
- * @param placeholderTmplIndex Index of the template with the `{:placeholder}` block content.
13397
- * @param errorTmplIndex Index of the template with the `{:error}` block content.
13398
- * @param loadingConfigIndex Index in the constants array of the configuration of the `{:loading}`.
13428
+ * @param loadingTmplIndex Index of the template with the loading block content.
13429
+ * @param placeholderTmplIndex Index of the template with the placeholder block content.
13430
+ * @param errorTmplIndex Index of the template with the error block content.
13431
+ * @param loadingConfigIndex Index in the constants array of the configuration of the loading.
13399
13432
  * block.
13400
- * @param placeholderConfigIndexIndex in the constants array of the configuration of the
13401
- * `{:placeholder}` block.
13433
+ * @param placeholderConfigIndex Index in the constants array of the configuration of the
13434
+ * placeholder block.
13402
13435
  *
13403
13436
  * @codeGenApi
13404
13437
  */
@@ -13406,28 +13439,31 @@ export declare function ɵɵdefer(index: number, primaryTmplIndex: number, depen
13406
13439
 
13407
13440
  /**
13408
13441
  * Creates runtime data structures for the `on hover` deferred trigger.
13442
+ * @param triggerIndex Index at which to find the trigger element.
13443
+ * @param walkUpTimes Number of times to walk up/down the tree hierarchy to find the trigger.
13409
13444
  * @codeGenApi
13410
13445
  */
13411
- export declare function ɵɵdeferOnHover(): void;
13446
+ export declare function ɵɵdeferOnHover(triggerIndex: number, walkUpTimes?: number): void;
13412
13447
 
13413
13448
  /**
13414
- * Sets up handlers that represent `on idle` deferred trigger.
13449
+ * Sets up logic to handle the `on idle` deferred trigger.
13415
13450
  * @codeGenApi
13416
13451
  */
13417
13452
  export declare function ɵɵdeferOnIdle(): void;
13418
13453
 
13419
13454
  /**
13420
- * Creates runtime data structures for the `on immediate` deferred trigger.
13455
+ * Sets up logic to handle the `on immediate` deferred trigger.
13421
13456
  * @codeGenApi
13422
13457
  */
13423
13458
  export declare function ɵɵdeferOnImmediate(): void;
13424
13459
 
13425
13460
  /**
13426
13461
  * Creates runtime data structures for the `on interaction` deferred trigger.
13427
- * @param target Optional element on which to listen for hover events.
13462
+ * @param triggerIndex Index at which to find the trigger element.
13463
+ * @param walkUpTimes Number of times to walk up/down the tree hierarchy to find the trigger.
13428
13464
  * @codeGenApi
13429
13465
  */
13430
- export declare function ɵɵdeferOnInteraction(target?: unknown): void;
13466
+ export declare function ɵɵdeferOnInteraction(triggerIndex: number, walkUpTimes?: number): void;
13431
13467
 
13432
13468
  /**
13433
13469
  * Creates runtime data structures for the `on timer` deferred trigger.
@@ -13438,35 +13474,39 @@ export declare function ɵɵdeferOnTimer(delay: number): void;
13438
13474
 
13439
13475
  /**
13440
13476
  * Creates runtime data structures for the `on viewport` deferred trigger.
13441
- * @param target Optional element on which to listen for hover events.
13477
+ * @param triggerIndex Index at which to find the trigger element.
13478
+ * @param walkUpTimes Number of times to walk up/down the tree hierarchy to find the trigger.
13442
13479
  * @codeGenApi
13443
13480
  */
13444
- export declare function ɵɵdeferOnViewport(target?: unknown): void;
13481
+ export declare function ɵɵdeferOnViewport(triggerIndex: number, walkUpTimes?: number): void;
13445
13482
 
13446
13483
  /**
13447
13484
  * Creates runtime data structures for the `prefetch on hover` deferred trigger.
13485
+ * @param triggerIndex Index at which to find the trigger element.
13486
+ * @param walkUpTimes Number of times to walk up/down the tree hierarchy to find the trigger.
13448
13487
  * @codeGenApi
13449
13488
  */
13450
- export declare function ɵɵdeferPrefetchOnHover(): void;
13489
+ export declare function ɵɵdeferPrefetchOnHover(triggerIndex: number, walkUpTimes?: number): void;
13451
13490
 
13452
13491
  /**
13453
- * Creates runtime data structures for the `prefetch on idle` deferred trigger.
13492
+ * Sets up logic to handle the `prefetch on idle` deferred trigger.
13454
13493
  * @codeGenApi
13455
13494
  */
13456
13495
  export declare function ɵɵdeferPrefetchOnIdle(): void;
13457
13496
 
13458
13497
  /**
13459
- * Creates runtime data structures for the `prefetch on immediate` deferred trigger.
13498
+ * Sets up logic to handle the `prefetch on immediate` deferred trigger.
13460
13499
  * @codeGenApi
13461
13500
  */
13462
13501
  export declare function ɵɵdeferPrefetchOnImmediate(): void;
13463
13502
 
13464
13503
  /**
13465
13504
  * Creates runtime data structures for the `prefetch on interaction` deferred trigger.
13466
- * @param target Optional element on which to listen for hover events.
13505
+ * @param triggerIndex Index at which to find the trigger element.
13506
+ * @param walkUpTimes Number of times to walk up/down the tree hierarchy to find the trigger.
13467
13507
  * @codeGenApi
13468
13508
  */
13469
- export declare function ɵɵdeferPrefetchOnInteraction(target?: unknown): void;
13509
+ export declare function ɵɵdeferPrefetchOnInteraction(triggerIndex: number, walkUpTimes?: number): void;
13470
13510
 
13471
13511
  /**
13472
13512
  * Creates runtime data structures for the `prefetch on timer` deferred trigger.
@@ -13477,10 +13517,11 @@ export declare function ɵɵdeferPrefetchOnTimer(delay: number): void;
13477
13517
 
13478
13518
  /**
13479
13519
  * Creates runtime data structures for the `prefetch on viewport` deferred trigger.
13480
- * @param target Optional element on which to listen for hover events.
13520
+ * @param triggerIndex Index at which to find the trigger element.
13521
+ * @param walkUpTimes Number of times to walk up/down the tree hierarchy to find the trigger.
13481
13522
  * @codeGenApi
13482
13523
  */
13483
- export declare function ɵɵdeferPrefetchOnViewport(target?: unknown): void;
13524
+ export declare function ɵɵdeferPrefetchOnViewport(triggerIndex: number, walkUpTimes?: number): void;
13484
13525
 
13485
13526
  /**
13486
13527
  * Prefetches the deferred content when a value becomes truthy.
@@ -14274,12 +14315,12 @@ export declare function ɵɵpipe(index: number, pipeName: string): any;
14274
14315
  * the pipe only when an input to the pipe changes.
14275
14316
  *
14276
14317
  * @param index Pipe index where the pipe was stored on creation.
14277
- * @param slotOffset the offset in the reserved slot space
14318
+ * @param offset the binding offset
14278
14319
  * @param v1 1st argument to {@link PipeTransform#transform}.
14279
14320
  *
14280
14321
  * @codeGenApi
14281
14322
  */
14282
- export declare function ɵɵpipeBind1(index: number, slotOffset: number, v1: any): any;
14323
+ export declare function ɵɵpipeBind1(index: number, offset: number, v1: any): any;
14283
14324
 
14284
14325
  /**
14285
14326
  * Invokes a pipe with 2 arguments.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/core",
3
- "version": "17.0.0-next.5",
3
+ "version": "17.0.0-next.7",
4
4
  "description": "Angular - the core framework",
5
5
  "author": "angular",
6
6
  "license": "MIT",
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v17.0.0-next.5
2
+ * @license Angular v17.0.0-next.7
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */