@angular/core 18.0.0-next.5 → 18.0.0-next.6

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 (82) hide show
  1. package/esm2022/primitives/event-dispatch/contract_binary.mjs +10 -0
  2. package/esm2022/primitives/event-dispatch/index.mjs +13 -0
  3. package/esm2022/primitives/event-dispatch/src/a11y_click.mjs +54 -0
  4. package/esm2022/primitives/event-dispatch/src/accessibility.mjs +35 -0
  5. package/esm2022/primitives/event-dispatch/src/attribute.mjs +72 -0
  6. package/esm2022/primitives/event-dispatch/src/base_dispatcher.mjs +196 -0
  7. package/esm2022/primitives/event-dispatch/src/cache.mjs +95 -0
  8. package/esm2022/primitives/event-dispatch/src/char.mjs +35 -0
  9. package/esm2022/primitives/event-dispatch/src/custom_events.mjs +63 -0
  10. package/esm2022/primitives/event-dispatch/src/dispatcher.mjs +254 -0
  11. package/esm2022/primitives/event-dispatch/src/dom.mjs +48 -0
  12. package/esm2022/primitives/event-dispatch/src/earlyeventcontract.mjs +36 -0
  13. package/esm2022/primitives/event-dispatch/src/event.mjs +638 -0
  14. package/esm2022/primitives/event-dispatch/src/event_contract_container.mjs +63 -0
  15. package/esm2022/primitives/event-dispatch/src/event_contract_defines.mjs +48 -0
  16. package/esm2022/primitives/event-dispatch/src/event_contract_multi_container.mjs +192 -0
  17. package/esm2022/primitives/event-dispatch/src/event_handler.mjs +9 -0
  18. package/esm2022/primitives/event-dispatch/src/event_info.mjs +199 -0
  19. package/esm2022/primitives/event-dispatch/src/event_type.mjs +244 -0
  20. package/esm2022/primitives/event-dispatch/src/eventcontract.mjs +675 -0
  21. package/esm2022/primitives/event-dispatch/src/key_code.mjs +21 -0
  22. package/esm2022/primitives/event-dispatch/src/legacy_dispatcher.mjs +9 -0
  23. package/esm2022/primitives/event-dispatch/src/property.mjs +35 -0
  24. package/esm2022/primitives/event-dispatch/src/register_events.mjs +32 -0
  25. package/esm2022/primitives/event-dispatch/src/replay.mjs +389 -0
  26. package/esm2022/primitives/event-dispatch/src/restriction.mjs +15 -0
  27. package/esm2022/primitives/signals/index.mjs +3 -3
  28. package/esm2022/primitives/signals/src/computed.mjs +5 -3
  29. package/esm2022/primitives/signals/src/graph.mjs +14 -9
  30. package/esm2022/primitives/signals/src/signal.mjs +2 -2
  31. package/esm2022/primitives/signals/src/watch.mjs +2 -2
  32. package/esm2022/src/change_detection/scheduling/zoneless_scheduling_impl.mjs +50 -5
  33. package/esm2022/src/core.mjs +2 -1
  34. package/esm2022/src/core_private_export.mjs +2 -1
  35. package/esm2022/src/defer/instructions.mjs +31 -8
  36. package/esm2022/src/di/host_tag_name_token.mjs +65 -0
  37. package/esm2022/src/di/index.mjs +2 -1
  38. package/esm2022/src/errors.mjs +1 -1
  39. package/esm2022/src/hydration/annotate.mjs +15 -1
  40. package/esm2022/src/hydration/event_replay.mjs +181 -0
  41. package/esm2022/src/hydration/tokens.mjs +6 -1
  42. package/esm2022/src/pending_tasks.mjs +54 -11
  43. package/esm2022/src/render3/component_ref.mjs +1 -1
  44. package/esm2022/src/render3/context_discovery.mjs +15 -1
  45. package/esm2022/src/render3/instructions/control_flow.mjs +50 -3
  46. package/esm2022/src/render3/list_reconciliation.mjs +41 -1
  47. package/esm2022/src/util/callback_scheduler.mjs +13 -2
  48. package/esm2022/src/version.mjs +1 -1
  49. package/esm2022/src/zone/ng_zone.mjs +22 -6
  50. package/esm2022/testing/src/async.mjs +2 -10
  51. package/esm2022/testing/src/defer.mjs +1 -2
  52. package/esm2022/testing/src/logger.mjs +3 -3
  53. package/event-dispatch-contract.min.js +1 -1
  54. package/fesm2022/core.mjs +516 -39
  55. package/fesm2022/core.mjs.map +1 -1
  56. package/fesm2022/primitives/event-dispatch.mjs +3044 -0
  57. package/fesm2022/primitives/event-dispatch.mjs.map +1 -0
  58. package/fesm2022/primitives/signals.mjs +17 -10
  59. package/fesm2022/primitives/signals.mjs.map +1 -1
  60. package/fesm2022/rxjs-interop.mjs +1 -1
  61. package/fesm2022/testing.mjs +3 -12
  62. package/fesm2022/testing.mjs.map +1 -1
  63. package/index.d.ts +75 -13
  64. package/package.json +7 -1
  65. package/primitives/event-dispatch/index.d.ts +627 -0
  66. package/primitives/signals/index.d.ts +1 -1
  67. package/rxjs-interop/index.d.ts +1 -1
  68. package/schematics/migrations/{transfer-state → http-providers}/bundle.js +254 -68
  69. package/schematics/migrations/http-providers/bundle.js.map +7 -0
  70. package/schematics/migrations/invalid-two-way-bindings/bundle.js +659 -337
  71. package/schematics/migrations/invalid-two-way-bindings/bundle.js.map +2 -2
  72. package/schematics/migrations.json +6 -16
  73. package/schematics/ng-generate/control-flow-migration/bundle.js +667 -345
  74. package/schematics/ng-generate/control-flow-migration/bundle.js.map +2 -2
  75. package/schematics/ng-generate/standalone-migration/bundle.js +1030 -660
  76. package/schematics/ng-generate/standalone-migration/bundle.js.map +2 -2
  77. package/testing/index.d.ts +2 -9
  78. package/schematics/migrations/block-template-entities/bundle.js +0 -22808
  79. package/schematics/migrations/block-template-entities/bundle.js.map +0 -7
  80. package/schematics/migrations/compiler-options/bundle.js +0 -582
  81. package/schematics/migrations/compiler-options/bundle.js.map +0 -7
  82. package/schematics/migrations/transfer-state/bundle.js.map +0 -7
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v18.0.0-next.5
2
+ * @license Angular v18.0.0-next.6
3
3
  * (c) 2010-2024 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -3926,6 +3926,43 @@ export declare interface ExistingSansProvider {
3926
3926
  useExisting: any;
3927
3927
  }
3928
3928
 
3929
+ /**
3930
+ * Experimental service that keeps track of pending tasks contributing to the stableness of Angular
3931
+ * application. While several existing Angular services (ex.: `HttpClient`) will internally manage
3932
+ * tasks influencing stability, this API gives control over stability to library and application
3933
+ * developers for specific cases not covered by Angular internals.
3934
+ *
3935
+ * The concept of stability comes into play in several important scenarios:
3936
+ * - SSR process needs to wait for the application stability before serializing and sending rendered
3937
+ * HTML;
3938
+ * - tests might want to delay assertions until the application becomes stable;
3939
+ *
3940
+ * @usageNotes
3941
+ * ```typescript
3942
+ * const pendingTasks = inject(ExperimentalPendingTasks);
3943
+ * const taskCleanup = pendingTasks.add();
3944
+ * // do work that should block application's stability and then:
3945
+ * taskCleanup();
3946
+ * ```
3947
+ *
3948
+ * This API is experimental. Neither the shape, nor the underlying behavior is stable and can change
3949
+ * in patch versions. We will iterate on the exact API based on the feedback and our understanding
3950
+ * of the problem and solution space.
3951
+ *
3952
+ * @publicApi
3953
+ * @experimental
3954
+ */
3955
+ export declare class ExperimentalPendingTasks {
3956
+ internalPendingTasks: ɵPendingTasks;
3957
+ /**
3958
+ * Adds a new task that should block application's stability.
3959
+ * @returns A cleanup function that removes a task when called.
3960
+ */
3961
+ add(): () => void;
3962
+ static ɵfac: i0.ɵɵFactoryDeclaration<ExperimentalPendingTasks, never>;
3963
+ static ɵprov: i0.ɵɵInjectableDeclaration<ExperimentalPendingTasks>;
3964
+ }
3965
+
3929
3966
  /**
3930
3967
  * Definition of what a factory function should look like.
3931
3968
  */
@@ -4355,6 +4392,29 @@ export declare interface Host {
4355
4392
  */
4356
4393
  export declare const Host: HostDecorator;
4357
4394
 
4395
+ /**
4396
+ * A token that can be used to inject the tag name of the host node.
4397
+ *
4398
+ * @usageNotes
4399
+ * ### Injecting a tag name that is known to exist
4400
+ * ```typescript
4401
+ * @Directive()
4402
+ * class MyDir {
4403
+ * tagName: string = inject(HOST_TAG_NAME);
4404
+ * }
4405
+ * ```
4406
+ *
4407
+ * ### Optionally injecting a tag name
4408
+ * ```typescript
4409
+ * @Directive()
4410
+ * class MyDir {
4411
+ * tagName: string | null = inject(HOST_TAG_NAME, {optional: true});
4412
+ * }
4413
+ * ```
4414
+ * @publicApi
4415
+ */
4416
+ export declare const HOST_TAG_NAME: InjectionToken<string>;
4417
+
4358
4418
  /**
4359
4419
  * Creates a token that can be used to inject static attributes of the host node.
4360
4420
  *
@@ -8144,8 +8204,8 @@ declare type ProjectionSlots = (ɵCssSelectorList | '*')[];
8144
8204
  * ```
8145
8205
  *
8146
8206
  * This API is experimental. Neither the shape, nor the underlying behavior is stable and can change
8147
- * in patch versions. There are known feature gaps, including the lack of a public zoneless API
8148
- * which prevents the application from serializing too early with SSR.
8207
+ * in patch versions. There are known feature gaps and API ergonomic considerations. We will iterate
8208
+ * on the exact API based on the feedback and our understanding of the problem and solution space.
8149
8209
  *
8150
8210
  * @publicApi
8151
8211
  * @experimental
@@ -11781,8 +11841,9 @@ export declare const enum ɵAnimationRendererType {
11781
11841
  *
11782
11842
  * @param appRef An instance of an ApplicationRef.
11783
11843
  * @param doc A reference to the current Document instance.
11844
+ * @return event types that need to be replayed
11784
11845
  */
11785
- export declare function ɵannotateForHydration(appRef: ApplicationRef, doc: Document): void;
11846
+ export declare function ɵannotateForHydration(appRef: ApplicationRef, doc: Document): Set<string> | undefined;
11786
11847
 
11787
11848
 
11788
11849
  /**
@@ -13035,14 +13096,7 @@ export declare const ɵNOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR: {};
13035
13096
  export declare function ɵpatchComponentDefWithScope<C>(componentDef: ɵComponentDef<C>, transitiveScopes: ɵNgModuleTransitiveScopes): void;
13036
13097
 
13037
13098
  /**
13038
- * *Internal* service that keeps track of pending tasks happening in the system.
13039
- *
13040
- * This information is needed to make sure that the serialization on the server
13041
- * is delayed until all tasks in the queue (such as an initial navigation or a
13042
- * pending HTTP request) are completed.
13043
- *
13044
- * Pending tasks continue to contribute to the stableness of `ApplicationRef`
13045
- * throughout the lifetime of the application.
13099
+ * Internal implementation of the pending tasks service.
13046
13100
  */
13047
13101
  export declare class ɵPendingTasks implements OnDestroy {
13048
13102
  private taskId;
@@ -13473,6 +13527,8 @@ export declare const enum ɵRuntimeErrorCode {
13473
13527
  REQUIRED_QUERY_NO_VALUE = -951,
13474
13528
  REQUIRED_MODEL_NO_VALUE = -952,
13475
13529
  OUTPUT_REF_DESTROYED = 953,
13530
+ LOOP_TRACK_DUPLICATE_KEYS = 955,
13531
+ LOOP_TRACK_RECREATE = 956,
13476
13532
  RUNTIME_DEPS_INVALID_IMPORTED_TYPE = 1000,
13477
13533
  RUNTIME_DEPS_ORPHAN_COMPONENT = 1001
13478
13534
  }
@@ -13644,7 +13700,7 @@ export declare function ɵtransitiveScopesFor<T>(type: Type<T>): ɵNgModuleTrans
13644
13700
  * @param tDetails Static information about this defer block.
13645
13701
  * @param lView LView of a host view.
13646
13702
  */
13647
- export declare function ɵtriggerResourceLoading(tDetails: TDeferBlockDetails, lView: LView, tNode: TNode): void;
13703
+ export declare function ɵtriggerResourceLoading(tDetails: TDeferBlockDetails, lView: LView, tNode: TNode): Promise<unknown>;
13648
13704
 
13649
13705
  /**
13650
13706
  * Ellipses the string in the middle when longer than the max length
@@ -13929,6 +13985,12 @@ export declare function ɵwhenStable(applicationRef: ApplicationRef): Promise<vo
13929
13985
  */
13930
13986
  export declare function ɵwithDomHydration(): EnvironmentProviders;
13931
13987
 
13988
+ /**
13989
+ * Returns a set of providers required to setup support for event replay.
13990
+ * Requires hydration to be enabled separately.
13991
+ */
13992
+ export declare function ɵwithEventReplay(): Provider[];
13993
+
13932
13994
  /**
13933
13995
  * Returns a set of providers required to setup support for i18n hydration.
13934
13996
  * Requires hydration to be enabled separately.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/core",
3
- "version": "18.0.0-next.5",
3
+ "version": "18.0.0-next.6",
4
4
  "description": "Angular - the core framework",
5
5
  "author": "angular",
6
6
  "license": "MIT",
@@ -23,6 +23,12 @@
23
23
  "esm": "./esm2022/core.mjs",
24
24
  "default": "./fesm2022/core.mjs"
25
25
  },
26
+ "./primitives/event-dispatch": {
27
+ "types": "./primitives/event-dispatch/index.d.ts",
28
+ "esm2022": "./esm2022/primitives/event-dispatch/index.mjs",
29
+ "esm": "./esm2022/primitives/event-dispatch/index.mjs",
30
+ "default": "./fesm2022/primitives/event-dispatch.mjs"
31
+ },
26
32
  "./primitives/signals": {
27
33
  "types": "./primitives/signals/index.d.ts",
28
34
  "esm2022": "./esm2022/primitives/signals/index.mjs",