@angular/core 20.0.0-next.4 → 20.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/api.d-DQLNOR5l.d.ts +297 -0
- package/discovery.d-CFs2MaLO.d.ts +7383 -0
- package/{event_dispatcher.d-pVP0-wST.d.ts → event_dispatcher.d-DlbccpYq.d.ts} +3 -2
- package/fesm2022/attribute-BWp59EjE.mjs +24 -0
- package/fesm2022/attribute-BWp59EjE.mjs.map +1 -0
- package/fesm2022/core.mjs +586 -36873
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/debug_node-z_3NG8qT.mjs +32079 -0
- package/fesm2022/debug_node-z_3NG8qT.mjs.map +1 -0
- package/fesm2022/primitives/di.mjs +18 -4
- package/fesm2022/primitives/di.mjs.map +1 -1
- package/fesm2022/primitives/event-dispatch.mjs +2 -16
- package/fesm2022/primitives/event-dispatch.mjs.map +1 -1
- package/fesm2022/primitives/signals.mjs +5 -3
- package/fesm2022/primitives/signals.mjs.map +1 -1
- package/fesm2022/resource-CPPwEcg7.mjs +619 -0
- package/fesm2022/resource-CPPwEcg7.mjs.map +1 -0
- package/fesm2022/root_effect_scheduler-VSXfCzDX.mjs +3847 -0
- package/fesm2022/root_effect_scheduler-VSXfCzDX.mjs.map +1 -0
- package/fesm2022/rxjs-interop.mjs +16 -9
- package/fesm2022/rxjs-interop.mjs.map +1 -1
- package/fesm2022/{untracked-DkcXpNb_.mjs → signal-B6pMq7KS.mjs} +16 -114
- package/fesm2022/signal-B6pMq7KS.mjs.map +1 -0
- package/fesm2022/testing.mjs +265 -201
- package/fesm2022/testing.mjs.map +1 -1
- package/fesm2022/untracked-Bz5WMeU1.mjs +117 -0
- package/fesm2022/untracked-Bz5WMeU1.mjs.map +1 -0
- package/fesm2022/weak_ref-BaIq-pgY.mjs +12 -0
- package/fesm2022/weak_ref-BaIq-pgY.mjs.map +1 -0
- package/{weak_ref.d-BZ7gyRag.d.ts → graph.d-BcIOep_B.d.ts} +3 -24
- package/index.d.ts +2624 -10909
- package/ng_i18n_closure_mode.d-C9d2CaSt.d.ts +832 -0
- package/package.json +3 -3
- package/primitives/di/index.d.ts +3 -2
- package/primitives/event-dispatch/index.d.ts +3 -3
- package/primitives/signals/index.d.ts +8 -4
- package/rxjs-interop/index.d.ts +10 -7
- package/schematics/bundles/{apply_import_manager-CeNv8GIG.js → apply_import_manager-DnMqg1pY.js} +6 -6
- package/schematics/bundles/{compiler_host-DwM3ugW3.js → change_tracker-UMPkv-eH.js} +3 -121
- package/schematics/bundles/checker-BFBQyesT.js +17719 -0
- package/schematics/bundles/cleanup-unused-imports.js +25 -19
- package/schematics/bundles/{checker-k591b6WQ.js → compiler-BQ7R7w2v.js} +1325 -18286
- package/schematics/bundles/compiler_host-CAfDJO3W.js +129 -0
- package/schematics/bundles/control-flow-migration.js +28 -40
- package/schematics/bundles/document-core.js +96 -0
- package/schematics/bundles/imports-CIX-JgAN.js +1 -1
- package/schematics/bundles/{index-B4OAlHh8.js → index-Cv4Q415G.js} +641 -547
- package/schematics/bundles/{index-BhELUmYx.js → index-D8tMJPKa.js} +35 -34
- package/schematics/bundles/inject-flags.js +14 -13
- package/schematics/bundles/inject-migration.js +29 -10
- package/schematics/bundles/leading_space-D9nQ8UQC.js +1 -1
- package/schematics/bundles/{migrate_ts_type_references-Be0TNYen.js → migrate_ts_type_references-Cq_ZBuT4.js} +21 -20
- package/schematics/bundles/ng_decorators-DznZ5jMl.js +1 -1
- package/schematics/bundles/nodes-B16H9JUd.js +1 -1
- package/schematics/bundles/output-migration.js +88 -25
- package/schematics/bundles/{run_in_devkit-CkvEksWP.js → project_paths-ql6qcf_c.js} +254 -243
- 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 +7 -5
- package/schematics/bundles/self-closing-tags-migration.js +25 -19
- package/schematics/bundles/signal-input-migration.js +26 -20
- package/schematics/bundles/signal-queries-migration.js +51 -33
- package/schematics/bundles/signals.js +8 -7
- package/schematics/bundles/standalone-migration.js +11 -9
- package/schematics/bundles/symbol-VPWguRxr.js +1 -1
- package/schematics/bundles/test-bed-get.js +13 -12
- package/schematics/collection.json +0 -6
- package/schematics/migrations.json +11 -0
- package/signal.d-E0e5nW1p.d.ts +31 -0
- package/testing/index.d.ts +16 -28
- package/weak_ref.d-eGOEP9S1.d.ts +9 -0
- package/fesm2022/injector-BlLwZ2sr.mjs +0 -24
- package/fesm2022/injector-BlLwZ2sr.mjs.map +0 -1
- package/fesm2022/untracked-DkcXpNb_.mjs.map +0 -1
- package/navigation_types.d-DgDrF5rp.d.ts +0 -121
- package/schematics/ng-generate/control-flow-migration/schema.json +0 -20
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v20.0.0-next.
|
|
3
|
+
* @license Angular v20.0.0-next.6
|
|
4
4
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -8,12 +8,13 @@
|
|
|
8
8
|
|
|
9
9
|
var ts = require('typescript');
|
|
10
10
|
require('os');
|
|
11
|
-
var checker = require('./checker-
|
|
12
|
-
var
|
|
11
|
+
var checker = require('./checker-BFBQyesT.js');
|
|
12
|
+
var compiler = require('./compiler-BQ7R7w2v.js');
|
|
13
|
+
var index$1 = require('./index-Cv4Q415G.js');
|
|
13
14
|
require('path');
|
|
14
|
-
var
|
|
15
|
-
var apply_import_manager = require('./apply_import_manager-
|
|
16
|
-
var index = require('./index-
|
|
15
|
+
var project_paths = require('./project_paths-ql6qcf_c.js');
|
|
16
|
+
var apply_import_manager = require('./apply_import_manager-DnMqg1pY.js');
|
|
17
|
+
var index = require('./index-D8tMJPKa.js');
|
|
17
18
|
require('@angular-devkit/core');
|
|
18
19
|
require('node:path/posix');
|
|
19
20
|
require('fs');
|
|
@@ -90,7 +91,7 @@ function getOutputDecorator(node, reflector) {
|
|
|
90
91
|
// THINK: this utility + type is not specific to @Output, really, maybe move it to tsurge?
|
|
91
92
|
/** Computes an unique ID for a given Angular `@Output` property. */
|
|
92
93
|
function getUniqueIdForProperty(info, prop) {
|
|
93
|
-
const { id } =
|
|
94
|
+
const { id } = project_paths.projectFile(prop.getSourceFile(), info);
|
|
94
95
|
id.replace(/\.d\.ts$/, '.ts');
|
|
95
96
|
return `${id}@@${prop.parent.name ?? 'unknown-class'}@@${prop.name.getText()}`;
|
|
96
97
|
}
|
|
@@ -114,7 +115,7 @@ function checkNonTsReferenceAccessesField(ref, fieldName) {
|
|
|
114
115
|
if (ref.from.read !== readFromPath) {
|
|
115
116
|
return null;
|
|
116
117
|
}
|
|
117
|
-
if (!(parentRead instanceof
|
|
118
|
+
if (!(parentRead instanceof compiler.PropertyRead) || parentRead.name !== fieldName) {
|
|
118
119
|
return null;
|
|
119
120
|
}
|
|
120
121
|
return parentRead;
|
|
@@ -144,9 +145,13 @@ function checkNonTsReferenceCallsField(ref, fieldName) {
|
|
|
144
145
|
const printer = ts.createPrinter();
|
|
145
146
|
function calculateDeclarationReplacement(info, node, aliasParam) {
|
|
146
147
|
const sf = node.getSourceFile();
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
148
|
+
let payloadTypes;
|
|
149
|
+
if (node.initializer && ts.isNewExpression(node.initializer) && node.initializer.typeArguments) {
|
|
150
|
+
payloadTypes = node.initializer.typeArguments;
|
|
151
|
+
}
|
|
152
|
+
else if (node.type && ts.isTypeReferenceNode(node.type) && node.type.typeArguments) {
|
|
153
|
+
payloadTypes = ts.factory.createNodeArray(node.type.typeArguments);
|
|
154
|
+
}
|
|
150
155
|
const outputCall = ts.factory.createCallExpression(ts.factory.createIdentifier('output'), payloadTypes, aliasParam !== undefined
|
|
151
156
|
? [
|
|
152
157
|
ts.factory.createObjectLiteralExpression([
|
|
@@ -169,7 +174,7 @@ function calculateImportReplacements(info, sourceFiles) {
|
|
|
169
174
|
const importManager = new checker.ImportManager();
|
|
170
175
|
const addOnly = [];
|
|
171
176
|
const addRemove = [];
|
|
172
|
-
const file =
|
|
177
|
+
const file = project_paths.projectFile(sf, info);
|
|
173
178
|
importManager.addImport({
|
|
174
179
|
requestedFile: sf,
|
|
175
180
|
exportModuleSpecifier: '@angular/core',
|
|
@@ -225,21 +230,21 @@ function calculatePipeCallReplacement(info, node) {
|
|
|
225
230
|
}
|
|
226
231
|
function prepareTextReplacementForNode(info, node, replacement, start) {
|
|
227
232
|
const sf = node.getSourceFile();
|
|
228
|
-
return new
|
|
233
|
+
return new project_paths.Replacement(project_paths.projectFile(sf, info), new project_paths.TextUpdate({
|
|
229
234
|
position: start ?? node.getStart(),
|
|
230
235
|
end: node.getEnd(),
|
|
231
236
|
toInsert: replacement,
|
|
232
237
|
}));
|
|
233
238
|
}
|
|
234
239
|
function prepareTextReplacement(file, replacement, start, end) {
|
|
235
|
-
return new
|
|
240
|
+
return new project_paths.Replacement(file, new project_paths.TextUpdate({
|
|
236
241
|
position: start,
|
|
237
242
|
end: end,
|
|
238
243
|
toInsert: replacement,
|
|
239
244
|
}));
|
|
240
245
|
}
|
|
241
246
|
|
|
242
|
-
class OutputMigration extends
|
|
247
|
+
class OutputMigration extends project_paths.TsurgeFunnelMigration {
|
|
243
248
|
config;
|
|
244
249
|
constructor(config = {}) {
|
|
245
250
|
super();
|
|
@@ -290,7 +295,7 @@ class OutputMigration extends run_in_devkit.TsurgeFunnelMigration {
|
|
|
290
295
|
id: getUniqueIdForProperty(info, node),
|
|
291
296
|
aliasParam: outputDecorator.args?.at(0),
|
|
292
297
|
};
|
|
293
|
-
const outputFile =
|
|
298
|
+
const outputFile = project_paths.projectFile(node.getSourceFile(), info);
|
|
294
299
|
if (this.config.shouldMigrate === undefined ||
|
|
295
300
|
this.config.shouldMigrate({
|
|
296
301
|
key: outputDef.id,
|
|
@@ -318,7 +323,7 @@ class OutputMigration extends run_in_devkit.TsurgeFunnelMigration {
|
|
|
318
323
|
const propertyDeclaration = isTargetOutputDeclaration(node.expression.expression, checker$1, reflector, dtsReader);
|
|
319
324
|
if (propertyDeclaration !== null) {
|
|
320
325
|
const id = getUniqueIdForProperty(info, propertyDeclaration);
|
|
321
|
-
const outputFile =
|
|
326
|
+
const outputFile = project_paths.projectFile(node.getSourceFile(), info);
|
|
322
327
|
addOutputReplacement(outputFieldReplacements, id, outputFile, calculateNextFnReplacement(info, node.expression.name));
|
|
323
328
|
}
|
|
324
329
|
}
|
|
@@ -327,7 +332,7 @@ class OutputMigration extends run_in_devkit.TsurgeFunnelMigration {
|
|
|
327
332
|
const propertyDeclaration = isTargetOutputDeclaration(node.expression.expression, checker$1, reflector, dtsReader);
|
|
328
333
|
if (propertyDeclaration !== null) {
|
|
329
334
|
const id = getUniqueIdForProperty(info, propertyDeclaration);
|
|
330
|
-
const outputFile =
|
|
335
|
+
const outputFile = project_paths.projectFile(node.getSourceFile(), info);
|
|
331
336
|
if (ts.isExpressionStatement(node.parent)) {
|
|
332
337
|
addOutputReplacement(outputFieldReplacements, id, outputFile, calculateCompleteCallReplacement(info, node.parent));
|
|
333
338
|
}
|
|
@@ -336,6 +341,7 @@ class OutputMigration extends run_in_devkit.TsurgeFunnelMigration {
|
|
|
336
341
|
}
|
|
337
342
|
}
|
|
338
343
|
}
|
|
344
|
+
addCommentForEmptyEmit(node, info, checker$1, reflector, dtsReader, outputFieldReplacements);
|
|
339
345
|
// detect imports of test runners
|
|
340
346
|
if (isTestRunnerImport(node)) {
|
|
341
347
|
isTestFile = true;
|
|
@@ -346,7 +352,7 @@ class OutputMigration extends run_in_devkit.TsurgeFunnelMigration {
|
|
|
346
352
|
if (propertyDeclaration !== null) {
|
|
347
353
|
const id = getUniqueIdForProperty(info, propertyDeclaration);
|
|
348
354
|
if (isTestFile) {
|
|
349
|
-
const outputFile =
|
|
355
|
+
const outputFile = project_paths.projectFile(node.getSourceFile(), info);
|
|
350
356
|
addOutputReplacement(outputFieldReplacements, id, outputFile, ...calculatePipeCallReplacement(info, node));
|
|
351
357
|
}
|
|
352
358
|
else {
|
|
@@ -390,7 +396,7 @@ class OutputMigration extends run_in_devkit.TsurgeFunnelMigration {
|
|
|
390
396
|
}
|
|
391
397
|
// calculate import replacements but do so only for files that have output declarations
|
|
392
398
|
const importReplacements = calculateImportReplacements(info, filesWithOutputDeclarations);
|
|
393
|
-
return
|
|
399
|
+
return project_paths.confirmAsSerializable({
|
|
394
400
|
problematicDeclarationCount,
|
|
395
401
|
outputFields: outputFieldReplacements,
|
|
396
402
|
importReplacements,
|
|
@@ -420,7 +426,7 @@ class OutputMigration extends run_in_devkit.TsurgeFunnelMigration {
|
|
|
420
426
|
problematicUsages[declId] = unit.problematicUsages[declId];
|
|
421
427
|
}
|
|
422
428
|
}
|
|
423
|
-
return
|
|
429
|
+
return project_paths.confirmAsSerializable({
|
|
424
430
|
problematicDeclarationCount,
|
|
425
431
|
outputFields,
|
|
426
432
|
importReplacements,
|
|
@@ -442,7 +448,7 @@ class OutputMigration extends run_in_devkit.TsurgeFunnelMigration {
|
|
|
442
448
|
}
|
|
443
449
|
}
|
|
444
450
|
// Noop here as we don't have any form of special global metadata.
|
|
445
|
-
return
|
|
451
|
+
return project_paths.confirmAsSerializable(combinedData);
|
|
446
452
|
}
|
|
447
453
|
async stats(globalMetadata) {
|
|
448
454
|
const detectedOutputs = new Set(Object.keys(globalMetadata.outputFields)).size +
|
|
@@ -498,10 +504,62 @@ function addOutputReplacement(outputFieldReplacements, outputId, file, ...replac
|
|
|
498
504
|
}
|
|
499
505
|
existingReplacements.replacements.push(...replacements);
|
|
500
506
|
}
|
|
507
|
+
function addCommentForEmptyEmit(node, info, checker, reflector, dtsReader, outputFieldReplacements) {
|
|
508
|
+
if (!isEmptyEmitCall(node))
|
|
509
|
+
return;
|
|
510
|
+
const propertyAccess = getPropertyAccess(node);
|
|
511
|
+
if (!propertyAccess)
|
|
512
|
+
return;
|
|
513
|
+
const symbol = checker.getSymbolAtLocation(propertyAccess.name);
|
|
514
|
+
if (!symbol || !symbol.declarations?.length)
|
|
515
|
+
return;
|
|
516
|
+
const propertyDeclaration = isTargetOutputDeclaration(propertyAccess, checker, reflector, dtsReader);
|
|
517
|
+
if (!propertyDeclaration)
|
|
518
|
+
return;
|
|
519
|
+
const eventEmitterType = getEventEmitterArgumentType(propertyDeclaration);
|
|
520
|
+
if (!eventEmitterType)
|
|
521
|
+
return;
|
|
522
|
+
const id = getUniqueIdForProperty(info, propertyDeclaration);
|
|
523
|
+
const file = project_paths.projectFile(node.getSourceFile(), info);
|
|
524
|
+
const formatter = getFormatterText(node);
|
|
525
|
+
const todoReplacement = new project_paths.TextUpdate({
|
|
526
|
+
toInsert: `${formatter.indent}// TODO: The 'emit' function requires a mandatory ${eventEmitterType} argument\n`,
|
|
527
|
+
end: formatter.lineStartPos,
|
|
528
|
+
position: formatter.lineStartPos,
|
|
529
|
+
});
|
|
530
|
+
addOutputReplacement(outputFieldReplacements, id, file, new project_paths.Replacement(file, todoReplacement));
|
|
531
|
+
}
|
|
532
|
+
function isEmptyEmitCall(node) {
|
|
533
|
+
return (ts.isCallExpression(node) &&
|
|
534
|
+
ts.isPropertyAccessExpression(node.expression) &&
|
|
535
|
+
node.expression.name.text === 'emit' &&
|
|
536
|
+
node.arguments.length === 0);
|
|
537
|
+
}
|
|
538
|
+
function getPropertyAccess(node) {
|
|
539
|
+
const propertyAccessExpression = node.expression.expression;
|
|
540
|
+
return ts.isPropertyAccessExpression(propertyAccessExpression) ? propertyAccessExpression : null;
|
|
541
|
+
}
|
|
542
|
+
function getEventEmitterArgumentType(propertyDeclaration) {
|
|
543
|
+
const initializer = propertyDeclaration.initializer;
|
|
544
|
+
if (!initializer || !ts.isNewExpression(initializer))
|
|
545
|
+
return null;
|
|
546
|
+
const isEventEmitter = ts.isIdentifier(initializer.expression) && initializer.expression.getText() === 'EventEmitter';
|
|
547
|
+
if (!isEventEmitter)
|
|
548
|
+
return null;
|
|
549
|
+
const [typeArg] = initializer.typeArguments ?? [];
|
|
550
|
+
return typeArg ? typeArg.getText() : null;
|
|
551
|
+
}
|
|
552
|
+
function getFormatterText(node) {
|
|
553
|
+
const sourceFile = node.getSourceFile();
|
|
554
|
+
const { line } = sourceFile.getLineAndCharacterOfPosition(node.getStart());
|
|
555
|
+
const lineStartPos = sourceFile.getPositionOfLineAndCharacter(line, 0);
|
|
556
|
+
const indent = sourceFile.text.slice(lineStartPos, node.getStart());
|
|
557
|
+
return { indent, lineStartPos };
|
|
558
|
+
}
|
|
501
559
|
|
|
502
560
|
function migrate(options) {
|
|
503
561
|
return async (tree, context) => {
|
|
504
|
-
await
|
|
562
|
+
await project_paths.runMigrationInDevkit({
|
|
505
563
|
tree,
|
|
506
564
|
getMigration: (fs) => new OutputMigration({
|
|
507
565
|
shouldMigrate: (_, file) => {
|
|
@@ -509,8 +567,13 @@ function migrate(options) {
|
|
|
509
567
|
!/(^|\/)node_modules\//.test(file.rootRelativePath));
|
|
510
568
|
},
|
|
511
569
|
}),
|
|
512
|
-
beforeProgramCreation: (tsconfigPath) => {
|
|
513
|
-
|
|
570
|
+
beforeProgramCreation: (tsconfigPath, stage) => {
|
|
571
|
+
if (stage === project_paths.MigrationStage.Analysis) {
|
|
572
|
+
context.logger.info(`Preparing analysis for: ${tsconfigPath}...`);
|
|
573
|
+
}
|
|
574
|
+
else {
|
|
575
|
+
context.logger.info(`Running migration for: ${tsconfigPath}...`);
|
|
576
|
+
}
|
|
514
577
|
},
|
|
515
578
|
afterProgramCreation: (info, fs) => {
|
|
516
579
|
const analysisPath = fs.resolve(options.analysisDir);
|