@angular/compiler 21.0.0-next.5 → 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.
- package/fesm2022/compiler.mjs +132 -151
- package/fesm2022/compiler.mjs.map +1 -1
- package/package.json +3 -3
- package/{index.d.ts → types/compiler.d.ts} +20 -40
package/fesm2022/compiler.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v21.0.0-next.
|
|
2
|
+
* @license Angular v21.0.0-next.6
|
|
3
3
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -6430,48 +6430,6 @@ function createFactoryFunction(type) {
|
|
|
6430
6430
|
return arrowFn([t], type.prop('ɵfac').callFn([variable(t.name)]));
|
|
6431
6431
|
}
|
|
6432
6432
|
|
|
6433
|
-
const UNUSABLE_INTERPOLATION_REGEXPS = [
|
|
6434
|
-
/@/, // control flow reserved symbol
|
|
6435
|
-
/^\s*$/, // empty
|
|
6436
|
-
/[<>]/, // html tag
|
|
6437
|
-
/^[{}]$/, // i18n expansion
|
|
6438
|
-
/&(#|[a-z])/i, // character reference,
|
|
6439
|
-
/^\/\//, // comment
|
|
6440
|
-
];
|
|
6441
|
-
function assertInterpolationSymbols(identifier, value) {
|
|
6442
|
-
if (value != null && !(Array.isArray(value) && value.length == 2)) {
|
|
6443
|
-
throw new Error(`Expected '${identifier}' to be an array, [start, end].`);
|
|
6444
|
-
}
|
|
6445
|
-
else if (value != null) {
|
|
6446
|
-
const start = value[0];
|
|
6447
|
-
const end = value[1];
|
|
6448
|
-
// Check for unusable interpolation symbols
|
|
6449
|
-
UNUSABLE_INTERPOLATION_REGEXPS.forEach((regexp) => {
|
|
6450
|
-
if (regexp.test(start) || regexp.test(end)) {
|
|
6451
|
-
throw new Error(`['${start}', '${end}'] contains unusable interpolation symbol.`);
|
|
6452
|
-
}
|
|
6453
|
-
});
|
|
6454
|
-
}
|
|
6455
|
-
}
|
|
6456
|
-
|
|
6457
|
-
class InterpolationConfig {
|
|
6458
|
-
start;
|
|
6459
|
-
end;
|
|
6460
|
-
static fromArray(markers) {
|
|
6461
|
-
if (!markers) {
|
|
6462
|
-
return DEFAULT_INTERPOLATION_CONFIG;
|
|
6463
|
-
}
|
|
6464
|
-
assertInterpolationSymbols('interpolation', markers);
|
|
6465
|
-
return new InterpolationConfig(markers[0], markers[1]);
|
|
6466
|
-
}
|
|
6467
|
-
constructor(start, end) {
|
|
6468
|
-
this.start = start;
|
|
6469
|
-
this.end = end;
|
|
6470
|
-
}
|
|
6471
|
-
}
|
|
6472
|
-
const DEFAULT_INTERPOLATION_CONFIG = new InterpolationConfig('{{', '}}');
|
|
6473
|
-
const DEFAULT_CONTAINER_BLOCKS = new Set(['switch']);
|
|
6474
|
-
|
|
6475
6433
|
const $EOF = 0;
|
|
6476
6434
|
const $BSPACE = 8;
|
|
6477
6435
|
const $TAB = 9;
|
|
@@ -16053,12 +16011,15 @@ const SUPPORTED_BLOCKS = [
|
|
|
16053
16011
|
'@loading',
|
|
16054
16012
|
'@error',
|
|
16055
16013
|
];
|
|
16014
|
+
const INTERPOLATION = {
|
|
16015
|
+
start: '{{',
|
|
16016
|
+
end: '}}',
|
|
16017
|
+
};
|
|
16056
16018
|
// See https://www.w3.org/TR/html51/syntax.html#writing-html-documents
|
|
16057
16019
|
class _Tokenizer {
|
|
16058
16020
|
_getTagDefinition;
|
|
16059
16021
|
_cursor;
|
|
16060
16022
|
_tokenizeIcu;
|
|
16061
|
-
_interpolationConfig;
|
|
16062
16023
|
_leadingTriviaCodePoints;
|
|
16063
16024
|
_currentTokenStart = null;
|
|
16064
16025
|
_currentTokenType = null;
|
|
@@ -16081,7 +16042,6 @@ class _Tokenizer {
|
|
|
16081
16042
|
constructor(_file, _getTagDefinition, options) {
|
|
16082
16043
|
this._getTagDefinition = _getTagDefinition;
|
|
16083
16044
|
this._tokenizeIcu = options.tokenizeExpansionForms || false;
|
|
16084
|
-
this._interpolationConfig = options.interpolationConfig || DEFAULT_INTERPOLATION_CONFIG;
|
|
16085
16045
|
this._leadingTriviaCodePoints =
|
|
16086
16046
|
options.leadingTriviaChars && options.leadingTriviaChars.map((c) => c.codePointAt(0) || 0);
|
|
16087
16047
|
const range = options.range || {
|
|
@@ -16912,7 +16872,7 @@ class _Tokenizer {
|
|
|
16912
16872
|
const parts = [];
|
|
16913
16873
|
while (!endPredicate()) {
|
|
16914
16874
|
const current = this._cursor.clone();
|
|
16915
|
-
if (this.
|
|
16875
|
+
if (this._attemptStr(INTERPOLATION.start)) {
|
|
16916
16876
|
this._endToken([this._processCarriageReturns(parts.join(''))], current);
|
|
16917
16877
|
parts.length = 0;
|
|
16918
16878
|
this._consumeInterpolation(interpolationTokenType, current, endInterpolation);
|
|
@@ -16944,7 +16904,7 @@ class _Tokenizer {
|
|
|
16944
16904
|
_consumeInterpolation(interpolationTokenType, interpolationStart, prematureEndPredicate) {
|
|
16945
16905
|
const parts = [];
|
|
16946
16906
|
this._beginToken(interpolationTokenType, interpolationStart);
|
|
16947
|
-
parts.push(
|
|
16907
|
+
parts.push(INTERPOLATION.start);
|
|
16948
16908
|
// Find the end of the interpolation, ignoring content inside quotes.
|
|
16949
16909
|
const expressionStart = this._cursor.clone();
|
|
16950
16910
|
let inQuote = null;
|
|
@@ -16962,10 +16922,10 @@ class _Tokenizer {
|
|
|
16962
16922
|
return;
|
|
16963
16923
|
}
|
|
16964
16924
|
if (inQuote === null) {
|
|
16965
|
-
if (this._attemptStr(
|
|
16925
|
+
if (this._attemptStr(INTERPOLATION.end)) {
|
|
16966
16926
|
// We are not in a string, and we hit the end interpolation marker
|
|
16967
16927
|
parts.push(this._getProcessedChars(expressionStart, current));
|
|
16968
|
-
parts.push(
|
|
16928
|
+
parts.push(INTERPOLATION.end);
|
|
16969
16929
|
this._endToken(parts);
|
|
16970
16930
|
return;
|
|
16971
16931
|
}
|
|
@@ -17104,13 +17064,10 @@ class _Tokenizer {
|
|
|
17104
17064
|
if (this._cursor.peek() !== $LBRACE) {
|
|
17105
17065
|
return false;
|
|
17106
17066
|
}
|
|
17107
|
-
|
|
17108
|
-
|
|
17109
|
-
|
|
17110
|
-
|
|
17111
|
-
return !isInterpolation;
|
|
17112
|
-
}
|
|
17113
|
-
return true;
|
|
17067
|
+
const start = this._cursor.clone();
|
|
17068
|
+
const isInterpolation = this._attemptStr(INTERPOLATION.start);
|
|
17069
|
+
this._cursor = start;
|
|
17070
|
+
return !isInterpolation;
|
|
17114
17071
|
}
|
|
17115
17072
|
}
|
|
17116
17073
|
function isNotWhitespace(code) {
|
|
@@ -18430,9 +18387,6 @@ class Token {
|
|
|
18430
18387
|
isTemplateLiteralInterpolationStart() {
|
|
18431
18388
|
return this.isOperator('${');
|
|
18432
18389
|
}
|
|
18433
|
-
isTemplateLiteralInterpolationEnd() {
|
|
18434
|
-
return this.isOperator('}');
|
|
18435
|
-
}
|
|
18436
18390
|
toString() {
|
|
18437
18391
|
switch (this.type) {
|
|
18438
18392
|
case TokenType.Character:
|
|
@@ -18615,7 +18569,7 @@ class _Scanner {
|
|
|
18615
18569
|
this.advance();
|
|
18616
18570
|
const currentBrace = this.braceStack.pop();
|
|
18617
18571
|
if (currentBrace === 'interpolation') {
|
|
18618
|
-
this.tokens.push(
|
|
18572
|
+
this.tokens.push(newCharacterToken(start, this.index, $RBRACE));
|
|
18619
18573
|
return this.scanTemplateLiteralPart(this.index);
|
|
18620
18574
|
}
|
|
18621
18575
|
return newCharacterToken(start, this.index, code);
|
|
@@ -18979,17 +18933,17 @@ class Parser {
|
|
|
18979
18933
|
this._lexer = _lexer;
|
|
18980
18934
|
this._supportsDirectPipeReferences = _supportsDirectPipeReferences;
|
|
18981
18935
|
}
|
|
18982
|
-
parseAction(input, parseSourceSpan, absoluteOffset
|
|
18936
|
+
parseAction(input, parseSourceSpan, absoluteOffset) {
|
|
18983
18937
|
const errors = [];
|
|
18984
|
-
this._checkNoInterpolation(errors, input, parseSourceSpan
|
|
18938
|
+
this._checkNoInterpolation(errors, input, parseSourceSpan);
|
|
18985
18939
|
const { stripped: sourceToLex } = this._stripComments(input);
|
|
18986
18940
|
const tokens = this._lexer.tokenize(sourceToLex);
|
|
18987
18941
|
const ast = new _ParseAST(input, parseSourceSpan, absoluteOffset, tokens, 1 /* ParseFlags.Action */, errors, 0, this._supportsDirectPipeReferences).parseChain();
|
|
18988
18942
|
return new ASTWithSource(ast, input, getLocation(parseSourceSpan), absoluteOffset, errors);
|
|
18989
18943
|
}
|
|
18990
|
-
parseBinding(input, parseSourceSpan, absoluteOffset
|
|
18944
|
+
parseBinding(input, parseSourceSpan, absoluteOffset) {
|
|
18991
18945
|
const errors = [];
|
|
18992
|
-
const ast = this._parseBindingAst(input, parseSourceSpan, absoluteOffset,
|
|
18946
|
+
const ast = this._parseBindingAst(input, parseSourceSpan, absoluteOffset, errors);
|
|
18993
18947
|
return new ASTWithSource(ast, input, getLocation(parseSourceSpan), absoluteOffset, errors);
|
|
18994
18948
|
}
|
|
18995
18949
|
checkSimpleExpression(ast) {
|
|
@@ -18998,17 +18952,17 @@ class Parser {
|
|
|
18998
18952
|
return checker.errors;
|
|
18999
18953
|
}
|
|
19000
18954
|
// Host bindings parsed here
|
|
19001
|
-
parseSimpleBinding(input, parseSourceSpan, absoluteOffset
|
|
18955
|
+
parseSimpleBinding(input, parseSourceSpan, absoluteOffset) {
|
|
19002
18956
|
const errors = [];
|
|
19003
|
-
const ast = this._parseBindingAst(input, parseSourceSpan, absoluteOffset,
|
|
18957
|
+
const ast = this._parseBindingAst(input, parseSourceSpan, absoluteOffset, errors);
|
|
19004
18958
|
const simplExpressionErrors = this.checkSimpleExpression(ast);
|
|
19005
18959
|
if (simplExpressionErrors.length > 0) {
|
|
19006
18960
|
errors.push(getParseError(`Host binding expression cannot contain ${simplExpressionErrors.join(' ')}`, input, '', parseSourceSpan));
|
|
19007
18961
|
}
|
|
19008
18962
|
return new ASTWithSource(ast, input, getLocation(parseSourceSpan), absoluteOffset, errors);
|
|
19009
18963
|
}
|
|
19010
|
-
_parseBindingAst(input, parseSourceSpan, absoluteOffset,
|
|
19011
|
-
this._checkNoInterpolation(errors, input, parseSourceSpan
|
|
18964
|
+
_parseBindingAst(input, parseSourceSpan, absoluteOffset, errors) {
|
|
18965
|
+
this._checkNoInterpolation(errors, input, parseSourceSpan);
|
|
19012
18966
|
const { stripped: sourceToLex } = this._stripComments(input);
|
|
19013
18967
|
const tokens = this._lexer.tokenize(sourceToLex);
|
|
19014
18968
|
return new _ParseAST(input, parseSourceSpan, absoluteOffset, tokens, 0 /* ParseFlags.None */, errors, 0, this._supportsDirectPipeReferences).parseChain();
|
|
@@ -19048,9 +19002,9 @@ class Parser {
|
|
|
19048
19002
|
span: new AbsoluteSourceSpan(absoluteKeyOffset, absoluteKeyOffset + templateKey.length),
|
|
19049
19003
|
});
|
|
19050
19004
|
}
|
|
19051
|
-
parseInterpolation(input, parseSourceSpan, absoluteOffset, interpolatedTokens
|
|
19005
|
+
parseInterpolation(input, parseSourceSpan, absoluteOffset, interpolatedTokens) {
|
|
19052
19006
|
const errors = [];
|
|
19053
|
-
const { strings, expressions, offsets } = this.splitInterpolation(input, parseSourceSpan, errors, interpolatedTokens
|
|
19007
|
+
const { strings, expressions, offsets } = this.splitInterpolation(input, parseSourceSpan, errors, interpolatedTokens);
|
|
19054
19008
|
if (expressions.length === 0)
|
|
19055
19009
|
return null;
|
|
19056
19010
|
const expressionNodes = [];
|
|
@@ -19097,7 +19051,7 @@ class Parser {
|
|
|
19097
19051
|
* `SplitInterpolation` with splits that look like
|
|
19098
19052
|
* <raw text> <expression> <raw text> ... <raw text> <expression> <raw text>
|
|
19099
19053
|
*/
|
|
19100
|
-
splitInterpolation(input, parseSourceSpan, errors, interpolatedTokens
|
|
19054
|
+
splitInterpolation(input, parseSourceSpan, errors, interpolatedTokens) {
|
|
19101
19055
|
const strings = [];
|
|
19102
19056
|
const expressions = [];
|
|
19103
19057
|
const offsets = [];
|
|
@@ -19107,7 +19061,8 @@ class Parser {
|
|
|
19107
19061
|
let i = 0;
|
|
19108
19062
|
let atInterpolation = false;
|
|
19109
19063
|
let extendLastString = false;
|
|
19110
|
-
|
|
19064
|
+
const interpStart = '{{';
|
|
19065
|
+
const interpEnd = '}}';
|
|
19111
19066
|
while (i < input.length) {
|
|
19112
19067
|
if (!atInterpolation) {
|
|
19113
19068
|
// parse until starting {{
|
|
@@ -19186,24 +19141,24 @@ class Parser {
|
|
|
19186
19141
|
}
|
|
19187
19142
|
return null;
|
|
19188
19143
|
}
|
|
19189
|
-
_checkNoInterpolation(errors, input, parseSourceSpan
|
|
19144
|
+
_checkNoInterpolation(errors, input, parseSourceSpan) {
|
|
19190
19145
|
let startIndex = -1;
|
|
19191
19146
|
let endIndex = -1;
|
|
19192
19147
|
for (const charIndex of this._forEachUnquotedChar(input, 0)) {
|
|
19193
19148
|
if (startIndex === -1) {
|
|
19194
|
-
if (input.startsWith(
|
|
19149
|
+
if (input.startsWith('{{')) {
|
|
19195
19150
|
startIndex = charIndex;
|
|
19196
19151
|
}
|
|
19197
19152
|
}
|
|
19198
19153
|
else {
|
|
19199
|
-
endIndex = this._getInterpolationEndIndex(input,
|
|
19154
|
+
endIndex = this._getInterpolationEndIndex(input, '}}', charIndex);
|
|
19200
19155
|
if (endIndex > -1) {
|
|
19201
19156
|
break;
|
|
19202
19157
|
}
|
|
19203
19158
|
}
|
|
19204
19159
|
}
|
|
19205
19160
|
if (startIndex > -1 && endIndex > -1) {
|
|
19206
|
-
errors.push(getParseError(`Got interpolation (
|
|
19161
|
+
errors.push(getParseError(`Got interpolation ({{}}) where expression was expected`, input, `at column ${startIndex} in`, parseSourceSpan));
|
|
19207
19162
|
}
|
|
19208
19163
|
}
|
|
19209
19164
|
/**
|
|
@@ -20189,6 +20144,7 @@ class _ParseAST {
|
|
|
20189
20144
|
}
|
|
20190
20145
|
else if (token.isTemplateLiteralInterpolationStart()) {
|
|
20191
20146
|
this.advance();
|
|
20147
|
+
this.rbracesExpected++;
|
|
20192
20148
|
const expression = this.parsePipe();
|
|
20193
20149
|
if (expression instanceof EmptyExpr$1) {
|
|
20194
20150
|
this.error('Template literal interpolation cannot be empty');
|
|
@@ -20196,6 +20152,7 @@ class _ParseAST {
|
|
|
20196
20152
|
else {
|
|
20197
20153
|
expressions.push(expression);
|
|
20198
20154
|
}
|
|
20155
|
+
this.rbracesExpected--;
|
|
20199
20156
|
}
|
|
20200
20157
|
else {
|
|
20201
20158
|
this.advance();
|
|
@@ -21369,10 +21326,10 @@ class PlaceholderRegistry {
|
|
|
21369
21326
|
|
|
21370
21327
|
const _expParser = new Parser(new Lexer());
|
|
21371
21328
|
/**
|
|
21372
|
-
* Returns a function converting html nodes to an i18n Message
|
|
21329
|
+
* Returns a function converting html nodes to an i18n Message
|
|
21373
21330
|
*/
|
|
21374
|
-
function createI18nMessageFactory(
|
|
21375
|
-
const visitor = new _I18nVisitor(_expParser,
|
|
21331
|
+
function createI18nMessageFactory(containerBlocks, retainEmptyTokens, preserveExpressionWhitespace) {
|
|
21332
|
+
const visitor = new _I18nVisitor(_expParser, containerBlocks, retainEmptyTokens, preserveExpressionWhitespace);
|
|
21376
21333
|
return (nodes, meaning, description, customId, visitNodeFn) => visitor.toI18nMessage(nodes, meaning, description, customId, visitNodeFn);
|
|
21377
21334
|
}
|
|
21378
21335
|
function noopVisitNodeFn(_html, i18n) {
|
|
@@ -21380,13 +21337,11 @@ function noopVisitNodeFn(_html, i18n) {
|
|
|
21380
21337
|
}
|
|
21381
21338
|
class _I18nVisitor {
|
|
21382
21339
|
_expressionParser;
|
|
21383
|
-
_interpolationConfig;
|
|
21384
21340
|
_containerBlocks;
|
|
21385
21341
|
_retainEmptyTokens;
|
|
21386
21342
|
_preserveExpressionWhitespace;
|
|
21387
|
-
constructor(_expressionParser,
|
|
21343
|
+
constructor(_expressionParser, _containerBlocks, _retainEmptyTokens, _preserveExpressionWhitespace) {
|
|
21388
21344
|
this._expressionParser = _expressionParser;
|
|
21389
|
-
this._interpolationConfig = _interpolationConfig;
|
|
21390
21345
|
this._containerBlocks = _containerBlocks;
|
|
21391
21346
|
this._retainEmptyTokens = _retainEmptyTokens;
|
|
21392
21347
|
this._preserveExpressionWhitespace = _preserveExpressionWhitespace;
|
|
@@ -21608,7 +21563,7 @@ class _I18nVisitor {
|
|
|
21608
21563
|
const expression = token.parts[1];
|
|
21609
21564
|
const expr = this._expressionParser.parseBinding(expression,
|
|
21610
21565
|
/* location */ token.sourceSpan,
|
|
21611
|
-
/* absoluteOffset */ token.sourceSpan.start.offset
|
|
21566
|
+
/* absoluteOffset */ token.sourceSpan.start.offset);
|
|
21612
21567
|
return serialize(expr);
|
|
21613
21568
|
}
|
|
21614
21569
|
}
|
|
@@ -21673,6 +21628,51 @@ function extractPlaceholderName(input) {
|
|
|
21673
21628
|
return input.split(_CUSTOM_PH_EXP)[2];
|
|
21674
21629
|
}
|
|
21675
21630
|
|
|
21631
|
+
const UNUSABLE_INTERPOLATION_REGEXPS = [
|
|
21632
|
+
/@/, // control flow reserved symbol
|
|
21633
|
+
/^\s*$/, // empty
|
|
21634
|
+
/[<>]/, // html tag
|
|
21635
|
+
/^[{}]$/, // i18n expansion
|
|
21636
|
+
/&(#|[a-z])/i, // character reference,
|
|
21637
|
+
/^\/\//, // comment
|
|
21638
|
+
];
|
|
21639
|
+
function assertInterpolationSymbols(identifier, value) {
|
|
21640
|
+
if (value != null && !(Array.isArray(value) && value.length == 2)) {
|
|
21641
|
+
throw new Error(`Expected '${identifier}' to be an array, [start, end].`);
|
|
21642
|
+
}
|
|
21643
|
+
else if (value != null) {
|
|
21644
|
+
const start = value[0];
|
|
21645
|
+
const end = value[1];
|
|
21646
|
+
// Check for unusable interpolation symbols
|
|
21647
|
+
UNUSABLE_INTERPOLATION_REGEXPS.forEach((regexp) => {
|
|
21648
|
+
if (regexp.test(start) || regexp.test(end)) {
|
|
21649
|
+
throw new Error(`['${start}', '${end}'] contains unusable interpolation symbol.`);
|
|
21650
|
+
}
|
|
21651
|
+
});
|
|
21652
|
+
}
|
|
21653
|
+
}
|
|
21654
|
+
|
|
21655
|
+
class InterpolationConfig {
|
|
21656
|
+
start;
|
|
21657
|
+
end;
|
|
21658
|
+
static fromArray(markers) {
|
|
21659
|
+
if (!markers) {
|
|
21660
|
+
return DEFAULT_INTERPOLATION_CONFIG;
|
|
21661
|
+
}
|
|
21662
|
+
assertInterpolationSymbols('interpolation', markers);
|
|
21663
|
+
return new InterpolationConfig(markers[0], markers[1]);
|
|
21664
|
+
}
|
|
21665
|
+
constructor(start, end) {
|
|
21666
|
+
this.start = start;
|
|
21667
|
+
this.end = end;
|
|
21668
|
+
}
|
|
21669
|
+
}
|
|
21670
|
+
/**
|
|
21671
|
+
* This symbol is referenced inside G3 and will require some cleanup.
|
|
21672
|
+
*/
|
|
21673
|
+
const DEFAULT_INTERPOLATION_CONFIG = new InterpolationConfig('{{', '}}');
|
|
21674
|
+
const DEFAULT_CONTAINER_BLOCKS = new Set(['switch']);
|
|
21675
|
+
|
|
21676
21676
|
/**
|
|
21677
21677
|
* Set of tagName|propertyName corresponding to Trusted Types sinks. Properties applying to all
|
|
21678
21678
|
* tags use '*'.
|
|
@@ -21734,7 +21734,6 @@ const setI18nRefs = (originalNodeMap) => {
|
|
|
21734
21734
|
* stored with other element's and attribute's information.
|
|
21735
21735
|
*/
|
|
21736
21736
|
class I18nMetaVisitor {
|
|
21737
|
-
interpolationConfig;
|
|
21738
21737
|
keepI18nAttrs;
|
|
21739
21738
|
enableI18nLegacyMessageIdFormat;
|
|
21740
21739
|
containerBlocks;
|
|
@@ -21743,7 +21742,7 @@ class I18nMetaVisitor {
|
|
|
21743
21742
|
// whether visited nodes contain i18n information
|
|
21744
21743
|
hasI18nMeta = false;
|
|
21745
21744
|
_errors = [];
|
|
21746
|
-
constructor(
|
|
21745
|
+
constructor(keepI18nAttrs = false, enableI18nLegacyMessageIdFormat = false, containerBlocks = DEFAULT_CONTAINER_BLOCKS, preserveSignificantWhitespace = true,
|
|
21747
21746
|
// When dropping significant whitespace we need to retain empty tokens or
|
|
21748
21747
|
// else we won't be able to reuse source spans because empty tokens would be
|
|
21749
21748
|
// removed and cause a mismatch. Unfortunately this still needs to be
|
|
@@ -21751,7 +21750,6 @@ class I18nMetaVisitor {
|
|
|
21751
21750
|
// sure the number of nodes don't change between parses, even when
|
|
21752
21751
|
// `preserveSignificantWhitespace` changes.
|
|
21753
21752
|
retainEmptyTokens = !preserveSignificantWhitespace) {
|
|
21754
|
-
this.interpolationConfig = interpolationConfig;
|
|
21755
21753
|
this.keepI18nAttrs = keepI18nAttrs;
|
|
21756
21754
|
this.enableI18nLegacyMessageIdFormat = enableI18nLegacyMessageIdFormat;
|
|
21757
21755
|
this.containerBlocks = containerBlocks;
|
|
@@ -21760,7 +21758,7 @@ class I18nMetaVisitor {
|
|
|
21760
21758
|
}
|
|
21761
21759
|
_generateI18nMessage(nodes, meta = '', visitNodeFn) {
|
|
21762
21760
|
const { meaning, description, customId } = this._parseMetadata(meta);
|
|
21763
|
-
const createI18nMessage = createI18nMessageFactory(this.
|
|
21761
|
+
const createI18nMessage = createI18nMessageFactory(this.containerBlocks, this.retainEmptyTokens,
|
|
21764
21762
|
/* preserveExpressionWhitespace */ this.preserveSignificantWhitespace);
|
|
21765
21763
|
const message = createI18nMessage(nodes, meaning, description, customId, visitNodeFn);
|
|
21766
21764
|
this._setMessageId(message, meta);
|
|
@@ -28087,18 +28085,13 @@ const LEGACY_ANIMATE_PROP_PREFIX = 'animate-';
|
|
|
28087
28085
|
*/
|
|
28088
28086
|
class BindingParser {
|
|
28089
28087
|
_exprParser;
|
|
28090
|
-
_interpolationConfig;
|
|
28091
28088
|
_schemaRegistry;
|
|
28092
28089
|
errors;
|
|
28093
|
-
constructor(_exprParser,
|
|
28090
|
+
constructor(_exprParser, _schemaRegistry, errors) {
|
|
28094
28091
|
this._exprParser = _exprParser;
|
|
28095
|
-
this._interpolationConfig = _interpolationConfig;
|
|
28096
28092
|
this._schemaRegistry = _schemaRegistry;
|
|
28097
28093
|
this.errors = errors;
|
|
28098
28094
|
}
|
|
28099
|
-
get interpolationConfig() {
|
|
28100
|
-
return this._interpolationConfig;
|
|
28101
|
-
}
|
|
28102
28095
|
createBoundHostProperties(properties, sourceSpan) {
|
|
28103
28096
|
const boundProps = [];
|
|
28104
28097
|
for (const propName of Object.keys(properties)) {
|
|
@@ -28142,7 +28135,7 @@ class BindingParser {
|
|
|
28142
28135
|
parseInterpolation(value, sourceSpan, interpolatedTokens) {
|
|
28143
28136
|
const absoluteOffset = sourceSpan.fullStart.offset;
|
|
28144
28137
|
try {
|
|
28145
|
-
const ast = this._exprParser.parseInterpolation(value, sourceSpan, absoluteOffset, interpolatedTokens
|
|
28138
|
+
const ast = this._exprParser.parseInterpolation(value, sourceSpan, absoluteOffset, interpolatedTokens);
|
|
28146
28139
|
if (ast) {
|
|
28147
28140
|
this.errors.push(...ast.errors);
|
|
28148
28141
|
}
|
|
@@ -28314,8 +28307,8 @@ class BindingParser {
|
|
|
28314
28307
|
parseBinding(value, isHostBinding, sourceSpan, absoluteOffset) {
|
|
28315
28308
|
try {
|
|
28316
28309
|
const ast = isHostBinding
|
|
28317
|
-
? this._exprParser.parseSimpleBinding(value, sourceSpan, absoluteOffset
|
|
28318
|
-
: this._exprParser.parseBinding(value, sourceSpan, absoluteOffset
|
|
28310
|
+
? this._exprParser.parseSimpleBinding(value, sourceSpan, absoluteOffset)
|
|
28311
|
+
: this._exprParser.parseBinding(value, sourceSpan, absoluteOffset);
|
|
28319
28312
|
if (ast) {
|
|
28320
28313
|
this.errors.push(...ast.errors);
|
|
28321
28314
|
}
|
|
@@ -28450,7 +28443,7 @@ class BindingParser {
|
|
|
28450
28443
|
_parseAction(value, sourceSpan) {
|
|
28451
28444
|
const absoluteOffset = sourceSpan && sourceSpan.start ? sourceSpan.start.offset : 0;
|
|
28452
28445
|
try {
|
|
28453
|
-
const ast = this._exprParser.parseAction(value, sourceSpan, absoluteOffset
|
|
28446
|
+
const ast = this._exprParser.parseAction(value, sourceSpan, absoluteOffset);
|
|
28454
28447
|
if (ast) {
|
|
28455
28448
|
this.errors.push(...ast.errors);
|
|
28456
28449
|
}
|
|
@@ -29716,6 +29709,13 @@ class HtmlAstToIvyAst {
|
|
|
29716
29709
|
}
|
|
29717
29710
|
else {
|
|
29718
29711
|
const attrs = this.categorizePropertyAttributes(element.name, parsedProperties, i18nAttrsMeta);
|
|
29712
|
+
if (element.name === 'ng-container') {
|
|
29713
|
+
for (const bound of attrs.bound) {
|
|
29714
|
+
if (bound.type === BindingType.Attribute) {
|
|
29715
|
+
this.reportError(`Attribute bindings are not supported on ng-container. Use property bindings instead.`, bound.sourceSpan);
|
|
29716
|
+
}
|
|
29717
|
+
}
|
|
29718
|
+
}
|
|
29719
29719
|
parsedElement = new Element$1(element.name, attributes, attrs.bound, boundEvents, directives, children, references, element.isSelfClosing, element.sourceSpan, element.startSourceSpan, element.endSourceSpan, element.isVoid, element.i18n);
|
|
29720
29720
|
}
|
|
29721
29721
|
if (elementHasInlineTemplate) {
|
|
@@ -30300,9 +30300,9 @@ const LEADING_TRIVIA_CHARS = [' ', '\n', '\r', '\t'];
|
|
|
30300
30300
|
* @param options options to modify how the template is parsed
|
|
30301
30301
|
*/
|
|
30302
30302
|
function parseTemplate(template, templateUrl, options = {}) {
|
|
30303
|
-
const {
|
|
30303
|
+
const { preserveWhitespaces, enableI18nLegacyMessageIdFormat } = options;
|
|
30304
30304
|
const selectorlessEnabled = options.enableSelectorless ?? false;
|
|
30305
|
-
const bindingParser = makeBindingParser(
|
|
30305
|
+
const bindingParser = makeBindingParser(selectorlessEnabled);
|
|
30306
30306
|
const htmlParser = new HtmlParser();
|
|
30307
30307
|
const parseResult = htmlParser.parse(template, templateUrl, {
|
|
30308
30308
|
leadingTriviaChars: LEADING_TRIVIA_CHARS,
|
|
@@ -30316,7 +30316,6 @@ function parseTemplate(template, templateUrl, options = {}) {
|
|
|
30316
30316
|
parseResult.errors &&
|
|
30317
30317
|
parseResult.errors.length > 0) {
|
|
30318
30318
|
const parsedTemplate = {
|
|
30319
|
-
interpolationConfig,
|
|
30320
30319
|
preserveWhitespaces,
|
|
30321
30320
|
errors: parseResult.errors,
|
|
30322
30321
|
nodes: [],
|
|
@@ -30339,7 +30338,7 @@ function parseTemplate(template, templateUrl, options = {}) {
|
|
|
30339
30338
|
// before we run whitespace removal process, because existing i18n
|
|
30340
30339
|
// extraction process (ng extract-i18n) relies on a raw content to generate
|
|
30341
30340
|
// message ids
|
|
30342
|
-
const i18nMetaVisitor = new I18nMetaVisitor(
|
|
30341
|
+
const i18nMetaVisitor = new I18nMetaVisitor(
|
|
30343
30342
|
/* keepI18nAttrs */ !preserveWhitespaces, enableI18nLegacyMessageIdFormat,
|
|
30344
30343
|
/* containerBlocks */ undefined, options.preserveSignificantWhitespace, retainEmptyTokens);
|
|
30345
30344
|
const i18nMetaResult = i18nMetaVisitor.visitAllWithErrors(rootNodes);
|
|
@@ -30347,7 +30346,6 @@ function parseTemplate(template, templateUrl, options = {}) {
|
|
|
30347
30346
|
i18nMetaResult.errors &&
|
|
30348
30347
|
i18nMetaResult.errors.length > 0) {
|
|
30349
30348
|
const parsedTemplate = {
|
|
30350
|
-
interpolationConfig,
|
|
30351
30349
|
preserveWhitespaces,
|
|
30352
30350
|
errors: i18nMetaResult.errors,
|
|
30353
30351
|
nodes: [],
|
|
@@ -30382,7 +30380,7 @@ function parseTemplate(template, templateUrl, options = {}) {
|
|
|
30382
30380
|
// template. During this pass i18n IDs generated at the first pass will be preserved, so we can
|
|
30383
30381
|
// mimic existing extraction process (ng extract-i18n)
|
|
30384
30382
|
if (i18nMetaVisitor.hasI18nMeta) {
|
|
30385
|
-
rootNodes = visitAll(new I18nMetaVisitor(
|
|
30383
|
+
rootNodes = visitAll(new I18nMetaVisitor(
|
|
30386
30384
|
/* keepI18nAttrs */ false,
|
|
30387
30385
|
/* enableI18nLegacyMessageIdFormat */ undefined,
|
|
30388
30386
|
/* containerBlocks */ undefined,
|
|
@@ -30392,7 +30390,6 @@ function parseTemplate(template, templateUrl, options = {}) {
|
|
|
30392
30390
|
const { nodes, errors, styleUrls, styles, ngContentSelectors, commentNodes } = htmlAstToRender3Ast(rootNodes, bindingParser, { collectCommentNodes: !!options.collectCommentNodes });
|
|
30393
30391
|
errors.push(...parseResult.errors, ...i18nMetaResult.errors);
|
|
30394
30392
|
const parsedTemplate = {
|
|
30395
|
-
interpolationConfig,
|
|
30396
30393
|
preserveWhitespaces,
|
|
30397
30394
|
errors: errors.length > 0 ? errors : null,
|
|
30398
30395
|
nodes,
|
|
@@ -30409,8 +30406,8 @@ const elementRegistry = new DomElementSchemaRegistry();
|
|
|
30409
30406
|
/**
|
|
30410
30407
|
* Construct a `BindingParser` with a default configuration.
|
|
30411
30408
|
*/
|
|
30412
|
-
function makeBindingParser(
|
|
30413
|
-
return new BindingParser(new Parser(new Lexer(), selectorlessEnabled),
|
|
30409
|
+
function makeBindingParser(selectorlessEnabled = false) {
|
|
30410
|
+
return new BindingParser(new Parser(new Lexer(), selectorlessEnabled), elementRegistry, []);
|
|
30414
30411
|
}
|
|
30415
30412
|
|
|
30416
30413
|
const COMPONENT_VARIABLE = '%COMP%';
|
|
@@ -32132,7 +32129,7 @@ class CompilerFacadeImpl {
|
|
|
32132
32129
|
}
|
|
32133
32130
|
compileComponent(angularCoreEnv, sourceMapUrl, facade) {
|
|
32134
32131
|
// Parse the template and check for errors.
|
|
32135
|
-
const { template,
|
|
32132
|
+
const { template, defer } = parseJitTemplate(facade.template, facade.name, sourceMapUrl, facade.preserveWhitespaces, undefined);
|
|
32136
32133
|
// Compile the component metadata, including template, into an expression.
|
|
32137
32134
|
const meta = {
|
|
32138
32135
|
...facade,
|
|
@@ -32144,7 +32141,6 @@ class CompilerFacadeImpl {
|
|
|
32144
32141
|
defer,
|
|
32145
32142
|
styles: [...facade.styles, ...template.styles],
|
|
32146
32143
|
encapsulation: facade.encapsulation,
|
|
32147
|
-
interpolation,
|
|
32148
32144
|
changeDetection: facade.changeDetection ?? null,
|
|
32149
32145
|
animations: facade.animations != null ? new WrappedNodeExpr(facade.animations) : null,
|
|
32150
32146
|
viewProviders: facade.viewProviders != null ? new WrappedNodeExpr(facade.viewProviders) : null,
|
|
@@ -32162,7 +32158,7 @@ class CompilerFacadeImpl {
|
|
|
32162
32158
|
}
|
|
32163
32159
|
compileComponentFromMeta(angularCoreEnv, sourceMapUrl, meta) {
|
|
32164
32160
|
const constantPool = new ConstantPool();
|
|
32165
|
-
const bindingParser = makeBindingParser(
|
|
32161
|
+
const bindingParser = makeBindingParser();
|
|
32166
32162
|
const res = compileComponentFromMetadata(meta, constantPool, bindingParser);
|
|
32167
32163
|
return this.jitExpression(res.expression, angularCoreEnv, sourceMapUrl, constantPool.statements);
|
|
32168
32164
|
}
|
|
@@ -32368,7 +32364,7 @@ function convertOpaqueValuesToExpressions(obj) {
|
|
|
32368
32364
|
return result;
|
|
32369
32365
|
}
|
|
32370
32366
|
function convertDeclareComponentFacadeToMetadata(decl, typeSourceSpan, sourceMapUrl) {
|
|
32371
|
-
const { template,
|
|
32367
|
+
const { template, defer } = parseJitTemplate(decl.template, decl.type.name, sourceMapUrl, decl.preserveWhitespaces ?? false, decl.deferBlockDependencies);
|
|
32372
32368
|
const declarations = [];
|
|
32373
32369
|
if (decl.dependencies) {
|
|
32374
32370
|
for (const innerDep of decl.dependencies) {
|
|
@@ -32403,7 +32399,6 @@ function convertDeclareComponentFacadeToMetadata(decl, typeSourceSpan, sourceMap
|
|
|
32403
32399
|
defer,
|
|
32404
32400
|
changeDetection: decl.changeDetection ?? ChangeDetectionStrategy.Default,
|
|
32405
32401
|
encapsulation: decl.encapsulation ?? ViewEncapsulation$1.Emulated,
|
|
32406
|
-
interpolation,
|
|
32407
32402
|
declarationListEmitMode: 2 /* DeclarationListEmitMode.ClosureResolved */,
|
|
32408
32403
|
relativeContextFilePath: '',
|
|
32409
32404
|
i18nUseExternalIds: true,
|
|
@@ -32447,15 +32442,9 @@ function convertPipeDeclarationToMetadata(pipe) {
|
|
|
32447
32442
|
type: new WrappedNodeExpr(pipe.type),
|
|
32448
32443
|
};
|
|
32449
32444
|
}
|
|
32450
|
-
function parseJitTemplate(template, typeName, sourceMapUrl, preserveWhitespaces,
|
|
32451
|
-
const interpolationConfig = interpolation
|
|
32452
|
-
? InterpolationConfig.fromArray(interpolation)
|
|
32453
|
-
: DEFAULT_INTERPOLATION_CONFIG;
|
|
32445
|
+
function parseJitTemplate(template, typeName, sourceMapUrl, preserveWhitespaces, deferBlockDependencies) {
|
|
32454
32446
|
// Parse the template and check for errors.
|
|
32455
|
-
const parsed = parseTemplate(template, sourceMapUrl, {
|
|
32456
|
-
preserveWhitespaces,
|
|
32457
|
-
interpolationConfig,
|
|
32458
|
-
});
|
|
32447
|
+
const parsed = parseTemplate(template, sourceMapUrl, { preserveWhitespaces });
|
|
32459
32448
|
if (parsed.errors !== null) {
|
|
32460
32449
|
const errors = parsed.errors.map((err) => err.toString()).join(', ');
|
|
32461
32450
|
throw new Error(`Errors during JIT compilation of template for ${typeName}: ${errors}`);
|
|
@@ -32464,7 +32453,6 @@ function parseJitTemplate(template, typeName, sourceMapUrl, preserveWhitespaces,
|
|
|
32464
32453
|
const boundTarget = binder.bind({ template: parsed.nodes });
|
|
32465
32454
|
return {
|
|
32466
32455
|
template: parsed,
|
|
32467
|
-
interpolation: interpolationConfig,
|
|
32468
32456
|
defer: createR3ComponentDeferMetadata(boundTarget, deferBlockDependencies),
|
|
32469
32457
|
};
|
|
32470
32458
|
}
|
|
@@ -32702,13 +32690,13 @@ let i18nCommentsWarned = false;
|
|
|
32702
32690
|
/**
|
|
32703
32691
|
* Extract translatable messages from an html AST
|
|
32704
32692
|
*/
|
|
32705
|
-
function extractMessages(nodes,
|
|
32693
|
+
function extractMessages(nodes, implicitTags, implicitAttrs, preserveSignificantWhitespace) {
|
|
32706
32694
|
const visitor = new _Visitor(implicitTags, implicitAttrs, preserveSignificantWhitespace);
|
|
32707
|
-
return visitor.extract(nodes
|
|
32695
|
+
return visitor.extract(nodes);
|
|
32708
32696
|
}
|
|
32709
|
-
function mergeTranslations(nodes, translations,
|
|
32697
|
+
function mergeTranslations(nodes, translations, implicitTags, implicitAttrs) {
|
|
32710
32698
|
const visitor = new _Visitor(implicitTags, implicitAttrs);
|
|
32711
|
-
return visitor.merge(nodes, translations
|
|
32699
|
+
return visitor.merge(nodes, translations);
|
|
32712
32700
|
}
|
|
32713
32701
|
class ExtractionResult {
|
|
32714
32702
|
messages;
|
|
@@ -32763,8 +32751,8 @@ class _Visitor {
|
|
|
32763
32751
|
/**
|
|
32764
32752
|
* Extracts the messages from the tree
|
|
32765
32753
|
*/
|
|
32766
|
-
extract(nodes
|
|
32767
|
-
this._init(_VisitorMode.Extract
|
|
32754
|
+
extract(nodes) {
|
|
32755
|
+
this._init(_VisitorMode.Extract);
|
|
32768
32756
|
nodes.forEach((node) => node.visit(this, null));
|
|
32769
32757
|
if (this._inI18nBlock) {
|
|
32770
32758
|
this._reportError(nodes[nodes.length - 1], 'Unclosed block');
|
|
@@ -32774,8 +32762,8 @@ class _Visitor {
|
|
|
32774
32762
|
/**
|
|
32775
32763
|
* Returns a tree where all translatable nodes are translated
|
|
32776
32764
|
*/
|
|
32777
|
-
merge(nodes, translations
|
|
32778
|
-
this._init(_VisitorMode.Merge
|
|
32765
|
+
merge(nodes, translations) {
|
|
32766
|
+
this._init(_VisitorMode.Merge);
|
|
32779
32767
|
this._translations = translations;
|
|
32780
32768
|
// Construct a single fake root element
|
|
32781
32769
|
const wrapper = new Element('wrapper', [], [], nodes, false, undefined, undefined, undefined, false);
|
|
@@ -32880,7 +32868,7 @@ class _Visitor {
|
|
|
32880
32868
|
visitDirective(directive, context) {
|
|
32881
32869
|
throw new Error('unreachable code');
|
|
32882
32870
|
}
|
|
32883
|
-
_init(mode
|
|
32871
|
+
_init(mode) {
|
|
32884
32872
|
this._mode = mode;
|
|
32885
32873
|
this._inI18nBlock = false;
|
|
32886
32874
|
this._inI18nNode = false;
|
|
@@ -32890,7 +32878,7 @@ class _Visitor {
|
|
|
32890
32878
|
this._errors = [];
|
|
32891
32879
|
this._messages = [];
|
|
32892
32880
|
this._inImplicitNode = false;
|
|
32893
|
-
this._createI18nMessage = createI18nMessageFactory(
|
|
32881
|
+
this._createI18nMessage = createI18nMessageFactory(DEFAULT_CONTAINER_BLOCKS,
|
|
32894
32882
|
// When dropping significant whitespace we need to retain whitespace tokens or
|
|
32895
32883
|
// else we won't be able to reuse source spans because empty tokens would be
|
|
32896
32884
|
// removed and cause a mismatch.
|
|
@@ -34233,12 +34221,11 @@ class I18NHtmlParser {
|
|
|
34233
34221
|
}
|
|
34234
34222
|
}
|
|
34235
34223
|
parse(source, url, options = {}) {
|
|
34236
|
-
const
|
|
34237
|
-
const parseResult = this._htmlParser.parse(source, url, { interpolationConfig, ...options });
|
|
34224
|
+
const parseResult = this._htmlParser.parse(source, url, { ...options });
|
|
34238
34225
|
if (parseResult.errors.length) {
|
|
34239
34226
|
return new ParseTreeResult(parseResult.rootNodes, parseResult.errors);
|
|
34240
34227
|
}
|
|
34241
|
-
return mergeTranslations(parseResult.rootNodes, this._translationBundle,
|
|
34228
|
+
return mergeTranslations(parseResult.rootNodes, this._translationBundle, [], {});
|
|
34242
34229
|
}
|
|
34243
34230
|
}
|
|
34244
34231
|
function createSerializer(format) {
|
|
@@ -34275,11 +34262,8 @@ class MessageBundle {
|
|
|
34275
34262
|
this._locale = _locale;
|
|
34276
34263
|
this._preserveWhitespace = _preserveWhitespace;
|
|
34277
34264
|
}
|
|
34278
|
-
updateFromTemplate(source, url
|
|
34279
|
-
const htmlParserResult = this._htmlParser.parse(source, url, {
|
|
34280
|
-
tokenizeExpansionForms: true,
|
|
34281
|
-
interpolationConfig,
|
|
34282
|
-
});
|
|
34265
|
+
updateFromTemplate(source, url) {
|
|
34266
|
+
const htmlParserResult = this._htmlParser.parse(source, url, { tokenizeExpansionForms: true });
|
|
34283
34267
|
if (htmlParserResult.errors.length) {
|
|
34284
34268
|
return htmlParserResult.errors;
|
|
34285
34269
|
}
|
|
@@ -34289,7 +34273,7 @@ class MessageBundle {
|
|
|
34289
34273
|
const rootNodes = this._preserveWhitespace
|
|
34290
34274
|
? htmlParserResult.rootNodes
|
|
34291
34275
|
: visitAllWithSiblings(new WhitespaceVisitor(/* preserveSignificantWhitespace */ false), htmlParserResult.rootNodes);
|
|
34292
|
-
const i18nParserResult = extractMessages(rootNodes,
|
|
34276
|
+
const i18nParserResult = extractMessages(rootNodes, this._implicitTags, this._implicitAttrs,
|
|
34293
34277
|
/* preserveSignificantWhitespace */ this._preserveWhitespace);
|
|
34294
34278
|
if (i18nParserResult.errors.length) {
|
|
34295
34279
|
return i18nParserResult.errors;
|
|
@@ -34450,7 +34434,7 @@ const MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION = '18.0.0';
|
|
|
34450
34434
|
function compileDeclareClassMetadata(metadata) {
|
|
34451
34435
|
const definitionMap = new DefinitionMap();
|
|
34452
34436
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
|
|
34453
|
-
definitionMap.set('version', literal('21.0.0-next.
|
|
34437
|
+
definitionMap.set('version', literal('21.0.0-next.6'));
|
|
34454
34438
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
34455
34439
|
definitionMap.set('type', metadata.type);
|
|
34456
34440
|
definitionMap.set('decorators', metadata.decorators);
|
|
@@ -34468,7 +34452,7 @@ function compileComponentDeclareClassMetadata(metadata, dependencies) {
|
|
|
34468
34452
|
callbackReturnDefinitionMap.set('ctorParameters', metadata.ctorParameters ?? literal(null));
|
|
34469
34453
|
callbackReturnDefinitionMap.set('propDecorators', metadata.propDecorators ?? literal(null));
|
|
34470
34454
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION));
|
|
34471
|
-
definitionMap.set('version', literal('21.0.0-next.
|
|
34455
|
+
definitionMap.set('version', literal('21.0.0-next.6'));
|
|
34472
34456
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
34473
34457
|
definitionMap.set('type', metadata.type);
|
|
34474
34458
|
definitionMap.set('resolveDeferredDeps', compileComponentMetadataAsyncResolver(dependencies));
|
|
@@ -34563,7 +34547,7 @@ function createDirectiveDefinitionMap(meta) {
|
|
|
34563
34547
|
const definitionMap = new DefinitionMap();
|
|
34564
34548
|
const minVersion = getMinimumVersionForPartialOutput(meta);
|
|
34565
34549
|
definitionMap.set('minVersion', literal(minVersion));
|
|
34566
|
-
definitionMap.set('version', literal('21.0.0-next.
|
|
34550
|
+
definitionMap.set('version', literal('21.0.0-next.6'));
|
|
34567
34551
|
// e.g. `type: MyDirective`
|
|
34568
34552
|
definitionMap.set('type', meta.type.value);
|
|
34569
34553
|
if (meta.isStandalone !== undefined) {
|
|
@@ -34833,9 +34817,6 @@ function createComponentDefinitionMap(meta, template, templateInfo) {
|
|
|
34833
34817
|
if (meta.encapsulation !== ViewEncapsulation$1.Emulated) {
|
|
34834
34818
|
definitionMap.set('encapsulation', importExpr(Identifiers.ViewEncapsulation).prop(ViewEncapsulation$1[meta.encapsulation]));
|
|
34835
34819
|
}
|
|
34836
|
-
if (meta.interpolation !== DEFAULT_INTERPOLATION_CONFIG) {
|
|
34837
|
-
definitionMap.set('interpolation', literalArr([literal(meta.interpolation.start), literal(meta.interpolation.end)]));
|
|
34838
|
-
}
|
|
34839
34820
|
if (template.preserveWhitespaces === true) {
|
|
34840
34821
|
definitionMap.set('preserveWhitespaces', literal(true));
|
|
34841
34822
|
}
|
|
@@ -34979,7 +34960,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$4 = '12.0.0';
|
|
|
34979
34960
|
function compileDeclareFactoryFunction(meta) {
|
|
34980
34961
|
const definitionMap = new DefinitionMap();
|
|
34981
34962
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
|
|
34982
|
-
definitionMap.set('version', literal('21.0.0-next.
|
|
34963
|
+
definitionMap.set('version', literal('21.0.0-next.6'));
|
|
34983
34964
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
34984
34965
|
definitionMap.set('type', meta.type.value);
|
|
34985
34966
|
definitionMap.set('deps', compileDependencies(meta.deps));
|
|
@@ -35014,7 +34995,7 @@ function compileDeclareInjectableFromMetadata(meta) {
|
|
|
35014
34995
|
function createInjectableDefinitionMap(meta) {
|
|
35015
34996
|
const definitionMap = new DefinitionMap();
|
|
35016
34997
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
|
|
35017
|
-
definitionMap.set('version', literal('21.0.0-next.
|
|
34998
|
+
definitionMap.set('version', literal('21.0.0-next.6'));
|
|
35018
34999
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
35019
35000
|
definitionMap.set('type', meta.type.value);
|
|
35020
35001
|
// Only generate providedIn property if it has a non-null value
|
|
@@ -35065,7 +35046,7 @@ function compileDeclareInjectorFromMetadata(meta) {
|
|
|
35065
35046
|
function createInjectorDefinitionMap(meta) {
|
|
35066
35047
|
const definitionMap = new DefinitionMap();
|
|
35067
35048
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
|
|
35068
|
-
definitionMap.set('version', literal('21.0.0-next.
|
|
35049
|
+
definitionMap.set('version', literal('21.0.0-next.6'));
|
|
35069
35050
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
35070
35051
|
definitionMap.set('type', meta.type.value);
|
|
35071
35052
|
definitionMap.set('providers', meta.providers);
|
|
@@ -35098,7 +35079,7 @@ function createNgModuleDefinitionMap(meta) {
|
|
|
35098
35079
|
throw new Error('Invalid path! Local compilation mode should not get into the partial compilation path');
|
|
35099
35080
|
}
|
|
35100
35081
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
|
|
35101
|
-
definitionMap.set('version', literal('21.0.0-next.
|
|
35082
|
+
definitionMap.set('version', literal('21.0.0-next.6'));
|
|
35102
35083
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
35103
35084
|
definitionMap.set('type', meta.type.value);
|
|
35104
35085
|
// We only generate the keys in the metadata if the arrays contain values.
|
|
@@ -35149,7 +35130,7 @@ function compileDeclarePipeFromMetadata(meta) {
|
|
|
35149
35130
|
function createPipeDefinitionMap(meta) {
|
|
35150
35131
|
const definitionMap = new DefinitionMap();
|
|
35151
35132
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION));
|
|
35152
|
-
definitionMap.set('version', literal('21.0.0-next.
|
|
35133
|
+
definitionMap.set('version', literal('21.0.0-next.6'));
|
|
35153
35134
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
35154
35135
|
// e.g. `type: MyPipe`
|
|
35155
35136
|
definitionMap.set('type', meta.type.value);
|
|
@@ -35305,7 +35286,7 @@ function compileHmrUpdateCallback(definitions, constantStatements, meta) {
|
|
|
35305
35286
|
* @description
|
|
35306
35287
|
* Entry point for all public APIs of the compiler package.
|
|
35307
35288
|
*/
|
|
35308
|
-
const VERSION = new Version('21.0.0-next.
|
|
35289
|
+
const VERSION = new Version('21.0.0-next.6');
|
|
35309
35290
|
|
|
35310
35291
|
//////////////////////////////////////
|
|
35311
35292
|
// THIS FILE HAS GLOBAL SIDE EFFECT //
|