@angular/core 20.0.0-next.2 → 20.0.0-next.4
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/event_dispatcher.d-pVP0-wST.d.ts +345 -0
- package/fesm2022/core.mjs +614 -428
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/injector-BlLwZ2sr.mjs +24 -0
- package/fesm2022/injector-BlLwZ2sr.mjs.map +1 -0
- package/fesm2022/primitives/di.mjs +5 -18
- package/fesm2022/primitives/di.mjs.map +1 -1
- package/fesm2022/primitives/event-dispatch.mjs +1 -1
- package/fesm2022/primitives/signals.mjs +4 -589
- 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/untracked-DkcXpNb_.mjs +620 -0
- package/fesm2022/untracked-DkcXpNb_.mjs.map +1 -0
- package/index.d.ts +7589 -7510
- package/{navigation_types.d-u4EOrrdZ.d.ts → navigation_types.d-DgDrF5rp.d.ts} +2 -2
- package/package.json +2 -2
- package/primitives/di/index.d.ts +25 -10
- package/primitives/event-dispatch/index.d.ts +5 -340
- package/primitives/signals/index.d.ts +5 -208
- package/rxjs-interop/index.d.ts +1 -10
- package/schematics/bundles/{apply_import_manager-CyRT0UvU.js → apply_import_manager-CeNv8GIG.js} +6 -6
- package/schematics/bundles/{checker-DF8ZaFW5.js → checker-k591b6WQ.js} +856 -180
- package/schematics/bundles/cleanup-unused-imports.js +42 -69
- package/schematics/bundles/{compiler_host-Da636uJ8.js → compiler_host-DwM3ugW3.js} +2 -2
- package/schematics/bundles/control-flow-migration.js +34 -13
- package/schematics/bundles/imports-CIX-JgAN.js +1 -1
- package/schematics/bundles/{program-BZk27Ndu.js → index-B4OAlHh8.js} +2234 -2097
- package/schematics/bundles/{index-DnkWgagp.js → index-BhELUmYx.js} +11 -11
- 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-Be0TNYen.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-CkvEksWP.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 +2 -4
- package/weak_ref.d-BZ7gyRag.d.ts +216 -0
- package/fesm2022/weak_ref-DrMdAIDh.mjs +0 -12
- package/fesm2022/weak_ref-DrMdAIDh.mjs.map +0 -1
- package/schematics/bundles/index-vGJcp5M7.js +0 -30
- package/weak_ref.d-ttyj86RV.d.ts +0 -9
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v20.0.0-next.
|
|
3
|
+
* @license Angular v20.0.0-next.4
|
|
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-k591b6WQ.js');
|
|
12
|
+
var index$1 = require('./index-B4OAlHh8.js');
|
|
16
13
|
require('path');
|
|
17
|
-
var
|
|
18
|
-
var
|
|
14
|
+
var run_in_devkit = require('./run_in_devkit-CkvEksWP.js');
|
|
15
|
+
var apply_import_manager = require('./apply_import_manager-CeNv8GIG.js');
|
|
16
|
+
var index = require('./index-BhELUmYx.js');
|
|
19
17
|
require('@angular-devkit/core');
|
|
20
18
|
require('node:path/posix');
|
|
21
19
|
require('fs');
|
|
22
20
|
require('module');
|
|
23
21
|
require('url');
|
|
22
|
+
require('@angular-devkit/schematics');
|
|
23
|
+
require('./project_tsconfig_paths-CDVxT6Ov.js');
|
|
24
24
|
|
|
25
25
|
function isOutputDeclarationEligibleForMigration(node) {
|
|
26
26
|
return (node.initializer !== undefined &&
|
|
@@ -90,7 +90,7 @@ function getOutputDecorator(node, reflector) {
|
|
|
90
90
|
// THINK: this utility + type is not specific to @Output, really, maybe move it to tsurge?
|
|
91
91
|
/** Computes an unique ID for a given Angular `@Output` property. */
|
|
92
92
|
function getUniqueIdForProperty(info, prop) {
|
|
93
|
-
const { id } =
|
|
93
|
+
const { id } = run_in_devkit.projectFile(prop.getSourceFile(), info);
|
|
94
94
|
id.replace(/\.d\.ts$/, '.ts');
|
|
95
95
|
return `${id}@@${prop.parent.name ?? 'unknown-class'}@@${prop.name.getText()}`;
|
|
96
96
|
}
|
|
@@ -169,7 +169,7 @@ function calculateImportReplacements(info, sourceFiles) {
|
|
|
169
169
|
const importManager = new checker.ImportManager();
|
|
170
170
|
const addOnly = [];
|
|
171
171
|
const addRemove = [];
|
|
172
|
-
const file =
|
|
172
|
+
const file = run_in_devkit.projectFile(sf, info);
|
|
173
173
|
importManager.addImport({
|
|
174
174
|
requestedFile: sf,
|
|
175
175
|
exportModuleSpecifier: '@angular/core',
|
|
@@ -225,36 +225,36 @@ function calculatePipeCallReplacement(info, node) {
|
|
|
225
225
|
}
|
|
226
226
|
function prepareTextReplacementForNode(info, node, replacement, start) {
|
|
227
227
|
const sf = node.getSourceFile();
|
|
228
|
-
return new
|
|
228
|
+
return new run_in_devkit.Replacement(run_in_devkit.projectFile(sf, info), new run_in_devkit.TextUpdate({
|
|
229
229
|
position: start ?? node.getStart(),
|
|
230
230
|
end: node.getEnd(),
|
|
231
231
|
toInsert: replacement,
|
|
232
232
|
}));
|
|
233
233
|
}
|
|
234
234
|
function prepareTextReplacement(file, replacement, start, end) {
|
|
235
|
-
return new
|
|
235
|
+
return new run_in_devkit.Replacement(file, new run_in_devkit.TextUpdate({
|
|
236
236
|
position: start,
|
|
237
237
|
end: end,
|
|
238
238
|
toInsert: replacement,
|
|
239
239
|
}));
|
|
240
240
|
}
|
|
241
241
|
|
|
242
|
-
class OutputMigration extends
|
|
242
|
+
class OutputMigration extends run_in_devkit.TsurgeFunnelMigration {
|
|
243
243
|
config;
|
|
244
244
|
constructor(config = {}) {
|
|
245
245
|
super();
|
|
246
246
|
this.config = config;
|
|
247
247
|
}
|
|
248
248
|
async analyze(info) {
|
|
249
|
-
const { sourceFiles, program
|
|
249
|
+
const { sourceFiles, program } = info;
|
|
250
250
|
const outputFieldReplacements = {};
|
|
251
251
|
const problematicUsages = {};
|
|
252
252
|
let problematicDeclarationCount = 0;
|
|
253
253
|
const filesWithOutputDeclarations = new Set();
|
|
254
|
-
const checker$1 = program
|
|
254
|
+
const checker$1 = program.getTypeChecker();
|
|
255
255
|
const reflector = new checker.TypeScriptReflectionHost(checker$1);
|
|
256
|
-
const dtsReader = new
|
|
257
|
-
const evaluator = new
|
|
256
|
+
const dtsReader = new index$1.DtsMetadataReader(checker$1, reflector);
|
|
257
|
+
const evaluator = new index$1.PartialEvaluator(reflector, checker$1, null);
|
|
258
258
|
const resourceLoader = info.ngCompiler?.['resourceManager'] ?? null;
|
|
259
259
|
// Pre-analyze the program and get access to the template type checker.
|
|
260
260
|
// If we are processing a non-Angular target, there is no template info.
|
|
@@ -290,7 +290,7 @@ class OutputMigration extends project_paths.TsurgeFunnelMigration {
|
|
|
290
290
|
id: getUniqueIdForProperty(info, node),
|
|
291
291
|
aliasParam: outputDecorator.args?.at(0),
|
|
292
292
|
};
|
|
293
|
-
const outputFile =
|
|
293
|
+
const outputFile = run_in_devkit.projectFile(node.getSourceFile(), info);
|
|
294
294
|
if (this.config.shouldMigrate === undefined ||
|
|
295
295
|
this.config.shouldMigrate({
|
|
296
296
|
key: outputDef.id,
|
|
@@ -318,7 +318,7 @@ class OutputMigration extends project_paths.TsurgeFunnelMigration {
|
|
|
318
318
|
const propertyDeclaration = isTargetOutputDeclaration(node.expression.expression, checker$1, reflector, dtsReader);
|
|
319
319
|
if (propertyDeclaration !== null) {
|
|
320
320
|
const id = getUniqueIdForProperty(info, propertyDeclaration);
|
|
321
|
-
const outputFile =
|
|
321
|
+
const outputFile = run_in_devkit.projectFile(node.getSourceFile(), info);
|
|
322
322
|
addOutputReplacement(outputFieldReplacements, id, outputFile, calculateNextFnReplacement(info, node.expression.name));
|
|
323
323
|
}
|
|
324
324
|
}
|
|
@@ -327,7 +327,7 @@ class OutputMigration extends project_paths.TsurgeFunnelMigration {
|
|
|
327
327
|
const propertyDeclaration = isTargetOutputDeclaration(node.expression.expression, checker$1, reflector, dtsReader);
|
|
328
328
|
if (propertyDeclaration !== null) {
|
|
329
329
|
const id = getUniqueIdForProperty(info, propertyDeclaration);
|
|
330
|
-
const outputFile =
|
|
330
|
+
const outputFile = run_in_devkit.projectFile(node.getSourceFile(), info);
|
|
331
331
|
if (ts.isExpressionStatement(node.parent)) {
|
|
332
332
|
addOutputReplacement(outputFieldReplacements, id, outputFile, calculateCompleteCallReplacement(info, node.parent));
|
|
333
333
|
}
|
|
@@ -346,7 +346,7 @@ class OutputMigration extends project_paths.TsurgeFunnelMigration {
|
|
|
346
346
|
if (propertyDeclaration !== null) {
|
|
347
347
|
const id = getUniqueIdForProperty(info, propertyDeclaration);
|
|
348
348
|
if (isTestFile) {
|
|
349
|
-
const outputFile =
|
|
349
|
+
const outputFile = run_in_devkit.projectFile(node.getSourceFile(), info);
|
|
350
350
|
addOutputReplacement(outputFieldReplacements, id, outputFile, ...calculatePipeCallReplacement(info, node));
|
|
351
351
|
}
|
|
352
352
|
else {
|
|
@@ -390,7 +390,7 @@ class OutputMigration extends project_paths.TsurgeFunnelMigration {
|
|
|
390
390
|
}
|
|
391
391
|
// calculate import replacements but do so only for files that have output declarations
|
|
392
392
|
const importReplacements = calculateImportReplacements(info, filesWithOutputDeclarations);
|
|
393
|
-
return
|
|
393
|
+
return run_in_devkit.confirmAsSerializable({
|
|
394
394
|
problematicDeclarationCount,
|
|
395
395
|
outputFields: outputFieldReplacements,
|
|
396
396
|
importReplacements,
|
|
@@ -420,7 +420,7 @@ class OutputMigration extends project_paths.TsurgeFunnelMigration {
|
|
|
420
420
|
problematicUsages[declId] = unit.problematicUsages[declId];
|
|
421
421
|
}
|
|
422
422
|
}
|
|
423
|
-
return
|
|
423
|
+
return run_in_devkit.confirmAsSerializable({
|
|
424
424
|
problematicDeclarationCount,
|
|
425
425
|
outputFields,
|
|
426
426
|
importReplacements,
|
|
@@ -442,7 +442,7 @@ class OutputMigration extends project_paths.TsurgeFunnelMigration {
|
|
|
442
442
|
}
|
|
443
443
|
}
|
|
444
444
|
// Noop here as we don't have any form of special global metadata.
|
|
445
|
-
return
|
|
445
|
+
return run_in_devkit.confirmAsSerializable(combinedData);
|
|
446
446
|
}
|
|
447
447
|
async stats(globalMetadata) {
|
|
448
448
|
const detectedOutputs = new Set(Object.keys(globalMetadata.outputFields)).size +
|
|
@@ -501,73 +501,45 @@ function addOutputReplacement(outputFieldReplacements, outputId, file, ...replac
|
|
|
501
501
|
|
|
502
502
|
function migrate(options) {
|
|
503
503
|
return async (tree, context) => {
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
504
|
+
await run_in_devkit.runMigrationInDevkit({
|
|
505
|
+
tree,
|
|
506
|
+
getMigration: (fs) => new OutputMigration({
|
|
507
|
+
shouldMigrate: (_, file) => {
|
|
508
|
+
return (file.rootRelativePath.startsWith(fs.normalize(options.path)) &&
|
|
509
|
+
!/(^|\/)node_modules\//.test(file.rootRelativePath));
|
|
510
|
+
},
|
|
511
|
+
}),
|
|
512
|
+
beforeProgramCreation: (tsconfigPath) => {
|
|
513
|
+
context.logger.info(`Preparing analysis for: ${tsconfigPath}...`);
|
|
514
514
|
},
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
const info = migration.prepareProgram(baseInfo);
|
|
522
|
-
// Support restricting the analysis to subfolders for larger projects.
|
|
523
|
-
if (analysisPath !== '/') {
|
|
524
|
-
info.sourceFiles = info.sourceFiles.filter((sf) => sf.fileName.startsWith(analysisPath));
|
|
525
|
-
info.fullProgramSourceFiles = info.fullProgramSourceFiles.filter((sf) => sf.fileName.startsWith(analysisPath));
|
|
526
|
-
}
|
|
527
|
-
return { info, tsconfigPath };
|
|
528
|
-
});
|
|
529
|
-
// Analyze phase. Treat all projects as compilation units as
|
|
530
|
-
// this allows us to support references between those.
|
|
531
|
-
for (const { info, tsconfigPath } of programInfos) {
|
|
532
|
-
context.logger.info(`Scanning for outputs: ${tsconfigPath}..`);
|
|
533
|
-
unitResults.push(await migration.analyze(info));
|
|
534
|
-
}
|
|
535
|
-
context.logger.info(``);
|
|
536
|
-
context.logger.info(`Processing analysis data between targets..`);
|
|
537
|
-
context.logger.info(``);
|
|
538
|
-
const combined = await project_paths.synchronouslyCombineUnitData(migration, unitResults);
|
|
539
|
-
if (combined === null) {
|
|
540
|
-
context.logger.error('Migration failed unexpectedly with no analysis data');
|
|
541
|
-
return;
|
|
542
|
-
}
|
|
543
|
-
const globalMeta = await migration.globalMeta(combined);
|
|
544
|
-
const replacementsPerFile = new Map();
|
|
545
|
-
for (const { info, tsconfigPath } of programInfos) {
|
|
546
|
-
context.logger.info(`Migrating: ${tsconfigPath}..`);
|
|
547
|
-
const { replacements } = await migration.migrate(globalMeta);
|
|
548
|
-
const changesPerFile = project_paths.groupReplacementsByFile(replacements);
|
|
549
|
-
for (const [file, changes] of changesPerFile) {
|
|
550
|
-
if (!replacementsPerFile.has(file)) {
|
|
551
|
-
replacementsPerFile.set(file, changes);
|
|
515
|
+
afterProgramCreation: (info, fs) => {
|
|
516
|
+
const analysisPath = fs.resolve(options.analysisDir);
|
|
517
|
+
// Support restricting the analysis to subfolders for larger projects.
|
|
518
|
+
if (analysisPath !== '/') {
|
|
519
|
+
info.sourceFiles = info.sourceFiles.filter((sf) => sf.fileName.startsWith(analysisPath));
|
|
520
|
+
info.fullProgramSourceFiles = info.fullProgramSourceFiles.filter((sf) => sf.fileName.startsWith(analysisPath));
|
|
552
521
|
}
|
|
553
|
-
}
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
522
|
+
},
|
|
523
|
+
beforeUnitAnalysis: (tsconfigPath) => {
|
|
524
|
+
context.logger.info(`Scanning for outputs: ${tsconfigPath}...`);
|
|
525
|
+
},
|
|
526
|
+
afterAllAnalyzed: () => {
|
|
527
|
+
context.logger.info(``);
|
|
528
|
+
context.logger.info(`Processing analysis data between targets...`);
|
|
529
|
+
context.logger.info(``);
|
|
530
|
+
},
|
|
531
|
+
afterAnalysisFailure: () => {
|
|
532
|
+
context.logger.error('Migration failed unexpectedly with no analysis data');
|
|
533
|
+
},
|
|
534
|
+
whenDone: ({ counters }) => {
|
|
535
|
+
const { detectedOutputs, problematicOutputs, successRate } = counters;
|
|
536
|
+
const migratedOutputs = detectedOutputs - problematicOutputs;
|
|
537
|
+
const successRatePercent = (successRate * 100).toFixed(2);
|
|
538
|
+
context.logger.info('');
|
|
539
|
+
context.logger.info(`Successfully migrated to outputs as functions 🎉`);
|
|
540
|
+
context.logger.info(` -> Migrated ${migratedOutputs} out of ${detectedOutputs} detected outputs (${successRatePercent} %).`);
|
|
541
|
+
},
|
|
542
|
+
});
|
|
571
543
|
};
|
|
572
544
|
}
|
|
573
545
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v20.0.0-next.
|
|
3
|
+
* @license Angular v20.0.0-next.4
|
|
4
4
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
var schematics = require('@angular-devkit/schematics');
|
|
10
10
|
var fs = require('fs');
|
|
11
11
|
var p = require('path');
|
|
12
|
-
var compiler_host = require('./compiler_host-
|
|
12
|
+
var compiler_host = require('./compiler_host-DwM3ugW3.js');
|
|
13
13
|
var project_tsconfig_paths = require('./project_tsconfig_paths-CDVxT6Ov.js');
|
|
14
14
|
var ts = require('typescript');
|
|
15
|
-
var checker = require('./checker-
|
|
15
|
+
var checker = require('./checker-k591b6WQ.js');
|
|
16
16
|
var property_name = require('./property_name-BBwFuqMe.js');
|
|
17
17
|
require('os');
|
|
18
18
|
require('@angular-devkit/core');
|