@angular/core 22.0.0-next.5 → 22.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/fesm2022/_attribute-chunk.mjs +1 -1
- package/fesm2022/_debug_node-chunk.mjs +164 -70
- package/fesm2022/_debug_node-chunk.mjs.map +1 -1
- package/fesm2022/_effect-chunk.mjs +1 -1
- package/fesm2022/_not_found-chunk.mjs +1 -1
- package/fesm2022/_pending_tasks-chunk.mjs +2 -2
- package/fesm2022/_pending_tasks-chunk.mjs.map +1 -1
- package/fesm2022/_resource-chunk.mjs +1 -1
- package/fesm2022/_untracked-chunk.mjs +1 -1
- package/fesm2022/_weak_ref-chunk.mjs +1 -1
- package/fesm2022/core.mjs +2 -2
- package/fesm2022/primitives-di.mjs +1 -1
- package/fesm2022/primitives-event-dispatch.mjs +1 -5
- package/fesm2022/primitives-event-dispatch.mjs.map +1 -1
- package/fesm2022/primitives-signals.mjs +1 -1
- package/fesm2022/rxjs-interop.mjs +1 -1
- package/fesm2022/testing.mjs +1 -1
- package/package.json +2 -2
- package/schematics/bundles/apply_import_manager-CxA_YYgB.cjs +1 -1
- package/schematics/bundles/can-match-snapshot-required.cjs +104 -0
- package/schematics/bundles/change-detection-eager.cjs +1 -1
- package/schematics/bundles/cleanup-unused-imports.cjs +1 -1
- package/schematics/bundles/common-to-standalone-migration.cjs +1 -1
- package/schematics/bundles/compiler_host-CY14HvaP.cjs +1 -1
- package/schematics/bundles/control-flow-migration.cjs +1 -1
- package/schematics/bundles/http-xhr-backend.cjs +6 -11
- package/schematics/bundles/imports-CKV-ITqD.cjs +1 -1
- package/schematics/bundles/{index-BtLcQH8g.cjs → index-DADA7AvC.cjs} +7 -3
- package/schematics/bundles/inject-migration.cjs +1 -1
- package/schematics/bundles/leading_space-BTPRV0wu.cjs +1 -1
- package/schematics/bundles/{migrate_ts_type_references-Dp33iyGx.cjs → migrate_ts_type_references-B9LlDDUg.cjs} +2 -2
- package/schematics/bundles/ng_component_template-DPAF1aEA.cjs +1 -1
- package/schematics/bundles/ng_decorators-IVztR9rk.cjs +1 -1
- package/schematics/bundles/ngclass-to-class-migration.cjs +1 -1
- package/schematics/bundles/ngstyle-to-style-migration.cjs +1 -1
- package/schematics/bundles/nodes-ZSQ7WZRB.cjs +1 -1
- package/schematics/bundles/output-migration.cjs +2 -2
- package/schematics/bundles/parse_html-C8eKA9px.cjs +1 -1
- package/schematics/bundles/project_paths-D2V-Uh2L.cjs +1 -1
- package/schematics/bundles/project_tsconfig_paths-DkkMibv-.cjs +1 -1
- package/schematics/bundles/property_name-BCpALNpZ.cjs +1 -1
- package/schematics/bundles/route-lazy-loading.cjs +22 -2
- package/schematics/bundles/router-testing-module-migration.cjs +1 -1
- package/schematics/bundles/self-closing-tags-migration.cjs +1 -1
- package/schematics/bundles/signal-input-migration.cjs +3 -3
- package/schematics/bundles/signal-queries-migration.cjs +3 -3
- package/schematics/bundles/signals.cjs +3 -3
- package/schematics/bundles/standalone-migration.cjs +29 -17
- package/schematics/bundles/strict-templates.cjs +55 -0
- package/schematics/migrations.json +10 -0
- package/types/_api-chunk.d.ts +1 -1
- package/types/_chrome_dev_tools_performance-chunk.d.ts +1 -1
- package/types/_debug_node-chunk.d.ts +13 -55
- package/types/_effect-chunk.d.ts +1 -1
- package/types/_event_dispatcher-chunk.d.ts +1 -1
- package/types/_formatter-chunk.d.ts +1 -1
- package/types/_weak_ref-chunk.d.ts +1 -1
- package/types/core.d.ts +2 -23
- package/types/primitives-di.d.ts +1 -1
- package/types/primitives-event-dispatch.d.ts +1 -1
- package/types/primitives-signals.d.ts +1 -1
- package/types/rxjs-interop.d.ts +1 -1
- package/types/testing.d.ts +1 -1
package/fesm2022/testing.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular/core",
|
|
3
|
-
"version": "22.0.0-next.
|
|
3
|
+
"version": "22.0.0-next.7",
|
|
4
4
|
"description": "Angular - the core framework",
|
|
5
5
|
"author": "angular",
|
|
6
6
|
"license": "MIT",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"tslib": "^2.3.0"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"@angular/compiler": "22.0.0-next.
|
|
49
|
+
"@angular/compiler": "22.0.0-next.7",
|
|
50
50
|
"rxjs": "^6.5.3 || ^7.4.0",
|
|
51
51
|
"zone.js": "~0.15.0 || ~0.16.0"
|
|
52
52
|
},
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/**
|
|
3
|
+
* @license Angular v22.0.0-next.7
|
|
4
|
+
* (c) 2010-2026 Google LLC. https://angular.dev/
|
|
5
|
+
* License: MIT
|
|
6
|
+
*/
|
|
7
|
+
'use strict';
|
|
8
|
+
|
|
9
|
+
require('@angular-devkit/core');
|
|
10
|
+
require('node:path/posix');
|
|
11
|
+
var project_paths = require('./project_paths-D2V-Uh2L.cjs');
|
|
12
|
+
var ts = require('typescript');
|
|
13
|
+
require('@angular/compiler-cli');
|
|
14
|
+
require('@angular/compiler-cli/private/migrations');
|
|
15
|
+
require('node:path');
|
|
16
|
+
require('@angular-devkit/schematics');
|
|
17
|
+
require('./project_tsconfig_paths-DkkMibv-.cjs');
|
|
18
|
+
|
|
19
|
+
class CanMatchSnapshotRequiredMigration extends project_paths.TsurgeFunnelMigration {
|
|
20
|
+
async analyze(info) {
|
|
21
|
+
const replacements = [];
|
|
22
|
+
const { sourceFiles, program } = info;
|
|
23
|
+
const typeChecker = program.getTypeChecker();
|
|
24
|
+
for (const sourceFile of sourceFiles) {
|
|
25
|
+
const walk = (node) => {
|
|
26
|
+
ts.forEachChild(node, walk);
|
|
27
|
+
if (ts.isCallExpression(node)) {
|
|
28
|
+
let shouldMigrate = false;
|
|
29
|
+
// 1. Method calls objective: obj.canMatch(a, b)
|
|
30
|
+
if (ts.isPropertyAccessExpression(node.expression) &&
|
|
31
|
+
node.expression.name.text === 'canMatch') {
|
|
32
|
+
const type = typeChecker.getTypeAtLocation(node.expression.expression);
|
|
33
|
+
const classSymbol = type.getSymbol();
|
|
34
|
+
if (classSymbol && classSymbol.declarations) {
|
|
35
|
+
const decl = classSymbol.declarations[0];
|
|
36
|
+
if (ts.isClassDeclaration(decl)) {
|
|
37
|
+
if (implementsInterface(decl, 'CanMatch')) {
|
|
38
|
+
shouldMigrate = true;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
// 2. Function calls objective: canMatch(a, b)
|
|
44
|
+
if (ts.isIdentifier(node.expression) && node.expression.text === 'canMatch') {
|
|
45
|
+
const type = typeChecker.getTypeAtLocation(node.expression);
|
|
46
|
+
const typeStr = typeChecker.typeToString(type);
|
|
47
|
+
if (typeStr.includes('CanMatchFn')) {
|
|
48
|
+
shouldMigrate = true;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
if (shouldMigrate && node.arguments.length === 2) {
|
|
52
|
+
const lastArg = node.arguments[1];
|
|
53
|
+
replacements.push(new project_paths.Replacement(project_paths.projectFile(sourceFile, info), new project_paths.TextUpdate({
|
|
54
|
+
position: lastArg.getEnd(),
|
|
55
|
+
end: lastArg.getEnd(),
|
|
56
|
+
toInsert: ', {} as any /* added by migration */',
|
|
57
|
+
})));
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
ts.forEachChild(sourceFile, walk);
|
|
62
|
+
}
|
|
63
|
+
return project_paths.confirmAsSerializable({ replacements });
|
|
64
|
+
}
|
|
65
|
+
async combine(unitA, unitB) {
|
|
66
|
+
return project_paths.confirmAsSerializable({
|
|
67
|
+
replacements: [...unitA.replacements, ...unitB.replacements],
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
async globalMeta(combinedData) {
|
|
71
|
+
return project_paths.confirmAsSerializable(combinedData);
|
|
72
|
+
}
|
|
73
|
+
async stats(globalMetadata) {
|
|
74
|
+
return project_paths.confirmAsSerializable({});
|
|
75
|
+
}
|
|
76
|
+
async migrate(globalData) {
|
|
77
|
+
return { replacements: globalData.replacements };
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
function implementsInterface(decl, interfaceName) {
|
|
81
|
+
if (!decl.heritageClauses)
|
|
82
|
+
return false;
|
|
83
|
+
for (const clause of decl.heritageClauses) {
|
|
84
|
+
if (clause.token === ts.SyntaxKind.ImplementsKeyword) {
|
|
85
|
+
for (const expr of clause.types) {
|
|
86
|
+
if (ts.isIdentifier(expr.expression) && expr.expression.text === interfaceName) {
|
|
87
|
+
return true;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function migrate(options) {
|
|
96
|
+
return async (tree, context) => {
|
|
97
|
+
await project_paths.runMigrationInDevkit({
|
|
98
|
+
tree,
|
|
99
|
+
getMigration: (fs) => new CanMatchSnapshotRequiredMigration(),
|
|
100
|
+
});
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
exports.migrate = migrate;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v22.0.0-next.
|
|
3
|
+
* @license Angular v22.0.0-next.7
|
|
4
4
|
* (c) 2010-2026 Google LLC. https://angular.dev/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -23,7 +23,11 @@ const provideHttpClient = 'provideHttpClient';
|
|
|
23
23
|
const WITH_FETCH = 'withFetch';
|
|
24
24
|
const WITH_XHR = 'withXhr';
|
|
25
25
|
const HTTP_PACKAGE = '@angular/common/http';
|
|
26
|
-
|
|
26
|
+
/**
|
|
27
|
+
* Prior to v22, provideHttpClient() had a Xhr backend by default. In v22, the default was switched to a Fetch backend.
|
|
28
|
+
* This migration adds the withXhr() option to any provideHttpClient() calls that do not already have either withFetch() or withXhr() specified,
|
|
29
|
+
* to preserve the Xhr backend behavior.
|
|
30
|
+
*/
|
|
27
31
|
class XhrBackendMigration extends project_paths.TsurgeFunnelMigration {
|
|
28
32
|
config;
|
|
29
33
|
constructor(config = {}) {
|
|
@@ -76,15 +80,6 @@ class XhrBackendMigration extends project_paths.TsurgeFunnelMigration {
|
|
|
76
80
|
requestedFile: sourceFile,
|
|
77
81
|
});
|
|
78
82
|
}
|
|
79
|
-
else if (withFetchNode) {
|
|
80
|
-
const isLastArg = node.arguments[node.arguments.length - 1] === withFetchNode;
|
|
81
|
-
replacements.push(new project_paths.Replacement(project_paths.projectFile(sourceFile, info), new project_paths.TextUpdate({
|
|
82
|
-
position: withFetchNode.getStart(),
|
|
83
|
-
end: isLastArg ? withFetchNode.getEnd() : withFetchNode.getEnd() + 2, // +2 to remove the comma and space, could be improved
|
|
84
|
-
toInsert: '',
|
|
85
|
-
})));
|
|
86
|
-
importManager.removeImport(sourceFile, 'withFetch', HTTP_PACKAGE);
|
|
87
|
-
}
|
|
88
83
|
};
|
|
89
84
|
sourceFile.forEachChild(walk);
|
|
90
85
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v22.0.0-next.
|
|
3
|
+
* @license Angular v22.0.0-next.7
|
|
4
4
|
* (c) 2010-2026 Google LLC. https://angular.dev/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -402,13 +402,17 @@ class TemplateExpressionReferenceVisitor extends compiler.RecursiveAstVisitor {
|
|
|
402
402
|
return false;
|
|
403
403
|
}
|
|
404
404
|
const symbol = this.templateTypeChecker.getSymbolOfNode(ast, this.componentClass);
|
|
405
|
-
if (symbol?.kind !== migrations.SymbolKind.Expression
|
|
405
|
+
if (symbol?.kind !== migrations.SymbolKind.Expression) {
|
|
406
|
+
return false;
|
|
407
|
+
}
|
|
408
|
+
const tsSymbol = this.templateTypeChecker.getTsSymbolOfSymbol(symbol);
|
|
409
|
+
if (tsSymbol === null) {
|
|
406
410
|
return false;
|
|
407
411
|
}
|
|
408
412
|
// Dangerous: Type checking symbol retrieval is a totally different `ts.Program`,
|
|
409
413
|
// than the one where we analyzed `knownInputs`.
|
|
410
414
|
// --> Find the input via its input id.
|
|
411
|
-
const targetInput = this.knownFields.attemptRetrieveDescriptorFromSymbol(
|
|
415
|
+
const targetInput = this.knownFields.attemptRetrieveDescriptorFromSymbol(tsSymbol);
|
|
412
416
|
if (targetInput === null) {
|
|
413
417
|
return false;
|
|
414
418
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v22.0.0-next.
|
|
3
|
+
* @license Angular v22.0.0-next.7
|
|
4
4
|
* (c) 2010-2026 Google LLC. https://angular.dev/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
var assert = require('assert');
|
|
10
10
|
var ts = require('typescript');
|
|
11
11
|
var migrations = require('@angular/compiler-cli/private/migrations');
|
|
12
|
-
var index = require('./index-
|
|
12
|
+
var index = require('./index-DADA7AvC.cjs');
|
|
13
13
|
var project_paths = require('./project_paths-D2V-Uh2L.cjs');
|
|
14
14
|
var leading_space = require('./leading_space-BTPRV0wu.cjs');
|
|
15
15
|
require('@angular/compiler-cli');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v22.0.0-next.
|
|
3
|
+
* @license Angular v22.0.0-next.7
|
|
4
4
|
* (c) 2010-2026 Google LLC. https://angular.dev/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -13,7 +13,7 @@ require('node:path');
|
|
|
13
13
|
var project_paths = require('./project_paths-D2V-Uh2L.cjs');
|
|
14
14
|
var compiler = require('@angular/compiler');
|
|
15
15
|
var apply_import_manager = require('./apply_import_manager-CxA_YYgB.cjs');
|
|
16
|
-
var index = require('./index-
|
|
16
|
+
var index = require('./index-DADA7AvC.cjs');
|
|
17
17
|
require('@angular-devkit/core');
|
|
18
18
|
require('node:path/posix');
|
|
19
19
|
require('@angular-devkit/schematics');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v22.0.0-next.
|
|
3
|
+
* @license Angular v22.0.0-next.7
|
|
4
4
|
* (c) 2010-2026 Google LLC. https://angular.dev/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -296,7 +296,27 @@ function migrateRoute(element, route, typeChecker, reflector, tracker) {
|
|
|
296
296
|
if (componentDeclaration.getSourceFile().fileName === route.routeFilePath) {
|
|
297
297
|
return routeMigrationResults;
|
|
298
298
|
}
|
|
299
|
-
|
|
299
|
+
// Resolve the import that provides this component by exact specifier match
|
|
300
|
+
// Handles default imports, named imports, and aliases (e.g., `import { Foo as Bar }`).
|
|
301
|
+
const componentImport = route.routeFileImports.find((importDecl) => {
|
|
302
|
+
const clause = importDecl.importClause;
|
|
303
|
+
if (!clause)
|
|
304
|
+
return false;
|
|
305
|
+
// Default import: import FooComponent from '...'
|
|
306
|
+
if (clause.name && ts.isIdentifier(clause.name) && clause.name.text === componentClassName) {
|
|
307
|
+
return true;
|
|
308
|
+
}
|
|
309
|
+
// Named imports: import { FooComponent } from '...'
|
|
310
|
+
const named = clause.namedBindings;
|
|
311
|
+
if (named && ts.isNamedImports(named)) {
|
|
312
|
+
return named.elements.some((el) => {
|
|
313
|
+
// Support alias: import { Foo as Bar }
|
|
314
|
+
const importedName = el.propertyName ? el.propertyName.text : el.name.text;
|
|
315
|
+
return importedName === componentClassName;
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
return false;
|
|
319
|
+
});
|
|
300
320
|
// remove single and double quotes from the import path
|
|
301
321
|
let componentImportPath = ts.isStringLiteral(componentImport?.moduleSpecifier)
|
|
302
322
|
? componentImport.moduleSpecifier.text
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v22.0.0-next.
|
|
3
|
+
* @license Angular v22.0.0-next.7
|
|
4
4
|
* (c) 2010-2026 Google LLC. https://angular.dev/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
7
7
|
'use strict';
|
|
8
8
|
|
|
9
|
-
var migrate_ts_type_references = require('./migrate_ts_type_references-
|
|
9
|
+
var migrate_ts_type_references = require('./migrate_ts_type_references-B9LlDDUg.cjs');
|
|
10
10
|
var ts = require('typescript');
|
|
11
11
|
require('@angular/compiler-cli');
|
|
12
12
|
var migrations = require('@angular/compiler-cli/private/migrations');
|
|
13
13
|
require('node:path');
|
|
14
14
|
var project_paths = require('./project_paths-D2V-Uh2L.cjs');
|
|
15
|
-
var index = require('./index-
|
|
15
|
+
var index = require('./index-DADA7AvC.cjs');
|
|
16
16
|
var assert = require('assert');
|
|
17
17
|
var apply_import_manager = require('./apply_import_manager-CxA_YYgB.cjs');
|
|
18
18
|
require('@angular-devkit/core');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v22.0.0-next.
|
|
3
|
+
* @license Angular v22.0.0-next.7
|
|
4
4
|
* (c) 2010-2026 Google LLC. https://angular.dev/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -12,9 +12,9 @@ require('@angular/compiler-cli');
|
|
|
12
12
|
require('node:path');
|
|
13
13
|
var project_paths = require('./project_paths-D2V-Uh2L.cjs');
|
|
14
14
|
var apply_import_manager = require('./apply_import_manager-CxA_YYgB.cjs');
|
|
15
|
-
var migrate_ts_type_references = require('./migrate_ts_type_references-
|
|
15
|
+
var migrate_ts_type_references = require('./migrate_ts_type_references-B9LlDDUg.cjs');
|
|
16
16
|
var assert = require('assert');
|
|
17
|
-
var index = require('./index-
|
|
17
|
+
var index = require('./index-DADA7AvC.cjs');
|
|
18
18
|
var compiler = require('@angular/compiler');
|
|
19
19
|
require('@angular-devkit/core');
|
|
20
20
|
require('node:path/posix');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v22.0.0-next.
|
|
3
|
+
* @license Angular v22.0.0-next.7
|
|
4
4
|
* (c) 2010-2026 Google LLC. https://angular.dev/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -19,9 +19,9 @@ require('@angular-devkit/core');
|
|
|
19
19
|
require('node:path/posix');
|
|
20
20
|
require('./project_tsconfig_paths-DkkMibv-.cjs');
|
|
21
21
|
require('./apply_import_manager-CxA_YYgB.cjs');
|
|
22
|
-
require('./migrate_ts_type_references-
|
|
22
|
+
require('./migrate_ts_type_references-B9LlDDUg.cjs');
|
|
23
23
|
require('assert');
|
|
24
|
-
require('./index-
|
|
24
|
+
require('./index-DADA7AvC.cjs');
|
|
25
25
|
require('@angular/compiler');
|
|
26
26
|
require('./leading_space-BTPRV0wu.cjs');
|
|
27
27
|
|