@angular/core 20.0.0-next.2 → 20.0.0-next.3
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/core.mjs +413 -365
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/primitives/di.mjs +3 -2
- package/fesm2022/primitives/di.mjs.map +1 -1
- package/fesm2022/primitives/event-dispatch.mjs +1 -1
- package/fesm2022/primitives/signals.mjs +28 -7
- package/fesm2022/primitives/signals.mjs.map +1 -1
- package/fesm2022/rxjs-interop.mjs +1 -8
- package/fesm2022/rxjs-interop.mjs.map +1 -1
- package/fesm2022/testing.mjs +2 -10
- package/fesm2022/testing.mjs.map +1 -1
- package/fesm2022/weak_ref-DrMdAIDh.mjs +1 -1
- package/index.d.ts +7523 -7489
- package/navigation_types.d-u4EOrrdZ.d.ts +1 -1
- package/package.json +2 -2
- package/primitives/di/index.d.ts +25 -10
- package/primitives/event-dispatch/index.d.ts +1 -1
- package/primitives/signals/index.d.ts +9 -6
- package/rxjs-interop/index.d.ts +1 -10
- package/schematics/bundles/{apply_import_manager-CyRT0UvU.js → apply_import_manager-BXQEjo09.js} +6 -6
- package/schematics/bundles/{checker-DF8ZaFW5.js → checker-BHb19MHt.js} +629 -71
- package/schematics/bundles/cleanup-unused-imports.js +42 -69
- package/schematics/bundles/{compiler_host-Da636uJ8.js → compiler_host-Bk3repE2.js} +2 -2
- package/schematics/bundles/control-flow-migration.js +3 -3
- package/schematics/bundles/imports-CIX-JgAN.js +1 -1
- package/schematics/bundles/{index-DnkWgagp.js → index-BL9kAIe5.js} +11 -11
- package/schematics/bundles/{program-BZk27Ndu.js → index-I8VbxQcO.js} +2234 -2097
- package/schematics/bundles/inject-flags.js +18 -52
- package/schematics/bundles/inject-migration.js +3 -3
- package/schematics/bundles/leading_space-D9nQ8UQC.js +1 -1
- package/schematics/bundles/{migrate_ts_type_references-DtkOnnv0.js → migrate_ts_type_references-KlOTWeDl.js} +20 -20
- package/schematics/bundles/ng_decorators-DznZ5jMl.js +1 -1
- package/schematics/bundles/nodes-B16H9JUd.js +1 -1
- package/schematics/bundles/output-migration.js +62 -90
- package/schematics/bundles/project_tsconfig_paths-CDVxT6Ov.js +1 -1
- package/schematics/bundles/property_name-BBwFuqMe.js +1 -1
- package/schematics/bundles/route-lazy-loading.js +3 -3
- package/schematics/bundles/{project_paths-Jtbi76Bs.js → run_in_devkit-C0JPtK2u.js} +262 -197
- package/schematics/bundles/self-closing-tags-migration.js +41 -71
- package/schematics/bundles/signal-input-migration.js +69 -97
- package/schematics/bundles/signal-queries-migration.js +80 -108
- package/schematics/bundles/signals.js +11 -11
- package/schematics/bundles/standalone-migration.js +8 -22
- package/schematics/bundles/symbol-VPWguRxr.js +25 -0
- package/schematics/bundles/test-bed-get.js +98 -0
- package/schematics/migrations.json +5 -0
- package/testing/index.d.ts +1 -3
- package/weak_ref.d-ttyj86RV.d.ts +1 -1
- package/schematics/bundles/index-vGJcp5M7.js +0 -30
|
@@ -1,36 +1,35 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v20.0.0-next.
|
|
3
|
+
* @license Angular v20.0.0-next.3
|
|
4
4
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
7
7
|
'use strict';
|
|
8
8
|
|
|
9
|
-
var schematics = require('@angular-devkit/schematics');
|
|
10
|
-
var project_tsconfig_paths = require('./project_tsconfig_paths-CDVxT6Ov.js');
|
|
11
|
-
var project_paths = require('./project_paths-Jtbi76Bs.js');
|
|
12
|
-
require('os');
|
|
13
9
|
var ts = require('typescript');
|
|
14
|
-
|
|
15
|
-
var
|
|
10
|
+
require('os');
|
|
11
|
+
var checker = require('./checker-BHb19MHt.js');
|
|
12
|
+
var index = require('./index-I8VbxQcO.js');
|
|
16
13
|
require('path');
|
|
17
|
-
require('./
|
|
18
|
-
var apply_import_manager = require('./apply_import_manager-
|
|
14
|
+
var run_in_devkit = require('./run_in_devkit-C0JPtK2u.js');
|
|
15
|
+
var apply_import_manager = require('./apply_import_manager-BXQEjo09.js');
|
|
19
16
|
require('@angular-devkit/core');
|
|
20
17
|
require('node:path/posix');
|
|
21
18
|
require('fs');
|
|
22
19
|
require('module');
|
|
23
20
|
require('url');
|
|
21
|
+
require('@angular-devkit/schematics');
|
|
22
|
+
require('./project_tsconfig_paths-CDVxT6Ov.js');
|
|
24
23
|
|
|
25
24
|
/** Migration that cleans up unused imports from a project. */
|
|
26
|
-
class UnusedImportsMigration extends
|
|
25
|
+
class UnusedImportsMigration extends run_in_devkit.TsurgeFunnelMigration {
|
|
27
26
|
printer = ts.createPrinter();
|
|
28
27
|
createProgram(tsconfigAbsPath, fs) {
|
|
29
28
|
return super.createProgram(tsconfigAbsPath, fs, {
|
|
30
29
|
extendedDiagnostics: {
|
|
31
30
|
checks: {
|
|
32
31
|
// Ensure that the diagnostic is enabled.
|
|
33
|
-
unusedStandaloneImports:
|
|
32
|
+
unusedStandaloneImports: index.DiagnosticCategoryLabel.Warning,
|
|
34
33
|
},
|
|
35
34
|
},
|
|
36
35
|
});
|
|
@@ -62,10 +61,10 @@ class UnusedImportsMigration extends project_paths.TsurgeFunnelMigration {
|
|
|
62
61
|
}
|
|
63
62
|
this.generateReplacements(sourceFile, resolvedLocations, usageAnalysis, info, replacements);
|
|
64
63
|
});
|
|
65
|
-
return
|
|
64
|
+
return run_in_devkit.confirmAsSerializable({ replacements, removedIdentifiers, changedFiles });
|
|
66
65
|
}
|
|
67
66
|
async migrate(globalData) {
|
|
68
|
-
return
|
|
67
|
+
return run_in_devkit.confirmAsSerializable(globalData);
|
|
69
68
|
}
|
|
70
69
|
async combine(unitA, unitB) {
|
|
71
70
|
const combinedReplacements = [];
|
|
@@ -89,14 +88,14 @@ class UnusedImportsMigration extends project_paths.TsurgeFunnelMigration {
|
|
|
89
88
|
}
|
|
90
89
|
}
|
|
91
90
|
});
|
|
92
|
-
return
|
|
91
|
+
return run_in_devkit.confirmAsSerializable({
|
|
93
92
|
replacements: combinedReplacements,
|
|
94
93
|
removedIdentifiers: combinedRemovedIdentifiers,
|
|
95
94
|
changedFiles: changedFileIds.size,
|
|
96
95
|
});
|
|
97
96
|
}
|
|
98
97
|
async globalMeta(combinedData) {
|
|
99
|
-
return
|
|
98
|
+
return run_in_devkit.confirmAsSerializable(combinedData);
|
|
100
99
|
}
|
|
101
100
|
async stats(globalMetadata) {
|
|
102
101
|
return {
|
|
@@ -223,7 +222,7 @@ class UnusedImportsMigration extends project_paths.TsurgeFunnelMigration {
|
|
|
223
222
|
const importManager = new checker.ImportManager();
|
|
224
223
|
// Replace full arrays with empty ones. This allows preserves more of the user's formatting.
|
|
225
224
|
fullRemovals.forEach((node) => {
|
|
226
|
-
replacements.push(new
|
|
225
|
+
replacements.push(new run_in_devkit.Replacement(run_in_devkit.projectFile(sourceFile, info), new run_in_devkit.TextUpdate({
|
|
227
226
|
position: node.getStart(),
|
|
228
227
|
end: node.getEnd(),
|
|
229
228
|
toInsert: '[]',
|
|
@@ -232,7 +231,7 @@ class UnusedImportsMigration extends project_paths.TsurgeFunnelMigration {
|
|
|
232
231
|
// Filter out the unused identifiers from an array.
|
|
233
232
|
partialRemovals.forEach((toRemove, node) => {
|
|
234
233
|
const newNode = ts.factory.updateArrayLiteralExpression(node, node.elements.filter((el) => !toRemove.has(el)));
|
|
235
|
-
replacements.push(new
|
|
234
|
+
replacements.push(new run_in_devkit.Replacement(run_in_devkit.projectFile(sourceFile, info), new run_in_devkit.TextUpdate({
|
|
236
235
|
position: node.getStart(),
|
|
237
236
|
end: node.getEnd(),
|
|
238
237
|
toInsert: this.printer.printNode(ts.EmitHint.Unspecified, newNode, sourceFile),
|
|
@@ -264,59 +263,33 @@ class UnusedImportsMigration extends project_paths.TsurgeFunnelMigration {
|
|
|
264
263
|
|
|
265
264
|
function migrate() {
|
|
266
265
|
return async (tree, context) => {
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
266
|
+
await run_in_devkit.runMigrationInDevkit({
|
|
267
|
+
getMigration: () => new UnusedImportsMigration(),
|
|
268
|
+
tree,
|
|
269
|
+
beforeProgramCreation: (tsconfigPath) => {
|
|
270
|
+
context.logger.info(`Preparing analysis for ${tsconfigPath}`);
|
|
271
|
+
},
|
|
272
|
+
beforeUnitAnalysis: (tsconfigPath) => {
|
|
273
|
+
context.logger.info(`Scanning for unused imports using ${tsconfigPath}`);
|
|
274
|
+
},
|
|
275
|
+
afterAnalysisFailure: () => {
|
|
276
|
+
context.logger.error('Schematic failed unexpectedly with no analysis data');
|
|
277
|
+
},
|
|
278
|
+
whenDone: (stats) => {
|
|
279
|
+
const { removedImports, changedFiles } = stats.counters;
|
|
280
|
+
let statsMessage;
|
|
281
|
+
if (removedImports === 0) {
|
|
282
|
+
statsMessage = 'Schematic could not find unused imports in the project';
|
|
283
|
+
}
|
|
284
|
+
else {
|
|
285
|
+
statsMessage =
|
|
286
|
+
`Removed ${removedImports} import${removedImports !== 1 ? 's' : ''} ` +
|
|
287
|
+
`in ${changedFiles} file${changedFiles !== 1 ? 's' : ''}`;
|
|
288
|
+
}
|
|
289
|
+
context.logger.info('');
|
|
290
|
+
context.logger.info(statsMessage);
|
|
291
|
+
},
|
|
280
292
|
});
|
|
281
|
-
for (const { info, tsconfigPath } of programInfos) {
|
|
282
|
-
context.logger.info(`Scanning for unused imports using ${tsconfigPath}`);
|
|
283
|
-
unitResults.push(await migration.analyze(info));
|
|
284
|
-
}
|
|
285
|
-
const combined = await project_paths.synchronouslyCombineUnitData(migration, unitResults);
|
|
286
|
-
if (combined === null) {
|
|
287
|
-
context.logger.error('Schematic failed unexpectedly with no analysis data');
|
|
288
|
-
return;
|
|
289
|
-
}
|
|
290
|
-
const globalMeta = await migration.globalMeta(combined);
|
|
291
|
-
const replacementsPerFile = new Map();
|
|
292
|
-
const { replacements } = await migration.migrate(globalMeta);
|
|
293
|
-
const changesPerFile = project_paths.groupReplacementsByFile(replacements);
|
|
294
|
-
for (const [file, changes] of changesPerFile) {
|
|
295
|
-
if (!replacementsPerFile.has(file)) {
|
|
296
|
-
replacementsPerFile.set(file, changes);
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
for (const [file, changes] of replacementsPerFile) {
|
|
300
|
-
const recorder = tree.beginUpdate(file);
|
|
301
|
-
for (const c of changes) {
|
|
302
|
-
recorder
|
|
303
|
-
.remove(c.data.position, c.data.end - c.data.position)
|
|
304
|
-
.insertRight(c.data.position, c.data.toInsert);
|
|
305
|
-
}
|
|
306
|
-
tree.commitUpdate(recorder);
|
|
307
|
-
}
|
|
308
|
-
const { counters: { removedImports, changedFiles }, } = await migration.stats(globalMeta);
|
|
309
|
-
let statsMessage;
|
|
310
|
-
if (removedImports === 0) {
|
|
311
|
-
statsMessage = 'Schematic could not find unused imports in the project';
|
|
312
|
-
}
|
|
313
|
-
else {
|
|
314
|
-
statsMessage =
|
|
315
|
-
`Removed ${removedImports} import${removedImports !== 1 ? 's' : ''} ` +
|
|
316
|
-
`in ${changedFiles} file${changedFiles !== 1 ? 's' : ''}`;
|
|
317
|
-
}
|
|
318
|
-
context.logger.info('');
|
|
319
|
-
context.logger.info(statsMessage);
|
|
320
293
|
};
|
|
321
294
|
}
|
|
322
295
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v20.0.0-next.
|
|
3
|
+
* @license Angular v20.0.0-next.3
|
|
4
4
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
7
7
|
'use strict';
|
|
8
8
|
|
|
9
9
|
var ts = require('typescript');
|
|
10
|
-
var checker = require('./checker-
|
|
10
|
+
var checker = require('./checker-BHb19MHt.js');
|
|
11
11
|
require('os');
|
|
12
12
|
var p = require('path');
|
|
13
13
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v20.0.0-next.
|
|
3
|
+
* @license Angular v20.0.0-next.3
|
|
4
4
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
|
|
9
9
|
var schematics = require('@angular-devkit/schematics');
|
|
10
10
|
var p = require('path');
|
|
11
|
-
var compiler_host = require('./compiler_host-
|
|
12
|
-
var checker = require('./checker-
|
|
11
|
+
var compiler_host = require('./compiler_host-Bk3repE2.js');
|
|
12
|
+
var checker = require('./checker-BHb19MHt.js');
|
|
13
13
|
var ts = require('typescript');
|
|
14
14
|
require('os');
|
|
15
15
|
require('fs');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v20.0.0-next.
|
|
3
|
+
* @license Angular v20.0.0-next.3
|
|
4
4
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
|
|
9
9
|
var ts = require('typescript');
|
|
10
10
|
require('os');
|
|
11
|
-
var checker = require('./checker-
|
|
12
|
-
var
|
|
11
|
+
var checker = require('./checker-BHb19MHt.js');
|
|
12
|
+
var index = require('./index-I8VbxQcO.js');
|
|
13
13
|
require('path');
|
|
14
|
-
var
|
|
14
|
+
var run_in_devkit = require('./run_in_devkit-C0JPtK2u.js');
|
|
15
15
|
|
|
16
16
|
function getMemberName(member) {
|
|
17
17
|
if (member.name === undefined) {
|
|
@@ -611,7 +611,7 @@ function identifyHostBindingReferences(node, programInfo, checker$1, reflector,
|
|
|
611
611
|
readAstPath: ref.readAstPath,
|
|
612
612
|
isObjectShorthandExpression: ref.isObjectShorthandExpression,
|
|
613
613
|
isWrite: ref.isWrite,
|
|
614
|
-
file:
|
|
614
|
+
file: run_in_devkit.projectFile(ref.context.getSourceFile(), programInfo),
|
|
615
615
|
hostPropertyNode: ref.context,
|
|
616
616
|
},
|
|
617
617
|
target: ref.targetField,
|
|
@@ -628,7 +628,7 @@ function identifyHostBindingReferences(node, programInfo, checker$1, reflector,
|
|
|
628
628
|
*/
|
|
629
629
|
function attemptExtractTemplateDefinition(node, checker$1, reflector, resourceLoader) {
|
|
630
630
|
const classDecorators = reflector.getDecoratorsOfDeclaration(node);
|
|
631
|
-
const evaluator = new
|
|
631
|
+
const evaluator = new index.PartialEvaluator(reflector, checker$1, null);
|
|
632
632
|
const ngDecorators = classDecorators !== null
|
|
633
633
|
? checker.getAngularDecorators(classDecorators, ['Component'], /* isAngularCore */ false)
|
|
634
634
|
: [];
|
|
@@ -711,8 +711,8 @@ function identifyTemplateReferences(programInfo, node, reflector, checker$1, eva
|
|
|
711
711
|
readAstPath: res.readAstPath,
|
|
712
712
|
node: res.context,
|
|
713
713
|
isObjectShorthandExpression: res.isObjectShorthandExpression,
|
|
714
|
-
originatingTsFile:
|
|
715
|
-
templateFile:
|
|
714
|
+
originatingTsFile: run_in_devkit.projectFile(node.getSourceFile(), programInfo),
|
|
715
|
+
templateFile: run_in_devkit.projectFile(checker.absoluteFrom(templateFilePath), programInfo),
|
|
716
716
|
isLikelyPartOfNarrowing: res.isLikelyNarrowed,
|
|
717
717
|
isWrite: res.isWrite,
|
|
718
718
|
},
|
|
@@ -738,7 +738,7 @@ function extractTemplateWithoutCompilerAnalysis(node, checker$1, reflector, reso
|
|
|
738
738
|
if (tmplDef === null) {
|
|
739
739
|
return null;
|
|
740
740
|
}
|
|
741
|
-
return
|
|
741
|
+
return index.extractTemplate(node, tmplDef, evaluator, null, resourceLoader, {
|
|
742
742
|
enableBlockSyntax: true,
|
|
743
743
|
enableLetSyntax: true,
|
|
744
744
|
usePoisonedData: true,
|
|
@@ -894,7 +894,7 @@ function identifyPotentialTypeScriptReference(node, programInfo, checker, knownF
|
|
|
894
894
|
kind: exports.ReferenceKind.TsReference,
|
|
895
895
|
from: {
|
|
896
896
|
node,
|
|
897
|
-
file:
|
|
897
|
+
file: run_in_devkit.projectFile(node.getSourceFile(), programInfo),
|
|
898
898
|
isWrite: isWriteReference,
|
|
899
899
|
isPartOfElementBinding: ts.isBindingElement(node.parent),
|
|
900
900
|
},
|
|
@@ -958,7 +958,7 @@ function createFindAllSourceFileReferencesVisitor(programInfo, checker, reflecto
|
|
|
958
958
|
result.references.push({
|
|
959
959
|
kind: exports.ReferenceKind.TsClassTypeReference,
|
|
960
960
|
from: {
|
|
961
|
-
file:
|
|
961
|
+
file: run_in_devkit.projectFile(partialDirectiveInCatalyst.referenceNode.getSourceFile(), programInfo),
|
|
962
962
|
node: partialDirectiveInCatalyst.referenceNode,
|
|
963
963
|
},
|
|
964
964
|
isPartialReference: true,
|