@angular/core 18.1.1 → 18.1.3

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 (54) hide show
  1. package/esm2022/primitives/event-dispatch/index.mjs +2 -1
  2. package/esm2022/primitives/event-dispatch/src/bootstrap_app_scoped.mjs +18 -3
  3. package/esm2022/primitives/event-dispatch/src/bootstrap_global.mjs +18 -7
  4. package/esm2022/primitives/event-dispatch/src/earlyeventcontract.mjs +25 -1
  5. package/esm2022/primitives/event-dispatch/src/event_type.mjs +2 -2
  6. package/esm2022/primitives/event-dispatch/src/eventcontract.mjs +40 -35
  7. package/esm2022/rxjs-interop/src/to_signal.mjs +6 -5
  8. package/esm2022/src/application/application_init.mjs +2 -2
  9. package/esm2022/src/application/application_module.mjs +2 -2
  10. package/esm2022/src/application/application_ref.mjs +2 -2
  11. package/esm2022/src/change_detection/scheduling/ng_zone_scheduling.mjs +3 -10
  12. package/esm2022/src/change_detection/scheduling/zoneless_scheduling_impl.mjs +2 -2
  13. package/esm2022/src/console.mjs +2 -2
  14. package/esm2022/src/core_private_export.mjs +2 -1
  15. package/esm2022/src/error_handler.mjs +4 -2
  16. package/esm2022/src/event_delegation_utils.mjs +8 -8
  17. package/esm2022/src/event_dispatch/event_delegation.mjs +2 -4
  18. package/esm2022/src/hydration/event_replay.mjs +6 -6
  19. package/esm2022/src/image_performance_warning.mjs +2 -2
  20. package/esm2022/src/linker/compiler.mjs +2 -2
  21. package/esm2022/src/platform/platform_ref.mjs +2 -2
  22. package/esm2022/src/render3/after_render_hooks.mjs +2 -2
  23. package/esm2022/src/render3/component_ref.mjs +1 -1
  24. package/esm2022/src/render3/node_manipulation.mjs +9 -2
  25. package/esm2022/src/testability/testability.mjs +3 -3
  26. package/esm2022/src/util/callback_scheduler.mjs +26 -23
  27. package/esm2022/src/version.mjs +1 -1
  28. package/esm2022/testing/src/application_error_handler.mjs +43 -0
  29. package/esm2022/testing/src/component_fixture.mjs +13 -2
  30. package/esm2022/testing/src/logger.mjs +3 -3
  31. package/esm2022/testing/src/test_bed_common.mjs +1 -1
  32. package/esm2022/testing/src/test_bed_compiler.mjs +24 -2
  33. package/event-dispatch-contract.min.js +1 -1
  34. package/fesm2022/core.mjs +735 -731
  35. package/fesm2022/core.mjs.map +1 -1
  36. package/fesm2022/primitives/event-dispatch.mjs +144 -35
  37. package/fesm2022/primitives/event-dispatch.mjs.map +1 -1
  38. package/fesm2022/primitives/signals.mjs +1 -1
  39. package/fesm2022/rxjs-interop.mjs +6 -5
  40. package/fesm2022/rxjs-interop.mjs.map +1 -1
  41. package/fesm2022/testing.mjs +69 -3
  42. package/fesm2022/testing.mjs.map +1 -1
  43. package/index.d.ts +10 -2
  44. package/package.json +1 -1
  45. package/primitives/event-dispatch/index.d.ts +28 -13
  46. package/primitives/signals/index.d.ts +1 -1
  47. package/rxjs-interop/index.d.ts +1 -1
  48. package/schematics/migrations/invalid-two-way-bindings/bundle.js +11 -7
  49. package/schematics/migrations/invalid-two-way-bindings/bundle.js.map +2 -2
  50. package/schematics/ng-generate/control-flow-migration/bundle.js +11 -7
  51. package/schematics/ng-generate/control-flow-migration/bundle.js.map +2 -2
  52. package/schematics/ng-generate/standalone-migration/bundle.js +114 -78
  53. package/schematics/ng-generate/standalone-migration/bundle.js.map +4 -4
  54. package/testing/index.d.ts +2 -1
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v18.1.1
2
+ * @license Angular v18.1.3
3
3
  * (c) 2010-2024 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -4519,7 +4519,7 @@ declare class GlobalEventDelegation implements OnDestroy {
4519
4519
  private eventContractDetails;
4520
4520
  ngOnDestroy(): void;
4521
4521
  supports(eventType: string): boolean;
4522
- addEventListener(element: HTMLElement, eventType: string, handler: Function): Function;
4522
+ addEventListener(element: HTMLElement, eventName: string, handler: Function): Function;
4523
4523
  removeEventListener(element: HTMLElement, eventType: string, callback: Function): void;
4524
4524
  static ɵfac: i0.ɵɵFactoryDeclaration<GlobalEventDelegation, never>;
4525
4525
  static ɵprov: i0.ɵɵInjectableDeclaration<GlobalEventDelegation>;
@@ -13061,6 +13061,14 @@ declare const ɵINPUT_SIGNAL_BRAND_READ_TYPE: unique symbol;
13061
13061
 
13062
13062
  export declare const ɵINPUT_SIGNAL_BRAND_WRITE_TYPE: unique symbol;
13063
13063
 
13064
+ /**
13065
+ * `InjectionToken` used to configure how to call the `ErrorHandler`.
13066
+ *
13067
+ * `NgZone` is provided by default today so the default (and only) implementation for this
13068
+ * is calling `ErrorHandler.handleError` outside of the Angular zone.
13069
+ */
13070
+ export declare const ɵINTERNAL_APPLICATION_ERROR_HANDLER: InjectionToken<(e: any) => void>;
13071
+
13064
13072
  /**
13065
13073
  * Register a callback to run once before any userspace `afterRender` or
13066
13074
  * `afterNextRender` callbacks.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/core",
3
- "version": "18.1.1",
3
+ "version": "18.1.3",
4
4
  "description": "Angular - the core framework",
5
5
  "author": "angular",
6
6
  "license": "MIT",
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v18.1.1
2
+ * @license Angular v18.1.3
3
3
  * (c) 2010-2024 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -33,6 +33,15 @@ export declare const Attribute: {
33
33
  JSACTION: "jsaction";
34
34
  };
35
35
 
36
+ /**
37
+ * Creates an `EarlyJsactionData`, adds events to it, and populates it on a nested object on
38
+ * the window.
39
+ */
40
+ export declare function bootstrapAppScopedEarlyEventContract(container: HTMLElement, appId: string, bubbleEventTypes: string[], captureEventTypes: string[], dataContainer?: EarlyJsactionDataContainer): void;
41
+
42
+ /** Clear the early event contract. */
43
+ export declare function clearAppScopedEarlyEventContract(appId: string, dataContainer?: EarlyJsactionDataContainer): void;
44
+
36
45
  /** Clones an `EventInfo` */
37
46
  declare function cloneEventInfo(eventInfo: EventInfo): EventInfo;
38
47
 
@@ -104,7 +113,6 @@ export declare interface EarlyJsactionDataContainer {
104
113
  * be delay loaded in a generic way.
105
114
  */
106
115
  export declare class EventContract implements UnrenamedEventContract {
107
- private readonly useActionResolver?;
108
116
  static MOUSE_SPECIAL_SUPPORT: boolean;
109
117
  private containerManager;
110
118
  /**
@@ -129,7 +137,7 @@ export declare class EventContract implements UnrenamedEventContract {
129
137
  * as soon as the `Dispatcher` is registered.
130
138
  */
131
139
  private queuedEventInfos;
132
- constructor(containerManager: EventContractContainerManager, useActionResolver?: false | undefined);
140
+ constructor(containerManager: EventContractContainerManager);
133
141
  private handleEvent;
134
142
  /**
135
143
  * Handle an `EventInfo`.
@@ -155,6 +163,11 @@ export declare class EventContract implements UnrenamedEventContract {
155
163
  * up the early contract.
156
164
  */
157
165
  replayEarlyEvents(earlyJsactionData?: EarlyJsactionData | undefined): void;
166
+ /**
167
+ * Replays all the early `EventInfo` objects, dispatching them through the normal
168
+ * `EventContract` flow.
169
+ */
170
+ replayEarlyEventInfos(earlyEventInfos: eventInfoLib.EventInfo[]): void;
158
171
  /**
159
172
  * Returns all JSAction event types that have been registered for a given
160
173
  * browser event type.
@@ -186,16 +199,6 @@ export declare class EventContract implements UnrenamedEventContract {
186
199
  * units.
187
200
  */
188
201
  ecrd(dispatcher: Dispatcher, restriction: Restriction): void;
189
- /**
190
- * Adds a11y click support to the given `EventContract`. Meant to be called in
191
- * the same compilation unit as the `EventContract`.
192
- */
193
- addA11yClickSupport(): void;
194
- /**
195
- * Enables a11y click support to be deferred. Meant to be called in the same
196
- * compilation unit as the `EventContract`.
197
- */
198
- exportAddA11yClickSupport(): void;
199
202
  }
200
203
 
201
204
  /**
@@ -395,6 +398,9 @@ declare function getActionElement(actionInfo: ActionInfoInternal): Element;
395
398
  /** Added for readability when accessing stable property names. */
396
399
  declare function getActionName(actionInfo: ActionInfoInternal): string;
397
400
 
401
+ /** Get the queued `EventInfo` objects that were dispatched before a dispatcher was registered. */
402
+ export declare function getAppScopedQueuedEventInfos(appId: string, dataContainer?: EarlyJsactionDataContainer): EventInfo[];
403
+
398
404
  /** Added for readability when accessing stable property names. */
399
405
  declare function getContainer(eventInfo: EventInfo): Element;
400
406
 
@@ -428,12 +434,21 @@ export declare const isCaptureEventType: (eventType: string) => boolean;
428
434
  */
429
435
  export declare const isEarlyEventType: (eventType: string) => boolean;
430
436
 
437
+ /**
438
+ * Registers a dispatcher function on the `EarlyJsactionData` present on the nested object on the
439
+ * window.
440
+ */
441
+ export declare function registerAppScopedDispatcher(restriction: Restriction, appId: string, dispatcher: (eventInfo: EventInfo) => void, dataContainer?: EarlyJsactionDataContainer): void;
442
+
431
443
  /**
432
444
  * Registers deferred functionality for an EventContract and a Jsaction
433
445
  * Dispatcher.
434
446
  */
435
447
  export declare function registerDispatcher(eventContract: UnrenamedEventContract, dispatcher: EventDispatcher): void;
436
448
 
449
+ /** Removes all event listener handlers. */
450
+ export declare function removeAllAppScopedEventListeners(appId: string, dataContainer?: EarlyJsactionDataContainer): void;
451
+
437
452
 
438
453
  /**
439
454
  * @fileoverview An enum to control who can call certain jsaction APIs.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v18.1.1
2
+ * @license Angular v18.1.3
3
3
  * (c) 2010-2024 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v18.1.1
2
+ * @license Angular v18.1.3
3
3
  * (c) 2010-2024 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -3669,7 +3669,7 @@ var FactoryTarget;
3669
3669
  FactoryTarget3[FactoryTarget3["NgModule"] = 4] = "NgModule";
3670
3670
  })(FactoryTarget || (FactoryTarget = {}));
3671
3671
  function compileFactoryFunction(meta) {
3672
- const t = variable("t");
3672
+ const t = variable("\u0275t");
3673
3673
  let baseFactoryVar = null;
3674
3674
  const typeForCtor = !isDelegatedFactoryMetadata(meta) ? new BinaryOperatorExpr(BinaryOperator.Or, t, meta.type.value) : t;
3675
3675
  let ctorExpr = null;
@@ -3684,7 +3684,7 @@ function compileFactoryFunction(meta) {
3684
3684
  const body = [];
3685
3685
  let retExpr = null;
3686
3686
  function makeConditionalFactory(nonCtorExpr) {
3687
- const r = variable("r");
3687
+ const r = variable("\u0275r");
3688
3688
  body.push(r.set(NULL_EXPR).toDeclStmt());
3689
3689
  const ctorStmt = ctorExpr !== null ? r.set(ctorExpr).toStmt() : importExpr(Identifiers.invalidFactory).callFn([]).toStmt();
3690
3690
  body.push(ifStmt(t, [ctorStmt], [r.set(nonCtorExpr).toStmt()]));
@@ -3708,7 +3708,7 @@ function compileFactoryFunction(meta) {
3708
3708
  } else {
3709
3709
  body.push(new ReturnStatement(retExpr));
3710
3710
  }
3711
- let factoryFn = fn([new FnParam("t", DYNAMIC_TYPE)], body, INFERRED_TYPE, void 0, `${meta.name}_Factory`);
3711
+ let factoryFn = fn([new FnParam(t.name, DYNAMIC_TYPE)], body, INFERRED_TYPE, void 0, `${meta.name}_Factory`);
3712
3712
  if (baseFactoryVar !== null) {
3713
3713
  factoryFn = arrowFn([], [new DeclareVarStmt(baseFactoryVar.name), new ReturnStatement(factoryFn)]).callFn([], void 0, true);
3714
3714
  }
@@ -5168,7 +5168,8 @@ function delegateToFactory(type, useType, unwrapForwardRefs) {
5168
5168
  return createFactoryFunction(unwrappedType);
5169
5169
  }
5170
5170
  function createFactoryFunction(type) {
5171
- return arrowFn([new FnParam("t", DYNAMIC_TYPE)], type.prop("\u0275fac").callFn([variable("t")]));
5171
+ const t = new FnParam("\u0275t", DYNAMIC_TYPE);
5172
+ return arrowFn([t], type.prop("\u0275fac").callFn([variable(t.name)]));
5172
5173
  }
5173
5174
 
5174
5175
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/assertions.mjs
@@ -8626,6 +8627,7 @@ var CHAINABLE = /* @__PURE__ */ new Set([
8626
8627
  Identifiers.twoWayListener,
8627
8628
  Identifiers.declareLet
8628
8629
  ]);
8630
+ var MAX_CHAIN_LENGTH = 256;
8629
8631
  function chain(job) {
8630
8632
  for (const unit of job.units) {
8631
8633
  chainOperationsInList(unit.create);
@@ -8648,16 +8650,18 @@ function chainOperationsInList(opList) {
8648
8650
  chain2 = null;
8649
8651
  continue;
8650
8652
  }
8651
- if (chain2 !== null && chain2.instruction === instruction) {
8653
+ if (chain2 !== null && chain2.instruction === instruction && chain2.length < MAX_CHAIN_LENGTH) {
8652
8654
  const expression = chain2.expression.callFn(op.statement.expr.args, op.statement.expr.sourceSpan, op.statement.expr.pure);
8653
8655
  chain2.expression = expression;
8654
8656
  chain2.op.statement = expression.toStmt();
8657
+ chain2.length++;
8655
8658
  OpList.remove(op);
8656
8659
  } else {
8657
8660
  chain2 = {
8658
8661
  op,
8659
8662
  instruction,
8660
- expression: op.statement.expr
8663
+ expression: op.statement.expr,
8664
+ length: 1
8661
8665
  };
8662
8666
  }
8663
8667
  }
@@ -23448,7 +23452,7 @@ function publishFacade(global) {
23448
23452
  }
23449
23453
 
23450
23454
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/version.mjs
23451
- var VERSION2 = new Version("18.1.1");
23455
+ var VERSION2 = new Version("18.1.3");
23452
23456
 
23453
23457
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/i18n/extractor_merger.mjs
23454
23458
  var _VisitorMode;