@angular/core 21.2.6 → 21.2.8

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 (64) hide show
  1. package/fesm2022/_attribute-chunk.mjs +1 -1
  2. package/fesm2022/_debug_node-chunk.mjs +89 -15
  3. package/fesm2022/_debug_node-chunk.mjs.map +1 -1
  4. package/fesm2022/_effect-chunk.mjs +1 -1
  5. package/fesm2022/_effect-chunk2.mjs +2 -2
  6. package/fesm2022/_effect-chunk2.mjs.map +1 -1
  7. package/fesm2022/_not_found-chunk.mjs +1 -1
  8. package/fesm2022/_resource-chunk.mjs +1 -1
  9. package/fesm2022/_untracked-chunk.mjs +1 -1
  10. package/fesm2022/_weak_ref-chunk.mjs +1 -1
  11. package/fesm2022/core.mjs +1 -1
  12. package/fesm2022/primitives-di.mjs +1 -1
  13. package/fesm2022/primitives-event-dispatch.mjs +1 -5
  14. package/fesm2022/primitives-event-dispatch.mjs.map +1 -1
  15. package/fesm2022/primitives-signals.mjs +1 -1
  16. package/fesm2022/rxjs-interop.mjs +1 -1
  17. package/fesm2022/testing.mjs +1 -1
  18. package/package.json +2 -2
  19. package/schematics/bundles/add-bootstrap-context-to-server-main.cjs +1 -1
  20. package/schematics/bundles/application-config-core.cjs +1 -1
  21. package/schematics/bundles/apply_import_manager-CxA_YYgB.cjs +1 -1
  22. package/schematics/bundles/bootstrap-options-migration.cjs +1 -1
  23. package/schematics/bundles/cleanup-unused-imports.cjs +1 -1
  24. package/schematics/bundles/common-to-standalone-migration.cjs +1 -1
  25. package/schematics/bundles/compiler_host-CY14HvaP.cjs +1 -1
  26. package/schematics/bundles/control-flow-migration.cjs +1 -1
  27. package/schematics/bundles/imports-CVmcbVA9.cjs +1 -1
  28. package/schematics/bundles/{index-BtLcQH8g.cjs → index-DADA7AvC.cjs} +7 -3
  29. package/schematics/bundles/inject-migration.cjs +1 -1
  30. package/schematics/bundles/leading_space-BTPRV0wu.cjs +1 -1
  31. package/schematics/bundles/{migrate_ts_type_references-MWoZx-Cb.cjs → migrate_ts_type_references-CJvpTtkh.cjs} +2 -2
  32. package/schematics/bundles/ng_component_template-BOuKAnQd.cjs +1 -1
  33. package/schematics/bundles/ng_decorators-DYy6II6x.cjs +1 -1
  34. package/schematics/bundles/ngclass-to-class-migration.cjs +1 -1
  35. package/schematics/bundles/ngstyle-to-style-migration.cjs +1 -1
  36. package/schematics/bundles/nodes-ZSQ7WZRB.cjs +1 -1
  37. package/schematics/bundles/output-migration.cjs +2 -2
  38. package/schematics/bundles/parse_html-C8eKA9px.cjs +1 -1
  39. package/schematics/bundles/project_paths-D2V-Uh2L.cjs +1 -1
  40. package/schematics/bundles/project_tsconfig_paths-DkkMibv-.cjs +1 -1
  41. package/schematics/bundles/property_name-BCpALNpZ.cjs +1 -1
  42. package/schematics/bundles/route-lazy-loading.cjs +22 -2
  43. package/schematics/bundles/router-current-navigation.cjs +1 -1
  44. package/schematics/bundles/router-last-successful-navigation.cjs +1 -1
  45. package/schematics/bundles/router-testing-module-migration.cjs +1 -1
  46. package/schematics/bundles/self-closing-tags-migration.cjs +1 -1
  47. package/schematics/bundles/signal-input-migration.cjs +3 -3
  48. package/schematics/bundles/signal-queries-migration.cjs +3 -3
  49. package/schematics/bundles/signals.cjs +3 -3
  50. package/schematics/bundles/standalone-migration.cjs +29 -17
  51. package/schematics/bundles/symbol-DZeHSR-V.cjs +1 -1
  52. package/types/_api-chunk.d.ts +1 -1
  53. package/types/_chrome_dev_tools_performance-chunk.d.ts +1 -1
  54. package/types/_discovery-chunk.d.ts +1 -1
  55. package/types/_effect-chunk.d.ts +1 -1
  56. package/types/_event_dispatcher-chunk.d.ts +1 -1
  57. package/types/_formatter-chunk.d.ts +1 -1
  58. package/types/_weak_ref-chunk.d.ts +1 -1
  59. package/types/core.d.ts +1 -1
  60. package/types/primitives-di.d.ts +1 -1
  61. package/types/primitives-event-dispatch.d.ts +1 -1
  62. package/types/primitives-signals.d.ts +1 -1
  63. package/types/rxjs-interop.d.ts +1 -1
  64. package/types/testing.d.ts +1 -1
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v21.2.6
2
+ * @license Angular v21.2.8
3
3
  * (c) 2010-2026 Google LLC. https://angular.dev/
4
4
  * License: MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v21.2.6
2
+ * @license Angular v21.2.8
3
3
  * (c) 2010-2026 Google LLC. https://angular.dev/
4
4
  * License: MIT
5
5
  */
@@ -3354,10 +3354,37 @@ function ɵɵtrustConstantResourceUrl(url) {
3354
3354
  }
3355
3355
  return trustedScriptURLFromString(url[0]);
3356
3356
  }
3357
- const SRC_RESOURCE_TAGS = new Set(['embed', 'frame', 'iframe', 'media', 'script']);
3358
- const HREF_RESOURCE_TAGS = new Set(['base', 'link', 'script']);
3357
+ const RESOURCE_MAP = {
3358
+ 'embed': {
3359
+ 'src': true
3360
+ },
3361
+ 'frame': {
3362
+ 'src': true
3363
+ },
3364
+ 'iframe': {
3365
+ 'src': true
3366
+ },
3367
+ 'media': {
3368
+ 'src': true
3369
+ },
3370
+ 'script': {
3371
+ 'src': true,
3372
+ 'href': true,
3373
+ 'xlink:href': true
3374
+ },
3375
+ 'base': {
3376
+ 'href': true
3377
+ },
3378
+ 'link': {
3379
+ 'href': true
3380
+ },
3381
+ 'object': {
3382
+ 'data': true,
3383
+ 'codebase': true
3384
+ }
3385
+ };
3359
3386
  function getUrlSanitizer(tag, prop) {
3360
- const isResource = prop === 'src' && SRC_RESOURCE_TAGS.has(tag) || prop === 'href' && HREF_RESOURCE_TAGS.has(tag) || prop === 'xlink:href' && tag === 'script';
3387
+ const isResource = RESOURCE_MAP[tag]?.[prop] === true;
3361
3388
  return isResource ? ɵɵsanitizeResourceUrl : ɵɵsanitizeUrl;
3362
3389
  }
3363
3390
  function ɵɵsanitizeUrlOrResourceUrl(unsafeUrl, tag, prop) {
@@ -3379,18 +3406,38 @@ function getSanitizer() {
3379
3406
  const lView = getLView();
3380
3407
  return lView && lView[ENVIRONMENT].sanitizer;
3381
3408
  }
3382
- const attributeName = new Set(['attributename']);
3409
+ const SECURITY_SENSITIVE_ATTRIBUTE_NAMES = new Set(['href', 'xlink:href']);
3383
3410
  const SECURITY_SENSITIVE_ELEMENTS = {
3384
- 'iframe': new Set(['sandbox', 'allow', 'allowfullscreen', 'referrerpolicy', 'csp', 'fetchpriority']),
3385
- 'animate': attributeName,
3386
- 'set': attributeName,
3387
- 'animatemotion': attributeName,
3388
- 'animatetransform': attributeName
3411
+ 'iframe': {
3412
+ 'sandbox': true,
3413
+ 'allow': true,
3414
+ 'allowfullscreen': true,
3415
+ 'referrerpolicy': true,
3416
+ 'csp': true,
3417
+ 'fetchpriority': true
3418
+ },
3419
+ 'animate': {
3420
+ 'attributename': true,
3421
+ 'to': SECURITY_SENSITIVE_ATTRIBUTE_NAMES,
3422
+ 'values': SECURITY_SENSITIVE_ATTRIBUTE_NAMES,
3423
+ 'from': SECURITY_SENSITIVE_ATTRIBUTE_NAMES
3424
+ },
3425
+ 'set': {
3426
+ 'attributename': true,
3427
+ 'to': SECURITY_SENSITIVE_ATTRIBUTE_NAMES
3428
+ },
3429
+ 'animatemotion': {
3430
+ 'attributename': true
3431
+ },
3432
+ 'animatetransform': {
3433
+ 'attributename': true
3434
+ }
3389
3435
  };
3390
3436
  function ɵɵvalidateAttribute(value, tagName, attributeName) {
3391
3437
  const lowerCaseTagName = tagName.toLowerCase();
3392
3438
  const lowerCaseAttrName = attributeName.toLowerCase();
3393
- if (!SECURITY_SENSITIVE_ELEMENTS[lowerCaseTagName]?.has(lowerCaseAttrName)) {
3439
+ const validationConfig = SECURITY_SENSITIVE_ELEMENTS[lowerCaseTagName]?.[lowerCaseAttrName];
3440
+ if (!validationConfig) {
3394
3441
  return value;
3395
3442
  }
3396
3443
  const tNode = getSelectedTNode();
@@ -3402,6 +3449,15 @@ function ɵɵvalidateAttribute(value, tagName, attributeName) {
3402
3449
  const element = getNativeByTNode(tNode, lView);
3403
3450
  enforceIframeSecurity(element);
3404
3451
  }
3452
+ if (typeof validationConfig !== 'boolean') {
3453
+ const element = getNativeByTNode(tNode, lView);
3454
+ const attributeNameValue = element.getAttribute('attributeName');
3455
+ if (attributeNameValue && validationConfig.has(attributeNameValue.toLowerCase())) {
3456
+ const errorMessage = ngDevMode && `Angular has detected that the \`${attributeName}\` was applied ` + `as a binding to the <${tagName}> element${getTemplateLocationDetails(lView)}. ` + `For security reasons, the \`${attributeName}\` can be set on the <${tagName}> element ` + `as a static attribute only when the "attributeName" is set to \'${attributeNameValue}\'. \n` + `To fix this, switch the \`${attributeNameValue}\` binding to a static attribute ` + `in a template or in host bindings section.`;
3457
+ throw new RuntimeError(-910, errorMessage);
3458
+ }
3459
+ return value;
3460
+ }
3405
3461
  const errorMessage = ngDevMode && `Angular has detected that the \`${attributeName}\` was applied ` + `as a binding to the <${tagName}> element${getTemplateLocationDetails(lView)}. ` + `For security reasons, the \`${attributeName}\` can be set on the <${tagName}> element ` + `as a static attribute only. \n` + `To fix this, switch the \`${attributeName}\` binding to a static attribute ` + `in a template or in host bindings section.`;
3406
3462
  throw new RuntimeError(-910, errorMessage);
3407
3463
  }
@@ -8691,7 +8747,7 @@ class ComponentFactory extends ComponentFactory$1 {
8691
8747
  }
8692
8748
  }
8693
8749
  function createRootTView(rootSelectorOrNode, componentDef, componentBindings, directives) {
8694
- const tAttributes = rootSelectorOrNode ? ['ng-version', '21.2.6'] : extractAttrsAndClassesFromSelector(componentDef.selectors[0]);
8750
+ const tAttributes = rootSelectorOrNode ? ['ng-version', '21.2.8'] : extractAttrsAndClassesFromSelector(componentDef.selectors[0]);
8695
8751
  let creationBindings = null;
8696
8752
  let updateBindings = null;
8697
8753
  let varsToAllocate = 0;
@@ -9038,7 +9094,10 @@ function populateDehydratedViewsInLContainerImpl(lContainer, tNode, hostLView) {
9038
9094
  }
9039
9095
  const currentRNode = getSegmentHead(hydrationInfo, noOffsetIndex);
9040
9096
  const serializedViews = hydrationInfo.data[CONTAINERS]?.[noOffsetIndex];
9041
- ngDevMode && assertDefined(serializedViews, 'Unexpected state: no hydration info available for a given TNode, ' + 'which represents a view container.');
9097
+ if (serializedViews === undefined) {
9098
+ ngDevMode && console.warn('Unexpected state: no hydration info available for a given TNode, ' + 'which represents a view container.');
9099
+ return false;
9100
+ }
9042
9101
  const [commentNode, dehydratedViews] = locateDehydratedViewsInContainer(currentRNode, serializedViews);
9043
9102
  if (ngDevMode) {
9044
9103
  validateMatchingNode(commentNode, Node.COMMENT_NODE, null, hostLView, tNode, true);
@@ -12546,9 +12605,11 @@ function triggerResourceLoading(tDetails, lView, tNode) {
12546
12605
  }
12547
12606
  tDetails.loadingPromise = Promise.allSettled(dependenciesFn()).then(results => {
12548
12607
  let failed = false;
12608
+ let failedReason = null;
12549
12609
  const directiveDefs = [];
12550
12610
  const pipeDefs = [];
12551
- for (const result of results) {
12611
+ for (let i = 0; i < results.length; i++) {
12612
+ const result = results[i];
12552
12613
  if (result.status === 'fulfilled') {
12553
12614
  const dependency = result.value;
12554
12615
  const directiveDef = getComponentDef(dependency) || getDirectiveDef(dependency);
@@ -12562,6 +12623,7 @@ function triggerResourceLoading(tDetails, lView, tNode) {
12562
12623
  }
12563
12624
  } else {
12564
12625
  failed = true;
12626
+ failedReason = result.reason instanceof Error ? result.reason : new Error(String(result.reason));
12565
12627
  break;
12566
12628
  }
12567
12629
  }
@@ -12569,7 +12631,19 @@ function triggerResourceLoading(tDetails, lView, tNode) {
12569
12631
  tDetails.loadingState = DeferDependenciesLoadingState.FAILED;
12570
12632
  if (tDetails.errorTmplIndex === null) {
12571
12633
  const templateLocation = ngDevMode ? getTemplateLocationDetails(lView) : '';
12572
- const error = new RuntimeError(-750, ngDevMode && 'Loading dependencies for `@defer` block failed, ' + `but no \`@error\` block was configured${templateLocation}. ` + 'Consider using the `@error` block to render an error state.');
12634
+ let errorMsg = '';
12635
+ if (ngDevMode) {
12636
+ errorMsg = 'Loading dependencies for `@defer` block failed, ' + `but no \`@error\` block was configured${templateLocation}. ` + 'Consider using the `@error` block to render an error state.';
12637
+ const depsFn = tDetails.dependencyResolverFn;
12638
+ const errorReason = failedReason?.message;
12639
+ if (depsFn) {
12640
+ errorMsg += `\n\nAngular tried to invoke the following dependency function (compiler-generated):\n` + `\`\`\`\n${depsFn.toString()}\n\`\`\``;
12641
+ }
12642
+ if (errorReason) {
12643
+ errorMsg += depsFn ? `\n\nbut it resulted in the following error:\n\n${errorReason}` : `\n\nThe loading resulted in the following error:\n\n${errorReason}`;
12644
+ }
12645
+ }
12646
+ const error = new RuntimeError(-750, errorMsg);
12573
12647
  handleUncaughtError(lView, error);
12574
12648
  }
12575
12649
  } else {