@angular/compiler 21.2.4 → 21.2.5
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 +27 -29
- package/fesm2022/compiler.mjs.map +1 -1
- package/package.json +1 -1
- package/types/compiler.d.ts +1 -1
package/fesm2022/compiler.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v21.2.
|
|
2
|
+
* @license Angular v21.2.5
|
|
3
3
|
* (c) 2010-2026 Google LLC. https://angular.dev/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -536,7 +536,7 @@ function fingerprint(str) {
|
|
|
536
536
|
let lo = hash32(view, utf8.length, 102072);
|
|
537
537
|
if (hi == 0 && (lo == 0 || lo == 1)) {
|
|
538
538
|
hi = hi ^ 0x130f9bef;
|
|
539
|
-
lo = lo ^ -
|
|
539
|
+
lo = lo ^ -1801410264;
|
|
540
540
|
}
|
|
541
541
|
return BigInt.asUintN(32, BigInt(hi)) << BigInt(32) | BigInt.asUintN(32, BigInt(lo));
|
|
542
542
|
}
|
|
@@ -6750,12 +6750,12 @@ function createNgModuleType(meta) {
|
|
|
6750
6750
|
const {
|
|
6751
6751
|
type: moduleType,
|
|
6752
6752
|
declarations,
|
|
6753
|
-
exports,
|
|
6753
|
+
exports: exports$1,
|
|
6754
6754
|
imports,
|
|
6755
6755
|
includeImportTypes,
|
|
6756
6756
|
publicDeclarationTypes
|
|
6757
6757
|
} = meta;
|
|
6758
|
-
return new ExpressionType(importExpr(Identifiers.NgModuleDeclaration, [new ExpressionType(moduleType.type), publicDeclarationTypes === null ? tupleTypeOf(declarations) : tupleOfTypes(publicDeclarationTypes), includeImportTypes ? tupleTypeOf(imports) : NONE_TYPE, tupleTypeOf(exports)]));
|
|
6758
|
+
return new ExpressionType(importExpr(Identifiers.NgModuleDeclaration, [new ExpressionType(moduleType.type), publicDeclarationTypes === null ? tupleTypeOf(declarations) : tupleOfTypes(publicDeclarationTypes), includeImportTypes ? tupleTypeOf(imports) : NONE_TYPE, tupleTypeOf(exports$1)]));
|
|
6759
6759
|
}
|
|
6760
6760
|
function generateSetNgModuleScopeCall(meta) {
|
|
6761
6761
|
const scopeMap = new DefinitionMap();
|
|
@@ -14445,7 +14445,7 @@ function isDigitEntityEnd(code) {
|
|
|
14445
14445
|
return code === $SEMICOLON || code === $EOF || !isAsciiHexDigit(code);
|
|
14446
14446
|
}
|
|
14447
14447
|
function isNamedEntityEnd(code) {
|
|
14448
|
-
return code === $SEMICOLON || code === $EOF || !isAsciiLetter(code);
|
|
14448
|
+
return code === $SEMICOLON || code === $EOF || !(isAsciiLetter(code) || isDigit(code));
|
|
14449
14449
|
}
|
|
14450
14450
|
function isExpansionCaseStart(peek) {
|
|
14451
14451
|
return peek !== $RBRACE;
|
|
@@ -19386,7 +19386,7 @@ class PureFunctionConstant extends GenericKeyFn {
|
|
|
19386
19386
|
toSharedConstantDeclaration(declName, keyExpr) {
|
|
19387
19387
|
const fnParams = [];
|
|
19388
19388
|
for (let idx = 0; idx < this.numArgs; idx++) {
|
|
19389
|
-
fnParams.push(new FnParam('a' + idx));
|
|
19389
|
+
fnParams.push(new FnParam('a' + idx, DYNAMIC_TYPE));
|
|
19390
19390
|
}
|
|
19391
19391
|
const returnExpr = transformExpressionsInExpression(keyExpr, expr => {
|
|
19392
19392
|
if (!(expr instanceof PureFunctionParameterExpr)) {
|
|
@@ -20371,7 +20371,7 @@ function reifyListenerHandler(unit, name, handlerOps, consumesDollarEvent) {
|
|
|
20371
20371
|
}
|
|
20372
20372
|
const params = [];
|
|
20373
20373
|
if (consumesDollarEvent) {
|
|
20374
|
-
params.push(new FnParam('$event'));
|
|
20374
|
+
params.push(new FnParam('$event', DYNAMIC_TYPE));
|
|
20375
20375
|
}
|
|
20376
20376
|
return fn(params, handlerStmts, undefined, undefined, name);
|
|
20377
20377
|
}
|
|
@@ -20379,7 +20379,7 @@ function reifyTrackBy(unit, op) {
|
|
|
20379
20379
|
if (op.trackByFn !== null) {
|
|
20380
20380
|
return op.trackByFn;
|
|
20381
20381
|
}
|
|
20382
|
-
const params = [new FnParam('$index'), new FnParam('$item')];
|
|
20382
|
+
const params = [new FnParam('$index', NUMBER_TYPE), new FnParam('$item', DYNAMIC_TYPE)];
|
|
20383
20383
|
let fn$1;
|
|
20384
20384
|
if (op.trackByOps === null) {
|
|
20385
20385
|
fn$1 = op.usesComponentInstance ? fn(params, [new ReturnStatement(op.track)]) : arrowFn(params, op.track);
|
|
@@ -20407,7 +20407,7 @@ function getArrowFunctionFactory(unit, expr) {
|
|
|
20407
20407
|
statements.push(op.statement);
|
|
20408
20408
|
}
|
|
20409
20409
|
const body = statements.length === 1 && statements[0] instanceof ReturnStatement ? statements[0].value : statements;
|
|
20410
|
-
return arrowFn([new FnParam(expr.contextName), new FnParam(expr.currentViewName)], arrowFn(expr.parameters, body));
|
|
20410
|
+
return arrowFn([new FnParam(expr.contextName, DYNAMIC_TYPE), new FnParam(expr.currentViewName, DYNAMIC_TYPE)], arrowFn(expr.parameters, body));
|
|
20411
20411
|
}
|
|
20412
20412
|
|
|
20413
20413
|
function removeEmptyBindings(job) {
|
|
@@ -22073,7 +22073,7 @@ function emitView(view) {
|
|
|
22073
22073
|
}
|
|
22074
22074
|
const createCond = maybeGenerateRfBlock(1, createStatements);
|
|
22075
22075
|
const updateCond = maybeGenerateRfBlock(2, updateStatements);
|
|
22076
|
-
return fn([new FnParam(RENDER_FLAGS), new FnParam(CONTEXT_NAME)], [...createCond, ...updateCond], undefined, undefined, view.fnName);
|
|
22076
|
+
return fn([new FnParam(RENDER_FLAGS, NUMBER_TYPE), new FnParam(CONTEXT_NAME, DYNAMIC_TYPE)], [...createCond, ...updateCond], undefined, undefined, view.fnName);
|
|
22077
22077
|
}
|
|
22078
22078
|
function maybeGenerateRfBlock(flag, statements) {
|
|
22079
22079
|
if (statements.length === 0) {
|
|
@@ -22104,7 +22104,7 @@ function emitHostBindingFunction(job) {
|
|
|
22104
22104
|
}
|
|
22105
22105
|
const createCond = maybeGenerateRfBlock(1, createStatements);
|
|
22106
22106
|
const updateCond = maybeGenerateRfBlock(2, updateStatements);
|
|
22107
|
-
return fn([new FnParam(RENDER_FLAGS), new FnParam(CONTEXT_NAME)], [...createCond, ...updateCond], undefined, undefined, job.root.fnName);
|
|
22107
|
+
return fn([new FnParam(RENDER_FLAGS, NUMBER_TYPE), new FnParam(CONTEXT_NAME, DYNAMIC_TYPE)], [...createCond, ...updateCond], undefined, undefined, job.root.fnName);
|
|
22108
22108
|
}
|
|
22109
22109
|
|
|
22110
22110
|
const domSchema = new DomElementSchemaRegistry();
|
|
@@ -22649,7 +22649,7 @@ function convertAst(ast, job, baseSourceSpan) {
|
|
|
22649
22649
|
} else if (ast instanceof SpreadElement) {
|
|
22650
22650
|
return new SpreadElementExpr(convertAst(ast.expression, job, baseSourceSpan));
|
|
22651
22651
|
} else if (ast instanceof ArrowFunction) {
|
|
22652
|
-
return updateParameterReferences(arrowFn(ast.parameters.map(arg => new FnParam(arg.name)), convertAst(ast.body, job, baseSourceSpan)));
|
|
22652
|
+
return updateParameterReferences(arrowFn(ast.parameters.map(arg => new FnParam(arg.name, DYNAMIC_TYPE)), convertAst(ast.body, job, baseSourceSpan)));
|
|
22653
22653
|
} else {
|
|
22654
22654
|
throw new Error(`Unhandled expression type "${ast.constructor.name}" in file "${baseSourceSpan?.start.file.url}"`);
|
|
22655
22655
|
}
|
|
@@ -22987,7 +22987,7 @@ function createViewQueriesFunction(viewQueries, constantPool, name) {
|
|
|
22987
22987
|
createStatements.push(new ExpressionStatement(viewQueryCall));
|
|
22988
22988
|
}
|
|
22989
22989
|
const viewQueryFnName = name ? `${name}_Query` : null;
|
|
22990
|
-
return fn([new FnParam(RENDER_FLAGS, NUMBER_TYPE), new FnParam(CONTEXT_NAME,
|
|
22990
|
+
return fn([new FnParam(RENDER_FLAGS, NUMBER_TYPE), new FnParam(CONTEXT_NAME, DYNAMIC_TYPE)], [renderFlagCheckIfStmt(1, createStatements), renderFlagCheckIfStmt(2, collapseAdvanceStatements(updateStatements))], INFERRED_TYPE, null, viewQueryFnName);
|
|
22991
22991
|
}
|
|
22992
22992
|
function createContentQueriesFunction(queries, constantPool, name) {
|
|
22993
22993
|
const createStatements = [];
|
|
@@ -23021,7 +23021,7 @@ function createContentQueriesFunction(queries, constantPool, name) {
|
|
|
23021
23021
|
createStatements.push(new ExpressionStatement(contentQueryCall));
|
|
23022
23022
|
}
|
|
23023
23023
|
const contentQueriesFnName = name ? `${name}_ContentQueries` : null;
|
|
23024
|
-
return fn([new FnParam(RENDER_FLAGS, NUMBER_TYPE), new FnParam(CONTEXT_NAME,
|
|
23024
|
+
return fn([new FnParam(RENDER_FLAGS, NUMBER_TYPE), new FnParam(CONTEXT_NAME, DYNAMIC_TYPE), new FnParam('dirIndex', NUMBER_TYPE)], [renderFlagCheckIfStmt(1, createStatements), renderFlagCheckIfStmt(2, collapseAdvanceStatements(updateStatements))], INFERRED_TYPE, null, contentQueriesFnName);
|
|
23025
23025
|
}
|
|
23026
23026
|
|
|
23027
23027
|
class HtmlParser extends Parser$1 {
|
|
@@ -26377,7 +26377,6 @@ class CompilerFacadeImpl {
|
|
|
26377
26377
|
name: facade.name,
|
|
26378
26378
|
type: wrapReference(facade.type),
|
|
26379
26379
|
typeArgumentCount: 0,
|
|
26380
|
-
deps: null,
|
|
26381
26380
|
pipeName: facade.pipeName,
|
|
26382
26381
|
pure: facade.pure,
|
|
26383
26382
|
isStandalone: facade.isStandalone
|
|
@@ -26426,7 +26425,6 @@ class CompilerFacadeImpl {
|
|
|
26426
26425
|
}
|
|
26427
26426
|
compileInjector(angularCoreEnv, sourceMapUrl, facade) {
|
|
26428
26427
|
const meta = {
|
|
26429
|
-
name: facade.name,
|
|
26430
26428
|
type: wrapReference(facade.type),
|
|
26431
26429
|
providers: facade.providers && facade.providers.length > 0 ? new WrappedNodeExpr(facade.providers) : null,
|
|
26432
26430
|
imports: facade.imports.map(i => new WrappedNodeExpr(i))
|
|
@@ -28529,7 +28527,7 @@ const MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION = '18.0.0';
|
|
|
28529
28527
|
function compileDeclareClassMetadata(metadata) {
|
|
28530
28528
|
const definitionMap = new DefinitionMap();
|
|
28531
28529
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
|
|
28532
|
-
definitionMap.set('version', literal('21.2.
|
|
28530
|
+
definitionMap.set('version', literal('21.2.5'));
|
|
28533
28531
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
28534
28532
|
definitionMap.set('type', metadata.type);
|
|
28535
28533
|
definitionMap.set('decorators', metadata.decorators);
|
|
@@ -28547,7 +28545,7 @@ function compileComponentDeclareClassMetadata(metadata, dependencies) {
|
|
|
28547
28545
|
callbackReturnDefinitionMap.set('ctorParameters', metadata.ctorParameters ?? literal(null));
|
|
28548
28546
|
callbackReturnDefinitionMap.set('propDecorators', metadata.propDecorators ?? literal(null));
|
|
28549
28547
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION));
|
|
28550
|
-
definitionMap.set('version', literal('21.2.
|
|
28548
|
+
definitionMap.set('version', literal('21.2.5'));
|
|
28551
28549
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
28552
28550
|
definitionMap.set('type', metadata.type);
|
|
28553
28551
|
definitionMap.set('resolveDeferredDeps', compileComponentMetadataAsyncResolver(dependencies));
|
|
@@ -28620,7 +28618,7 @@ function createDirectiveDefinitionMap(meta) {
|
|
|
28620
28618
|
const definitionMap = new DefinitionMap();
|
|
28621
28619
|
const minVersion = getMinimumVersionForPartialOutput(meta);
|
|
28622
28620
|
definitionMap.set('minVersion', literal(minVersion));
|
|
28623
|
-
definitionMap.set('version', literal('21.2.
|
|
28621
|
+
definitionMap.set('version', literal('21.2.5'));
|
|
28624
28622
|
definitionMap.set('type', meta.type.value);
|
|
28625
28623
|
if (meta.isStandalone !== undefined) {
|
|
28626
28624
|
definitionMap.set('isStandalone', literal(meta.isStandalone));
|
|
@@ -28962,7 +28960,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$4 = '12.0.0';
|
|
|
28962
28960
|
function compileDeclareFactoryFunction(meta) {
|
|
28963
28961
|
const definitionMap = new DefinitionMap();
|
|
28964
28962
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
|
|
28965
|
-
definitionMap.set('version', literal('21.2.
|
|
28963
|
+
definitionMap.set('version', literal('21.2.5'));
|
|
28966
28964
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
28967
28965
|
definitionMap.set('type', meta.type.value);
|
|
28968
28966
|
definitionMap.set('deps', compileDependencies(meta.deps));
|
|
@@ -28988,7 +28986,7 @@ function compileDeclareInjectableFromMetadata(meta) {
|
|
|
28988
28986
|
function createInjectableDefinitionMap(meta) {
|
|
28989
28987
|
const definitionMap = new DefinitionMap();
|
|
28990
28988
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
|
|
28991
|
-
definitionMap.set('version', literal('21.2.
|
|
28989
|
+
definitionMap.set('version', literal('21.2.5'));
|
|
28992
28990
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
28993
28991
|
definitionMap.set('type', meta.type.value);
|
|
28994
28992
|
if (meta.providedIn !== undefined) {
|
|
@@ -29029,7 +29027,7 @@ function compileDeclareInjectorFromMetadata(meta) {
|
|
|
29029
29027
|
function createInjectorDefinitionMap(meta) {
|
|
29030
29028
|
const definitionMap = new DefinitionMap();
|
|
29031
29029
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
|
|
29032
|
-
definitionMap.set('version', literal('21.2.
|
|
29030
|
+
definitionMap.set('version', literal('21.2.5'));
|
|
29033
29031
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
29034
29032
|
definitionMap.set('type', meta.type.value);
|
|
29035
29033
|
definitionMap.set('providers', meta.providers);
|
|
@@ -29056,7 +29054,7 @@ function createNgModuleDefinitionMap(meta) {
|
|
|
29056
29054
|
throw new Error('Invalid path! Local compilation mode should not get into the partial compilation path');
|
|
29057
29055
|
}
|
|
29058
29056
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
|
|
29059
|
-
definitionMap.set('version', literal('21.2.
|
|
29057
|
+
definitionMap.set('version', literal('21.2.5'));
|
|
29060
29058
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
29061
29059
|
definitionMap.set('type', meta.type.value);
|
|
29062
29060
|
if (meta.bootstrap.length > 0) {
|
|
@@ -29094,7 +29092,7 @@ function compileDeclarePipeFromMetadata(meta) {
|
|
|
29094
29092
|
function createPipeDefinitionMap(meta) {
|
|
29095
29093
|
const definitionMap = new DefinitionMap();
|
|
29096
29094
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION));
|
|
29097
|
-
definitionMap.set('version', literal('21.2.
|
|
29095
|
+
definitionMap.set('version', literal('21.2.5'));
|
|
29098
29096
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
29099
29097
|
definitionMap.set('type', meta.type.value);
|
|
29100
29098
|
if (meta.isStandalone !== undefined) {
|
|
@@ -29137,10 +29135,10 @@ function compileHmrInitializer(meta) {
|
|
|
29137
29135
|
});
|
|
29138
29136
|
const defaultRead = variable(moduleName).prop('default');
|
|
29139
29137
|
const replaceCall = importExpr(Identifiers.replaceMetadata).callFn([meta.type, defaultRead, literalArr(namespaces), literalArr(meta.localDependencies.map(l => l.runtimeRepresentation)), variable('import').prop('meta'), variable(idName)]);
|
|
29140
|
-
const replaceCallback = arrowFn([new FnParam(moduleName)], defaultRead.and(replaceCall));
|
|
29138
|
+
const replaceCallback = arrowFn([new FnParam(moduleName, DYNAMIC_TYPE)], defaultRead.and(replaceCall));
|
|
29141
29139
|
const url = importExpr(Identifiers.getReplaceMetadataURL).callFn([variable(idName), variable(timestampName), variable('import').prop('meta').prop('url')]);
|
|
29142
|
-
const importCallback = new DeclareFunctionStmt(importCallbackName, [new FnParam(timestampName)], [new DynamicImportExpr(url, null, '@vite-ignore').prop('then').callFn([replaceCallback]).toStmt()], null, StmtModifier.Final);
|
|
29143
|
-
const updateCallback = arrowFn([new FnParam(dataName)], variable(dataName).prop('id').identical(variable(idName)).and(variable(importCallbackName).callFn([variable(dataName).prop('timestamp')])));
|
|
29140
|
+
const importCallback = new DeclareFunctionStmt(importCallbackName, [new FnParam(timestampName, DYNAMIC_TYPE)], [new DynamicImportExpr(url, null, '@vite-ignore').prop('then').callFn([replaceCallback]).toStmt()], null, StmtModifier.Final);
|
|
29141
|
+
const updateCallback = arrowFn([new FnParam(dataName, DYNAMIC_TYPE)], variable(dataName).prop('id').identical(variable(idName)).and(variable(importCallbackName).callFn([variable(dataName).prop('timestamp')])));
|
|
29144
29142
|
const initialCall = variable(importCallbackName).callFn([variable('Date').prop('now').callFn([])]);
|
|
29145
29143
|
const hotRead = variable('import').prop('meta').prop('hot');
|
|
29146
29144
|
const hotListener = hotRead.clone().prop('on').callFn([literal('angular:component-update'), updateCallback]);
|
|
@@ -29151,7 +29149,7 @@ function compileHmrUpdateCallback(definitions, constantStatements, meta) {
|
|
|
29151
29149
|
const params = [meta.className, namespaces].map(name => new FnParam(name, DYNAMIC_TYPE));
|
|
29152
29150
|
const body = [];
|
|
29153
29151
|
for (const local of meta.localDependencies) {
|
|
29154
|
-
params.push(new FnParam(local.name));
|
|
29152
|
+
params.push(new FnParam(local.name, DYNAMIC_TYPE));
|
|
29155
29153
|
}
|
|
29156
29154
|
for (let i = 0; i < meta.namespaceDependencies.length; i++) {
|
|
29157
29155
|
body.push(new DeclareVarStmt(meta.namespaceDependencies[i].assignedName, variable(namespaces).key(literal(i)), DYNAMIC_TYPE, StmtModifier.Final));
|
|
@@ -29168,7 +29166,7 @@ function compileHmrUpdateCallback(definitions, constantStatements, meta) {
|
|
|
29168
29166
|
return new DeclareFunctionStmt(`${meta.className}_UpdateMetadata`, params, body, null, StmtModifier.Final);
|
|
29169
29167
|
}
|
|
29170
29168
|
|
|
29171
|
-
const VERSION = new Version('21.2.
|
|
29169
|
+
const VERSION = new Version('21.2.5');
|
|
29172
29170
|
|
|
29173
29171
|
publishFacade(_global);
|
|
29174
29172
|
|