@angular/core 19.1.5 → 19.1.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 (35) hide show
  1. package/fesm2022/core.mjs +40 -13
  2. package/fesm2022/core.mjs.map +1 -1
  3. package/fesm2022/primitives/event-dispatch.mjs +1 -1
  4. package/fesm2022/primitives/signals.mjs +1 -1
  5. package/fesm2022/rxjs-interop.mjs +1 -1
  6. package/fesm2022/testing.mjs +4 -4
  7. package/index.d.ts +13 -2
  8. package/package.json +1 -1
  9. package/primitives/event-dispatch/index.d.ts +1 -1
  10. package/primitives/signals/index.d.ts +1 -1
  11. package/rxjs-interop/index.d.ts +1 -1
  12. package/schematics/bundles/{apply_import_manager-57619f3c.js → apply_import_manager-61eb7e4a.js} +3 -3
  13. package/schematics/bundles/{checker-ce908760.js → checker-58684f3f.js} +87 -50
  14. package/schematics/bundles/cleanup-unused-imports.js +5 -5
  15. package/schematics/bundles/{compiler_host-33b24174.js → compiler_host-dff4346e.js} +2 -2
  16. package/schematics/bundles/control-flow-migration.js +10 -3
  17. package/schematics/bundles/explicit-standalone-flag.js +3 -3
  18. package/schematics/bundles/imports-31a38653.js +1 -1
  19. package/schematics/bundles/{index-d6e51169.js → index-027c9191.js} +4 -4
  20. package/schematics/bundles/{index-59a1204f.js → index-4bb9c755.js} +4 -4
  21. package/schematics/bundles/inject-migration.js +3 -3
  22. package/schematics/bundles/leading_space-6e7a8ec6.js +1 -1
  23. package/schematics/bundles/{migrate_ts_type_references-2c37e645.js → migrate_ts_type_references-f48f6ec0.js} +5 -5
  24. package/schematics/bundles/nodes-88c2157f.js +1 -1
  25. package/schematics/bundles/output-migration.js +5 -5
  26. package/schematics/bundles/pending-tasks.js +3 -3
  27. package/schematics/bundles/{program-5512058c.js → program-721d697e.js} +34 -20
  28. package/schematics/bundles/project_tsconfig_paths-6c9cde78.js +1 -1
  29. package/schematics/bundles/provide-initializer.js +3 -3
  30. package/schematics/bundles/route-lazy-loading.js +3 -3
  31. package/schematics/bundles/signal-input-migration.js +6 -6
  32. package/schematics/bundles/signal-queries-migration.js +6 -6
  33. package/schematics/bundles/signals.js +6 -6
  34. package/schematics/bundles/standalone-migration.js +5 -5
  35. package/testing/index.d.ts +1 -1
package/fesm2022/core.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v19.1.5
2
+ * @license Angular v19.1.6
3
3
  * (c) 2010-2024 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -17951,7 +17951,7 @@ class ComponentFactory extends ComponentFactory$1 {
17951
17951
  const cmpDef = this.componentDef;
17952
17952
  ngDevMode && verifyNotAnOrphanComponent(cmpDef);
17953
17953
  const tAttributes = rootSelectorOrNode
17954
- ? ['ng-version', '19.1.5']
17954
+ ? ['ng-version', '19.1.6']
17955
17955
  : // Extract attributes and classes from the first selector only to match VE behavior.
17956
17956
  extractAttrsAndClassesFromSelector(this.componentDef.selectors[0]);
17957
17957
  // Create the root view. Uses empty TView and ContentTemplate.
@@ -33305,9 +33305,13 @@ function ɵsetClassDebugInfo(type, debugInfo) {
33305
33305
  * @param applyMetadata Callback that will apply a new set of metadata on the `type` when invoked.
33306
33306
  * @param environment Syntehtic namespace imports that need to be passed along to the callback.
33307
33307
  * @param locals Local symbols from the source location that have to be exposed to the callback.
33308
+ * @param importMeta `import.meta` from the call site of the replacement function. Optional since
33309
+ * it isn't used internally.
33310
+ * @param id ID to the class being replaced. **Not** the same as the component definition ID.
33311
+ * Optional since the ID might not be available internally.
33308
33312
  * @codeGenApi
33309
33313
  */
33310
- function ɵɵreplaceMetadata(type, applyMetadata, namespaces, locals) {
33314
+ function ɵɵreplaceMetadata(type, applyMetadata, namespaces, locals, importMeta = null, id = null) {
33311
33315
  ngDevMode && assertComponentDef(type);
33312
33316
  const currentDef = getComponentDef(type);
33313
33317
  // The reason `applyMetadata` is a callback that is invoked (almost) immediately is because
@@ -33329,7 +33333,7 @@ function ɵɵreplaceMetadata(type, applyMetadata, namespaces, locals) {
33329
33333
  // Note: we have the additional check, because `IsRoot` can also indicate
33330
33334
  // a component created through something like `createComponent`.
33331
33335
  if (isRootView(root) && root[PARENT] === null) {
33332
- recreateMatchingLViews(newDef, oldDef, root);
33336
+ recreateMatchingLViews(importMeta, id, newDef, oldDef, root);
33333
33337
  }
33334
33338
  }
33335
33339
  }
@@ -33365,10 +33369,12 @@ function mergeWithExistingDefinition(currentDef, newDef) {
33365
33369
  }
33366
33370
  /**
33367
33371
  * Finds all LViews matching a specific component definition and recreates them.
33372
+ * @param importMeta `import.meta` information.
33373
+ * @param id HMR ID of the component.
33368
33374
  * @param oldDef Component definition to search for.
33369
33375
  * @param rootLView View from which to start the search.
33370
33376
  */
33371
- function recreateMatchingLViews(newDef, oldDef, rootLView) {
33377
+ function recreateMatchingLViews(importMeta, id, newDef, oldDef, rootLView) {
33372
33378
  ngDevMode &&
33373
33379
  assertDefined(oldDef.tView, 'Expected a component definition that has been instantiated at least once');
33374
33380
  const tView = rootLView[TVIEW];
@@ -33376,7 +33382,7 @@ function recreateMatchingLViews(newDef, oldDef, rootLView) {
33376
33382
  // produce false positives when using inheritance.
33377
33383
  if (tView === oldDef.tView) {
33378
33384
  ngDevMode && assertComponentDef(oldDef.type);
33379
- recreateLView(newDef, oldDef, rootLView);
33385
+ recreateLView(importMeta, id, newDef, oldDef, rootLView);
33380
33386
  return;
33381
33387
  }
33382
33388
  for (let i = HEADER_OFFSET; i < tView.bindingStartIndex; i++) {
@@ -33384,14 +33390,14 @@ function recreateMatchingLViews(newDef, oldDef, rootLView) {
33384
33390
  if (isLContainer(current)) {
33385
33391
  // The host can be an LView if a component is injecting `ViewContainerRef`.
33386
33392
  if (isLView(current[HOST])) {
33387
- recreateMatchingLViews(newDef, oldDef, current[HOST]);
33393
+ recreateMatchingLViews(importMeta, id, newDef, oldDef, current[HOST]);
33388
33394
  }
33389
33395
  for (let j = CONTAINER_HEADER_OFFSET; j < current.length; j++) {
33390
- recreateMatchingLViews(newDef, oldDef, current[j]);
33396
+ recreateMatchingLViews(importMeta, id, newDef, oldDef, current[j]);
33391
33397
  }
33392
33398
  }
33393
33399
  else if (isLView(current)) {
33394
- recreateMatchingLViews(newDef, oldDef, current);
33400
+ recreateMatchingLViews(importMeta, id, newDef, oldDef, current);
33395
33401
  }
33396
33402
  }
33397
33403
  }
@@ -33410,11 +33416,13 @@ function clearRendererCache(factory, def) {
33410
33416
  }
33411
33417
  /**
33412
33418
  * Recreates an LView in-place from a new component definition.
33419
+ * @param importMeta `import.meta` information.
33420
+ * @param id HMR ID for the component.
33413
33421
  * @param newDef Definition from which to recreate the view.
33414
33422
  * @param oldDef Previous component definition being swapped out.
33415
33423
  * @param lView View to be recreated.
33416
33424
  */
33417
- function recreateLView(newDef, oldDef, lView) {
33425
+ function recreateLView(importMeta, id, newDef, oldDef, lView) {
33418
33426
  const instance = lView[CONTEXT];
33419
33427
  let host = lView[HOST];
33420
33428
  // In theory the parent can also be an LContainer, but it appears like that's
@@ -33466,10 +33474,29 @@ function recreateLView(newDef, oldDef, lView) {
33466
33474
  };
33467
33475
  // The callback isn't guaranteed to be inside the Zone so we need to bring it in ourselves.
33468
33476
  if (zone === null) {
33469
- recreate();
33477
+ executeWithInvalidateFallback(importMeta, id, recreate);
33470
33478
  }
33471
33479
  else {
33472
- zone.run(recreate);
33480
+ zone.run(() => executeWithInvalidateFallback(importMeta, id, recreate));
33481
+ }
33482
+ }
33483
+ /**
33484
+ * Runs an HMR-related function and falls back to
33485
+ * invalidating the HMR data if it throws an error.
33486
+ */
33487
+ function executeWithInvalidateFallback(importMeta, id, callback) {
33488
+ try {
33489
+ callback();
33490
+ }
33491
+ catch (e) {
33492
+ const errorMessage = e.message;
33493
+ // If we have all the necessary information and APIs to send off the invalidation
33494
+ // request, send it before rethrowing so the dev server can decide what to do.
33495
+ if (id !== null && errorMessage) {
33496
+ importMeta?.hot?.send?.('angular:invalidate', { id, message: errorMessage, error: true });
33497
+ }
33498
+ // Throw the error in case the page doesn't get refreshed.
33499
+ throw e;
33473
33500
  }
33474
33501
  }
33475
33502
  /**
@@ -34897,7 +34924,7 @@ class Version {
34897
34924
  /**
34898
34925
  * @publicApi
34899
34926
  */
34900
- const VERSION = new Version('19.1.5');
34927
+ const VERSION = new Version('19.1.6');
34901
34928
 
34902
34929
  /**
34903
34930
  * Combination of NgModuleFactory and ComponentFactories.