@angular/core 22.0.0-next.5 → 22.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/fesm2022/_attribute-chunk.mjs +1 -1
- package/fesm2022/_debug_node-chunk.mjs +68 -12
- 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 +1 -1
- package/fesm2022/primitives-di.mjs +1 -1
- package/fesm2022/primitives-event-dispatch.mjs +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/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 +1 -1
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- package/schematics/bundles/signal-queries-migration.cjs +1 -1
- package/schematics/bundles/signals.cjs +1 -1
- package/schematics/bundles/standalone-migration.cjs +1 -1
- package/schematics/bundles/strict-templates.cjs +55 -0
- package/schematics/migrations.json +5 -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 +6 -2
- 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 +1 -1
- 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/core.mjs
CHANGED
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.6",
|
|
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.6",
|
|
50
50
|
"rxjs": "^6.5.3 || ^7.4.0",
|
|
51
51
|
"zone.js": "~0.15.0 || ~0.16.0"
|
|
52
52
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v22.0.0-next.
|
|
3
|
+
* @license Angular v22.0.0-next.6
|
|
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.6
|
|
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
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/**
|
|
3
|
+
* @license Angular v22.0.0-next.6
|
|
4
|
+
* (c) 2010-2026 Google LLC. https://angular.dev/
|
|
5
|
+
* License: MIT
|
|
6
|
+
*/
|
|
7
|
+
'use strict';
|
|
8
|
+
|
|
9
|
+
var project_tsconfig_paths = require('./project_tsconfig_paths-DkkMibv-.cjs');
|
|
10
|
+
require('@angular-devkit/core');
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Migration that adds `strictTemplates: false` to `tsconfig.json` files.
|
|
14
|
+
*/
|
|
15
|
+
function migrate() {
|
|
16
|
+
return async (tree) => {
|
|
17
|
+
const { buildPaths, testPaths } = await project_tsconfig_paths.getProjectTsConfigPaths(tree);
|
|
18
|
+
const allPaths = [...new Set([...buildPaths, ...testPaths])];
|
|
19
|
+
for (const path of allPaths) {
|
|
20
|
+
const content = tree.read(path);
|
|
21
|
+
if (!content)
|
|
22
|
+
continue;
|
|
23
|
+
const contentStr = content.toString('utf-8');
|
|
24
|
+
// Check if it's already there to avoid parsing if not needed.
|
|
25
|
+
if (contentStr.includes('strictTemplates')) {
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
try {
|
|
29
|
+
// Use a simple JSON.parse for now. In a real world scenario we might want to use
|
|
30
|
+
// a parser that supports comments (JSONC), but for this migration it's likely
|
|
31
|
+
// that tsconfig files are standard enough or that overwriting them is acceptable
|
|
32
|
+
// in the context of an ng update.
|
|
33
|
+
const json = JSON.parse(contentStr);
|
|
34
|
+
if (!json.compilerOptions || Object.keys(json.compilerOptions).length === 0) {
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
37
|
+
if (!json.angularCompilerOptions) {
|
|
38
|
+
json.angularCompilerOptions = { strictTemplates: false };
|
|
39
|
+
tree.overwrite(path, JSON.stringify(json, null, 2));
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
if (json.angularCompilerOptions.strictTemplates === undefined) {
|
|
43
|
+
json.angularCompilerOptions.strictTemplates = false;
|
|
44
|
+
tree.overwrite(path, JSON.stringify(json, null, 2));
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
catch (e) {
|
|
48
|
+
// If parsing fails, skip the file to avoid corrupting it.
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
exports.migrate = migrate;
|
|
@@ -9,6 +9,11 @@
|
|
|
9
9
|
"version": "22.0.0",
|
|
10
10
|
"description": "Adds 'withXhr' to 'provideHttpClient' function calls when the 'HttpXhrBackend' is used. For more information see: https://angular.dev/api/common/http/withXhr",
|
|
11
11
|
"factory": "./bundles/http-xhr-backend.cjs#migrate"
|
|
12
|
+
},
|
|
13
|
+
"strict-template": {
|
|
14
|
+
"version": "22.0.0",
|
|
15
|
+
"description": "Adds 'strictTemplates: true' in tsconfig.json.",
|
|
16
|
+
"factory": "./bundles/strict-templates.cjs#migrate"
|
|
12
17
|
}
|
|
13
18
|
}
|
|
14
19
|
}
|
package/types/_api-chunk.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v22.0.0-next.
|
|
2
|
+
* @license Angular v22.0.0-next.6
|
|
3
3
|
* (c) 2010-2026 Google LLC. https://angular.dev/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -4787,6 +4787,8 @@ declare enum ChangeDetectionStrategy {
|
|
|
4787
4787
|
* until reactivated by setting the strategy to `Default` (`CheckAlways`).
|
|
4788
4788
|
* Change detection can still be explicitly invoked.
|
|
4789
4789
|
* This strategy applies to all child directives and cannot be overridden.
|
|
4790
|
+
*
|
|
4791
|
+
* NOTE: OnPush is enabled by default.
|
|
4790
4792
|
*/
|
|
4791
4793
|
OnPush = 0,
|
|
4792
4794
|
/**
|
|
@@ -6768,7 +6770,9 @@ interface Component extends Directive {
|
|
|
6768
6770
|
* which is responsible for propagating the component's bindings.
|
|
6769
6771
|
* The strategy is one of:
|
|
6770
6772
|
* - `ChangeDetectionStrategy#OnPush` sets the strategy to `CheckOnce` (on demand).
|
|
6771
|
-
* - `ChangeDetectionStrategy#
|
|
6773
|
+
* - `ChangeDetectionStrategy#Eager` sets the strategy to `CheckAlways`.
|
|
6774
|
+
*
|
|
6775
|
+
* NOTE: OnPush is enabled by default.
|
|
6772
6776
|
*/
|
|
6773
6777
|
changeDetection?: ChangeDetectionStrategy;
|
|
6774
6778
|
/**
|
package/types/_effect-chunk.d.ts
CHANGED
package/types/core.d.ts
CHANGED
package/types/primitives-di.d.ts
CHANGED
package/types/rxjs-interop.d.ts
CHANGED
package/types/testing.d.ts
CHANGED