@angular/compiler-cli 21.0.0-next.4 → 21.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.
@@ -4,7 +4,7 @@
4
4
 
5
5
  import {
6
6
  angularJitApplicationTransform
7
- } from "./chunk-TO7TOCP7.js";
7
+ } from "./chunk-WX6HCNBV.js";
8
8
  import {
9
9
  AbsoluteModuleStrategy,
10
10
  ActivePerfRecorder,
@@ -92,7 +92,7 @@ import {
92
92
  toUnredirectedSourceFile,
93
93
  tryParseInitializerApi,
94
94
  untagAllTsFiles
95
- } from "./chunk-YRHCC62K.js";
95
+ } from "./chunk-O7L4BBZY.js";
96
96
  import {
97
97
  LogicalFileSystem,
98
98
  absoluteFrom,
@@ -3146,14 +3146,23 @@ var factory6 = {
3146
3146
  };
3147
3147
 
3148
3148
  // packages/compiler-cli/src/ngtsc/typecheck/extended/checks/optional_chain_not_nullable/index.js
3149
- import { SafeCall, SafeKeyedRead, SafePropertyRead } from "@angular/compiler";
3149
+ import { KeyedRead, SafeCall, SafeKeyedRead, SafePropertyRead } from "@angular/compiler";
3150
3150
  import ts20 from "typescript";
3151
3151
  var OptionalChainNotNullableCheck = class extends TemplateCheckWithVisitor {
3152
+ noUncheckedIndexedAccess;
3152
3153
  canVisitStructuralAttributes = false;
3153
3154
  code = ErrorCode.OPTIONAL_CHAIN_NOT_NULLABLE;
3155
+ constructor(noUncheckedIndexedAccess) {
3156
+ super();
3157
+ this.noUncheckedIndexedAccess = noUncheckedIndexedAccess;
3158
+ }
3154
3159
  visitNode(ctx, component, node) {
3155
- if (!(node instanceof SafeCall) && !(node instanceof SafePropertyRead) && !(node instanceof SafeKeyedRead))
3160
+ if (!(node instanceof SafeCall) && !(node instanceof SafePropertyRead) && !(node instanceof SafeKeyedRead)) {
3156
3161
  return [];
3162
+ }
3163
+ if (node.receiver instanceof KeyedRead && !this.noUncheckedIndexedAccess) {
3164
+ return [];
3165
+ }
3157
3166
  const symbolLeft = ctx.templateTypeChecker.getSymbolOfNode(node.receiver, component);
3158
3167
  if (symbolLeft === null || symbolLeft.kind !== SymbolKind.Expression) {
3159
3168
  return [];
@@ -3185,7 +3194,8 @@ var factory7 = {
3185
3194
  if (!strictNullChecks) {
3186
3195
  return null;
3187
3196
  }
3188
- return new OptionalChainNotNullableCheck();
3197
+ const noUncheckedIndexedAccess = !!options.noUncheckedIndexedAccess;
3198
+ return new OptionalChainNotNullableCheck(noUncheckedIndexedAccess);
3189
3199
  }
3190
3200
  };
3191
3201
 
@@ -12,7 +12,7 @@ import {
12
12
  formatDiagnostics,
13
13
  performCompilation,
14
14
  readConfiguration
15
- } from "./chunk-IMTR3556.js";
15
+ } from "./chunk-3I7LEC2O.js";
16
16
 
17
17
  // packages/compiler-cli/src/main.js
18
18
  import ts2 from "typescript";
@@ -8,7 +8,7 @@ import {
8
8
  import {
9
9
  Context,
10
10
  ExpressionTranslatorVisitor
11
- } from "./chunk-I2BHWRAU.js";
11
+ } from "./chunk-LS5RJ5CS.js";
12
12
 
13
13
  // packages/compiler-cli/linker/src/fatal_linker_error.js
14
14
  var FatalLinkerError = class extends Error {
@@ -446,7 +446,7 @@ function toR3ClassMetadata(metaObj) {
446
446
  }
447
447
 
448
448
  // packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_component_linker_1.js
449
- import { ChangeDetectionStrategy, compileComponentFromMetadata, DEFAULT_INTERPOLATION_CONFIG, InterpolationConfig, makeBindingParser as makeBindingParser2, parseTemplate, R3TargetBinder, R3TemplateDependencyKind, ViewEncapsulation } from "@angular/compiler";
449
+ import { ChangeDetectionStrategy, compileComponentFromMetadata, makeBindingParser as makeBindingParser2, parseTemplate, R3TargetBinder, R3TemplateDependencyKind, ViewEncapsulation } from "@angular/compiler";
450
450
  import semver2 from "semver";
451
451
 
452
452
  // packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_directive_linker_1.js
@@ -455,7 +455,7 @@ import { compileDirectiveFromMetadata, makeBindingParser, ParseLocation, ParseSo
455
455
  // packages/compiler-cli/linker/src/file_linker/partial_linkers/util.js
456
456
  import { createMayBeForwardRefExpression, outputAst as o2 } from "@angular/compiler";
457
457
  import semver from "semver";
458
- var PLACEHOLDER_VERSION = "21.0.0-next.4";
458
+ var PLACEHOLDER_VERSION = "21.0.0-next.6";
459
459
  function wrapReference(wrapped) {
460
460
  return { value: wrapped, type: wrapped };
461
461
  }
@@ -694,7 +694,6 @@ var PartialComponentLinkerVersion1 = class {
694
694
  * This function derives the `R3ComponentMetadata` from the provided AST object.
695
695
  */
696
696
  toR3ComponentMeta(metaObj, version) {
697
- const interpolation = parseInterpolationConfig(metaObj);
698
697
  const templateSource = metaObj.getValue("template");
699
698
  const isInline = metaObj.has("isInline") ? metaObj.getBoolean("isInline") : false;
700
699
  const templateInfo = this.getTemplateInfo(templateSource, isInline);
@@ -703,7 +702,6 @@ var PartialComponentLinkerVersion1 = class {
703
702
  const enableLetSyntax = major > 18 || major === 18 && minor >= 1 || version === PLACEHOLDER_VERSION;
704
703
  const template = parseTemplate(templateInfo.code, templateInfo.sourceUrl, {
705
704
  escapedString: templateInfo.isEscaped,
706
- interpolationConfig: interpolation,
707
705
  range: templateInfo.range,
708
706
  enableI18nLegacyMessageIdFormat: false,
709
707
  preserveWhitespaces: metaObj.has("preserveWhitespaces") ? metaObj.getBoolean("preserveWhitespaces") : false,
@@ -807,7 +805,6 @@ ${errors}`);
807
805
  styles: metaObj.has("styles") ? metaObj.getArray("styles").map((entry) => entry.getString()) : [],
808
806
  defer: deferBlockDependencies,
809
807
  encapsulation: metaObj.has("encapsulation") ? parseEncapsulation(metaObj.getValue("encapsulation")) : ViewEncapsulation.Emulated,
810
- interpolation,
811
808
  changeDetection: metaObj.has("changeDetection") ? parseChangeDetectionStrategy(metaObj.getValue("changeDetection")) : ChangeDetectionStrategy.Default,
812
809
  animations: metaObj.has("animations") ? metaObj.getOpaque("animations") : null,
813
810
  relativeContextFilePath: this.sourceUrl,
@@ -880,17 +877,6 @@ ${errors}`);
880
877
  return result;
881
878
  }
882
879
  };
883
- function parseInterpolationConfig(metaObj) {
884
- if (!metaObj.has("interpolation")) {
885
- return DEFAULT_INTERPOLATION_CONFIG;
886
- }
887
- const interpolationExpr = metaObj.getValue("interpolation");
888
- const values = interpolationExpr.getArray().map((entry) => entry.getString());
889
- if (values.length !== 2) {
890
- throw new FatalLinkerError(interpolationExpr.expression, "Unsupported interpolation config, expected an array containing exactly two strings");
891
- }
892
- return InterpolationConfig.fromArray(values);
893
- }
894
880
  function parseEncapsulation(encapsulation) {
895
881
  const symbolName = encapsulation.getSymbolName();
896
882
  if (symbolName === null) {
@@ -107,6 +107,9 @@ var ExpressionTranslatorVisitor = class {
107
107
  visitLiteralExpr(ast, _context) {
108
108
  return this.setSourceMapRange(this.factory.createLiteral(ast.value), ast.sourceSpan);
109
109
  }
110
+ visitRegularExpressionLiteral(ast, context) {
111
+ return this.setSourceMapRange(this.factory.createRegularExpressionLiteral(ast.body, ast.flags), ast.sourceSpan);
112
+ }
110
113
  visitLocalizedString(ast, context) {
111
114
  const elements = [createTemplateElement(ast.serializeI18nHead())];
112
115
  const expressions = [];
@@ -5,7 +5,7 @@
5
5
  import {
6
6
  Context,
7
7
  ExpressionTranslatorVisitor
8
- } from "./chunk-I2BHWRAU.js";
8
+ } from "./chunk-LS5RJ5CS.js";
9
9
  import {
10
10
  LogicalProjectPath,
11
11
  absoluteFrom,
@@ -4046,6 +4046,9 @@ var TypeTranslatorVisitor = class {
4046
4046
  visitDynamicImportExpr(ast, context) {
4047
4047
  throw new Error("Method not implemented.");
4048
4048
  }
4049
+ visitRegularExpressionLiteral(ast, context) {
4050
+ throw new Error("Method not implemented.");
4051
+ }
4049
4052
  visitNotExpr(ast, context) {
4050
4053
  throw new Error("Method not implemented.");
4051
4054
  }
@@ -4341,6 +4344,9 @@ var TypeScriptAstFactory = class {
4341
4344
  ts23.factory.createVariableDeclaration(variableName, void 0, void 0, initializer ?? void 0)
4342
4345
  ], this.VAR_TYPES[type]));
4343
4346
  }
4347
+ createRegularExpressionLiteral(body, flags) {
4348
+ return ts23.factory.createRegularExpressionLiteral(`/${body}/${flags ?? ""}`);
4349
+ }
4344
4350
  setSourceMapRange(node, sourceMapRange) {
4345
4351
  if (sourceMapRange === null) {
4346
4352
  return node;
@@ -6819,13 +6825,15 @@ function nodeArrayFromDecoratorsArray(decorators) {
6819
6825
  // packages/compiler-cli/src/ngtsc/transform/src/implicit_signal_debug_name_transform.js
6820
6826
  import ts32 from "typescript";
6821
6827
  function insertDebugNameIntoCallExpression(callExpression, debugName) {
6822
- const signalExpressionHasNoArguments = callExpression.arguments.length === 0;
6823
6828
  const signalExpressionIsRequired = isRequiredSignalFunction(callExpression.expression);
6824
6829
  let configPosition = signalExpressionIsRequired ? 0 : 1;
6825
- if (signalExpressionHasNoArguments) {
6830
+ const nodeArgs = Array.from(callExpression.arguments);
6831
+ const signalExpressionHasNoArguments = callExpression.arguments.length === 0;
6832
+ const isLinkedSignal = callExpression.expression.getText() === "linkedSignal";
6833
+ const isComputationLinkedSignal = isLinkedSignal && nodeArgs[0].kind === ts32.SyntaxKind.ObjectLiteralExpression;
6834
+ if (signalExpressionHasNoArguments || isComputationLinkedSignal) {
6826
6835
  configPosition = 0;
6827
6836
  }
6828
- const nodeArgs = Array.from(callExpression.arguments);
6829
6837
  let existingArgument = nodeArgs[configPosition];
6830
6838
  if (existingArgument === void 0) {
6831
6839
  existingArgument = ts32.factory.createObjectLiteralExpression([]);
@@ -6867,7 +6875,7 @@ function insertDebugNameIntoCallExpression(callExpression, debugName) {
6867
6875
  nonDevModeCase
6868
6876
  )));
6869
6877
  let transformedSignalArgs;
6870
- if (signalExpressionIsRequired || signalExpressionHasNoArguments) {
6878
+ if (signalExpressionIsRequired || signalExpressionHasNoArguments || isComputationLinkedSignal) {
6871
6879
  transformedSignalArgs = ts32.factory.createNodeArray([spreadElementContainingUpdatedOptions]);
6872
6880
  } else {
6873
6881
  transformedSignalArgs = ts32.factory.createNodeArray([
@@ -6957,6 +6965,7 @@ function expressionIsUsingAngularCoreImportedSymbol(program, expression) {
6957
6965
  var signalFunctions = /* @__PURE__ */ new Set([
6958
6966
  "signal",
6959
6967
  "computed",
6968
+ "linkedSignal",
6960
6969
  "input",
6961
6970
  "model",
6962
6971
  "viewChild",
@@ -7515,7 +7524,7 @@ var JitDeclarationRegistry = class {
7515
7524
  };
7516
7525
 
7517
7526
  // packages/compiler-cli/src/ngtsc/annotations/component/src/handler.js
7518
- import { compileClassDebugInfo, compileHmrInitializer, compileComponentClassMetadata, compileComponentDeclareClassMetadata, compileComponentFromMetadata, compileDeclareComponentFromMetadata, compileDeferResolverFunction, ConstantPool as ConstantPool2, CssSelector as CssSelector5, DEFAULT_INTERPOLATION_CONFIG as DEFAULT_INTERPOLATION_CONFIG2, DomElementSchemaRegistry as DomElementSchemaRegistry3, ExternalExpr as ExternalExpr10, FactoryTarget as FactoryTarget3, makeBindingParser as makeBindingParser3, outputAst as o5, R3TargetBinder as R3TargetBinder2, R3TemplateDependencyKind, SelectorMatcher as SelectorMatcher3, ViewEncapsulation as ViewEncapsulation2, SelectorlessMatcher as SelectorlessMatcher2 } from "@angular/compiler";
7527
+ import { compileClassDebugInfo, compileHmrInitializer, compileComponentClassMetadata, compileComponentDeclareClassMetadata, compileComponentFromMetadata, compileDeclareComponentFromMetadata, compileDeferResolverFunction, ConstantPool as ConstantPool2, CssSelector as CssSelector5, DomElementSchemaRegistry as DomElementSchemaRegistry3, ExternalExpr as ExternalExpr10, FactoryTarget as FactoryTarget3, makeBindingParser as makeBindingParser3, outputAst as o5, R3TargetBinder as R3TargetBinder2, R3TemplateDependencyKind, SelectorMatcher as SelectorMatcher3, ViewEncapsulation as ViewEncapsulation2, SelectorlessMatcher as SelectorlessMatcher2 } from "@angular/compiler";
7519
7528
  import ts73 from "typescript";
7520
7529
 
7521
7530
  // packages/compiler-cli/src/ngtsc/incremental/semantic_graph/src/api.js
@@ -10984,7 +10993,7 @@ var CompletionEngine = class {
10984
10993
  // packages/compiler-cli/src/ngtsc/typecheck/src/context.js
10985
10994
  import { ParseSourceFile as ParseSourceFile2 } from "@angular/compiler";
10986
10995
 
10987
- // node_modules/.aspect_rules_js/magic-string@0.30.18/node_modules/magic-string/dist/magic-string.es.mjs
10996
+ // node_modules/.aspect_rules_js/magic-string@0.30.19/node_modules/magic-string/dist/magic-string.es.mjs
10988
10997
  import { encode } from "@jridgewell/sourcemap-codec";
10989
10998
  var BitSet = class _BitSet {
10990
10999
  constructor(arg) {
@@ -11434,6 +11443,9 @@ var MagicString = class _MagicString {
11434
11443
  if (chunk.outro.length)
11435
11444
  mappings.advance(chunk.outro);
11436
11445
  });
11446
+ if (this.outro) {
11447
+ mappings.advance(this.outro);
11448
+ }
11437
11449
  return {
11438
11450
  file: options.file ? options.file.split(/[/\\]/).pop() : void 0,
11439
11451
  sources: [
@@ -11996,7 +12008,12 @@ var MagicString = class _MagicString {
11996
12008
  const { original } = this;
11997
12009
  const index = original.indexOf(string);
11998
12010
  if (index !== -1) {
11999
- this.overwrite(index, index + string.length, replacement);
12011
+ if (typeof replacement === "function") {
12012
+ replacement = replacement(string, index, original);
12013
+ }
12014
+ if (string !== replacement) {
12015
+ this.overwrite(index, index + string.length, replacement);
12016
+ }
12000
12017
  }
12001
12018
  return this;
12002
12019
  }
@@ -12011,8 +12028,12 @@ var MagicString = class _MagicString {
12011
12028
  const stringLength = string.length;
12012
12029
  for (let index = original.indexOf(string); index !== -1; index = original.indexOf(string, index + stringLength)) {
12013
12030
  const previous = original.slice(index, index + stringLength);
12014
- if (previous !== replacement)
12015
- this.overwrite(index, index + stringLength, replacement);
12031
+ let _replacement = replacement;
12032
+ if (typeof replacement === "function") {
12033
+ _replacement = replacement(previous, index, original);
12034
+ }
12035
+ if (previous !== _replacement)
12036
+ this.overwrite(index, index + stringLength, _replacement);
12016
12037
  }
12017
12038
  return this;
12018
12039
  }
@@ -13303,6 +13324,9 @@ var AstTranslator = class {
13303
13324
  visitThisReceiver(ast) {
13304
13325
  throw new Error("Method not implemented.");
13305
13326
  }
13327
+ visitRegularExpressionLiteral(ast, context) {
13328
+ return wrapForTypeChecker(ts59.factory.createRegularExpressionLiteral(`/${ast.body}/${ast.flags ?? ""}`));
13329
+ }
13306
13330
  visitInterpolation(ast) {
13307
13331
  return ast.expressions.reduce((lhs, ast2) => ts59.factory.createBinaryExpression(lhs, ts59.SyntaxKind.PlusToken, wrapForTypeChecker(this.translate(ast2))), ts59.factory.createStringLiteral(""));
13308
13332
  }
@@ -13571,6 +13595,9 @@ var VeSafeLhsInferenceBugDetector = class _VeSafeLhsInferenceBugDetector {
13571
13595
  visitParenthesizedExpression(ast, context) {
13572
13596
  return ast.expression.visit(this);
13573
13597
  }
13598
+ visitRegularExpressionLiteral(ast, context) {
13599
+ return false;
13600
+ }
13574
13601
  };
13575
13602
 
13576
13603
  // packages/compiler-cli/src/ngtsc/typecheck/src/type_check_block.js
@@ -19134,7 +19161,7 @@ function checkCustomElementSelectorForErrors(selector) {
19134
19161
  }
19135
19162
 
19136
19163
  // packages/compiler-cli/src/ngtsc/annotations/component/src/resources.js
19137
- import { DEFAULT_INTERPOLATION_CONFIG, InterpolationConfig, ParseSourceFile as ParseSourceFile3, parseTemplate } from "@angular/compiler";
19164
+ import { ParseSourceFile as ParseSourceFile3, parseTemplate } from "@angular/compiler";
19138
19165
  import ts68 from "typescript";
19139
19166
  function getTemplateDeclarationNodeForError(declaration) {
19140
19167
  return declaration.isInline ? declaration.expression : declaration.templateUrlExpression;
@@ -19230,14 +19257,12 @@ function createEmptyTemplate(componentClass, component, containingFile) {
19230
19257
  },
19231
19258
  declaration: templateUrl ? {
19232
19259
  isInline: false,
19233
- interpolationConfig: InterpolationConfig.fromArray(null),
19234
19260
  preserveWhitespaces: false,
19235
19261
  templateUrlExpression: templateUrl,
19236
19262
  templateUrl: "missing.ng.html",
19237
19263
  resolvedTemplateUrl: "/missing.ng.html"
19238
19264
  } : {
19239
19265
  isInline: true,
19240
- interpolationConfig: InterpolationConfig.fromArray(null),
19241
19266
  preserveWhitespaces: false,
19242
19267
  expression: template,
19243
19268
  templateUrl: containingFile,
@@ -19248,7 +19273,6 @@ function createEmptyTemplate(componentClass, component, containingFile) {
19248
19273
  function parseExtractedTemplate(template, sourceStr, sourceParseRange, escapedString, sourceMapUrl, options) {
19249
19274
  const i18nNormalizeLineEndingsInICUs = escapedString || options.i18nNormalizeLineEndingsInICUs;
19250
19275
  const commonParseOptions = {
19251
- interpolationConfig: template.interpolationConfig,
19252
19276
  range: sourceParseRange ?? void 0,
19253
19277
  enableI18nLegacyMessageIdFormat: options.enableI18nLegacyMessageIdFormat,
19254
19278
  i18nNormalizeLineEndingsInICUs,
@@ -19286,14 +19310,12 @@ function parseTemplateDeclaration(node, decorator, component, containingFile, ev
19286
19310
  }
19287
19311
  preserveWhitespaces = value;
19288
19312
  }
19289
- let interpolationConfig = DEFAULT_INTERPOLATION_CONFIG;
19290
19313
  if (component.has("interpolation")) {
19291
19314
  const expr = component.get("interpolation");
19292
19315
  const value = evaluator.evaluate(expr);
19293
19316
  if (!Array.isArray(value) || value.length !== 2 || !value.every((element) => typeof element === "string")) {
19294
19317
  throw createValueHasWrongTypeError(expr, value, "interpolation must be an array with 2 elements of string type");
19295
19318
  }
19296
- interpolationConfig = InterpolationConfig.fromArray(value);
19297
19319
  }
19298
19320
  if (component.has("templateUrl")) {
19299
19321
  const templateUrlExpr = component.get("templateUrl");
@@ -19305,7 +19327,6 @@ function parseTemplateDeclaration(node, decorator, component, containingFile, ev
19305
19327
  const resourceUrl = resourceLoader.resolve(templateUrl, containingFile);
19306
19328
  return {
19307
19329
  isInline: false,
19308
- interpolationConfig,
19309
19330
  preserveWhitespaces,
19310
19331
  templateUrl,
19311
19332
  templateUrlExpression: templateUrlExpr,
@@ -19325,7 +19346,6 @@ function parseTemplateDeclaration(node, decorator, component, containingFile, ev
19325
19346
  } else if (component.has("template")) {
19326
19347
  return {
19327
19348
  isInline: true,
19328
- interpolationConfig,
19329
19349
  preserveWhitespaces,
19330
19350
  expression: component.get("template"),
19331
19351
  templateUrl: containingFile,
@@ -20443,7 +20463,6 @@ var ComponentDecoratorHandler = class {
20443
20463
  template,
20444
20464
  encapsulation,
20445
20465
  changeDetection,
20446
- interpolation: template.interpolationConfig ?? DEFAULT_INTERPOLATION_CONFIG2,
20447
20466
  styles,
20448
20467
  externalStyles,
20449
20468
  // These will be replaced during the compilation step, after all `NgModule`s have been
@@ -20668,7 +20687,7 @@ var ComponentDecoratorHandler = class {
20668
20687
  return { data };
20669
20688
  }
20670
20689
  xi18n(ctx, node, analysis) {
20671
- ctx.updateFromTemplate(analysis.template.content, analysis.template.declaration.resolvedTemplateUrl, analysis.template.interpolationConfig ?? DEFAULT_INTERPOLATION_CONFIG2);
20690
+ ctx.updateFromTemplate(analysis.template.content, analysis.template.declaration.resolvedTemplateUrl);
20672
20691
  }
20673
20692
  updateResources(node, analysis) {
20674
20693
  const containingFile = node.getSourceFile().fileName;
@@ -21072,11 +21091,12 @@ var ComponentDecoratorHandler = class {
21072
21091
  for (const [_, deps] of resolution.deferPerBlockDependencies) {
21073
21092
  for (const deferBlockDep of deps) {
21074
21093
  const node = deferBlockDep.declaration.node;
21075
- const importDecl = resolution.deferrableDeclToImportDecl.get(node) ?? null;
21076
- if (importDecl !== null && this.deferredSymbolTracker.canDefer(importDecl)) {
21094
+ const importInfo = resolution.deferrableDeclToImportDecl.get(node) ?? null;
21095
+ if (importInfo !== null && this.deferredSymbolTracker.canDefer(importInfo.node)) {
21077
21096
  deferBlockDep.isDeferrable = true;
21078
- deferBlockDep.importPath = importDecl.moduleSpecifier.text;
21079
- deferBlockDep.isDefaultImport = isDefaultImport(importDecl);
21097
+ deferBlockDep.symbolName = importInfo.name;
21098
+ deferBlockDep.importPath = importInfo.from;
21099
+ deferBlockDep.isDefaultImport = isDefaultImport(importInfo.node);
21080
21100
  if (!seenDeps.has(node)) {
21081
21101
  seenDeps.add(node);
21082
21102
  deferrableTypes.push(deferBlockDep);
@@ -21219,7 +21239,7 @@ var ComponentDecoratorHandler = class {
21219
21239
  if (dirMeta === null && pipeMeta === null) {
21220
21240
  return;
21221
21241
  }
21222
- resolutionData.deferrableDeclToImportDecl.set(decl.node, imp.node);
21242
+ resolutionData.deferrableDeclToImportDecl.set(decl.node, imp);
21223
21243
  this.deferredSymbolTracker.markAsDeferrableCandidate(node, imp.node, componentClassDecl, isDeferredImport);
21224
21244
  }
21225
21245
  compileDeferBlocks(resolution) {
@@ -21247,7 +21267,7 @@ var ComponentDecoratorHandler = class {
21247
21267
  }
21248
21268
  /** Creates a new binding parser. */
21249
21269
  getNewBindingParser() {
21250
- return makeBindingParser3(void 0, this.enableSelectorless);
21270
+ return makeBindingParser3(this.enableSelectorless);
21251
21271
  }
21252
21272
  };
21253
21273
  function createMatcherFromScope(scope, hostDirectivesResolver) {
@@ -16,7 +16,7 @@ import {
16
16
  tryParseSignalInputMapping,
17
17
  tryParseSignalModelMapping,
18
18
  tryParseSignalQueryFromInitializer
19
- } from "./chunk-YRHCC62K.js";
19
+ } from "./chunk-O7L4BBZY.js";
20
20
 
21
21
  // packages/compiler-cli/src/ngtsc/transform/jit/src/downlevel_decorators_transform.js
22
22
  import ts from "typescript";
package/bundles/index.js CHANGED
@@ -28,7 +28,7 @@ import {
28
28
  isTsDiagnostic,
29
29
  performCompilation,
30
30
  readConfiguration
31
- } from "./chunk-IMTR3556.js";
31
+ } from "./chunk-3I7LEC2O.js";
32
32
  import {
33
33
  ConsoleLogger,
34
34
  LogLevel
@@ -37,7 +37,7 @@ import {
37
37
  angularJitApplicationTransform,
38
38
  getDownlevelDecoratorsTransform,
39
39
  getInitializerApiJitTransform
40
- } from "./chunk-TO7TOCP7.js";
40
+ } from "./chunk-WX6HCNBV.js";
41
41
  import {
42
42
  ActivePerfRecorder,
43
43
  ErrorCode,
@@ -46,8 +46,8 @@ import {
46
46
  TsCreateProgramDriver,
47
47
  isLocalCompilationDiagnostics,
48
48
  ngErrorCode
49
- } from "./chunk-YRHCC62K.js";
50
- import "./chunk-I2BHWRAU.js";
49
+ } from "./chunk-O7L4BBZY.js";
50
+ import "./chunk-LS5RJ5CS.js";
51
51
  import {
52
52
  InvalidFileSystem,
53
53
  LogicalFileSystem,
@@ -77,7 +77,7 @@ import "./chunk-G7GFT6BU.js";
77
77
 
78
78
  // packages/compiler-cli/src/version.js
79
79
  import { Version } from "@angular/compiler";
80
- var VERSION = new Version("21.0.0-next.4");
80
+ var VERSION = new Version("21.0.0-next.6");
81
81
 
82
82
  // packages/compiler-cli/private/tooling.js
83
83
  var GLOBAL_DEFS_FOR_TERSER = {
@@ -8,13 +8,13 @@ import {
8
8
  LinkerEnvironment,
9
9
  assert,
10
10
  isFatalLinkerError
11
- } from "../../chunk-BPDNYZBC.js";
11
+ } from "../../chunk-DT6FD4OE.js";
12
12
  import {
13
13
  ConsoleLogger,
14
14
  LogLevel
15
15
  } from "../../chunk-6HOSNZU5.js";
16
16
  import "../../chunk-HYJ2H3FU.js";
17
- import "../../chunk-I2BHWRAU.js";
17
+ import "../../chunk-LS5RJ5CS.js";
18
18
  import {
19
19
  NodeJSFileSystem
20
20
  } from "../../chunk-XYYEESKY.js";
@@ -163,6 +163,9 @@ var BabelAstFactory = class {
163
163
  t.variableDeclarator(t.identifier(variableName), initializer)
164
164
  ]);
165
165
  }
166
+ createRegularExpressionLiteral(body, flags) {
167
+ return t.regExpLiteral(body, flags ?? void 0);
168
+ }
166
169
  setSourceMapRange(node, sourceMapRange) {
167
170
  if (sourceMapRange === null) {
168
171
  return node;
@@ -10,9 +10,9 @@ import {
10
10
  assert,
11
11
  isFatalLinkerError,
12
12
  needsLinking
13
- } from "../chunk-BPDNYZBC.js";
13
+ } from "../chunk-DT6FD4OE.js";
14
14
  import "../chunk-HYJ2H3FU.js";
15
- import "../chunk-I2BHWRAU.js";
15
+ import "../chunk-LS5RJ5CS.js";
16
16
  import "../chunk-G7GFT6BU.js";
17
17
  export {
18
18
  DEFAULT_LINKER_OPTIONS,
@@ -13,8 +13,8 @@ import {
13
13
  TypeScriptReflectionHost,
14
14
  createForwardRefResolver,
15
15
  reflectObjectLiteral
16
- } from "../chunk-YRHCC62K.js";
17
- import "../chunk-I2BHWRAU.js";
16
+ } from "../chunk-O7L4BBZY.js";
17
+ import "../chunk-LS5RJ5CS.js";
18
18
  import "../chunk-GWZQLAGK.js";
19
19
  import "../chunk-XYYEESKY.js";
20
20
  import "../chunk-G7GFT6BU.js";
@@ -4,9 +4,9 @@
4
4
 
5
5
  import {
6
6
  angularJitApplicationTransform
7
- } from "../chunk-TO7TOCP7.js";
8
- import "../chunk-YRHCC62K.js";
9
- import "../chunk-I2BHWRAU.js";
7
+ } from "../chunk-WX6HCNBV.js";
8
+ import "../chunk-O7L4BBZY.js";
9
+ import "../chunk-LS5RJ5CS.js";
10
10
  import "../chunk-GWZQLAGK.js";
11
11
  import "../chunk-XYYEESKY.js";
12
12
  import "../chunk-G7GFT6BU.js";
@@ -6,13 +6,13 @@
6
6
  import {
7
7
  main,
8
8
  readCommandLineAndConfiguration
9
- } from "../../chunk-COFK26OM.js";
9
+ } from "../../chunk-CXWG7H5K.js";
10
10
  import {
11
11
  EmitFlags
12
- } from "../../chunk-IMTR3556.js";
13
- import "../../chunk-TO7TOCP7.js";
14
- import "../../chunk-YRHCC62K.js";
15
- import "../../chunk-I2BHWRAU.js";
12
+ } from "../../chunk-3I7LEC2O.js";
13
+ import "../../chunk-WX6HCNBV.js";
14
+ import "../../chunk-O7L4BBZY.js";
15
+ import "../../chunk-LS5RJ5CS.js";
16
16
  import {
17
17
  setFileSystem
18
18
  } from "../../chunk-GWZQLAGK.js";
@@ -5,11 +5,11 @@
5
5
 
6
6
  import {
7
7
  main
8
- } from "../../chunk-COFK26OM.js";
9
- import "../../chunk-IMTR3556.js";
10
- import "../../chunk-TO7TOCP7.js";
11
- import "../../chunk-YRHCC62K.js";
12
- import "../../chunk-I2BHWRAU.js";
8
+ } from "../../chunk-CXWG7H5K.js";
9
+ import "../../chunk-3I7LEC2O.js";
10
+ import "../../chunk-WX6HCNBV.js";
11
+ import "../../chunk-O7L4BBZY.js";
12
+ import "../../chunk-LS5RJ5CS.js";
13
13
  import {
14
14
  setFileSystem
15
15
  } from "../../chunk-GWZQLAGK.js";
@@ -44,5 +44,6 @@ export declare class BabelAstFactory implements AstFactory<t.Statement, t.Expres
44
44
  createVoidExpression(expression: t.Expression): t.Expression;
45
45
  createUnaryExpression: typeof t.unaryExpression;
46
46
  createVariableDeclaration(variableName: string, initializer: t.Expression | null, type: VariableDeclarationType): t.Statement;
47
+ createRegularExpressionLiteral(body: string, flags: string | null): t.Expression;
47
48
  setSourceMapRange<T extends t.Statement | t.Expression | t.TemplateElement>(node: T, sourceMapRange: SourceMapRange | null): T;
48
49
  }
@@ -7,7 +7,7 @@
7
7
  */
8
8
  import { MaybeForwardRefExpression, outputAst as o, R3DeclareDependencyMetadata, R3DependencyMetadata, R3Reference } from '@angular/compiler';
9
9
  import { AstObject, AstValue } from '../../ast/ast_value';
10
- export declare const PLACEHOLDER_VERSION = "21.0.0-next.4";
10
+ export declare const PLACEHOLDER_VERSION = "21.0.0-next.6";
11
11
  export declare function wrapReference<TExpression>(wrapped: o.WrappedNodeExpr<TExpression>): R3Reference;
12
12
  /**
13
13
  * Parses the value of an enum from the AST value's symbol name.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/compiler-cli",
3
- "version": "21.0.0-next.4",
3
+ "version": "21.0.0-next.6",
4
4
  "description": "Angular - the compiler CLI for Node.js",
5
5
  "typings": "index.d.ts",
6
6
  "bin": {
@@ -48,7 +48,7 @@
48
48
  "yargs": "^18.0.0"
49
49
  },
50
50
  "peerDependencies": {
51
- "@angular/compiler": "21.0.0-next.4",
51
+ "@angular/compiler": "21.0.0-next.6",
52
52
  "typescript": ">=5.9 <6.0"
53
53
  },
54
54
  "peerDependenciesMeta": {
@@ -9,7 +9,7 @@ import { LegacyAnimationTriggerNames, DeclarationListEmitMode, DeferBlockDepsEmi
9
9
  import ts from 'typescript';
10
10
  import { Reference } from '../../../imports';
11
11
  import { ClassPropertyMapping, DirectiveResources, DirectiveTypeCheckMeta, HostDirectiveMeta, InputMapping } from '../../../metadata';
12
- import { ClassDeclaration } from '../../../reflection';
12
+ import { ClassDeclaration, Import } from '../../../reflection';
13
13
  import { SubsetOfKeys } from '../../../util/src/typescript';
14
14
  import { ParsedTemplateWithSource, StyleUrlMeta } from './resources';
15
15
  import { HostBindingNodes } from '../../directive';
@@ -84,10 +84,11 @@ export interface ComponentResolutionData {
84
84
  declarationListEmitMode: DeclarationListEmitMode;
85
85
  /**
86
86
  * Map of all types that can be defer loaded (ts.ClassDeclaration) ->
87
- * corresponding import declaration (ts.ImportDeclaration) within
88
- * the current source file.
87
+ * corresponding import information (reflection `Import`) within
88
+ * the current source file. The `Import` preserves the exported name
89
+ * as seen by the importing module so aliasing is handled correctly.
89
90
  */
90
- deferrableDeclToImportDecl: Map<ClassDeclaration, ts.ImportDeclaration>;
91
+ deferrableDeclToImportDecl: Map<ClassDeclaration, Import>;
91
92
  /**
92
93
  * Map of `@defer` blocks -> their corresponding dependencies.
93
94
  * Required to compile the defer resolver function in `PerBlock` mode.
@@ -5,7 +5,7 @@
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.dev/license
7
7
  */
8
- import { InterpolationConfig, ParsedTemplate, ParseSourceFile, TmplAstNode } from '@angular/compiler';
8
+ import { ParsedTemplate, ParseSourceFile, TmplAstNode } from '@angular/compiler';
9
9
  import ts from 'typescript';
10
10
  import { FatalDiagnosticError } from '../../../diagnostics';
11
11
  import { DependencyTracker } from '../../../incremental/api';
@@ -66,7 +66,6 @@ export interface ParsedTemplateWithSource extends ParsedComponentTemplate {
66
66
  */
67
67
  interface CommonTemplateDeclaration {
68
68
  preserveWhitespaces: boolean;
69
- interpolationConfig: InterpolationConfig;
70
69
  templateUrl: string;
71
70
  resolvedTemplateUrl: string;
72
71
  }
@@ -219,6 +219,13 @@ export interface AstFactory<TStatement, TExpression> {
219
219
  * @param type whether this variable should be declared as `var`, `let` or `const`.
220
220
  */
221
221
  createVariableDeclaration(variableName: string, initializer: TExpression | null, type: VariableDeclarationType): TStatement;
222
+ /**
223
+ * Create a regular expression literal (e.g. `/\d+/g`).
224
+ *
225
+ * @param body Body of the regex.
226
+ * @param flags Flags of the regex, if any.
227
+ */
228
+ createRegularExpressionLiteral(body: string, flags: string | null): TExpression;
222
229
  /**
223
230
  * Attach a source map range to the given node.
224
231
  *
@@ -35,6 +35,7 @@ export declare class ExpressionTranslatorVisitor<TFile, TStatement, TExpression>
35
35
  visitTemplateLiteralExpr(ast: o.TemplateLiteralExpr, context: Context): TExpression;
36
36
  visitInstantiateExpr(ast: o.InstantiateExpr, context: Context): TExpression;
37
37
  visitLiteralExpr(ast: o.LiteralExpr, _context: Context): TExpression;
38
+ visitRegularExpressionLiteral(ast: o.outputAst.RegularExpressionLiteral, context: any): TExpression;
38
39
  visitLocalizedString(ast: o.LocalizedString, context: Context): TExpression;
39
40
  private createTaggedTemplateExpression;
40
41
  /**
@@ -45,6 +45,7 @@ export declare class TypeScriptAstFactory implements AstFactory<ts.Statement, ts
45
45
  createVoidExpression: (expression: ts.Expression) => ts.VoidExpression;
46
46
  createUnaryExpression(operator: UnaryOperator, operand: ts.Expression): ts.Expression;
47
47
  createVariableDeclaration(variableName: string, initializer: ts.Expression | null, type: VariableDeclarationType): ts.Statement;
48
+ createRegularExpressionLiteral(body: string, flags: string | null): ts.Expression;
48
49
  setSourceMapRange<T extends ts.Node>(node: T, sourceMapRange: SourceMapRange | null): T;
49
50
  }
50
51
  export declare function createTemplateMiddle(cooked: string, raw: string): ts.TemplateMiddle;
@@ -5,7 +5,6 @@
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.dev/license
7
7
  */
8
- import { InterpolationConfig } from '@angular/compiler';
9
8
  /**
10
9
  * Captures template information intended for extraction of i18n messages from a template.
11
10
  *
@@ -21,5 +20,5 @@ export interface Xi18nContext {
21
20
  * the return type is declared as `void` for simplicity, since any parse errors would be reported
22
21
  * as diagnostics anyway.
23
22
  */
24
- updateFromTemplate(html: string, url: string, interpolationConfig: InterpolationConfig): void;
23
+ updateFromTemplate(html: string, url: string): void;
25
24
  }