@angular/core 20.0.0-next.5 → 20.0.0-next.7
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-mxcXqDpA.d.ts → api.d-KjtSQajV.d.ts} +4 -4
- package/{ng_i18n_closure_mode.d-DLxSUiDr.d.ts → chrome_dev_tools_performance.d-qv7drdAl.d.ts} +20 -5
- package/{discovery.d-CyYpOJ7j.d.ts → discovery.d-D6xf1HH-.d.ts} +8 -79
- package/{event_dispatcher.d-PWnbqZDx.d.ts → event_dispatcher.d-DlbccpYq.d.ts} +3 -3
- package/fesm2022/{attribute-B17mgaqe.mjs → attribute-BWp59EjE.mjs} +3 -3
- package/fesm2022/{attribute-B17mgaqe.mjs.map → attribute-BWp59EjE.mjs.map} +1 -1
- package/fesm2022/core.mjs +22 -31
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/{debug_node-xKpCIZm-.mjs → debug_node-B3CixwNH.mjs} +218 -141
- package/fesm2022/debug_node-B3CixwNH.mjs.map +1 -0
- package/fesm2022/primitives/di.mjs +1 -1
- package/fesm2022/primitives/event-dispatch.mjs +2 -2
- package/fesm2022/primitives/signals.mjs +5 -5
- package/fesm2022/{resource-BPpYEDic.mjs → resource-DtpS_sTw.mjs} +6 -8
- package/fesm2022/resource-DtpS_sTw.mjs.map +1 -0
- package/fesm2022/{root_effect_scheduler-D0_b1cf_.mjs → root_effect_scheduler-BK3l7wIO.mjs} +144 -68
- package/fesm2022/root_effect_scheduler-BK3l7wIO.mjs.map +1 -0
- package/fesm2022/rxjs-interop.mjs +7 -84
- package/fesm2022/rxjs-interop.mjs.map +1 -1
- package/fesm2022/{signal-DhRAAi7R.mjs → signal-B6pMq7KS.mjs} +3 -3
- package/fesm2022/{signal-DhRAAi7R.mjs.map → signal-B6pMq7KS.mjs.map} +1 -1
- package/fesm2022/testing.mjs +167 -103
- package/fesm2022/testing.mjs.map +1 -1
- package/fesm2022/{untracked-DaaW3JJm.mjs → untracked-Bz5WMeU1.mjs} +4 -4
- package/fesm2022/{untracked-DaaW3JJm.mjs.map → untracked-Bz5WMeU1.mjs.map} +1 -1
- package/fesm2022/{weak_ref-DrMdAIDh.mjs → weak_ref-BaIq-pgY.mjs} +3 -3
- package/fesm2022/{weak_ref-DrMdAIDh.mjs.map → weak_ref-BaIq-pgY.mjs.map} +1 -1
- package/{graph.d-StYigYp1.d.ts → graph.d-BcIOep_B.d.ts} +3 -3
- package/index.d.ts +34 -41
- package/package.json +2 -2
- package/primitives/di/index.d.ts +1 -1
- package/primitives/event-dispatch/index.d.ts +3 -3
- package/primitives/signals/index.d.ts +6 -6
- package/rxjs-interop/index.d.ts +8 -17
- package/schematics/bundles/{apply_import_manager-C-ysxahq.js → apply_import_manager-DczRKpTm.js} +6 -6
- package/schematics/bundles/{change_tracker-0Ktek5Xl.js → change_tracker-CWLh-wes.js} +3 -3
- package/schematics/bundles/{checker-DqUKCGda.js → checker-_f5wM7PH.js} +20 -3
- package/schematics/bundles/cleanup-unused-imports.js +25 -20
- package/schematics/bundles/{compiler-CuoiHqkc.js → compiler-BaCbbux6.js} +964 -298
- package/schematics/bundles/compiler_host-CAfDJO3W.js +1 -1
- package/schematics/bundles/control-flow-migration.js +2 -2
- package/schematics/bundles/document-core.js +12 -12
- package/schematics/bundles/imports-CIX-JgAN.js +1 -1
- package/schematics/bundles/{index-CwFQSYXZ.js → index--W6S49uu.js} +10 -10
- package/schematics/bundles/{index-WFXCe5Q0.js → index-rsJ8I_hu.js} +131 -64
- package/schematics/bundles/inject-flags.js +14 -14
- package/schematics/bundles/inject-migration.js +108 -19
- package/schematics/bundles/leading_space-D9nQ8UQC.js +1 -1
- package/schematics/bundles/{migrate_ts_type_references-BNuHufqZ.js → migrate_ts_type_references-C4D_SzJk.js} +21 -21
- package/schematics/bundles/ng_decorators-DznZ5jMl.js +1 -1
- package/schematics/bundles/nodes-B16H9JUd.js +1 -1
- package/schematics/bundles/output-migration.js +80 -22
- package/schematics/bundles/{run_in_devkit-CmHxABFr.js → project_paths-Ce0O2u-M.js} +254 -244
- 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 +4 -4
- package/schematics/bundles/self-closing-tags-migration.js +20 -15
- package/schematics/bundles/signal-input-migration.js +26 -21
- package/schematics/bundles/signal-queries-migration.js +32 -27
- package/schematics/bundles/signals.js +8 -8
- package/schematics/bundles/standalone-migration.js +5 -5
- package/schematics/bundles/symbol-VPWguRxr.js +1 -1
- package/schematics/bundles/test-bed-get.js +13 -13
- package/{signal.d-BeaTIeOE.d.ts → signal.d-E0e5nW1p.d.ts} +4 -4
- package/testing/index.d.ts +9 -25
- package/{weak_ref.d-ttyj86RV.d.ts → weak_ref.d-eGOEP9S1.d.ts} +2 -2
- package/fesm2022/debug_node-xKpCIZm-.mjs.map +0 -1
- package/fesm2022/resource-BPpYEDic.mjs.map +0 -1
- package/fesm2022/root_effect_scheduler-D0_b1cf_.mjs.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v20.0.0-next.
|
|
3
|
+
* @license Angular v20.0.0-next.7
|
|
4
4
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
|
|
9
9
|
var ts = require('typescript');
|
|
10
10
|
require('os');
|
|
11
|
-
var checker = require('./checker-
|
|
12
|
-
var compiler = require('./compiler-
|
|
13
|
-
var index$1 = require('./index-
|
|
11
|
+
var checker = require('./checker-_f5wM7PH.js');
|
|
12
|
+
var compiler = require('./compiler-BaCbbux6.js');
|
|
13
|
+
var index$1 = require('./index-rsJ8I_hu.js');
|
|
14
14
|
require('path');
|
|
15
|
-
var
|
|
16
|
-
var apply_import_manager = require('./apply_import_manager-
|
|
17
|
-
var index = require('./index
|
|
15
|
+
var project_paths = require('./project_paths-Ce0O2u-M.js');
|
|
16
|
+
var apply_import_manager = require('./apply_import_manager-DczRKpTm.js');
|
|
17
|
+
var index = require('./index--W6S49uu.js');
|
|
18
18
|
require('@angular-devkit/core');
|
|
19
19
|
require('node:path/posix');
|
|
20
20
|
require('fs');
|
|
@@ -91,7 +91,7 @@ function getOutputDecorator(node, reflector) {
|
|
|
91
91
|
// THINK: this utility + type is not specific to @Output, really, maybe move it to tsurge?
|
|
92
92
|
/** Computes an unique ID for a given Angular `@Output` property. */
|
|
93
93
|
function getUniqueIdForProperty(info, prop) {
|
|
94
|
-
const { id } =
|
|
94
|
+
const { id } = project_paths.projectFile(prop.getSourceFile(), info);
|
|
95
95
|
id.replace(/\.d\.ts$/, '.ts');
|
|
96
96
|
return `${id}@@${prop.parent.name ?? 'unknown-class'}@@${prop.name.getText()}`;
|
|
97
97
|
}
|
|
@@ -174,7 +174,7 @@ function calculateImportReplacements(info, sourceFiles) {
|
|
|
174
174
|
const importManager = new checker.ImportManager();
|
|
175
175
|
const addOnly = [];
|
|
176
176
|
const addRemove = [];
|
|
177
|
-
const file =
|
|
177
|
+
const file = project_paths.projectFile(sf, info);
|
|
178
178
|
importManager.addImport({
|
|
179
179
|
requestedFile: sf,
|
|
180
180
|
exportModuleSpecifier: '@angular/core',
|
|
@@ -230,21 +230,21 @@ function calculatePipeCallReplacement(info, node) {
|
|
|
230
230
|
}
|
|
231
231
|
function prepareTextReplacementForNode(info, node, replacement, start) {
|
|
232
232
|
const sf = node.getSourceFile();
|
|
233
|
-
return new
|
|
233
|
+
return new project_paths.Replacement(project_paths.projectFile(sf, info), new project_paths.TextUpdate({
|
|
234
234
|
position: start ?? node.getStart(),
|
|
235
235
|
end: node.getEnd(),
|
|
236
236
|
toInsert: replacement,
|
|
237
237
|
}));
|
|
238
238
|
}
|
|
239
239
|
function prepareTextReplacement(file, replacement, start, end) {
|
|
240
|
-
return new
|
|
240
|
+
return new project_paths.Replacement(file, new project_paths.TextUpdate({
|
|
241
241
|
position: start,
|
|
242
242
|
end: end,
|
|
243
243
|
toInsert: replacement,
|
|
244
244
|
}));
|
|
245
245
|
}
|
|
246
246
|
|
|
247
|
-
class OutputMigration extends
|
|
247
|
+
class OutputMigration extends project_paths.TsurgeFunnelMigration {
|
|
248
248
|
config;
|
|
249
249
|
constructor(config = {}) {
|
|
250
250
|
super();
|
|
@@ -295,7 +295,7 @@ class OutputMigration extends run_in_devkit.TsurgeFunnelMigration {
|
|
|
295
295
|
id: getUniqueIdForProperty(info, node),
|
|
296
296
|
aliasParam: outputDecorator.args?.at(0),
|
|
297
297
|
};
|
|
298
|
-
const outputFile =
|
|
298
|
+
const outputFile = project_paths.projectFile(node.getSourceFile(), info);
|
|
299
299
|
if (this.config.shouldMigrate === undefined ||
|
|
300
300
|
this.config.shouldMigrate({
|
|
301
301
|
key: outputDef.id,
|
|
@@ -323,7 +323,7 @@ class OutputMigration extends run_in_devkit.TsurgeFunnelMigration {
|
|
|
323
323
|
const propertyDeclaration = isTargetOutputDeclaration(node.expression.expression, checker$1, reflector, dtsReader);
|
|
324
324
|
if (propertyDeclaration !== null) {
|
|
325
325
|
const id = getUniqueIdForProperty(info, propertyDeclaration);
|
|
326
|
-
const outputFile =
|
|
326
|
+
const outputFile = project_paths.projectFile(node.getSourceFile(), info);
|
|
327
327
|
addOutputReplacement(outputFieldReplacements, id, outputFile, calculateNextFnReplacement(info, node.expression.name));
|
|
328
328
|
}
|
|
329
329
|
}
|
|
@@ -332,7 +332,7 @@ class OutputMigration extends run_in_devkit.TsurgeFunnelMigration {
|
|
|
332
332
|
const propertyDeclaration = isTargetOutputDeclaration(node.expression.expression, checker$1, reflector, dtsReader);
|
|
333
333
|
if (propertyDeclaration !== null) {
|
|
334
334
|
const id = getUniqueIdForProperty(info, propertyDeclaration);
|
|
335
|
-
const outputFile =
|
|
335
|
+
const outputFile = project_paths.projectFile(node.getSourceFile(), info);
|
|
336
336
|
if (ts.isExpressionStatement(node.parent)) {
|
|
337
337
|
addOutputReplacement(outputFieldReplacements, id, outputFile, calculateCompleteCallReplacement(info, node.parent));
|
|
338
338
|
}
|
|
@@ -341,6 +341,7 @@ class OutputMigration extends run_in_devkit.TsurgeFunnelMigration {
|
|
|
341
341
|
}
|
|
342
342
|
}
|
|
343
343
|
}
|
|
344
|
+
addCommentForEmptyEmit(node, info, checker$1, reflector, dtsReader, outputFieldReplacements);
|
|
344
345
|
// detect imports of test runners
|
|
345
346
|
if (isTestRunnerImport(node)) {
|
|
346
347
|
isTestFile = true;
|
|
@@ -351,7 +352,7 @@ class OutputMigration extends run_in_devkit.TsurgeFunnelMigration {
|
|
|
351
352
|
if (propertyDeclaration !== null) {
|
|
352
353
|
const id = getUniqueIdForProperty(info, propertyDeclaration);
|
|
353
354
|
if (isTestFile) {
|
|
354
|
-
const outputFile =
|
|
355
|
+
const outputFile = project_paths.projectFile(node.getSourceFile(), info);
|
|
355
356
|
addOutputReplacement(outputFieldReplacements, id, outputFile, ...calculatePipeCallReplacement(info, node));
|
|
356
357
|
}
|
|
357
358
|
else {
|
|
@@ -395,7 +396,7 @@ class OutputMigration extends run_in_devkit.TsurgeFunnelMigration {
|
|
|
395
396
|
}
|
|
396
397
|
// calculate import replacements but do so only for files that have output declarations
|
|
397
398
|
const importReplacements = calculateImportReplacements(info, filesWithOutputDeclarations);
|
|
398
|
-
return
|
|
399
|
+
return project_paths.confirmAsSerializable({
|
|
399
400
|
problematicDeclarationCount,
|
|
400
401
|
outputFields: outputFieldReplacements,
|
|
401
402
|
importReplacements,
|
|
@@ -425,7 +426,7 @@ class OutputMigration extends run_in_devkit.TsurgeFunnelMigration {
|
|
|
425
426
|
problematicUsages[declId] = unit.problematicUsages[declId];
|
|
426
427
|
}
|
|
427
428
|
}
|
|
428
|
-
return
|
|
429
|
+
return project_paths.confirmAsSerializable({
|
|
429
430
|
problematicDeclarationCount,
|
|
430
431
|
outputFields,
|
|
431
432
|
importReplacements,
|
|
@@ -447,7 +448,7 @@ class OutputMigration extends run_in_devkit.TsurgeFunnelMigration {
|
|
|
447
448
|
}
|
|
448
449
|
}
|
|
449
450
|
// Noop here as we don't have any form of special global metadata.
|
|
450
|
-
return
|
|
451
|
+
return project_paths.confirmAsSerializable(combinedData);
|
|
451
452
|
}
|
|
452
453
|
async stats(globalMetadata) {
|
|
453
454
|
const detectedOutputs = new Set(Object.keys(globalMetadata.outputFields)).size +
|
|
@@ -503,10 +504,62 @@ function addOutputReplacement(outputFieldReplacements, outputId, file, ...replac
|
|
|
503
504
|
}
|
|
504
505
|
existingReplacements.replacements.push(...replacements);
|
|
505
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
|
+
}
|
|
506
559
|
|
|
507
560
|
function migrate(options) {
|
|
508
561
|
return async (tree, context) => {
|
|
509
|
-
await
|
|
562
|
+
await project_paths.runMigrationInDevkit({
|
|
510
563
|
tree,
|
|
511
564
|
getMigration: (fs) => new OutputMigration({
|
|
512
565
|
shouldMigrate: (_, file) => {
|
|
@@ -514,8 +567,13 @@ function migrate(options) {
|
|
|
514
567
|
!/(^|\/)node_modules\//.test(file.rootRelativePath));
|
|
515
568
|
},
|
|
516
569
|
}),
|
|
517
|
-
beforeProgramCreation: (tsconfigPath) => {
|
|
518
|
-
|
|
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
|
+
}
|
|
519
577
|
},
|
|
520
578
|
afterProgramCreation: (info, fs) => {
|
|
521
579
|
const analysisPath = fs.resolve(options.analysisDir);
|