@angular/core 21.0.0-next.0 → 21.0.0-next.10
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/_attribute-chunk.mjs +12 -0
- package/fesm2022/_attribute-chunk.mjs.map +1 -0
- package/fesm2022/_debug_node-chunk.mjs +18469 -0
- package/fesm2022/_debug_node-chunk.mjs.map +1 -0
- package/fesm2022/_effect-chunk.mjs +423 -0
- package/fesm2022/_effect-chunk.mjs.map +1 -0
- package/fesm2022/_effect-chunk2.mjs +2951 -0
- package/fesm2022/_effect-chunk2.mjs.map +1 -0
- package/fesm2022/_not_found-chunk.mjs +39 -0
- package/fesm2022/_not_found-chunk.mjs.map +1 -0
- package/fesm2022/_resource-chunk.mjs +378 -0
- package/fesm2022/_resource-chunk.mjs.map +1 -0
- package/fesm2022/_untracked-chunk.mjs +96 -0
- package/fesm2022/_untracked-chunk.mjs.map +1 -0
- package/fesm2022/_weak_ref-chunk.mjs +10 -0
- package/fesm2022/_weak_ref-chunk.mjs.map +1 -0
- package/fesm2022/core.mjs +2499 -4185
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/primitives-di.mjs +23 -0
- package/fesm2022/primitives-di.mjs.map +1 -0
- package/fesm2022/primitives-event-dispatch.mjs +788 -0
- package/fesm2022/primitives-event-dispatch.mjs.map +1 -0
- package/fesm2022/primitives-signals.mjs +187 -0
- package/fesm2022/primitives-signals.mjs.map +1 -0
- package/fesm2022/rxjs-interop.mjs +210 -308
- package/fesm2022/rxjs-interop.mjs.map +1 -1
- package/fesm2022/testing.mjs +2309 -3170
- package/fesm2022/testing.mjs.map +1 -1
- package/package.json +18 -12
- package/resources/best-practices.md +56 -0
- package/schematics/bundles/add-bootstrap-context-to-server-main.cjs +117 -0
- package/schematics/bundles/application-config-core.cjs +84 -0
- package/schematics/bundles/{apply_import_manager-DR9xXCle.cjs → apply_import_manager-1Zs_gpB6.cjs} +4 -5
- package/schematics/bundles/bootstrap-options-migration.cjs +598 -0
- package/schematics/bundles/cleanup-unused-imports.cjs +9 -13
- package/schematics/bundles/common-to-standalone-migration.cjs +381 -0
- package/schematics/bundles/{compiler_host-BXBP7CE2.cjs → compiler_host-DBwYMlTo.cjs} +10 -11
- package/schematics/bundles/control-flow-migration.cjs +122 -119
- package/schematics/bundles/{imports-CIX-JgAN.cjs → imports-DP72APSx.cjs} +6 -1
- package/schematics/bundles/{index-CfTQUOiz.cjs → index-B7I9sIUx.cjs} +36 -39
- package/schematics/bundles/inject-migration.cjs +148 -70
- package/schematics/bundles/leading_space-D9nQ8UQC.cjs +1 -1
- package/schematics/bundles/{migrate_ts_type_references-6NtAj-Wk.cjs → migrate_ts_type_references-UGIUl7En.cjs} +500 -24
- package/schematics/bundles/ng_component_template-Dsuq1Lw7.cjs +185 -0
- package/schematics/bundles/{ng_decorators-B5HCqr20.cjs → ng_decorators-DSFlWYQY.cjs} +2 -2
- package/schematics/bundles/ngclass-to-class-migration.cjs +542 -0
- package/schematics/bundles/ngstyle-to-style-migration.cjs +487 -0
- package/schematics/bundles/nodes-B16H9JUd.cjs +1 -1
- package/schematics/bundles/output-migration.cjs +16 -19
- package/schematics/bundles/parse_html-8VLCL37B.cjs +132 -0
- package/schematics/bundles/{project_paths-DcaODbky.cjs → project_paths-DvD50ouC.cjs} +14 -247
- package/schematics/bundles/project_tsconfig_paths-CDVxT6Ov.cjs +90 -0
- package/schematics/bundles/property_name-BBwFuqMe.cjs +1 -1
- package/schematics/bundles/route-lazy-loading.cjs +54 -26
- package/schematics/bundles/router-current-navigation.cjs +7 -18
- package/schematics/bundles/router-last-successful-navigation.cjs +7 -18
- package/schematics/bundles/router-testing-module-migration.cjs +502 -0
- package/schematics/bundles/self-closing-tags-migration.cjs +17 -216
- package/schematics/bundles/signal-input-migration.cjs +93 -29
- package/schematics/bundles/signal-queries-migration.cjs +22 -25
- package/schematics/bundles/signals.cjs +10 -13
- package/schematics/bundles/standalone-migration.cjs +135 -102
- package/schematics/bundles/{symbol-VPWguRxr.cjs → symbol-BObKoqes.cjs} +3 -2
- package/schematics/collection.json +23 -0
- package/schematics/migrations/common-to-standalone-migration/schema.json +14 -0
- package/schematics/migrations/ngclass-to-class-migration/schema.json +20 -0
- package/schematics/migrations/ngstyle-to-style-migration/schema.json +20 -0
- package/schematics/migrations/router-testing-module-migration/schema.json +14 -0
- package/schematics/migrations.json +16 -2
- package/{api.d.d.ts → types/_api-chunk.d.ts} +9 -6
- package/{chrome_dev_tools_performance.d.d.ts → types/_chrome_dev_tools_performance-chunk.d.ts} +26 -31
- package/{discovery.d.d.ts → types/_discovery-chunk.d.ts} +135 -98
- package/{signal.d.d.ts → types/_effect-chunk.d.ts} +14 -5
- package/{event_dispatcher.d.d.ts → types/_event_dispatcher-chunk.d.ts} +2 -2
- package/{graph.d.d.ts → types/_formatter-chunk.d.ts} +40 -7
- package/{weak_ref.d.d.ts → types/_weak_ref-chunk.d.ts} +2 -2
- package/{index.d.ts → types/core.d.ts} +233 -305
- package/{primitives/di/index.d.ts → types/primitives-di.d.ts} +2 -2
- package/{primitives/event-dispatch/index.d.ts → types/primitives-event-dispatch.d.ts} +4 -4
- package/{primitives/signals/index.d.ts → types/primitives-signals.d.ts} +7 -8
- package/{rxjs-interop/index.d.ts → types/rxjs-interop.d.ts} +8 -6
- package/{testing/index.d.ts → types/testing.d.ts} +7 -7
- package/fesm2022/attribute.mjs +0 -24
- package/fesm2022/attribute.mjs.map +0 -1
- package/fesm2022/debug_node.mjs +0 -31833
- package/fesm2022/debug_node.mjs.map +0 -1
- package/fesm2022/not_found.mjs +0 -56
- package/fesm2022/not_found.mjs.map +0 -1
- package/fesm2022/primitives/di.mjs +0 -23
- package/fesm2022/primitives/di.mjs.map +0 -1
- package/fesm2022/primitives/event-dispatch.mjs +0 -1622
- package/fesm2022/primitives/event-dispatch.mjs.map +0 -1
- package/fesm2022/primitives/signals.mjs +0 -89
- package/fesm2022/primitives/signals.mjs.map +0 -1
- package/fesm2022/resource.mjs +0 -633
- package/fesm2022/resource.mjs.map +0 -1
- package/fesm2022/root_effect_scheduler.mjs +0 -4007
- package/fesm2022/root_effect_scheduler.mjs.map +0 -1
- package/fesm2022/signal.mjs +0 -560
- package/fesm2022/signal.mjs.map +0 -1
- package/fesm2022/untracked.mjs +0 -117
- package/fesm2022/untracked.mjs.map +0 -1
- package/fesm2022/weak_ref.mjs +0 -12
- package/fesm2022/weak_ref.mjs.map +0 -1
- package/schematics/bundles/index-esqfDjNB.cjs +0 -22074
- package/schematics/bundles/project_tsconfig_paths-CS-eSeHC.cjs +0 -51062
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v21.0.0-next.
|
|
3
|
+
* @license Angular v21.0.0-next.10
|
|
4
4
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -8,14 +8,12 @@
|
|
|
8
8
|
|
|
9
9
|
var schematics = require('@angular-devkit/schematics');
|
|
10
10
|
var fs = require('fs');
|
|
11
|
-
var
|
|
12
|
-
var compiler_host = require('./compiler_host-
|
|
13
|
-
var project_tsconfig_paths = require('./project_tsconfig_paths-
|
|
11
|
+
var path = require('path');
|
|
12
|
+
var compiler_host = require('./compiler_host-DBwYMlTo.cjs');
|
|
13
|
+
var project_tsconfig_paths = require('./project_tsconfig_paths-CDVxT6Ov.cjs');
|
|
14
14
|
var ts = require('typescript');
|
|
15
|
+
var migrations = require('@angular/compiler-cli/private/migrations');
|
|
15
16
|
var property_name = require('./property_name-BBwFuqMe.cjs');
|
|
16
|
-
require('os');
|
|
17
|
-
require('module');
|
|
18
|
-
require('url');
|
|
19
17
|
require('@angular-devkit/core');
|
|
20
18
|
|
|
21
19
|
/**
|
|
@@ -30,13 +28,6 @@ function findClassDeclaration(reference, typeChecker) {
|
|
|
30
28
|
?.declarations?.find(ts.isClassDeclaration) || null);
|
|
31
29
|
}
|
|
32
30
|
|
|
33
|
-
/*!
|
|
34
|
-
* @license
|
|
35
|
-
* Copyright Google LLC All Rights Reserved.
|
|
36
|
-
*
|
|
37
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
38
|
-
* found in the LICENSE file at https://angular.dev/license
|
|
39
|
-
*/
|
|
40
31
|
/**
|
|
41
32
|
* Checks whether a component is standalone.
|
|
42
33
|
* @param node Class being checked.
|
|
@@ -47,7 +38,7 @@ function isStandaloneComponent(node, reflector) {
|
|
|
47
38
|
if (decorators === null) {
|
|
48
39
|
return false;
|
|
49
40
|
}
|
|
50
|
-
const decorator =
|
|
41
|
+
const decorator = migrations.findAngularDecorator(decorators, 'Component', false);
|
|
51
42
|
if (decorator === undefined || decorator.args === null || decorator.args.length !== 1) {
|
|
52
43
|
return false;
|
|
53
44
|
}
|
|
@@ -139,13 +130,6 @@ function isProvideRoutesCallExpression(node, typeChecker) {
|
|
|
139
130
|
return false;
|
|
140
131
|
}
|
|
141
132
|
|
|
142
|
-
/*!
|
|
143
|
-
* @license
|
|
144
|
-
* Copyright Google LLC All Rights Reserved.
|
|
145
|
-
*
|
|
146
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
147
|
-
* found in the LICENSE file at https://angular.dev/license
|
|
148
|
-
*/
|
|
149
133
|
/**
|
|
150
134
|
* Converts all application routes that are using standalone components to be lazy loaded.
|
|
151
135
|
* @param sourceFile File that should be migrated.
|
|
@@ -153,7 +137,7 @@ function isProvideRoutesCallExpression(node, typeChecker) {
|
|
|
153
137
|
*/
|
|
154
138
|
function migrateFileToLazyRoutes(sourceFile, program) {
|
|
155
139
|
const typeChecker = program.getTypeChecker();
|
|
156
|
-
const reflector = new
|
|
140
|
+
const reflector = new migrations.TypeScriptReflectionHost(typeChecker);
|
|
157
141
|
const printer = ts.createPrinter();
|
|
158
142
|
const tracker = new compiler_host.ChangeTracker(printer);
|
|
159
143
|
const routeArraysToMigrate = findRoutesArrayToMigrate(sourceFile, typeChecker);
|
|
@@ -208,7 +192,7 @@ function findRoutesArrayToMigrate(sourceFile, typeChecker) {
|
|
|
208
192
|
}
|
|
209
193
|
}
|
|
210
194
|
}
|
|
211
|
-
if (ts.isVariableDeclaration(node)) {
|
|
195
|
+
else if (ts.isVariableDeclaration(node)) {
|
|
212
196
|
if (isAngularRoutesArray(node, typeChecker)) {
|
|
213
197
|
const initializer = node.initializer;
|
|
214
198
|
if (initializer &&
|
|
@@ -227,6 +211,33 @@ function findRoutesArrayToMigrate(sourceFile, typeChecker) {
|
|
|
227
211
|
}
|
|
228
212
|
}
|
|
229
213
|
}
|
|
214
|
+
else if (ts.isExportAssignment(node)) {
|
|
215
|
+
// Handles `export default routes`, `export default [...]` and `export default [...] as Routes`
|
|
216
|
+
let expression = node.expression;
|
|
217
|
+
if (ts.isAsExpression(expression)) {
|
|
218
|
+
expression = expression.expression;
|
|
219
|
+
}
|
|
220
|
+
if (ts.isArrayLiteralExpression(expression)) {
|
|
221
|
+
routesArrays.push({
|
|
222
|
+
routeFilePath: sourceFile.fileName,
|
|
223
|
+
array: expression,
|
|
224
|
+
routeFileImports: sourceFile.statements.filter(ts.isImportDeclaration),
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
else if (ts.isIdentifier(expression)) {
|
|
228
|
+
manageRoutesExportedByDefault(routesArrays, typeChecker, expression, sourceFile);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
else if (ts.isExportDeclaration(node)) {
|
|
232
|
+
// Handles cases like `export { routes as default }`
|
|
233
|
+
if (node.exportClause && ts.isNamedExports(node.exportClause)) {
|
|
234
|
+
for (const specifier of node.exportClause.elements) {
|
|
235
|
+
if (specifier.name.text === 'default') {
|
|
236
|
+
manageRoutesExportedByDefault(routesArrays, typeChecker, specifier.propertyName ?? specifier.name, sourceFile);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
230
241
|
node.forEachChild(walk);
|
|
231
242
|
});
|
|
232
243
|
return routesArrays;
|
|
@@ -333,6 +344,23 @@ function createLoadComponentPropertyAssignment(componentImportPath, componentDec
|
|
|
333
344
|
// will generate import('./path).then(m => m.componentName)
|
|
334
345
|
ts.factory.createPropertyAccessExpression(createImportCallExpression(componentImportPath), 'then'), undefined, [createImportThenCallExpression(componentDeclarationName)])));
|
|
335
346
|
}
|
|
347
|
+
const manageRoutesExportedByDefault = (routesArrays, typeChecker, expression, sourceFile) => {
|
|
348
|
+
const symbol = typeChecker.getSymbolAtLocation(expression);
|
|
349
|
+
if (!symbol?.declarations) {
|
|
350
|
+
return;
|
|
351
|
+
}
|
|
352
|
+
for (const declaration of symbol.declarations) {
|
|
353
|
+
if (ts.isVariableDeclaration(declaration) &&
|
|
354
|
+
declaration.initializer &&
|
|
355
|
+
ts.isArrayLiteralExpression(declaration.initializer)) {
|
|
356
|
+
routesArrays.push({
|
|
357
|
+
routeFilePath: sourceFile.fileName,
|
|
358
|
+
array: declaration.initializer,
|
|
359
|
+
routeFileImports: sourceFile.statements.filter(ts.isImportDeclaration),
|
|
360
|
+
});
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
};
|
|
336
364
|
// import('./path)
|
|
337
365
|
const createImportCallExpression = (componentImportPath) => ts.factory.createCallExpression(ts.factory.createIdentifier('import'), undefined, [
|
|
338
366
|
ts.factory.createStringLiteral(componentImportPath, true),
|
|
@@ -346,7 +374,7 @@ function migrate(options) {
|
|
|
346
374
|
const basePath = process.cwd();
|
|
347
375
|
// TS and Schematic use paths in POSIX format even on Windows. This is needed as otherwise
|
|
348
376
|
// string matching such as `sourceFile.fileName.startsWith(pathToMigrate)` might not work.
|
|
349
|
-
const pathToMigrate = compiler_host.normalizePath(
|
|
377
|
+
const pathToMigrate = compiler_host.normalizePath(path.join(basePath, options.path));
|
|
350
378
|
if (!buildPaths.length) {
|
|
351
379
|
throw new schematics.SchematicsException('Could not find any tsconfig file. Cannot run the route lazy loading migration.');
|
|
352
380
|
}
|
|
@@ -395,7 +423,7 @@ function standaloneRoutesMigration(tree, tsconfigPath, basePath, pathToMigrate,
|
|
|
395
423
|
const { pendingChanges, skippedRoutes: skipped, migratedRoutes: migrated, } = migrateFileToLazyRoutes(sourceFile, program);
|
|
396
424
|
skippedRoutes.push(...skipped);
|
|
397
425
|
migratedRoutes.push(...migrated);
|
|
398
|
-
const update = tree.beginUpdate(
|
|
426
|
+
const update = tree.beginUpdate(path.relative(basePath, sourceFile.fileName));
|
|
399
427
|
pendingChanges.forEach((change) => {
|
|
400
428
|
if (change.removeLength != null) {
|
|
401
429
|
update.remove(change.start, change.removeLength);
|
|
@@ -1,26 +1,22 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v21.0.0-next.
|
|
3
|
+
* @license Angular v21.0.0-next.10
|
|
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
|
-
require('
|
|
11
|
-
require('
|
|
12
|
-
require('./index-esqfDjNB.cjs');
|
|
13
|
-
require('path');
|
|
10
|
+
require('@angular/compiler-cli');
|
|
11
|
+
require('@angular/compiler-cli/private/migrations');
|
|
14
12
|
require('node:path');
|
|
15
|
-
var project_paths = require('./project_paths-
|
|
16
|
-
var imports = require('./imports-
|
|
17
|
-
var symbol = require('./symbol-
|
|
13
|
+
var project_paths = require('./project_paths-DvD50ouC.cjs');
|
|
14
|
+
var imports = require('./imports-DP72APSx.cjs');
|
|
15
|
+
var symbol = require('./symbol-BObKoqes.cjs');
|
|
18
16
|
require('@angular-devkit/core');
|
|
19
17
|
require('node:path/posix');
|
|
20
|
-
require('fs');
|
|
21
|
-
require('module');
|
|
22
|
-
require('url');
|
|
23
18
|
require('@angular-devkit/schematics');
|
|
19
|
+
require('./project_tsconfig_paths-CDVxT6Ov.cjs');
|
|
24
20
|
|
|
25
21
|
/** Name of the method being replaced. */
|
|
26
22
|
const METHOD_NAME = 'getCurrentNavigation';
|
|
@@ -95,13 +91,6 @@ function isRouterType(typeChecker, expression, routerSpecifier) {
|
|
|
95
91
|
return declarations.some((decl) => decl === routerSpecifier);
|
|
96
92
|
}
|
|
97
93
|
|
|
98
|
-
/*!
|
|
99
|
-
* @license
|
|
100
|
-
* Copyright Google LLC All Rights Reserved.
|
|
101
|
-
*
|
|
102
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
103
|
-
* found in the LICENSE file at https://angular.dev/license
|
|
104
|
-
*/
|
|
105
94
|
function migrate() {
|
|
106
95
|
return async (tree) => {
|
|
107
96
|
await project_paths.runMigrationInDevkit({
|
|
@@ -1,26 +1,22 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v21.0.0-next.
|
|
3
|
+
* @license Angular v21.0.0-next.10
|
|
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
|
-
require('
|
|
11
|
-
require('
|
|
12
|
-
require('./index-esqfDjNB.cjs');
|
|
13
|
-
require('path');
|
|
10
|
+
require('@angular/compiler-cli');
|
|
11
|
+
require('@angular/compiler-cli/private/migrations');
|
|
14
12
|
require('node:path');
|
|
15
|
-
var project_paths = require('./project_paths-
|
|
16
|
-
var imports = require('./imports-
|
|
17
|
-
var symbol = require('./symbol-
|
|
13
|
+
var project_paths = require('./project_paths-DvD50ouC.cjs');
|
|
14
|
+
var imports = require('./imports-DP72APSx.cjs');
|
|
15
|
+
var symbol = require('./symbol-BObKoqes.cjs');
|
|
18
16
|
require('@angular-devkit/core');
|
|
19
17
|
require('node:path/posix');
|
|
20
|
-
require('fs');
|
|
21
|
-
require('module');
|
|
22
|
-
require('url');
|
|
23
18
|
require('@angular-devkit/schematics');
|
|
19
|
+
require('./project_tsconfig_paths-CDVxT6Ov.cjs');
|
|
24
20
|
|
|
25
21
|
/** Name of the method being replaced. */
|
|
26
22
|
const METHOD_NAME = 'lastSuccessfulNavigation';
|
|
@@ -95,13 +91,6 @@ function isRouterType(typeChecker, expression, routerSpecifier) {
|
|
|
95
91
|
return declarations.some((decl) => decl === routerSpecifier);
|
|
96
92
|
}
|
|
97
93
|
|
|
98
|
-
/*!
|
|
99
|
-
* @license
|
|
100
|
-
* Copyright Google LLC All Rights Reserved.
|
|
101
|
-
*
|
|
102
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
103
|
-
* found in the LICENSE file at https://angular.dev/license
|
|
104
|
-
*/
|
|
105
94
|
function migrate() {
|
|
106
95
|
return async (tree) => {
|
|
107
96
|
await project_paths.runMigrationInDevkit({
|