@angular/core 20.0.0-next.1 → 20.0.0-next.2
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 +374 -1796
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/primitives/di.mjs +1 -1
- package/fesm2022/primitives/di.mjs.map +1 -1
- package/fesm2022/primitives/event-dispatch.mjs +2 -589
- package/fesm2022/primitives/event-dispatch.mjs.map +1 -1
- package/fesm2022/primitives/signals.mjs +18 -8
- package/fesm2022/primitives/signals.mjs.map +1 -1
- package/fesm2022/rxjs-interop.mjs +7 -32
- package/fesm2022/rxjs-interop.mjs.map +1 -1
- package/fesm2022/testing.mjs +119 -138
- package/fesm2022/testing.mjs.map +1 -1
- package/fesm2022/weak_ref-DrMdAIDh.mjs +12 -0
- package/fesm2022/weak_ref-DrMdAIDh.mjs.map +1 -0
- package/index.d.ts +14343 -15225
- package/navigation_types.d-u4EOrrdZ.d.ts +121 -0
- package/package.json +2 -2
- package/primitives/di/index.d.ts +42 -50
- package/primitives/event-dispatch/index.d.ts +205 -309
- package/primitives/signals/index.d.ts +158 -195
- package/rxjs-interop/index.d.ts +71 -91
- package/schematics/bundles/{apply_import_manager-e2a7fe5b.js → apply_import_manager-CyRT0UvU.js} +12 -16
- package/schematics/bundles/{checker-af521da6.js → checker-DF8ZaFW5.js} +3084 -1122
- package/schematics/bundles/cleanup-unused-imports.js +21 -27
- package/schematics/bundles/{compiler_host-5a29293c.js → compiler_host-Da636uJ8.js} +19 -23
- package/schematics/bundles/control-flow-migration.js +81 -38
- package/schematics/bundles/{imports-047fbbc8.js → imports-CIX-JgAN.js} +9 -14
- package/schematics/bundles/{index-1bef3025.js → index-DnkWgagp.js} +55 -59
- package/schematics/bundles/{index-ef1bffbb.js → index-vGJcp5M7.js} +4 -4
- package/schematics/bundles/inject-flags.js +181 -0
- package/schematics/bundles/inject-migration.js +121 -127
- package/schematics/bundles/{leading_space-f8944434.js → leading_space-D9nQ8UQC.js} +1 -1
- package/schematics/bundles/{migrate_ts_type_references-2a3e9e6b.js → migrate_ts_type_references-DtkOnnv0.js} +106 -111
- package/schematics/bundles/{ng_decorators-b0d8b324.js → ng_decorators-DznZ5jMl.js} +4 -8
- package/schematics/bundles/{nodes-7758dbf6.js → nodes-B16H9JUd.js} +2 -6
- package/schematics/bundles/output-migration.js +39 -45
- package/schematics/bundles/{program-a449f9bf.js → program-BZk27Ndu.js} +844 -2651
- package/schematics/bundles/{project_paths-17dc204d.js → project_paths-Jtbi76Bs.js} +25 -23
- package/schematics/bundles/{project_tsconfig_paths-b558633b.js → project_tsconfig_paths-CDVxT6Ov.js} +1 -1
- package/schematics/bundles/{property_name-ac18447e.js → property_name-BBwFuqMe.js} +3 -7
- package/schematics/bundles/route-lazy-loading.js +35 -41
- package/schematics/bundles/self-closing-tags-migration.js +19 -25
- package/schematics/bundles/signal-input-migration.js +60 -67
- package/schematics/bundles/signal-queries-migration.js +47 -54
- package/schematics/bundles/signals.js +9 -11
- package/schematics/bundles/standalone-migration.js +178 -184
- package/schematics/migrations.json +4 -15
- package/testing/index.d.ts +289 -469
- package/weak_ref.d-ttyj86RV.d.ts +9 -0
- package/schematics/bundles/explicit-standalone-flag.js +0 -184
- package/schematics/bundles/pending-tasks.js +0 -103
- package/schematics/bundles/provide-initializer.js +0 -186
|
@@ -1,43 +1,37 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v20.0.0-next.
|
|
3
|
+
* @license Angular v20.0.0-next.2
|
|
4
4
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
7
7
|
'use strict';
|
|
8
8
|
|
|
9
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
10
|
-
|
|
11
9
|
var schematics = require('@angular-devkit/schematics');
|
|
12
|
-
var project_tsconfig_paths = require('./project_tsconfig_paths-
|
|
13
|
-
var project_paths = require('./project_paths-
|
|
10
|
+
var project_tsconfig_paths = require('./project_tsconfig_paths-CDVxT6Ov.js');
|
|
11
|
+
var project_paths = require('./project_paths-Jtbi76Bs.js');
|
|
14
12
|
require('os');
|
|
15
13
|
var ts = require('typescript');
|
|
16
|
-
var checker = require('./checker-
|
|
17
|
-
var program = require('./program-
|
|
14
|
+
var checker = require('./checker-DF8ZaFW5.js');
|
|
15
|
+
var program = require('./program-BZk27Ndu.js');
|
|
18
16
|
require('path');
|
|
19
|
-
var apply_import_manager = require('./apply_import_manager-
|
|
20
|
-
var index = require('./index-
|
|
17
|
+
var apply_import_manager = require('./apply_import_manager-CyRT0UvU.js');
|
|
18
|
+
var index = require('./index-DnkWgagp.js');
|
|
21
19
|
require('@angular-devkit/core');
|
|
22
20
|
require('node:path/posix');
|
|
23
21
|
require('fs');
|
|
24
22
|
require('module');
|
|
25
23
|
require('url');
|
|
26
24
|
|
|
27
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
28
|
-
|
|
29
|
-
var ts__default = /*#__PURE__*/_interopDefaultLegacy(ts);
|
|
30
|
-
|
|
31
25
|
function isOutputDeclarationEligibleForMigration(node) {
|
|
32
26
|
return (node.initializer !== undefined &&
|
|
33
|
-
|
|
34
|
-
|
|
27
|
+
ts.isNewExpression(node.initializer) &&
|
|
28
|
+
ts.isIdentifier(node.initializer.expression) &&
|
|
35
29
|
node.initializer.expression.text === 'EventEmitter');
|
|
36
30
|
}
|
|
37
31
|
function isPotentialOutputCallUsage(node, name) {
|
|
38
|
-
if (
|
|
39
|
-
|
|
40
|
-
|
|
32
|
+
if (ts.isCallExpression(node) &&
|
|
33
|
+
ts.isPropertyAccessExpression(node.expression) &&
|
|
34
|
+
ts.isIdentifier(node.expression.name)) {
|
|
41
35
|
return node.expression?.name.text === name;
|
|
42
36
|
}
|
|
43
37
|
else {
|
|
@@ -68,8 +62,8 @@ function isTargetOutputDeclaration(node, checker, reflector, dtsReader) {
|
|
|
68
62
|
function isOutputDeclaration(node, reflector, dtsReader) {
|
|
69
63
|
// `.d.ts` file, so we check the `static ecmp` metadata on the `declare class`.
|
|
70
64
|
if (node.getSourceFile().isDeclarationFile) {
|
|
71
|
-
if (!
|
|
72
|
-
!
|
|
65
|
+
if (!ts.isIdentifier(node.name) ||
|
|
66
|
+
!ts.isClassDeclaration(node.parent) ||
|
|
73
67
|
node.parent.name === undefined) {
|
|
74
68
|
return false;
|
|
75
69
|
}
|
|
@@ -82,7 +76,7 @@ function isOutputDeclaration(node, reflector, dtsReader) {
|
|
|
82
76
|
}
|
|
83
77
|
function getTargetPropertyDeclaration(targetSymbol) {
|
|
84
78
|
const valDeclaration = targetSymbol.valueDeclaration;
|
|
85
|
-
if (valDeclaration !== undefined &&
|
|
79
|
+
if (valDeclaration !== undefined && ts.isPropertyDeclaration(valDeclaration)) {
|
|
86
80
|
return valDeclaration;
|
|
87
81
|
}
|
|
88
82
|
return null;
|
|
@@ -101,7 +95,7 @@ function getUniqueIdForProperty(info, prop) {
|
|
|
101
95
|
return `${id}@@${prop.parent.name ?? 'unknown-class'}@@${prop.name.getText()}`;
|
|
102
96
|
}
|
|
103
97
|
function isTestRunnerImport(node) {
|
|
104
|
-
if (
|
|
98
|
+
if (ts.isImportDeclaration(node)) {
|
|
105
99
|
const moduleSpecifier = node.moduleSpecifier.getText();
|
|
106
100
|
return moduleSpecifier.includes('jasmine') || moduleSpecifier.includes('catalyst');
|
|
107
101
|
}
|
|
@@ -147,27 +141,27 @@ function checkNonTsReferenceCallsField(ref, fieldName) {
|
|
|
147
141
|
return potentialRead;
|
|
148
142
|
}
|
|
149
143
|
|
|
150
|
-
const printer =
|
|
144
|
+
const printer = ts.createPrinter();
|
|
151
145
|
function calculateDeclarationReplacement(info, node, aliasParam) {
|
|
152
146
|
const sf = node.getSourceFile();
|
|
153
|
-
const payloadTypes = node.initializer !== undefined &&
|
|
147
|
+
const payloadTypes = node.initializer !== undefined && ts.isNewExpression(node.initializer)
|
|
154
148
|
? node.initializer?.typeArguments
|
|
155
149
|
: undefined;
|
|
156
|
-
const outputCall =
|
|
150
|
+
const outputCall = ts.factory.createCallExpression(ts.factory.createIdentifier('output'), payloadTypes, aliasParam !== undefined
|
|
157
151
|
? [
|
|
158
|
-
|
|
159
|
-
|
|
152
|
+
ts.factory.createObjectLiteralExpression([
|
|
153
|
+
ts.factory.createPropertyAssignment('alias', ts.factory.createStringLiteral(aliasParam, true)),
|
|
160
154
|
], false),
|
|
161
155
|
]
|
|
162
156
|
: []);
|
|
163
|
-
const existingModifiers = (node.modifiers ?? []).filter((modifier) => !
|
|
164
|
-
const updatedOutputDeclaration =
|
|
157
|
+
const existingModifiers = (node.modifiers ?? []).filter((modifier) => !ts.isDecorator(modifier) && modifier.kind !== ts.SyntaxKind.ReadonlyKeyword);
|
|
158
|
+
const updatedOutputDeclaration = ts.factory.createPropertyDeclaration(
|
|
165
159
|
// Think: this logic of dealing with modifiers is applicable to all signal-based migrations
|
|
166
|
-
|
|
160
|
+
ts.factory.createNodeArray([
|
|
167
161
|
...existingModifiers,
|
|
168
|
-
|
|
162
|
+
ts.factory.createModifier(ts.SyntaxKind.ReadonlyKeyword),
|
|
169
163
|
]), node.name, undefined, undefined, outputCall);
|
|
170
|
-
return prepareTextReplacementForNode(info, node, printer.printNode(
|
|
164
|
+
return prepareTextReplacementForNode(info, node, printer.printNode(ts.EmitHint.Unspecified, updatedOutputDeclaration, sf));
|
|
171
165
|
}
|
|
172
166
|
function calculateImportReplacements(info, sourceFiles) {
|
|
173
167
|
const importReplacements = {};
|
|
@@ -205,7 +199,7 @@ function calculateCompleteCallReplacement(info, node) {
|
|
|
205
199
|
return prepareTextReplacementForNode(info, node, '', node.getFullStart());
|
|
206
200
|
}
|
|
207
201
|
function calculatePipeCallReplacement(info, node) {
|
|
208
|
-
if (
|
|
202
|
+
if (ts.isPropertyAccessExpression(node.expression)) {
|
|
209
203
|
const sf = node.getSourceFile();
|
|
210
204
|
const importManager = new checker.ImportManager();
|
|
211
205
|
const outputToObservableIdent = importManager.addImport({
|
|
@@ -213,13 +207,13 @@ function calculatePipeCallReplacement(info, node) {
|
|
|
213
207
|
exportModuleSpecifier: '@angular/core/rxjs-interop',
|
|
214
208
|
exportSymbolName: 'outputToObservable',
|
|
215
209
|
});
|
|
216
|
-
const toObsCallExp =
|
|
210
|
+
const toObsCallExp = ts.factory.createCallExpression(outputToObservableIdent, undefined, [
|
|
217
211
|
node.expression.expression,
|
|
218
212
|
]);
|
|
219
|
-
const pipePropAccessExp =
|
|
220
|
-
const pipeCallExp =
|
|
213
|
+
const pipePropAccessExp = ts.factory.updatePropertyAccessExpression(node.expression, toObsCallExp, node.expression.name);
|
|
214
|
+
const pipeCallExp = ts.factory.updateCallExpression(node, pipePropAccessExp, [], node.arguments);
|
|
221
215
|
const replacements = [
|
|
222
|
-
prepareTextReplacementForNode(info, node, printer.printNode(
|
|
216
|
+
prepareTextReplacementForNode(info, node, printer.printNode(ts.EmitHint.Unspecified, pipeCallExp, sf)),
|
|
223
217
|
];
|
|
224
218
|
apply_import_manager.applyImportManagerChanges(importManager, replacements, [sf], info);
|
|
225
219
|
return replacements;
|
|
@@ -288,7 +282,7 @@ class OutputMigration extends project_paths.TsurgeFunnelMigration {
|
|
|
288
282
|
let isTestFile = false;
|
|
289
283
|
const outputMigrationVisitor = (node) => {
|
|
290
284
|
// detect output declarations
|
|
291
|
-
if (
|
|
285
|
+
if (ts.isPropertyDeclaration(node)) {
|
|
292
286
|
const outputDecorator = getOutputDecorator(node, reflector);
|
|
293
287
|
if (outputDecorator !== null) {
|
|
294
288
|
if (isOutputDeclarationEligibleForMigration(node)) {
|
|
@@ -320,7 +314,7 @@ class OutputMigration extends project_paths.TsurgeFunnelMigration {
|
|
|
320
314
|
}
|
|
321
315
|
}
|
|
322
316
|
// detect .next usages that should be migrated to .emit
|
|
323
|
-
if (isPotentialNextCallUsage(node) &&
|
|
317
|
+
if (isPotentialNextCallUsage(node) && ts.isPropertyAccessExpression(node.expression)) {
|
|
324
318
|
const propertyDeclaration = isTargetOutputDeclaration(node.expression.expression, checker$1, reflector, dtsReader);
|
|
325
319
|
if (propertyDeclaration !== null) {
|
|
326
320
|
const id = getUniqueIdForProperty(info, propertyDeclaration);
|
|
@@ -329,12 +323,12 @@ class OutputMigration extends project_paths.TsurgeFunnelMigration {
|
|
|
329
323
|
}
|
|
330
324
|
}
|
|
331
325
|
// detect .complete usages that should be removed
|
|
332
|
-
if (isPotentialCompleteCallUsage(node) &&
|
|
326
|
+
if (isPotentialCompleteCallUsage(node) && ts.isPropertyAccessExpression(node.expression)) {
|
|
333
327
|
const propertyDeclaration = isTargetOutputDeclaration(node.expression.expression, checker$1, reflector, dtsReader);
|
|
334
328
|
if (propertyDeclaration !== null) {
|
|
335
329
|
const id = getUniqueIdForProperty(info, propertyDeclaration);
|
|
336
330
|
const outputFile = project_paths.projectFile(node.getSourceFile(), info);
|
|
337
|
-
if (
|
|
331
|
+
if (ts.isExpressionStatement(node.parent)) {
|
|
338
332
|
addOutputReplacement(outputFieldReplacements, id, outputFile, calculateCompleteCallReplacement(info, node.parent));
|
|
339
333
|
}
|
|
340
334
|
else {
|
|
@@ -347,7 +341,7 @@ class OutputMigration extends project_paths.TsurgeFunnelMigration {
|
|
|
347
341
|
isTestFile = true;
|
|
348
342
|
}
|
|
349
343
|
// detect unsafe access of the output property
|
|
350
|
-
if (isPotentialPipeCallUsage(node) &&
|
|
344
|
+
if (isPotentialPipeCallUsage(node) && ts.isPropertyAccessExpression(node.expression)) {
|
|
351
345
|
const propertyDeclaration = isTargetOutputDeclaration(node.expression.expression, checker$1, reflector, dtsReader);
|
|
352
346
|
if (propertyDeclaration !== null) {
|
|
353
347
|
const id = getUniqueIdForProperty(info, propertyDeclaration);
|
|
@@ -360,12 +354,12 @@ class OutputMigration extends project_paths.TsurgeFunnelMigration {
|
|
|
360
354
|
}
|
|
361
355
|
}
|
|
362
356
|
}
|
|
363
|
-
|
|
357
|
+
ts.forEachChild(node, outputMigrationVisitor);
|
|
364
358
|
};
|
|
365
359
|
// calculate output migration replacements
|
|
366
360
|
for (const sf of sourceFiles) {
|
|
367
361
|
isTestFile = false;
|
|
368
|
-
|
|
362
|
+
ts.forEachChild(sf, outputMigrationVisitor);
|
|
369
363
|
}
|
|
370
364
|
// take care of the references in templates and host bindings
|
|
371
365
|
const referenceResult = { references: [] };
|
|
@@ -373,7 +367,7 @@ class OutputMigration extends project_paths.TsurgeFunnelMigration {
|
|
|
373
367
|
referenceResult);
|
|
374
368
|
// calculate template / host binding replacements
|
|
375
369
|
for (const sf of sourceFiles) {
|
|
376
|
-
|
|
370
|
+
ts.forEachChild(sf, templateHostRefVisitor);
|
|
377
371
|
}
|
|
378
372
|
for (const ref of referenceResult.references) {
|
|
379
373
|
// detect .next usages that should be migrated to .emit in template and host binding expressions
|