@angular/compiler 18.1.0-next.0 → 18.1.0-next.2

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 (32) hide show
  1. package/esm2022/src/compiler.mjs +2 -2
  2. package/esm2022/src/i18n/extractor_merger.mjs +2 -1
  3. package/esm2022/src/i18n/i18n_parser.mjs +4 -1
  4. package/esm2022/src/i18n/serializers/xliff.mjs +3 -1
  5. package/esm2022/src/i18n/serializers/xliff2.mjs +3 -1
  6. package/esm2022/src/i18n/serializers/xtb.mjs +3 -1
  7. package/esm2022/src/ml_parser/ast.mjs +14 -1
  8. package/esm2022/src/ml_parser/html_whitespaces.mjs +4 -1
  9. package/esm2022/src/ml_parser/icu_ast_expander.mjs +4 -1
  10. package/esm2022/src/ml_parser/lexer.mjs +83 -2
  11. package/esm2022/src/ml_parser/parser.mjs +57 -4
  12. package/esm2022/src/ml_parser/tokens.mjs +1 -1
  13. package/esm2022/src/ml_parser/xml_parser.mjs +3 -3
  14. package/esm2022/src/render3/partial/class_metadata.mjs +2 -2
  15. package/esm2022/src/render3/partial/directive.mjs +1 -1
  16. package/esm2022/src/render3/partial/factory.mjs +1 -1
  17. package/esm2022/src/render3/partial/injectable.mjs +1 -1
  18. package/esm2022/src/render3/partial/injector.mjs +1 -1
  19. package/esm2022/src/render3/partial/ng_module.mjs +1 -1
  20. package/esm2022/src/render3/partial/pipe.mjs +1 -1
  21. package/esm2022/src/render3/r3_ast.mjs +14 -1
  22. package/esm2022/src/render3/r3_template_transform.mjs +12 -1
  23. package/esm2022/src/render3/view/i18n/meta.mjs +4 -1
  24. package/esm2022/src/render3/view/t2_api.mjs +1 -1
  25. package/esm2022/src/render3/view/t2_binder.mjs +20 -4
  26. package/esm2022/src/render3/view/template.mjs +2 -1
  27. package/esm2022/src/template/pipeline/src/ingest.mjs +4 -1
  28. package/esm2022/src/version.mjs +1 -1
  29. package/fesm2022/compiler.mjs +224 -18
  30. package/fesm2022/compiler.mjs.map +1 -1
  31. package/index.d.ts +52 -11
  32. package/package.json +3 -3
@@ -11,5 +11,5 @@
11
11
  * Entry point for all public APIs of the compiler package.
12
12
  */
13
13
  import { Version } from './util';
14
- export const VERSION = new Version('18.1.0-next.0');
14
+ export const VERSION = new Version('18.1.0-next.2');
15
15
  //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmVyc2lvbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL2NvbXBpbGVyL3NyYy92ZXJzaW9uLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7R0FNRztBQUVIOzs7O0dBSUc7QUFFSCxPQUFPLEVBQUMsT0FBTyxFQUFDLE1BQU0sUUFBUSxDQUFDO0FBRS9CLE1BQU0sQ0FBQyxNQUFNLE9BQU8sR0FBRyxJQUFJLE9BQU8sQ0FBQyxtQkFBbUIsQ0FBQyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBAbGljZW5zZVxuICogQ29weXJpZ2h0IEdvb2dsZSBMTEMgQWxsIFJpZ2h0cyBSZXNlcnZlZC5cbiAqXG4gKiBVc2Ugb2YgdGhpcyBzb3VyY2UgY29kZSBpcyBnb3Zlcm5lZCBieSBhbiBNSVQtc3R5bGUgbGljZW5zZSB0aGF0IGNhbiBiZVxuICogZm91bmQgaW4gdGhlIExJQ0VOU0UgZmlsZSBhdCBodHRwczovL2FuZ3VsYXIuaW8vbGljZW5zZVxuICovXG5cbi8qKlxuICogQG1vZHVsZVxuICogQGRlc2NyaXB0aW9uXG4gKiBFbnRyeSBwb2ludCBmb3IgYWxsIHB1YmxpYyBBUElzIG9mIHRoZSBjb21waWxlciBwYWNrYWdlLlxuICovXG5cbmltcG9ydCB7VmVyc2lvbn0gZnJvbSAnLi91dGlsJztcblxuZXhwb3J0IGNvbnN0IFZFUlNJT04gPSBuZXcgVmVyc2lvbignMC4wLjAtUExBQ0VIT0xERVInKTtcbiJdfQ==
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v18.1.0-next.0
2
+ * @license Angular v18.1.0-next.2
3
3
  * (c) 2010-2024 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -5091,6 +5091,18 @@ class UnknownBlock {
5091
5091
  return visitor.visitUnknownBlock(this);
5092
5092
  }
5093
5093
  }
5094
+ class LetDeclaration$1 {
5095
+ constructor(name, value, sourceSpan, nameSpan, valueSpan) {
5096
+ this.name = name;
5097
+ this.value = value;
5098
+ this.sourceSpan = sourceSpan;
5099
+ this.nameSpan = nameSpan;
5100
+ this.valueSpan = valueSpan;
5101
+ }
5102
+ visit(visitor) {
5103
+ return visitor.visitLetDeclaration(this);
5104
+ }
5105
+ }
5094
5106
  class Template {
5095
5107
  constructor(
5096
5108
  // tagName is the name of the container element, if applicable.
@@ -5226,6 +5238,7 @@ class RecursiveVisitor$1 {
5226
5238
  visitIcu(icu) { }
5227
5239
  visitDeferredTrigger(trigger) { }
5228
5240
  visitUnknownBlock(block) { }
5241
+ visitLetDeclaration(decl) { }
5229
5242
  }
5230
5243
  function visitAll$1(visitor, nodes) {
5231
5244
  const result = [];
@@ -14335,6 +14348,18 @@ class BlockParameter {
14335
14348
  return visitor.visitBlockParameter(this, context);
14336
14349
  }
14337
14350
  }
14351
+ class LetDeclaration {
14352
+ constructor(name, value, sourceSpan, nameSpan, valueSpan) {
14353
+ this.name = name;
14354
+ this.value = value;
14355
+ this.sourceSpan = sourceSpan;
14356
+ this.nameSpan = nameSpan;
14357
+ this.valueSpan = valueSpan;
14358
+ }
14359
+ visit(visitor, context) {
14360
+ return visitor.visitLetDeclaration(this, context);
14361
+ }
14362
+ }
14338
14363
  function visitAll(visitor, nodes, context = null) {
14339
14364
  const result = [];
14340
14365
  const visit = visitor.visit
@@ -14372,6 +14397,7 @@ class RecursiveVisitor {
14372
14397
  });
14373
14398
  }
14374
14399
  visitBlockParameter(ast, context) { }
14400
+ visitLetDeclaration(decl, context) { }
14375
14401
  visitChildren(context, cb) {
14376
14402
  let results = [];
14377
14403
  let t = this;
@@ -15335,6 +15361,9 @@ class _I18nVisitor {
15335
15361
  visitBlockParameter(_parameter, _context) {
15336
15362
  throw new Error('Unreachable code');
15337
15363
  }
15364
+ visitLetDeclaration(decl, context) {
15365
+ return null;
15366
+ }
15338
15367
  /**
15339
15368
  * Convert, text and interpolated tokens up into text and placeholder pieces.
15340
15369
  *
@@ -17660,6 +17689,8 @@ class _Tokenizer {
17660
17689
  this._preserveLineEndings = options.preserveLineEndings || false;
17661
17690
  this._i18nNormalizeLineEndingsInICUs = options.i18nNormalizeLineEndingsInICUs || false;
17662
17691
  this._tokenizeBlocks = options.tokenizeBlocks ?? true;
17692
+ // TODO(crisbeto): eventually set this to true.
17693
+ this._tokenizeLet = options.tokenizeLet || false;
17663
17694
  try {
17664
17695
  this._cursor.init();
17665
17696
  }
@@ -17700,6 +17731,14 @@ class _Tokenizer {
17700
17731
  this._consumeTagOpen(start);
17701
17732
  }
17702
17733
  }
17734
+ else if (this._tokenizeLet &&
17735
+ // Use `peek` instead of `attempCharCode` since we
17736
+ // don't want to advance in case it's not `@let`.
17737
+ this._cursor.peek() === $AT &&
17738
+ !this._inInterpolation &&
17739
+ this._attemptStr('@let')) {
17740
+ this._consumeLetDeclaration(start);
17741
+ }
17703
17742
  else if (this._tokenizeBlocks && this._attemptCharCode($AT)) {
17704
17743
  this._consumeBlockStart(start);
17705
17744
  }
@@ -17720,7 +17759,7 @@ class _Tokenizer {
17720
17759
  this.handleError(e);
17721
17760
  }
17722
17761
  }
17723
- this._beginToken(29 /* TokenType.EOF */);
17762
+ this._beginToken(33 /* TokenType.EOF */);
17724
17763
  this._endToken([]);
17725
17764
  }
17726
17765
  _getBlockName() {
@@ -17811,6 +17850,77 @@ class _Tokenizer {
17811
17850
  this._attemptCharCodeUntilFn(isBlockParameterChar);
17812
17851
  }
17813
17852
  }
17853
+ _consumeLetDeclaration(start) {
17854
+ this._beginToken(29 /* TokenType.LET_START */, start);
17855
+ // Require at least one white space after the `@let`.
17856
+ if (isWhitespace(this._cursor.peek())) {
17857
+ this._attemptCharCodeUntilFn(isNotWhitespace);
17858
+ }
17859
+ else {
17860
+ const token = this._endToken([this._cursor.getChars(start)]);
17861
+ token.type = 32 /* TokenType.INCOMPLETE_LET */;
17862
+ return;
17863
+ }
17864
+ const startToken = this._endToken([this._getLetDeclarationName()]);
17865
+ // Skip over white space before the equals character.
17866
+ this._attemptCharCodeUntilFn(isNotWhitespace);
17867
+ // Expect an equals sign.
17868
+ if (!this._attemptCharCode($EQ)) {
17869
+ startToken.type = 32 /* TokenType.INCOMPLETE_LET */;
17870
+ return;
17871
+ }
17872
+ // Skip spaces after the equals.
17873
+ this._attemptCharCodeUntilFn((code) => isNotWhitespace(code) && !isNewLine(code));
17874
+ this._consumeLetDeclarationValue();
17875
+ // Terminate the `@let` with a semicolon.
17876
+ const endChar = this._cursor.peek();
17877
+ if (endChar === $SEMICOLON) {
17878
+ this._beginToken(31 /* TokenType.LET_END */);
17879
+ this._endToken([]);
17880
+ this._cursor.advance();
17881
+ }
17882
+ else {
17883
+ startToken.type = 32 /* TokenType.INCOMPLETE_LET */;
17884
+ startToken.sourceSpan = this._cursor.getSpan(start);
17885
+ }
17886
+ }
17887
+ _getLetDeclarationName() {
17888
+ const nameCursor = this._cursor.clone();
17889
+ let allowDigit = false;
17890
+ this._attemptCharCodeUntilFn((code) => {
17891
+ // `@let` names can't start with a digit, but digits are valid anywhere else in the name.
17892
+ if (isAsciiLetter(code) || code === $_ || (allowDigit && isDigit(code))) {
17893
+ allowDigit = true;
17894
+ return false;
17895
+ }
17896
+ return true;
17897
+ });
17898
+ return this._cursor.getChars(nameCursor).trim();
17899
+ }
17900
+ _consumeLetDeclarationValue() {
17901
+ const start = this._cursor.clone();
17902
+ this._beginToken(30 /* TokenType.LET_VALUE */, start);
17903
+ while (this._cursor.peek() !== $EOF) {
17904
+ const char = this._cursor.peek();
17905
+ // `@let` declarations terminate with a semicolon.
17906
+ if (char === $SEMICOLON) {
17907
+ break;
17908
+ }
17909
+ // If we hit a quote, skip over its content since we don't care what's inside.
17910
+ if (isQuote(char)) {
17911
+ this._cursor.advance();
17912
+ this._attemptCharCodeUntilFn((inner) => {
17913
+ if (inner === $BACKSLASH) {
17914
+ this._cursor.advance();
17915
+ return false;
17916
+ }
17917
+ return inner === char;
17918
+ });
17919
+ }
17920
+ this._cursor.advance();
17921
+ }
17922
+ this._endToken([this._cursor.getChars(start)]);
17923
+ }
17814
17924
  /**
17815
17925
  * @returns whether an ICU token has been created
17816
17926
  * @internal
@@ -18741,7 +18851,7 @@ class _TreeBuilder {
18741
18851
  this._advance();
18742
18852
  }
18743
18853
  build() {
18744
- while (this._peek.type !== 29 /* TokenType.EOF */) {
18854
+ while (this._peek.type !== 33 /* TokenType.EOF */) {
18745
18855
  if (this._peek.type === 0 /* TokenType.TAG_OPEN_START */ ||
18746
18856
  this._peek.type === 4 /* TokenType.INCOMPLETE_TAG_OPEN */) {
18747
18857
  this._consumeStartTag(this._advance());
@@ -18778,6 +18888,14 @@ class _TreeBuilder {
18778
18888
  this._closeVoidElement();
18779
18889
  this._consumeIncompleteBlock(this._advance());
18780
18890
  }
18891
+ else if (this._peek.type === 29 /* TokenType.LET_START */) {
18892
+ this._closeVoidElement();
18893
+ this._consumeLet(this._advance());
18894
+ }
18895
+ else if (this._peek.type === 32 /* TokenType.INCOMPLETE_LET */) {
18896
+ this._closeVoidElement();
18897
+ this._consumeIncompleteLet(this._advance());
18898
+ }
18781
18899
  else {
18782
18900
  // Skip all other tokens...
18783
18901
  this._advance();
@@ -18851,7 +18969,7 @@ class _TreeBuilder {
18851
18969
  if (!exp)
18852
18970
  return null;
18853
18971
  const end = this._advance();
18854
- exp.push({ type: 29 /* TokenType.EOF */, parts: [], sourceSpan: end.sourceSpan });
18972
+ exp.push({ type: 33 /* TokenType.EOF */, parts: [], sourceSpan: end.sourceSpan });
18855
18973
  // parse everything in between { and }
18856
18974
  const expansionCaseParser = new _TreeBuilder(exp, this.getTagDefinition);
18857
18975
  expansionCaseParser.build();
@@ -18891,7 +19009,7 @@ class _TreeBuilder {
18891
19009
  return null;
18892
19010
  }
18893
19011
  }
18894
- if (this._peek.type === 29 /* TokenType.EOF */) {
19012
+ if (this._peek.type === 33 /* TokenType.EOF */) {
18895
19013
  this.errors.push(TreeError.create(null, start.sourceSpan, `Invalid ICU message. Missing '}'.`));
18896
19014
  return null;
18897
19015
  }
@@ -19121,6 +19239,51 @@ class _TreeBuilder {
19121
19239
  this.errors.push(TreeError.create(token.parts[0], span, `Incomplete block "${token.parts[0]}". If you meant to write the @ character, ` +
19122
19240
  `you should use the "@" HTML entity instead.`));
19123
19241
  }
19242
+ _consumeLet(startToken) {
19243
+ const name = startToken.parts[0];
19244
+ let valueToken;
19245
+ let endToken;
19246
+ if (this._peek.type !== 30 /* TokenType.LET_VALUE */) {
19247
+ this.errors.push(TreeError.create(startToken.parts[0], startToken.sourceSpan, `Invalid @let declaration "${name}". Declaration must have a value.`));
19248
+ return;
19249
+ }
19250
+ else {
19251
+ valueToken = this._advance();
19252
+ }
19253
+ // Type cast is necessary here since TS narrowed the type of `peek` above.
19254
+ if (this._peek.type !== 31 /* TokenType.LET_END */) {
19255
+ this.errors.push(TreeError.create(startToken.parts[0], startToken.sourceSpan, `Unterminated @let declaration "${name}". Declaration must be terminated with a semicolon.`));
19256
+ return;
19257
+ }
19258
+ else {
19259
+ endToken = this._advance();
19260
+ }
19261
+ const end = endToken.sourceSpan.fullStart;
19262
+ const span = new ParseSourceSpan(startToken.sourceSpan.start, end, startToken.sourceSpan.fullStart);
19263
+ // The start token usually captures the `@let`. Construct a name span by
19264
+ // offsetting the start by the length of any text before the name.
19265
+ const startOffset = startToken.sourceSpan.toString().lastIndexOf(name);
19266
+ const nameStart = startToken.sourceSpan.start.moveBy(startOffset);
19267
+ const nameSpan = new ParseSourceSpan(nameStart, startToken.sourceSpan.end);
19268
+ const node = new LetDeclaration(name, valueToken.parts[0], span, nameSpan, valueToken.sourceSpan);
19269
+ this._addToParent(node);
19270
+ }
19271
+ _consumeIncompleteLet(token) {
19272
+ // Incomplete `@let` declaration may end up with an empty name.
19273
+ const name = token.parts[0] ?? '';
19274
+ const nameString = name ? ` "${name}"` : '';
19275
+ // If there's at least a name, we can salvage an AST node that can be used for completions.
19276
+ if (name.length > 0) {
19277
+ const startOffset = token.sourceSpan.toString().lastIndexOf(name);
19278
+ const nameStart = token.sourceSpan.start.moveBy(startOffset);
19279
+ const nameSpan = new ParseSourceSpan(nameStart, token.sourceSpan.end);
19280
+ const valueSpan = new ParseSourceSpan(token.sourceSpan.start, token.sourceSpan.start.moveBy(0));
19281
+ const node = new LetDeclaration(name, '', token.sourceSpan, nameSpan, valueSpan);
19282
+ this._addToParent(node);
19283
+ }
19284
+ this.errors.push(TreeError.create(token.parts[0], token.sourceSpan, `Incomplete @let declaration${nameString}. ` +
19285
+ `@let declarations must be written as \`@let <name> = <value>;\``));
19286
+ }
19124
19287
  _getContainer() {
19125
19288
  return this._containerStack.length > 0
19126
19289
  ? this._containerStack[this._containerStack.length - 1]
@@ -19349,6 +19512,9 @@ class I18nMetaVisitor {
19349
19512
  visitBlockParameter(parameter, context) {
19350
19513
  return parameter;
19351
19514
  }
19515
+ visitLetDeclaration(decl, context) {
19516
+ return decl;
19517
+ }
19352
19518
  /**
19353
19519
  * Parse the general form `meta` passed into extract the explicit metadata needed to create a
19354
19520
  * `Message`.
@@ -23871,6 +24037,9 @@ function ingestNodes(unit, template) {
23871
24037
  else if (node instanceof ForLoopBlock) {
23872
24038
  ingestForBlock(unit, node);
23873
24039
  }
24040
+ else if (node instanceof LetDeclaration$1) {
24041
+ // TODO(crisbeto): needs further integration
24042
+ }
23874
24043
  else {
23875
24044
  throw new Error(`Unsupported template node: ${node.constructor.name}`);
23876
24045
  }
@@ -25034,6 +25203,9 @@ class WhitespaceVisitor {
25034
25203
  visitBlockParameter(parameter, context) {
25035
25204
  return parameter;
25036
25205
  }
25206
+ visitLetDeclaration(decl, context) {
25207
+ return decl;
25208
+ }
25037
25209
  }
25038
25210
  function createWhitespaceProcessedTextToken({ type, parts, sourceSpan }) {
25039
25211
  return { type, parts: [processWhitespace(parts[0])], sourceSpan };
@@ -26704,6 +26876,13 @@ class HtmlAstToIvyAst {
26704
26876
  }
26705
26877
  return null;
26706
26878
  }
26879
+ visitLetDeclaration(decl, context) {
26880
+ const value = this.bindingParser.parseBinding(decl.value, false, decl.valueSpan, decl.valueSpan.start.offset);
26881
+ if (value.errors.length === 0 && value.ast instanceof EmptyExpr$1) {
26882
+ this.reportError('@let declaration value cannot be empty', decl.valueSpan);
26883
+ }
26884
+ return new LetDeclaration$1(decl.name, value, decl.sourceSpan, decl.nameSpan, decl.valueSpan);
26885
+ }
26707
26886
  visitBlockParameter() {
26708
26887
  return null;
26709
26888
  }
@@ -26982,6 +27161,9 @@ class NonBindableVisitor {
26982
27161
  visitBlockParameter(parameter, context) {
26983
27162
  return null;
26984
27163
  }
27164
+ visitLetDeclaration(decl, context) {
27165
+ return new Text$3(`@let ${decl.name} = ${decl.value};`, decl.sourceSpan);
27166
+ }
26985
27167
  }
26986
27168
  const NON_BINDABLE_VISITOR = new NonBindableVisitor();
26987
27169
  function normalizeAttributeName(attrName) {
@@ -27016,6 +27198,7 @@ function parseTemplate(template, templateUrl, options = {}) {
27016
27198
  ...options,
27017
27199
  tokenizeExpansionForms: true,
27018
27200
  tokenizeBlocks: options.enableBlockSyntax ?? true,
27201
+ tokenizeLet: options.enableLetSyntax ?? false,
27019
27202
  });
27020
27203
  if (!options.alwaysAttemptHtmlToR3AstConversion &&
27021
27204
  parseResult.errors &&
@@ -27785,6 +27968,9 @@ class Scope {
27785
27968
  visitContent(content) {
27786
27969
  this.ingestScopedNode(content);
27787
27970
  }
27971
+ visitLetDeclaration(decl) {
27972
+ this.maybeDeclare(decl);
27973
+ }
27788
27974
  // Unused visitors.
27789
27975
  visitBoundAttribute(attr) { }
27790
27976
  visitBoundEvent(event) { }
@@ -27997,6 +28183,7 @@ class DirectiveBinder {
27997
28183
  visitIcu(icu) { }
27998
28184
  visitDeferredTrigger(trigger) { }
27999
28185
  visitUnknownBlock(block) { }
28186
+ visitLetDeclaration(decl) { }
28000
28187
  }
28001
28188
  /**
28002
28189
  * Processes a template and extract metadata about expressions and symbols within.
@@ -28193,6 +28380,12 @@ class TemplateBinder extends RecursiveAstVisitor {
28193
28380
  visitBoundText(text) {
28194
28381
  text.value.visit(this);
28195
28382
  }
28383
+ visitLetDeclaration(decl) {
28384
+ decl.value.visit(this);
28385
+ if (this.rootNode !== null) {
28386
+ this.symbols.set(decl, this.rootNode);
28387
+ }
28388
+ }
28196
28389
  visitPipe(ast, context) {
28197
28390
  this.usedPipes.add(ast.name);
28198
28391
  if (!this.scope.isDeferred) {
@@ -28227,7 +28420,13 @@ class TemplateBinder extends RecursiveAstVisitor {
28227
28420
  }
28228
28421
  // Check whether the name exists in the current scope. If so, map it. Otherwise, the name is
28229
28422
  // probably a property on the top-level component context.
28230
- let target = this.scope.lookup(name);
28423
+ const target = this.scope.lookup(name);
28424
+ // It's not allowed to read template entities via `this`, however it previously worked by
28425
+ // accident (see #55115). Since `@let` declarations are new, we can fix it from the beginning,
28426
+ // whereas pre-existing template entities will be fixed in #55115.
28427
+ if (target instanceof LetDeclaration$1 && ast.receiver instanceof ThisReceiver) {
28428
+ return;
28429
+ }
28231
28430
  if (target !== null) {
28232
28431
  this.bindings.set(ast, target);
28233
28432
  }
@@ -29062,7 +29261,7 @@ function publishFacade(global) {
29062
29261
  * @description
29063
29262
  * Entry point for all public APIs of the compiler package.
29064
29263
  */
29065
- const VERSION = new Version('18.1.0-next.0');
29264
+ const VERSION = new Version('18.1.0-next.2');
29066
29265
 
29067
29266
  class CompilerConfig {
29068
29267
  constructor({ defaultEncapsulation = ViewEncapsulation.Emulated, preserveWhitespaces, strictInjectionParameters, } = {}) {
@@ -29287,6 +29486,7 @@ class _Visitor {
29287
29486
  visitAll(this, block.children, context);
29288
29487
  }
29289
29488
  visitBlockParameter(parameter, context) { }
29489
+ visitLetDeclaration(decl, context) { }
29290
29490
  _init(mode, interpolationConfig) {
29291
29491
  this._mode = mode;
29292
29492
  this._inI18nBlock = false;
@@ -29499,8 +29699,8 @@ class XmlParser extends Parser {
29499
29699
  super(getXmlTagDefinition);
29500
29700
  }
29501
29701
  parse(source, url, options = {}) {
29502
- // Blocks aren't supported in an XML context.
29503
- return super.parse(source, url, { ...options, tokenizeBlocks: false });
29702
+ // Blocks and let declarations aren't supported in an XML context.
29703
+ return super.parse(source, url, { ...options, tokenizeBlocks: false, tokenizeLet: false });
29504
29704
  }
29505
29705
  }
29506
29706
 
@@ -29721,6 +29921,7 @@ class XliffParser {
29721
29921
  visitExpansionCase(expansionCase, context) { }
29722
29922
  visitBlock(block, context) { }
29723
29923
  visitBlockParameter(parameter, context) { }
29924
+ visitLetDeclaration(decl, context) { }
29724
29925
  _addError(node, message) {
29725
29926
  this._errors.push(new I18nError(node.sourceSpan, message));
29726
29927
  }
@@ -29773,6 +29974,7 @@ class XmlToI18n$2 {
29773
29974
  visitAttribute(attribute, context) { }
29774
29975
  visitBlock(block, context) { }
29775
29976
  visitBlockParameter(parameter, context) { }
29977
+ visitLetDeclaration(decl, context) { }
29776
29978
  _addError(node, message) {
29777
29979
  this._errors.push(new I18nError(node.sourceSpan, message));
29778
29980
  }
@@ -30032,6 +30234,7 @@ class Xliff2Parser {
30032
30234
  visitExpansionCase(expansionCase, context) { }
30033
30235
  visitBlock(block, context) { }
30034
30236
  visitBlockParameter(parameter, context) { }
30237
+ visitLetDeclaration(decl, context) { }
30035
30238
  _addError(node, message) {
30036
30239
  this._errors.push(new I18nError(node.sourceSpan, message));
30037
30240
  }
@@ -30101,6 +30304,7 @@ class XmlToI18n$1 {
30101
30304
  visitAttribute(attribute, context) { }
30102
30305
  visitBlock(block, context) { }
30103
30306
  visitBlockParameter(parameter, context) { }
30307
+ visitLetDeclaration(decl, context) { }
30104
30308
  _addError(node, message) {
30105
30309
  this._errors.push(new I18nError(node.sourceSpan, message));
30106
30310
  }
@@ -30237,6 +30441,7 @@ class XtbParser {
30237
30441
  visitExpansionCase(expansionCase, context) { }
30238
30442
  visitBlock(block, context) { }
30239
30443
  visitBlockParameter(block, context) { }
30444
+ visitLetDeclaration(decl, context) { }
30240
30445
  _addError(node, message) {
30241
30446
  this._errors.push(new I18nError(node.sourceSpan, message));
30242
30447
  }
@@ -30287,6 +30492,7 @@ class XmlToI18n {
30287
30492
  visitAttribute(attribute, context) { }
30288
30493
  visitBlock(block, context) { }
30289
30494
  visitBlockParameter(block, context) { }
30495
+ visitLetDeclaration(decl, context) { }
30290
30496
  _addError(node, message) {
30291
30497
  this._errors.push(new I18nError(node.sourceSpan, message));
30292
30498
  }
@@ -30693,7 +30899,7 @@ const MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION = '18.0.0';
30693
30899
  function compileDeclareClassMetadata(metadata) {
30694
30900
  const definitionMap = new DefinitionMap();
30695
30901
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
30696
- definitionMap.set('version', literal('18.1.0-next.0'));
30902
+ definitionMap.set('version', literal('18.1.0-next.2'));
30697
30903
  definitionMap.set('ngImport', importExpr(Identifiers.core));
30698
30904
  definitionMap.set('type', metadata.type);
30699
30905
  definitionMap.set('decorators', metadata.decorators);
@@ -30711,7 +30917,7 @@ function compileComponentDeclareClassMetadata(metadata, dependencies) {
30711
30917
  callbackReturnDefinitionMap.set('ctorParameters', metadata.ctorParameters ?? literal(null));
30712
30918
  callbackReturnDefinitionMap.set('propDecorators', metadata.propDecorators ?? literal(null));
30713
30919
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION));
30714
- definitionMap.set('version', literal('18.1.0-next.0'));
30920
+ definitionMap.set('version', literal('18.1.0-next.2'));
30715
30921
  definitionMap.set('ngImport', importExpr(Identifiers.core));
30716
30922
  definitionMap.set('type', metadata.type);
30717
30923
  definitionMap.set('resolveDeferredDeps', compileComponentMetadataAsyncResolver(dependencies));
@@ -30806,7 +31012,7 @@ function createDirectiveDefinitionMap(meta) {
30806
31012
  const definitionMap = new DefinitionMap();
30807
31013
  const minVersion = getMinimumVersionForPartialOutput(meta);
30808
31014
  definitionMap.set('minVersion', literal(minVersion));
30809
- definitionMap.set('version', literal('18.1.0-next.0'));
31015
+ definitionMap.set('version', literal('18.1.0-next.2'));
30810
31016
  // e.g. `type: MyDirective`
30811
31017
  definitionMap.set('type', meta.type.value);
30812
31018
  if (meta.isStandalone) {
@@ -31228,7 +31434,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$4 = '12.0.0';
31228
31434
  function compileDeclareFactoryFunction(meta) {
31229
31435
  const definitionMap = new DefinitionMap();
31230
31436
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
31231
- definitionMap.set('version', literal('18.1.0-next.0'));
31437
+ definitionMap.set('version', literal('18.1.0-next.2'));
31232
31438
  definitionMap.set('ngImport', importExpr(Identifiers.core));
31233
31439
  definitionMap.set('type', meta.type.value);
31234
31440
  definitionMap.set('deps', compileDependencies(meta.deps));
@@ -31263,7 +31469,7 @@ function compileDeclareInjectableFromMetadata(meta) {
31263
31469
  function createInjectableDefinitionMap(meta) {
31264
31470
  const definitionMap = new DefinitionMap();
31265
31471
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
31266
- definitionMap.set('version', literal('18.1.0-next.0'));
31472
+ definitionMap.set('version', literal('18.1.0-next.2'));
31267
31473
  definitionMap.set('ngImport', importExpr(Identifiers.core));
31268
31474
  definitionMap.set('type', meta.type.value);
31269
31475
  // Only generate providedIn property if it has a non-null value
@@ -31314,7 +31520,7 @@ function compileDeclareInjectorFromMetadata(meta) {
31314
31520
  function createInjectorDefinitionMap(meta) {
31315
31521
  const definitionMap = new DefinitionMap();
31316
31522
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
31317
- definitionMap.set('version', literal('18.1.0-next.0'));
31523
+ definitionMap.set('version', literal('18.1.0-next.2'));
31318
31524
  definitionMap.set('ngImport', importExpr(Identifiers.core));
31319
31525
  definitionMap.set('type', meta.type.value);
31320
31526
  definitionMap.set('providers', meta.providers);
@@ -31347,7 +31553,7 @@ function createNgModuleDefinitionMap(meta) {
31347
31553
  throw new Error('Invalid path! Local compilation mode should not get into the partial compilation path');
31348
31554
  }
31349
31555
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
31350
- definitionMap.set('version', literal('18.1.0-next.0'));
31556
+ definitionMap.set('version', literal('18.1.0-next.2'));
31351
31557
  definitionMap.set('ngImport', importExpr(Identifiers.core));
31352
31558
  definitionMap.set('type', meta.type.value);
31353
31559
  // We only generate the keys in the metadata if the arrays contain values.
@@ -31398,7 +31604,7 @@ function compileDeclarePipeFromMetadata(meta) {
31398
31604
  function createPipeDefinitionMap(meta) {
31399
31605
  const definitionMap = new DefinitionMap();
31400
31606
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION));
31401
- definitionMap.set('version', literal('18.1.0-next.0'));
31607
+ definitionMap.set('version', literal('18.1.0-next.2'));
31402
31608
  definitionMap.set('ngImport', importExpr(Identifiers.core));
31403
31609
  // e.g. `type: MyPipe`
31404
31610
  definitionMap.set('type', meta.type.value);
@@ -31431,5 +31637,5 @@ publishFacade(_global);
31431
31637
 
31432
31638
  // This file is not used to build this module. It is only used during editing
31433
31639
 
31434
- export { AST, ASTWithName, ASTWithSource, AbsoluteSourceSpan, ArrayType, ArrowFunctionExpr, AstMemoryEfficientTransformer, AstTransformer, Attribute, Binary, BinaryOperator, BinaryOperatorExpr, BindingPipe, BindingType, Block, BlockParameter, BoundElementProperty, BuiltinType, BuiltinTypeName, CUSTOM_ELEMENTS_SCHEMA, Call, Chain, ChangeDetectionStrategy, CommaExpr, Comment, CompilerConfig, Conditional, ConditionalExpr, ConstantPool, CssSelector, DEFAULT_INTERPOLATION_CONFIG, DYNAMIC_TYPE, DeclareFunctionStmt, DeclareVarStmt, DomElementSchemaRegistry, DynamicImportExpr, EOF, Element, ElementSchemaRegistry, EmitterVisitorContext, EmptyExpr$1 as EmptyExpr, Expansion, ExpansionCase, Expression, ExpressionBinding, ExpressionStatement, ExpressionType, ExternalExpr, ExternalReference, FactoryTarget$1 as FactoryTarget, FunctionExpr, HtmlParser, HtmlTagDefinition, I18NHtmlParser, IfStmt, ImplicitReceiver, InstantiateExpr, Interpolation$1 as Interpolation, InterpolationConfig, InvokeFunctionExpr, JSDocComment, JitEvaluator, KeyedRead, KeyedWrite, LeadingComment, Lexer, LiteralArray, LiteralArrayExpr, LiteralExpr, LiteralMap, LiteralMapExpr, LiteralPrimitive, LocalizedString, MapType, MessageBundle, NONE_TYPE, NO_ERRORS_SCHEMA, NodeWithI18n, NonNullAssert, NotExpr, ParseError, ParseErrorLevel, ParseLocation, ParseSourceFile, ParseSourceSpan, ParseSpan, ParseTreeResult, ParsedEvent, ParsedEventType, ParsedProperty, ParsedPropertyType, ParsedVariable, Parser$1 as Parser, ParserError, PrefixNot, PropertyRead, PropertyWrite, R3BoundTarget, Identifiers as R3Identifiers, R3NgModuleMetadataKind, R3SelectorScopeMode, R3TargetBinder, R3TemplateDependencyKind, ReadKeyExpr, ReadPropExpr, ReadVarExpr, RecursiveAstVisitor, RecursiveVisitor, ResourceLoader, ReturnStatement, STRING_TYPE, SafeCall, SafeKeyedRead, SafePropertyRead, SelectorContext, SelectorListContext, SelectorMatcher, Serializer, SplitInterpolation, Statement, StmtModifier, TagContentType, TaggedTemplateExpr, TemplateBindingParseResult, TemplateLiteral, TemplateLiteralElement, Text, ThisReceiver, BlockNode as TmplAstBlockNode, BoundAttribute as TmplAstBoundAttribute, BoundDeferredTrigger as TmplAstBoundDeferredTrigger, BoundEvent as TmplAstBoundEvent, BoundText as TmplAstBoundText, Content as TmplAstContent, DeferredBlock as TmplAstDeferredBlock, DeferredBlockError as TmplAstDeferredBlockError, DeferredBlockLoading as TmplAstDeferredBlockLoading, DeferredBlockPlaceholder as TmplAstDeferredBlockPlaceholder, DeferredTrigger as TmplAstDeferredTrigger, Element$1 as TmplAstElement, ForLoopBlock as TmplAstForLoopBlock, ForLoopBlockEmpty as TmplAstForLoopBlockEmpty, HoverDeferredTrigger as TmplAstHoverDeferredTrigger, Icu$1 as TmplAstIcu, IdleDeferredTrigger as TmplAstIdleDeferredTrigger, IfBlock as TmplAstIfBlock, IfBlockBranch as TmplAstIfBlockBranch, ImmediateDeferredTrigger as TmplAstImmediateDeferredTrigger, InteractionDeferredTrigger as TmplAstInteractionDeferredTrigger, RecursiveVisitor$1 as TmplAstRecursiveVisitor, Reference as TmplAstReference, SwitchBlock as TmplAstSwitchBlock, SwitchBlockCase as TmplAstSwitchBlockCase, Template as TmplAstTemplate, Text$3 as TmplAstText, TextAttribute as TmplAstTextAttribute, TimerDeferredTrigger as TmplAstTimerDeferredTrigger, UnknownBlock as TmplAstUnknownBlock, Variable as TmplAstVariable, ViewportDeferredTrigger as TmplAstViewportDeferredTrigger, Token, TokenType, TransplantedType, TreeError, Type, TypeModifier, TypeofExpr, Unary, UnaryOperator, UnaryOperatorExpr, VERSION, VariableBinding, Version, ViewEncapsulation, WrappedNodeExpr, WriteKeyExpr, WritePropExpr, WriteVarExpr, Xliff, Xliff2, Xmb, XmlParser, Xtb, compileClassDebugInfo, compileClassMetadata, compileComponentClassMetadata, compileComponentDeclareClassMetadata, compileComponentFromMetadata, compileDeclareClassMetadata, compileDeclareComponentFromMetadata, compileDeclareDirectiveFromMetadata, compileDeclareFactoryFunction, compileDeclareInjectableFromMetadata, compileDeclareInjectorFromMetadata, compileDeclareNgModuleFromMetadata, compileDeclarePipeFromMetadata, compileDeferResolverFunction, compileDirectiveFromMetadata, compileFactoryFunction, compileInjectable, compileInjector, compileNgModule, compileOpaqueAsyncClassMetadata, compilePipeFromMetadata, computeMsgId, core, createCssSelectorFromNode, createInjectableType, createMayBeForwardRefExpression, devOnlyGuardedExpression, emitDistinctChangesOnlyDefaultValue, encapsulateStyle, getHtmlTagDefinition, getNsPrefix, getSafePropertyAccessString, identifierName, isIdentifier, isNgContainer, isNgContent, isNgTemplate, jsDocComment, leadingComment, literal, literalMap, makeBindingParser, mergeNsAndName, output_ast as outputAst, parseHostBindings, parseTemplate, preserveWhitespacesDefault, publishFacade, r3JitTypeSourceSpan, sanitizeIdentifier, splitNsName, visitAll$1 as tmplAstVisitAll, verifyHostBindings, visitAll };
31640
+ export { AST, ASTWithName, ASTWithSource, AbsoluteSourceSpan, ArrayType, ArrowFunctionExpr, AstMemoryEfficientTransformer, AstTransformer, Attribute, Binary, BinaryOperator, BinaryOperatorExpr, BindingPipe, BindingType, Block, BlockParameter, BoundElementProperty, BuiltinType, BuiltinTypeName, CUSTOM_ELEMENTS_SCHEMA, Call, Chain, ChangeDetectionStrategy, CommaExpr, Comment, CompilerConfig, Conditional, ConditionalExpr, ConstantPool, CssSelector, DEFAULT_INTERPOLATION_CONFIG, DYNAMIC_TYPE, DeclareFunctionStmt, DeclareVarStmt, DomElementSchemaRegistry, DynamicImportExpr, EOF, Element, ElementSchemaRegistry, EmitterVisitorContext, EmptyExpr$1 as EmptyExpr, Expansion, ExpansionCase, Expression, ExpressionBinding, ExpressionStatement, ExpressionType, ExternalExpr, ExternalReference, FactoryTarget$1 as FactoryTarget, FunctionExpr, HtmlParser, HtmlTagDefinition, I18NHtmlParser, IfStmt, ImplicitReceiver, InstantiateExpr, Interpolation$1 as Interpolation, InterpolationConfig, InvokeFunctionExpr, JSDocComment, JitEvaluator, KeyedRead, KeyedWrite, LeadingComment, LetDeclaration, Lexer, LiteralArray, LiteralArrayExpr, LiteralExpr, LiteralMap, LiteralMapExpr, LiteralPrimitive, LocalizedString, MapType, MessageBundle, NONE_TYPE, NO_ERRORS_SCHEMA, NodeWithI18n, NonNullAssert, NotExpr, ParseError, ParseErrorLevel, ParseLocation, ParseSourceFile, ParseSourceSpan, ParseSpan, ParseTreeResult, ParsedEvent, ParsedEventType, ParsedProperty, ParsedPropertyType, ParsedVariable, Parser$1 as Parser, ParserError, PrefixNot, PropertyRead, PropertyWrite, R3BoundTarget, Identifiers as R3Identifiers, R3NgModuleMetadataKind, R3SelectorScopeMode, R3TargetBinder, R3TemplateDependencyKind, ReadKeyExpr, ReadPropExpr, ReadVarExpr, RecursiveAstVisitor, RecursiveVisitor, ResourceLoader, ReturnStatement, STRING_TYPE, SafeCall, SafeKeyedRead, SafePropertyRead, SelectorContext, SelectorListContext, SelectorMatcher, Serializer, SplitInterpolation, Statement, StmtModifier, TagContentType, TaggedTemplateExpr, TemplateBindingParseResult, TemplateLiteral, TemplateLiteralElement, Text, ThisReceiver, BlockNode as TmplAstBlockNode, BoundAttribute as TmplAstBoundAttribute, BoundDeferredTrigger as TmplAstBoundDeferredTrigger, BoundEvent as TmplAstBoundEvent, BoundText as TmplAstBoundText, Content as TmplAstContent, DeferredBlock as TmplAstDeferredBlock, DeferredBlockError as TmplAstDeferredBlockError, DeferredBlockLoading as TmplAstDeferredBlockLoading, DeferredBlockPlaceholder as TmplAstDeferredBlockPlaceholder, DeferredTrigger as TmplAstDeferredTrigger, Element$1 as TmplAstElement, ForLoopBlock as TmplAstForLoopBlock, ForLoopBlockEmpty as TmplAstForLoopBlockEmpty, HoverDeferredTrigger as TmplAstHoverDeferredTrigger, Icu$1 as TmplAstIcu, IdleDeferredTrigger as TmplAstIdleDeferredTrigger, IfBlock as TmplAstIfBlock, IfBlockBranch as TmplAstIfBlockBranch, ImmediateDeferredTrigger as TmplAstImmediateDeferredTrigger, InteractionDeferredTrigger as TmplAstInteractionDeferredTrigger, LetDeclaration$1 as TmplAstLetDeclaration, RecursiveVisitor$1 as TmplAstRecursiveVisitor, Reference as TmplAstReference, SwitchBlock as TmplAstSwitchBlock, SwitchBlockCase as TmplAstSwitchBlockCase, Template as TmplAstTemplate, Text$3 as TmplAstText, TextAttribute as TmplAstTextAttribute, TimerDeferredTrigger as TmplAstTimerDeferredTrigger, UnknownBlock as TmplAstUnknownBlock, Variable as TmplAstVariable, ViewportDeferredTrigger as TmplAstViewportDeferredTrigger, Token, TokenType, TransplantedType, TreeError, Type, TypeModifier, TypeofExpr, Unary, UnaryOperator, UnaryOperatorExpr, VERSION, VariableBinding, Version, ViewEncapsulation, WrappedNodeExpr, WriteKeyExpr, WritePropExpr, WriteVarExpr, Xliff, Xliff2, Xmb, XmlParser, Xtb, compileClassDebugInfo, compileClassMetadata, compileComponentClassMetadata, compileComponentDeclareClassMetadata, compileComponentFromMetadata, compileDeclareClassMetadata, compileDeclareComponentFromMetadata, compileDeclareDirectiveFromMetadata, compileDeclareFactoryFunction, compileDeclareInjectableFromMetadata, compileDeclareInjectorFromMetadata, compileDeclareNgModuleFromMetadata, compileDeclarePipeFromMetadata, compileDeferResolverFunction, compileDirectiveFromMetadata, compileFactoryFunction, compileInjectable, compileInjector, compileNgModule, compileOpaqueAsyncClassMetadata, compilePipeFromMetadata, computeMsgId, core, createCssSelectorFromNode, createInjectableType, createMayBeForwardRefExpression, devOnlyGuardedExpression, emitDistinctChangesOnlyDefaultValue, encapsulateStyle, getHtmlTagDefinition, getNsPrefix, getSafePropertyAccessString, identifierName, isIdentifier, isNgContainer, isNgContent, isNgTemplate, jsDocComment, leadingComment, literal, literalMap, makeBindingParser, mergeNsAndName, output_ast as outputAst, parseHostBindings, parseTemplate, preserveWhitespacesDefault, publishFacade, r3JitTypeSourceSpan, sanitizeIdentifier, splitNsName, visitAll$1 as tmplAstVisitAll, verifyHostBindings, visitAll };
31435
31641
  //# sourceMappingURL=compiler.mjs.map