@angular/core 19.1.0-next.4 → 19.1.0
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/LICENSE +1 -1
- package/fesm2022/core.mjs +85 -91
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/primitives/event-dispatch.mjs +1 -24
- package/fesm2022/primitives/event-dispatch.mjs.map +1 -1
- package/fesm2022/primitives/signals.mjs +1 -1
- package/fesm2022/rxjs-interop.mjs +1 -1
- package/fesm2022/rxjs-interop.mjs.map +1 -1
- package/fesm2022/testing.mjs +4 -4
- package/index.d.ts +41 -36
- package/package.json +1 -1
- package/primitives/event-dispatch/index.d.ts +1 -1
- package/primitives/signals/index.d.ts +1 -1
- package/rxjs-interop/index.d.ts +1 -1
- package/schematics/bundles/apply_import_manager-5082ccea.js +732 -0
- package/schematics/bundles/{checker-884633eb.js → checker-aa999c96.js} +50 -25
- package/schematics/bundles/cleanup-unused-imports.js +295 -0
- package/schematics/bundles/{compiler_host-22f6513d.js → compiler_host-f0b570c8.js} +2 -2
- package/schematics/bundles/control-flow-migration.js +3 -3
- package/schematics/bundles/explicit-standalone-flag.js +5 -5
- package/schematics/bundles/{imports-abe29092.js → imports-31a38653.js} +1 -1
- package/schematics/bundles/index-02a11f43.js +30 -0
- package/schematics/bundles/{combine_units-4a95b1b9.js → index-15b61bae.js} +10 -723
- package/schematics/bundles/inject-migration.js +6 -6
- package/schematics/bundles/{leading_space-d190b83b.js → leading_space-6e7a8ec6.js} +1 -1
- package/schematics/bundles/{migrate_ts_type_references-4b11f3f2.js → migrate_ts_type_references-042ca765.js} +30 -29
- package/schematics/bundles/{nodes-a9f0b985.js → nodes-88c2157f.js} +2 -2
- package/schematics/bundles/output-migration.js +27 -26
- package/schematics/bundles/pending-tasks.js +5 -5
- package/schematics/bundles/{program-094352ba.js → program-393ca8f3.js} +106 -46
- package/schematics/bundles/{project_tsconfig_paths-e9ccccbf.js → project_tsconfig_paths-6c9cde78.js} +1 -1
- package/schematics/bundles/provide-initializer.js +5 -5
- package/schematics/bundles/route-lazy-loading.js +4 -4
- package/schematics/bundles/signal-input-migration.js +33 -32
- package/schematics/bundles/signal-queries-migration.js +56 -49
- package/schematics/bundles/signals.js +8 -7
- package/schematics/bundles/standalone-migration.js +12 -28
- package/schematics/collection.json +5 -0
- package/schematics/ng-generate/cleanup-unused-imports/schema.json +7 -0
- package/testing/index.d.ts +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v19.1.0
|
|
3
|
+
* @license Angular v19.1.0
|
|
4
4
|
* (c) 2010-2024 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
7
7
|
'use strict';
|
|
8
8
|
|
|
9
|
-
var checker = require('./checker-
|
|
9
|
+
var checker = require('./checker-aa999c96.js');
|
|
10
10
|
var ts = require('typescript');
|
|
11
11
|
var p = require('path');
|
|
12
12
|
require('os');
|
|
@@ -914,14 +914,18 @@ function compileHmrInitializer(meta) {
|
|
|
914
914
|
// '<urlPartial>' + encodeURIComponent(t)
|
|
915
915
|
const urlValue = checker.literal(urlPartial)
|
|
916
916
|
.plus(checker.variable('encodeURIComponent').callFn([checker.variable(timestampName)]));
|
|
917
|
+
// import.meta.url
|
|
918
|
+
const urlBase = checker.variable('import').prop('meta').prop('url');
|
|
919
|
+
// new URL(urlValue, urlBase).href
|
|
920
|
+
const urlHref = new checker.InstantiateExpr(checker.variable('URL'), [urlValue, urlBase]).prop('href');
|
|
917
921
|
// function Cmp_HmrLoad(t) {
|
|
918
|
-
// import(/* @vite-ignore */
|
|
922
|
+
// import(/* @vite-ignore */ urlHref).then((m) => m.default && replaceMetadata(...));
|
|
919
923
|
// }
|
|
920
924
|
const importCallback = new checker.DeclareFunctionStmt(importCallbackName, [new checker.FnParam(timestampName)], [
|
|
921
925
|
// The vite-ignore special comment is required to prevent Vite from generating a superfluous
|
|
922
926
|
// warning for each usage within the development code. If Vite provides a method to
|
|
923
927
|
// programmatically avoid this warning in the future, this added comment can be removed here.
|
|
924
|
-
new checker.DynamicImportExpr(
|
|
928
|
+
new checker.DynamicImportExpr(urlHref, null, '@vite-ignore')
|
|
925
929
|
.prop('then')
|
|
926
930
|
.callFn([replaceCallback])
|
|
927
931
|
.toStmt(),
|
|
@@ -995,7 +999,7 @@ const MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION = '18.0.0';
|
|
|
995
999
|
function compileDeclareClassMetadata(metadata) {
|
|
996
1000
|
const definitionMap = new checker.DefinitionMap();
|
|
997
1001
|
definitionMap.set('minVersion', checker.literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
|
|
998
|
-
definitionMap.set('version', checker.literal('19.1.0
|
|
1002
|
+
definitionMap.set('version', checker.literal('19.1.0'));
|
|
999
1003
|
definitionMap.set('ngImport', checker.importExpr(checker.Identifiers.core));
|
|
1000
1004
|
definitionMap.set('type', metadata.type);
|
|
1001
1005
|
definitionMap.set('decorators', metadata.decorators);
|
|
@@ -1013,7 +1017,7 @@ function compileComponentDeclareClassMetadata(metadata, dependencies) {
|
|
|
1013
1017
|
callbackReturnDefinitionMap.set('ctorParameters', metadata.ctorParameters ?? checker.literal(null));
|
|
1014
1018
|
callbackReturnDefinitionMap.set('propDecorators', metadata.propDecorators ?? checker.literal(null));
|
|
1015
1019
|
definitionMap.set('minVersion', checker.literal(MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION));
|
|
1016
|
-
definitionMap.set('version', checker.literal('19.1.0
|
|
1020
|
+
definitionMap.set('version', checker.literal('19.1.0'));
|
|
1017
1021
|
definitionMap.set('ngImport', checker.importExpr(checker.Identifiers.core));
|
|
1018
1022
|
definitionMap.set('type', metadata.type);
|
|
1019
1023
|
definitionMap.set('resolveDeferredDeps', compileComponentMetadataAsyncResolver(dependencies));
|
|
@@ -1108,7 +1112,7 @@ function createDirectiveDefinitionMap(meta) {
|
|
|
1108
1112
|
const definitionMap = new checker.DefinitionMap();
|
|
1109
1113
|
const minVersion = getMinimumVersionForPartialOutput(meta);
|
|
1110
1114
|
definitionMap.set('minVersion', checker.literal(minVersion));
|
|
1111
|
-
definitionMap.set('version', checker.literal('19.1.0
|
|
1115
|
+
definitionMap.set('version', checker.literal('19.1.0'));
|
|
1112
1116
|
// e.g. `type: MyDirective`
|
|
1113
1117
|
definitionMap.set('type', meta.type.value);
|
|
1114
1118
|
if (meta.isStandalone !== undefined) {
|
|
@@ -1524,7 +1528,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$4 = '12.0.0';
|
|
|
1524
1528
|
function compileDeclareFactoryFunction(meta) {
|
|
1525
1529
|
const definitionMap = new checker.DefinitionMap();
|
|
1526
1530
|
definitionMap.set('minVersion', checker.literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
|
|
1527
|
-
definitionMap.set('version', checker.literal('19.1.0
|
|
1531
|
+
definitionMap.set('version', checker.literal('19.1.0'));
|
|
1528
1532
|
definitionMap.set('ngImport', checker.importExpr(checker.Identifiers.core));
|
|
1529
1533
|
definitionMap.set('type', meta.type.value);
|
|
1530
1534
|
definitionMap.set('deps', compileDependencies(meta.deps));
|
|
@@ -1559,7 +1563,7 @@ function compileDeclareInjectableFromMetadata(meta) {
|
|
|
1559
1563
|
function createInjectableDefinitionMap(meta) {
|
|
1560
1564
|
const definitionMap = new checker.DefinitionMap();
|
|
1561
1565
|
definitionMap.set('minVersion', checker.literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
|
|
1562
|
-
definitionMap.set('version', checker.literal('19.1.0
|
|
1566
|
+
definitionMap.set('version', checker.literal('19.1.0'));
|
|
1563
1567
|
definitionMap.set('ngImport', checker.importExpr(checker.Identifiers.core));
|
|
1564
1568
|
definitionMap.set('type', meta.type.value);
|
|
1565
1569
|
// Only generate providedIn property if it has a non-null value
|
|
@@ -1610,7 +1614,7 @@ function compileDeclareInjectorFromMetadata(meta) {
|
|
|
1610
1614
|
function createInjectorDefinitionMap(meta) {
|
|
1611
1615
|
const definitionMap = new checker.DefinitionMap();
|
|
1612
1616
|
definitionMap.set('minVersion', checker.literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
|
|
1613
|
-
definitionMap.set('version', checker.literal('19.1.0
|
|
1617
|
+
definitionMap.set('version', checker.literal('19.1.0'));
|
|
1614
1618
|
definitionMap.set('ngImport', checker.importExpr(checker.Identifiers.core));
|
|
1615
1619
|
definitionMap.set('type', meta.type.value);
|
|
1616
1620
|
definitionMap.set('providers', meta.providers);
|
|
@@ -1643,7 +1647,7 @@ function createNgModuleDefinitionMap(meta) {
|
|
|
1643
1647
|
throw new Error('Invalid path! Local compilation mode should not get into the partial compilation path');
|
|
1644
1648
|
}
|
|
1645
1649
|
definitionMap.set('minVersion', checker.literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
|
|
1646
|
-
definitionMap.set('version', checker.literal('19.1.0
|
|
1650
|
+
definitionMap.set('version', checker.literal('19.1.0'));
|
|
1647
1651
|
definitionMap.set('ngImport', checker.importExpr(checker.Identifiers.core));
|
|
1648
1652
|
definitionMap.set('type', meta.type.value);
|
|
1649
1653
|
// We only generate the keys in the metadata if the arrays contain values.
|
|
@@ -1694,7 +1698,7 @@ function compileDeclarePipeFromMetadata(meta) {
|
|
|
1694
1698
|
function createPipeDefinitionMap(meta) {
|
|
1695
1699
|
const definitionMap = new checker.DefinitionMap();
|
|
1696
1700
|
definitionMap.set('minVersion', checker.literal(MINIMUM_PARTIAL_LINKER_VERSION));
|
|
1697
|
-
definitionMap.set('version', checker.literal('19.1.0
|
|
1701
|
+
definitionMap.set('version', checker.literal('19.1.0'));
|
|
1698
1702
|
definitionMap.set('ngImport', checker.importExpr(checker.Identifiers.core));
|
|
1699
1703
|
// e.g. `type: MyPipe`
|
|
1700
1704
|
definitionMap.set('type', meta.type.value);
|
|
@@ -10132,14 +10136,15 @@ class TsCreateProgramDriver {
|
|
|
10132
10136
|
* @param sourceFile File in which the file is being compiled.
|
|
10133
10137
|
* @param definition Compiled component definition.
|
|
10134
10138
|
* @param factory Compiled component factory.
|
|
10139
|
+
* @param deferBlockMetadata Metadata about the defer blocks in the component.
|
|
10135
10140
|
* @param classMetadata Compiled `setClassMetadata` expression, if any.
|
|
10136
10141
|
* @param debugInfo Compiled `setClassDebugInfo` expression, if any.
|
|
10137
10142
|
*/
|
|
10138
|
-
function extractHmrDependencies(node, definition, factory, classMetadata, debugInfo) {
|
|
10143
|
+
function extractHmrDependencies(node, definition, factory, deferBlockMetadata, classMetadata, debugInfo) {
|
|
10139
10144
|
const name = ts__default["default"].isClassDeclaration(node) && node.name ? node.name.text : null;
|
|
10140
10145
|
const visitor = new PotentialTopLevelReadsVisitor();
|
|
10141
10146
|
const sourceFile = node.getSourceFile();
|
|
10142
|
-
// Visit all of the compiled
|
|
10147
|
+
// Visit all of the compiled expressions to look for potential
|
|
10143
10148
|
// local references that would have to be retained.
|
|
10144
10149
|
definition.expression.visitExpression(visitor, null);
|
|
10145
10150
|
definition.statements.forEach((statement) => statement.visitStatement(visitor, null));
|
|
@@ -10147,6 +10152,12 @@ function extractHmrDependencies(node, definition, factory, classMetadata, debugI
|
|
|
10147
10152
|
factory.statements.forEach((statement) => statement.visitStatement(visitor, null));
|
|
10148
10153
|
classMetadata?.visitStatement(visitor, null);
|
|
10149
10154
|
debugInfo?.visitStatement(visitor, null);
|
|
10155
|
+
if (deferBlockMetadata.mode === 0 /* DeferBlockDepsEmitMode.PerBlock */) {
|
|
10156
|
+
deferBlockMetadata.blocks.forEach((loader) => loader?.visitExpression(visitor, null));
|
|
10157
|
+
}
|
|
10158
|
+
else {
|
|
10159
|
+
deferBlockMetadata.dependenciesFn?.visitExpression(visitor, null);
|
|
10160
|
+
}
|
|
10150
10161
|
// Filter out only the references to defined top-level symbols. This allows us to ignore local
|
|
10151
10162
|
// variables inside of functions. Note that we filter out the class name since it is always
|
|
10152
10163
|
// defined and it saves us having to repeat this logic wherever the locals are consumed.
|
|
@@ -10285,8 +10296,7 @@ class PotentialTopLevelReadsVisitor extends checker.RecursiveAstVisitor {
|
|
|
10285
10296
|
return false;
|
|
10286
10297
|
}
|
|
10287
10298
|
// Identifier referenced at the top level. Unlikely.
|
|
10288
|
-
if (ts__default["default"].isSourceFile(parent)
|
|
10289
|
-
(ts__default["default"].isExpressionStatement(parent) && parent.expression === node)) {
|
|
10299
|
+
if (ts__default["default"].isSourceFile(parent)) {
|
|
10290
10300
|
return true;
|
|
10291
10301
|
}
|
|
10292
10302
|
// Identifier used inside a call is only top-level if it's an argument.
|
|
@@ -10294,22 +10304,67 @@ class PotentialTopLevelReadsVisitor extends checker.RecursiveAstVisitor {
|
|
|
10294
10304
|
if (ts__default["default"].isCallExpression(parent)) {
|
|
10295
10305
|
return parent.expression === node || parent.arguments.includes(node);
|
|
10296
10306
|
}
|
|
10297
|
-
// Identifier used in a
|
|
10298
|
-
if (ts__default["default"].
|
|
10307
|
+
// Identifier used in a nested expression is only top-level if it's the actual expression.
|
|
10308
|
+
if (ts__default["default"].isExpressionStatement(parent) ||
|
|
10309
|
+
ts__default["default"].isPropertyAccessExpression(parent) ||
|
|
10310
|
+
ts__default["default"].isComputedPropertyName(parent) ||
|
|
10311
|
+
ts__default["default"].isTemplateSpan(parent) ||
|
|
10312
|
+
ts__default["default"].isSpreadAssignment(parent) ||
|
|
10313
|
+
ts__default["default"].isSpreadElement(parent) ||
|
|
10314
|
+
ts__default["default"].isAwaitExpression(parent) ||
|
|
10315
|
+
ts__default["default"].isNonNullExpression(parent) ||
|
|
10316
|
+
ts__default["default"].isIfStatement(parent) ||
|
|
10317
|
+
ts__default["default"].isDoStatement(parent) ||
|
|
10318
|
+
ts__default["default"].isWhileStatement(parent) ||
|
|
10319
|
+
ts__default["default"].isSwitchStatement(parent) ||
|
|
10320
|
+
ts__default["default"].isCaseClause(parent) ||
|
|
10321
|
+
ts__default["default"].isThrowStatement(parent)) {
|
|
10299
10322
|
return parent.expression === node;
|
|
10300
10323
|
}
|
|
10301
10324
|
// Identifier used in an array is only top-level if it's one of the elements.
|
|
10302
10325
|
if (ts__default["default"].isArrayLiteralExpression(parent)) {
|
|
10303
10326
|
return parent.elements.includes(node);
|
|
10304
10327
|
}
|
|
10305
|
-
//
|
|
10306
|
-
if
|
|
10328
|
+
// If the parent is an initialized node, the identifier is
|
|
10329
|
+
// at the top level if it's the initializer itself.
|
|
10330
|
+
if (ts__default["default"].isPropertyAssignment(parent) ||
|
|
10331
|
+
ts__default["default"].isParameter(parent) ||
|
|
10332
|
+
ts__default["default"].isBindingElement(parent) ||
|
|
10333
|
+
ts__default["default"].isPropertyDeclaration(parent) ||
|
|
10334
|
+
ts__default["default"].isEnumMember(parent)) {
|
|
10307
10335
|
return parent.initializer === node;
|
|
10308
10336
|
}
|
|
10309
|
-
// Identifier in a
|
|
10310
|
-
if (ts__default["default"].
|
|
10337
|
+
// Identifier in a function is top level if it's either the name or the initializer.
|
|
10338
|
+
if (ts__default["default"].isVariableDeclaration(parent)) {
|
|
10339
|
+
return parent.name === node || parent.initializer === node;
|
|
10340
|
+
}
|
|
10341
|
+
// Identifier in a declaration is only top level if it's the name.
|
|
10342
|
+
// In shorthand assignments the name is also the value.
|
|
10343
|
+
if (ts__default["default"].isClassDeclaration(parent) ||
|
|
10344
|
+
ts__default["default"].isFunctionDeclaration(parent) ||
|
|
10345
|
+
ts__default["default"].isShorthandPropertyAssignment(parent)) {
|
|
10311
10346
|
return parent.name === node;
|
|
10312
10347
|
}
|
|
10348
|
+
if (ts__default["default"].isElementAccessExpression(parent)) {
|
|
10349
|
+
return parent.expression === node || parent.argumentExpression === node;
|
|
10350
|
+
}
|
|
10351
|
+
if (ts__default["default"].isBinaryExpression(parent)) {
|
|
10352
|
+
return parent.left === node || parent.right === node;
|
|
10353
|
+
}
|
|
10354
|
+
if (ts__default["default"].isForInStatement(parent) || ts__default["default"].isForOfStatement(parent)) {
|
|
10355
|
+
return parent.expression === node || parent.initializer === node;
|
|
10356
|
+
}
|
|
10357
|
+
if (ts__default["default"].isForStatement(parent)) {
|
|
10358
|
+
return (parent.condition === node || parent.initializer === node || parent.incrementor === node);
|
|
10359
|
+
}
|
|
10360
|
+
if (ts__default["default"].isArrowFunction(parent)) {
|
|
10361
|
+
return parent.body === node;
|
|
10362
|
+
}
|
|
10363
|
+
// It's unlikely that we'll run into imports/exports in this use case.
|
|
10364
|
+
// We handle them since it's simple and for completeness' sake.
|
|
10365
|
+
if (ts__default["default"].isImportSpecifier(parent) || ts__default["default"].isExportSpecifier(parent)) {
|
|
10366
|
+
return (parent.propertyName || parent.name) === node;
|
|
10367
|
+
}
|
|
10313
10368
|
// Otherwise it's not top-level.
|
|
10314
10369
|
return false;
|
|
10315
10370
|
}
|
|
@@ -10336,17 +10391,18 @@ class PotentialTopLevelReadsVisitor extends checker.RecursiveAstVisitor {
|
|
|
10336
10391
|
* @param rootDirs Root directories configured by the user.
|
|
10337
10392
|
* @param definition Analyzed component definition.
|
|
10338
10393
|
* @param factory Analyzed component factory.
|
|
10394
|
+
* @param deferBlockMetadata Metadata about the defer blocks in the component.
|
|
10339
10395
|
* @param classMetadata Analyzed `setClassMetadata` expression, if any.
|
|
10340
10396
|
* @param debugInfo Analyzed `setClassDebugInfo` expression, if any.
|
|
10341
10397
|
*/
|
|
10342
|
-
function extractHmrMetatadata(clazz, reflection, compilerHost, rootDirs, definition, factory, classMetadata, debugInfo) {
|
|
10398
|
+
function extractHmrMetatadata(clazz, reflection, compilerHost, rootDirs, definition, factory, deferBlockMetadata, classMetadata, debugInfo) {
|
|
10343
10399
|
if (!reflection.isClass(clazz)) {
|
|
10344
10400
|
return null;
|
|
10345
10401
|
}
|
|
10346
10402
|
const sourceFile = clazz.getSourceFile();
|
|
10347
10403
|
const filePath = getProjectRelativePath(sourceFile.fileName, rootDirs, compilerHost) ||
|
|
10348
10404
|
compilerHost.getCanonicalFileName(sourceFile.fileName);
|
|
10349
|
-
const dependencies = extractHmrDependencies(clazz, definition, factory, classMetadata, debugInfo);
|
|
10405
|
+
const dependencies = extractHmrDependencies(clazz, definition, factory, deferBlockMetadata, classMetadata, debugInfo);
|
|
10350
10406
|
const meta = {
|
|
10351
10407
|
type: new checker.WrappedNodeExpr(clazz.name),
|
|
10352
10408
|
className: clazz.name.text,
|
|
@@ -10509,7 +10565,7 @@ class ComponentDecoratorHandler {
|
|
|
10509
10565
|
};
|
|
10510
10566
|
// Dependencies can't be deferred during HMR, because the HMR update module can't have
|
|
10511
10567
|
// dynamic imports and its dependencies need to be passed in directly. If dependencies
|
|
10512
|
-
// are deferred, their imports will be deleted so we
|
|
10568
|
+
// are deferred, their imports will be deleted so we may lose the reference to them.
|
|
10513
10569
|
this.canDeferDeps = !enableHmr;
|
|
10514
10570
|
}
|
|
10515
10571
|
literalCache = new Map();
|
|
@@ -11447,10 +11503,11 @@ class ComponentDecoratorHandler {
|
|
|
11447
11503
|
const perComponentDeferredDeps = this.canDeferDeps
|
|
11448
11504
|
? this.resolveAllDeferredDependencies(resolution)
|
|
11449
11505
|
: null;
|
|
11506
|
+
const defer = this.compileDeferBlocks(resolution);
|
|
11450
11507
|
const meta = {
|
|
11451
11508
|
...analysis.meta,
|
|
11452
11509
|
...resolution,
|
|
11453
|
-
defer
|
|
11510
|
+
defer,
|
|
11454
11511
|
};
|
|
11455
11512
|
const fac = compileNgFactoryDefField(checker.toFactoryMetadata(meta, checker.FactoryTarget.Component));
|
|
11456
11513
|
if (perComponentDeferredDeps !== null) {
|
|
@@ -11465,7 +11522,7 @@ class ComponentDecoratorHandler {
|
|
|
11465
11522
|
? compileClassDebugInfo(analysis.classDebugInfo).toStmt()
|
|
11466
11523
|
: null;
|
|
11467
11524
|
const hmrMeta = this.enableHmr
|
|
11468
|
-
? extractHmrMetatadata(node, this.reflector, this.compilerHost, this.rootDirs, def, fac, classMetadata, debugInfo)
|
|
11525
|
+
? extractHmrMetatadata(node, this.reflector, this.compilerHost, this.rootDirs, def, fac, defer, classMetadata, debugInfo)
|
|
11469
11526
|
: null;
|
|
11470
11527
|
const hmrInitializer = hmrMeta ? compileHmrInitializer(hmrMeta).toStmt() : null;
|
|
11471
11528
|
const deferrableImports = this.canDeferDeps
|
|
@@ -11488,10 +11545,11 @@ class ComponentDecoratorHandler {
|
|
|
11488
11545
|
const perComponentDeferredDeps = this.canDeferDeps
|
|
11489
11546
|
? this.resolveAllDeferredDependencies(resolution)
|
|
11490
11547
|
: null;
|
|
11548
|
+
const defer = this.compileDeferBlocks(resolution);
|
|
11491
11549
|
const meta = {
|
|
11492
11550
|
...analysis.meta,
|
|
11493
11551
|
...resolution,
|
|
11494
|
-
defer
|
|
11552
|
+
defer,
|
|
11495
11553
|
};
|
|
11496
11554
|
const fac = compileDeclareFactory(checker.toFactoryMetadata(meta, checker.FactoryTarget.Component));
|
|
11497
11555
|
const inputTransformFields = compileInputTransformFields(analysis.inputs);
|
|
@@ -11500,7 +11558,7 @@ class ComponentDecoratorHandler {
|
|
|
11500
11558
|
? compileComponentDeclareClassMetadata(analysis.classMetadata, perComponentDeferredDeps).toStmt()
|
|
11501
11559
|
: null;
|
|
11502
11560
|
const hmrMeta = this.enableHmr
|
|
11503
|
-
? extractHmrMetatadata(node, this.reflector, this.compilerHost, this.rootDirs, def, fac, classMetadata, null)
|
|
11561
|
+
? extractHmrMetatadata(node, this.reflector, this.compilerHost, this.rootDirs, def, fac, defer, classMetadata, null)
|
|
11504
11562
|
: null;
|
|
11505
11563
|
const hmrInitializer = hmrMeta ? compileHmrInitializer(hmrMeta).toStmt() : null;
|
|
11506
11564
|
const deferrableImports = this.canDeferDeps
|
|
@@ -11513,10 +11571,11 @@ class ComponentDecoratorHandler {
|
|
|
11513
11571
|
// within the `@Component.deferredImports` array, because in this mode compiler
|
|
11514
11572
|
// doesn't have information on which dependencies belong to which defer blocks.
|
|
11515
11573
|
const deferrableTypes = this.canDeferDeps ? analysis.explicitlyDeferredTypes : null;
|
|
11574
|
+
const defer = this.compileDeferBlocks(resolution);
|
|
11516
11575
|
const meta = {
|
|
11517
11576
|
...analysis.meta,
|
|
11518
11577
|
...resolution,
|
|
11519
|
-
defer
|
|
11578
|
+
defer,
|
|
11520
11579
|
};
|
|
11521
11580
|
if (deferrableTypes !== null) {
|
|
11522
11581
|
removeDeferrableTypesFromComponentDecorator(analysis, deferrableTypes);
|
|
@@ -11531,7 +11590,7 @@ class ComponentDecoratorHandler {
|
|
|
11531
11590
|
? compileClassDebugInfo(analysis.classDebugInfo).toStmt()
|
|
11532
11591
|
: null;
|
|
11533
11592
|
const hmrMeta = this.enableHmr
|
|
11534
|
-
? extractHmrMetatadata(node, this.reflector, this.compilerHost, this.rootDirs, def, fac, classMetadata, debugInfo)
|
|
11593
|
+
? extractHmrMetatadata(node, this.reflector, this.compilerHost, this.rootDirs, def, fac, defer, classMetadata, debugInfo)
|
|
11535
11594
|
: null;
|
|
11536
11595
|
const hmrInitializer = hmrMeta ? compileHmrInitializer(hmrMeta).toStmt() : null;
|
|
11537
11596
|
const deferrableImports = this.canDeferDeps
|
|
@@ -11545,10 +11604,11 @@ class ComponentDecoratorHandler {
|
|
|
11545
11604
|
}
|
|
11546
11605
|
// Create a brand-new constant pool since there shouldn't be any constant sharing.
|
|
11547
11606
|
const pool = new checker.ConstantPool();
|
|
11607
|
+
const defer = this.compileDeferBlocks(resolution);
|
|
11548
11608
|
const meta = {
|
|
11549
11609
|
...analysis.meta,
|
|
11550
11610
|
...resolution,
|
|
11551
|
-
defer
|
|
11611
|
+
defer,
|
|
11552
11612
|
};
|
|
11553
11613
|
const fac = compileNgFactoryDefField(checker.toFactoryMetadata(meta, checker.FactoryTarget.Component));
|
|
11554
11614
|
const def = checker.compileComponentFromMetadata(meta, pool, checker.makeBindingParser());
|
|
@@ -11559,7 +11619,7 @@ class ComponentDecoratorHandler {
|
|
|
11559
11619
|
? compileClassDebugInfo(analysis.classDebugInfo).toStmt()
|
|
11560
11620
|
: null;
|
|
11561
11621
|
const hmrMeta = this.enableHmr
|
|
11562
|
-
? extractHmrMetatadata(node, this.reflector, this.compilerHost, this.rootDirs, def, fac, classMetadata, debugInfo)
|
|
11622
|
+
? extractHmrMetatadata(node, this.reflector, this.compilerHost, this.rootDirs, def, fac, defer, classMetadata, debugInfo)
|
|
11563
11623
|
: null;
|
|
11564
11624
|
const res = checker.compileResults(fac, def, classMetadata, 'ɵcmp', null, null, debugInfo, null);
|
|
11565
11625
|
return hmrMeta === null || res.length === 0
|
|
@@ -14692,7 +14752,7 @@ class DocsExtractor {
|
|
|
14692
14752
|
getExportedDeclarations(sourceFile) {
|
|
14693
14753
|
// Use the reflection host to get all the exported declarations from this
|
|
14694
14754
|
// source file entry point.
|
|
14695
|
-
const reflector = new checker.TypeScriptReflectionHost(this.typeChecker);
|
|
14755
|
+
const reflector = new checker.TypeScriptReflectionHost(this.typeChecker, false, true);
|
|
14696
14756
|
const exportedDeclarationMap = reflector.getExportsOfModule(sourceFile);
|
|
14697
14757
|
// Augment each declaration with the exported name in the public API.
|
|
14698
14758
|
let exportedDeclarations = Array.from(exportedDeclarationMap?.entries() ?? []).map(([exportName, declaration]) => [exportName, declaration.node]);
|
|
@@ -17017,7 +17077,7 @@ const factory = {
|
|
|
17017
17077
|
*
|
|
17018
17078
|
* @publicApi
|
|
17019
17079
|
*/
|
|
17020
|
-
|
|
17080
|
+
exports.DiagnosticCategoryLabel = void 0;
|
|
17021
17081
|
(function (DiagnosticCategoryLabel) {
|
|
17022
17082
|
/** Treat the diagnostic as a warning, don't fail the compilation. */
|
|
17023
17083
|
DiagnosticCategoryLabel["Warning"] = "warning";
|
|
@@ -17025,7 +17085,7 @@ var DiagnosticCategoryLabel;
|
|
|
17025
17085
|
DiagnosticCategoryLabel["Error"] = "error";
|
|
17026
17086
|
/** Ignore the diagnostic altogether. */
|
|
17027
17087
|
DiagnosticCategoryLabel["Suppress"] = "suppress";
|
|
17028
|
-
})(DiagnosticCategoryLabel || (DiagnosticCategoryLabel = {}));
|
|
17088
|
+
})(exports.DiagnosticCategoryLabel || (exports.DiagnosticCategoryLabel = {}));
|
|
17029
17089
|
|
|
17030
17090
|
class ExtendedTemplateCheckerImpl {
|
|
17031
17091
|
partialCtx;
|
|
@@ -17037,7 +17097,7 @@ class ExtendedTemplateCheckerImpl {
|
|
|
17037
17097
|
// Read the diagnostic category from compiler options.
|
|
17038
17098
|
const category = diagnosticLabelToCategory(options?.extendedDiagnostics?.checks?.[factory.name] ??
|
|
17039
17099
|
options?.extendedDiagnostics?.defaultCategory ??
|
|
17040
|
-
DiagnosticCategoryLabel.Warning);
|
|
17100
|
+
exports.DiagnosticCategoryLabel.Warning);
|
|
17041
17101
|
// Skip the diagnostic if suppressed via compiler options.
|
|
17042
17102
|
if (category === null) {
|
|
17043
17103
|
continue;
|
|
@@ -17083,11 +17143,11 @@ class ExtendedTemplateCheckerImpl {
|
|
|
17083
17143
|
*/
|
|
17084
17144
|
function diagnosticLabelToCategory(label) {
|
|
17085
17145
|
switch (label) {
|
|
17086
|
-
case DiagnosticCategoryLabel.Warning:
|
|
17146
|
+
case exports.DiagnosticCategoryLabel.Warning:
|
|
17087
17147
|
return ts__default["default"].DiagnosticCategory.Warning;
|
|
17088
|
-
case DiagnosticCategoryLabel.Error:
|
|
17148
|
+
case exports.DiagnosticCategoryLabel.Error:
|
|
17089
17149
|
return ts__default["default"].DiagnosticCategory.Error;
|
|
17090
|
-
case DiagnosticCategoryLabel.Suppress:
|
|
17150
|
+
case exports.DiagnosticCategoryLabel.Suppress:
|
|
17091
17151
|
return null;
|
|
17092
17152
|
default:
|
|
17093
17153
|
return assertNever(label);
|
|
@@ -20166,7 +20226,7 @@ var semver = /*@__PURE__*/getDefaultExportFromCjs(semverExports);
|
|
|
20166
20226
|
* @param minVersion Minimum required version for the feature.
|
|
20167
20227
|
*/
|
|
20168
20228
|
function coreVersionSupportsFeature(coreVersion, minVersion) {
|
|
20169
|
-
// A version of `19.1.0
|
|
20229
|
+
// A version of `19.1.0` usually means that core is at head so it supports
|
|
20170
20230
|
// all features. Use string interpolation prevent the placeholder from being replaced
|
|
20171
20231
|
// with the current version during build time.
|
|
20172
20232
|
if (coreVersion === `0.0.0-${'PLACEHOLDER'}`) {
|
|
@@ -20810,8 +20870,8 @@ class NgCompiler {
|
|
|
20810
20870
|
// (providing the full TemplateTypeChecker API) and if strict mode is not enabled. In strict
|
|
20811
20871
|
// mode, the user is in full control of type inference.
|
|
20812
20872
|
suggestionsForSuboptimalTypeInference: this.enableTemplateTypeChecker && !strictTemplates,
|
|
20813
|
-
controlFlowPreventingContentProjection: this.options.extendedDiagnostics?.defaultCategory || DiagnosticCategoryLabel.Warning,
|
|
20814
|
-
unusedStandaloneImports: this.options.extendedDiagnostics?.defaultCategory || DiagnosticCategoryLabel.Warning,
|
|
20873
|
+
controlFlowPreventingContentProjection: this.options.extendedDiagnostics?.defaultCategory || exports.DiagnosticCategoryLabel.Warning,
|
|
20874
|
+
unusedStandaloneImports: this.options.extendedDiagnostics?.defaultCategory || exports.DiagnosticCategoryLabel.Warning,
|
|
20815
20875
|
allowSignalsInTwoWayBindings,
|
|
20816
20876
|
checkTwoWayBoundEvents,
|
|
20817
20877
|
};
|
|
@@ -20844,8 +20904,8 @@ class NgCompiler {
|
|
|
20844
20904
|
// In "basic" template type-checking mode, no warnings are produced since most things are
|
|
20845
20905
|
// not checked anyways.
|
|
20846
20906
|
suggestionsForSuboptimalTypeInference: false,
|
|
20847
|
-
controlFlowPreventingContentProjection: this.options.extendedDiagnostics?.defaultCategory || DiagnosticCategoryLabel.Warning,
|
|
20848
|
-
unusedStandaloneImports: this.options.extendedDiagnostics?.defaultCategory || DiagnosticCategoryLabel.Warning,
|
|
20907
|
+
controlFlowPreventingContentProjection: this.options.extendedDiagnostics?.defaultCategory || exports.DiagnosticCategoryLabel.Warning,
|
|
20908
|
+
unusedStandaloneImports: this.options.extendedDiagnostics?.defaultCategory || exports.DiagnosticCategoryLabel.Warning,
|
|
20849
20909
|
allowSignalsInTwoWayBindings,
|
|
20850
20910
|
checkTwoWayBoundEvents,
|
|
20851
20911
|
};
|
|
@@ -21235,7 +21295,7 @@ One of the following actions is required:
|
|
|
21235
21295
|
`.trim(),
|
|
21236
21296
|
});
|
|
21237
21297
|
}
|
|
21238
|
-
const allowedCategoryLabels = Array.from(Object.values(DiagnosticCategoryLabel));
|
|
21298
|
+
const allowedCategoryLabels = Array.from(Object.values(exports.DiagnosticCategoryLabel));
|
|
21239
21299
|
const defaultCategory = options.extendedDiagnostics?.defaultCategory;
|
|
21240
21300
|
if (defaultCategory && !allowedCategoryLabels.includes(defaultCategory)) {
|
|
21241
21301
|
yield makeConfigDiagnostic({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v19.1.0
|
|
3
|
+
* @license Angular v19.1.0
|
|
4
4
|
* (c) 2010-2024 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -10,12 +10,12 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
10
10
|
|
|
11
11
|
var schematics = require('@angular-devkit/schematics');
|
|
12
12
|
var p = require('path');
|
|
13
|
-
var project_tsconfig_paths = require('./project_tsconfig_paths-
|
|
14
|
-
var compiler_host = require('./compiler_host-
|
|
13
|
+
var project_tsconfig_paths = require('./project_tsconfig_paths-6c9cde78.js');
|
|
14
|
+
var compiler_host = require('./compiler_host-f0b570c8.js');
|
|
15
15
|
var ts = require('typescript');
|
|
16
|
-
var imports = require('./imports-
|
|
16
|
+
var imports = require('./imports-31a38653.js');
|
|
17
17
|
require('@angular-devkit/core');
|
|
18
|
-
require('./checker-
|
|
18
|
+
require('./checker-aa999c96.js');
|
|
19
19
|
require('os');
|
|
20
20
|
require('fs');
|
|
21
21
|
require('module');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v19.1.0
|
|
3
|
+
* @license Angular v19.1.0
|
|
4
4
|
* (c) 2010-2024 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -11,10 +11,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
11
11
|
var schematics = require('@angular-devkit/schematics');
|
|
12
12
|
var fs = require('fs');
|
|
13
13
|
var p = require('path');
|
|
14
|
-
var compiler_host = require('./compiler_host-
|
|
15
|
-
var project_tsconfig_paths = require('./project_tsconfig_paths-
|
|
14
|
+
var compiler_host = require('./compiler_host-f0b570c8.js');
|
|
15
|
+
var project_tsconfig_paths = require('./project_tsconfig_paths-6c9cde78.js');
|
|
16
16
|
var ts = require('typescript');
|
|
17
|
-
var checker = require('./checker-
|
|
17
|
+
var checker = require('./checker-aa999c96.js');
|
|
18
18
|
require('os');
|
|
19
19
|
require('@angular-devkit/core');
|
|
20
20
|
require('module');
|