@angular/core 20.2.3 → 21.0.0-next.1

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.
Files changed (66) hide show
  1. package/api.d.d.ts +1 -1
  2. package/chrome_dev_tools_performance.d.d.ts +2 -17
  3. package/discovery.d.d.ts +25 -27
  4. package/effect.d.d.ts +1 -1
  5. package/event_dispatcher.d.d.ts +1 -1
  6. package/fesm2022/attribute.mjs +1 -1
  7. package/fesm2022/core.mjs +19 -14
  8. package/fesm2022/core.mjs.map +1 -1
  9. package/fesm2022/debug_node.mjs +48 -50
  10. package/fesm2022/debug_node.mjs.map +1 -1
  11. package/fesm2022/effect.mjs +1 -1
  12. package/fesm2022/not_found.mjs +1 -1
  13. package/fesm2022/primitives/di.mjs +1 -1
  14. package/fesm2022/primitives/event-dispatch.mjs +1 -1
  15. package/fesm2022/primitives/signals.mjs +1 -1
  16. package/fesm2022/resource.mjs +1 -1
  17. package/fesm2022/root_effect_scheduler.mjs +2 -8
  18. package/fesm2022/root_effect_scheduler.mjs.map +1 -1
  19. package/fesm2022/rxjs-interop.mjs +2 -2
  20. package/fesm2022/rxjs-interop.mjs.map +1 -1
  21. package/fesm2022/signal.mjs +1 -1
  22. package/fesm2022/testing.mjs +6 -4
  23. package/fesm2022/testing.mjs.map +1 -1
  24. package/fesm2022/weak_ref.mjs +1 -1
  25. package/graph.d.d.ts +1 -1
  26. package/index.d.ts +6 -13
  27. package/package.json +2 -2
  28. package/primitives/di/index.d.ts +1 -1
  29. package/primitives/event-dispatch/index.d.ts +1 -1
  30. package/primitives/signals/index.d.ts +1 -1
  31. package/rxjs-interop/index.d.ts +1 -1
  32. package/schematics/bundles/{apply_import_manager-BTXb3nRr.cjs → apply_import_manager-yycO3l8f.cjs} +3 -3
  33. package/schematics/bundles/cleanup-unused-imports.cjs +5 -5
  34. package/schematics/bundles/{compiler_host-Btt7nH4b.cjs → compiler_host-DrXTGf_7.cjs} +2 -2
  35. package/schematics/bundles/control-flow-migration.cjs +19 -48
  36. package/schematics/bundles/{imports-CIX-JgAN.cjs → imports-26VeX8i-.cjs} +2 -1
  37. package/schematics/bundles/{index-rL7rOVXa.cjs → index-BdH2rlWJ.cjs} +4 -4
  38. package/schematics/bundles/{index-CAfBb4YL.cjs → index-jjHOgYYs.cjs} +28 -14
  39. package/schematics/bundles/inject-migration.cjs +5 -5
  40. package/schematics/bundles/leading_space-D9nQ8UQC.cjs +1 -1
  41. package/schematics/bundles/{migrate_ts_type_references-Dyjkgb1x.cjs → migrate_ts_type_references-BVSg43hf.cjs} +9 -10
  42. package/schematics/bundles/ng_component_template-DjLc4mdL.cjs +186 -0
  43. package/schematics/bundles/{ng_decorators-B5HCqr20.cjs → ng_decorators-CtYwz9Lw.cjs} +2 -2
  44. package/schematics/bundles/ngclass-to-class-migration.cjs +533 -0
  45. package/schematics/bundles/nodes-B16H9JUd.cjs +1 -1
  46. package/schematics/bundles/output-migration.cjs +6 -6
  47. package/schematics/bundles/parse_html-CXR8hziE.cjs +41 -0
  48. package/schematics/bundles/{project_paths-BUuKobrE.cjs → project_paths-T_M15e2g.cjs} +3 -3
  49. package/schematics/bundles/{project_tsconfig_paths-x7xrmbI9.cjs → project_tsconfig_paths-D7xzGqRi.cjs} +8 -5
  50. package/schematics/bundles/property_name-BBwFuqMe.cjs +1 -1
  51. package/schematics/bundles/route-lazy-loading.cjs +3 -3
  52. package/schematics/bundles/router-current-navigation.cjs +5 -5
  53. package/schematics/bundles/{test-bed-get.cjs → router-last-successful-navigation.cjs} +30 -14
  54. package/schematics/bundles/self-closing-tags-migration.cjs +11 -207
  55. package/schematics/bundles/signal-input-migration.cjs +12 -13
  56. package/schematics/bundles/signal-queries-migration.cjs +7 -8
  57. package/schematics/bundles/signals.cjs +7 -8
  58. package/schematics/bundles/standalone-migration.cjs +6 -6
  59. package/schematics/bundles/symbol-VPWguRxr.cjs +1 -1
  60. package/schematics/collection.json +6 -0
  61. package/schematics/migrations/ngclass-to-class-migration/schema.json +20 -0
  62. package/schematics/migrations.json +7 -17
  63. package/testing/index.d.ts +1 -1
  64. package/weak_ref.d.d.ts +1 -1
  65. package/schematics/bundles/document-core.cjs +0 -95
  66. package/schematics/bundles/inject-flags.cjs +0 -147
@@ -0,0 +1,20 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
+ "$id": "AngularNgclassToClassMigration",
4
+ "title": "Angular ngClass to class Migration Schema",
5
+ "type": "object",
6
+ "properties": {
7
+ "path": {
8
+ "type": "string",
9
+ "description": "Path to the directory where all templates should be migrated.",
10
+ "x-prompt": "Which directory do you want to migrate?",
11
+ "default": "./"
12
+ },
13
+ "migrateSpaceSeparatedKey": {
14
+ "type": "boolean",
15
+ "description": "Enables the migration of object literals with space-separated keys",
16
+ "x-prompt": "Should the migration also migrate space-separated keys ?",
17
+ "default": "false"
18
+ }
19
+ }
20
+ }
@@ -1,31 +1,21 @@
1
1
  {
2
2
  "schematics": {
3
- "inject-flags": {
4
- "version": "20.0.0",
5
- "description": "Replaces usages of the deprecated InjectFlags enum",
6
- "factory": "./bundles/inject-flags.cjs#migrate"
7
- },
8
- "test-bed-get": {
9
- "version": "20.0.0",
10
- "description": "Replaces usages of the deprecated TestBed.get method with TestBed.inject",
11
- "factory": "./bundles/test-bed-get.cjs#migrate"
12
- },
13
3
  "control-flow-migration": {
14
- "version": "20.0.0",
4
+ "version": "21.0.0",
15
5
  "description": "Converts the entire application to block control flow syntax",
16
6
  "factory": "./bundles/control-flow-migration.cjs#migrate",
17
7
  "optional": true
18
8
  },
19
- "document-core": {
20
- "version": "20.0.0",
21
- "description": "Moves imports of `DOCUMENT` from `@angular/common` to `@angular/core`",
22
- "factory": "./bundles/document-core.cjs#migrate"
23
- },
24
9
  "router-current-navigation": {
25
- "version": "20.2.0",
10
+ "version": "21.0.0",
26
11
  "description": "Replaces usages of the deprecated Router.getCurrentNavigation method with the Router.currentNavigation signal",
27
12
  "factory": "./bundles/router-current-navigation.cjs#migrate",
28
13
  "optional": true
14
+ },
15
+ "router-last-successful-navigation": {
16
+ "version": "21.0.0",
17
+ "description": "Ensures that the Router.lastSuccessfulNavigation signal is now invoked",
18
+ "factory": "./bundles/router-last-successful-navigation.cjs#migrate"
29
19
  }
30
20
  }
31
21
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v20.2.3
2
+ * @license Angular v21.0.0-next.1
3
3
  * (c) 2010-2025 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
package/weak_ref.d.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v20.2.3
2
+ * @license Angular v21.0.0-next.1
3
3
  * (c) 2010-2025 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1,95 +0,0 @@
1
- 'use strict';
2
- /**
3
- * @license Angular v20.2.3
4
- * (c) 2010-2025 Google LLC. https://angular.io/
5
- * License: MIT
6
- */
7
- 'use strict';
8
-
9
- var project_tsconfig_paths = require('./project_tsconfig_paths-x7xrmbI9.cjs');
10
- require('typescript');
11
- require('os');
12
- var apply_import_manager = require('./apply_import_manager-BTXb3nRr.cjs');
13
- require('./index-CAfBb4YL.cjs');
14
- require('path');
15
- require('node:path');
16
- var project_paths = require('./project_paths-BUuKobrE.cjs');
17
- var imports = require('./imports-CIX-JgAN.cjs');
18
- require('@angular-devkit/core');
19
- require('node:path/posix');
20
- require('fs');
21
- require('module');
22
- require('url');
23
- require('@angular-devkit/schematics');
24
-
25
- /** Migration that moves the import of `DOCUMENT` from `core` to `common`. */
26
- class DocumentCoreMigration extends project_paths.TsurgeFunnelMigration {
27
- async analyze(info) {
28
- const replacements = [];
29
- let importManager = null;
30
- for (const sourceFile of info.sourceFiles) {
31
- const specifier = imports.getImportSpecifier(sourceFile, '@angular/common', 'DOCUMENT');
32
- if (specifier === null) {
33
- continue;
34
- }
35
- importManager ??= new project_tsconfig_paths.ImportManager({
36
- // Prevent the manager from trying to generate a non-conflicting import.
37
- generateUniqueIdentifier: () => null,
38
- shouldUseSingleQuotes: () => true,
39
- });
40
- importManager.removeImport(sourceFile, 'DOCUMENT', '@angular/common');
41
- importManager.addImport({
42
- exportSymbolName: 'DOCUMENT',
43
- exportModuleSpecifier: '@angular/core',
44
- requestedFile: sourceFile,
45
- unsafeAliasOverride: specifier.propertyName ? specifier.name.text : undefined,
46
- });
47
- }
48
- if (importManager !== null) {
49
- apply_import_manager.applyImportManagerChanges(importManager, replacements, info.sourceFiles, info);
50
- }
51
- return project_paths.confirmAsSerializable({ replacements });
52
- }
53
- async migrate(globalData) {
54
- return project_paths.confirmAsSerializable(globalData);
55
- }
56
- async combine(unitA, unitB) {
57
- const seen = new Set();
58
- const combined = [];
59
- [unitA.replacements, unitB.replacements].forEach((replacements) => {
60
- replacements.forEach((current) => {
61
- const { position, end, toInsert } = current.update.data;
62
- const key = current.projectFile.id + '/' + position + '/' + end + '/' + toInsert;
63
- if (!seen.has(key)) {
64
- seen.add(key);
65
- combined.push(current);
66
- }
67
- });
68
- });
69
- return project_paths.confirmAsSerializable({ replacements: combined });
70
- }
71
- async globalMeta(combinedData) {
72
- return project_paths.confirmAsSerializable(combinedData);
73
- }
74
- async stats() {
75
- return project_paths.confirmAsSerializable({});
76
- }
77
- }
78
-
79
- /*!
80
- * @license
81
- * Copyright Google LLC All Rights Reserved.
82
- *
83
- * Use of this source code is governed by an MIT-style license that can be
84
- * found in the LICENSE file at https://angular.dev/license
85
- */
86
- function migrate() {
87
- return async (tree) => {
88
- await project_paths.runMigrationInDevkit({
89
- tree,
90
- getMigration: () => new DocumentCoreMigration(),
91
- });
92
- };
93
- }
94
-
95
- exports.migrate = migrate;
@@ -1,147 +0,0 @@
1
- 'use strict';
2
- /**
3
- * @license Angular v20.2.3
4
- * (c) 2010-2025 Google LLC. https://angular.io/
5
- * License: MIT
6
- */
7
- 'use strict';
8
-
9
- var ts = require('typescript');
10
- require('os');
11
- var project_tsconfig_paths = require('./project_tsconfig_paths-x7xrmbI9.cjs');
12
- require('./index-CAfBb4YL.cjs');
13
- require('path');
14
- require('node:path');
15
- var project_paths = require('./project_paths-BUuKobrE.cjs');
16
- var apply_import_manager = require('./apply_import_manager-BTXb3nRr.cjs');
17
- var imports = require('./imports-CIX-JgAN.cjs');
18
- require('@angular-devkit/core');
19
- require('node:path/posix');
20
- require('fs');
21
- require('module');
22
- require('url');
23
- require('@angular-devkit/schematics');
24
-
25
- /** Mapping between `InjectFlag` enum members to their object literal equvalients. */
26
- const FLAGS_TO_FIELDS = {
27
- 'Default': 'default',
28
- 'Host': 'host',
29
- 'Optional': 'optional',
30
- 'Self': 'self',
31
- 'SkipSelf': 'skipSelf',
32
- };
33
- /** Migration that replaces `InjectFlags` usages with object literals. */
34
- class InjectFlagsMigration extends project_paths.TsurgeFunnelMigration {
35
- async analyze(info) {
36
- const locations = {};
37
- const importRemovals = {};
38
- for (const sourceFile of info.sourceFiles) {
39
- const specifier = imports.getImportSpecifier(sourceFile, '@angular/core', 'InjectFlags');
40
- if (specifier === null) {
41
- continue;
42
- }
43
- const file = project_paths.projectFile(sourceFile, info);
44
- const importManager = new project_tsconfig_paths.ImportManager();
45
- const importReplacements = [];
46
- // Always remove the `InjectFlags` since it has been removed from Angular.
47
- // Note that it be better to do this inside of `migrate`, but we don't have AST access there.
48
- importManager.removeImport(sourceFile, 'InjectFlags', '@angular/core');
49
- apply_import_manager.applyImportManagerChanges(importManager, importReplacements, [sourceFile], info);
50
- importRemovals[file.id] = importReplacements;
51
- sourceFile.forEachChild(function walk(node) {
52
- if (
53
- // Note: we don't use the type checker for matching here, because
54
- // the `InjectFlags` will be removed which can break the lookup.
55
- ts.isPropertyAccessExpression(node) &&
56
- ts.isIdentifier(node.expression) &&
57
- node.expression.text === specifier.name.text &&
58
- FLAGS_TO_FIELDS.hasOwnProperty(node.name.text)) {
59
- const root = getInjectFlagsRootExpression(node);
60
- if (root !== null) {
61
- const flagName = FLAGS_TO_FIELDS[node.name.text];
62
- const id = getNodeID(file, root);
63
- locations[id] ??= { file, flags: [], position: root.getStart(), end: root.getEnd() };
64
- // The flags can't be a set here, because they need to be serializable.
65
- if (!locations[id].flags.includes(flagName)) {
66
- locations[id].flags.push(flagName);
67
- }
68
- }
69
- }
70
- else {
71
- node.forEachChild(walk);
72
- }
73
- });
74
- }
75
- return project_paths.confirmAsSerializable({ locations, importRemovals });
76
- }
77
- async migrate(globalData) {
78
- const replacements = [];
79
- for (const removals of Object.values(globalData.importRemovals)) {
80
- replacements.push(...removals);
81
- }
82
- for (const { file, position, end, flags } of Object.values(globalData.locations)) {
83
- // Declare a property for each flag, except for `default` which does not have a flag.
84
- const properties = flags.filter((flag) => flag !== 'default').map((flag) => `${flag}: true`);
85
- const toInsert = properties.length ? `{ ${properties.join(', ')} }` : '{}';
86
- replacements.push(new project_paths.Replacement(file, new project_paths.TextUpdate({ position, end, toInsert })));
87
- }
88
- return project_paths.confirmAsSerializable({ replacements });
89
- }
90
- async combine(unitA, unitB) {
91
- return project_paths.confirmAsSerializable({
92
- locations: {
93
- ...unitA.locations,
94
- ...unitB.locations,
95
- },
96
- importRemovals: {
97
- ...unitA.importRemovals,
98
- ...unitB.importRemovals,
99
- },
100
- });
101
- }
102
- async globalMeta(combinedData) {
103
- return project_paths.confirmAsSerializable(combinedData);
104
- }
105
- async stats() {
106
- return project_paths.confirmAsSerializable({});
107
- }
108
- }
109
- /** Gets an ID that can be used to look up a node based on its location. */
110
- function getNodeID(file, node) {
111
- return `${file.id}/${node.getStart()}/${node.getWidth()}`;
112
- }
113
- /**
114
- * Gets the root expression of an `InjectFlags` usage. For example given `InjectFlags.Optional`.
115
- * in `InjectFlags.Host | InjectFlags.Optional | InjectFlags.SkipSelf`, the function will return
116
- * the top-level binary expression.
117
- * @param start Node from which to start searching.
118
- */
119
- function getInjectFlagsRootExpression(start) {
120
- let current = start;
121
- let parent = current?.parent;
122
- while (parent && (ts.isBinaryExpression(parent) || ts.isParenthesizedExpression(parent))) {
123
- current = parent;
124
- parent = current.parent;
125
- }
126
- // Only allow allow expressions that are call parameters, variable initializer or parameter
127
- // initializers which are the only officially supported usages of `InjectFlags`.
128
- if (current &&
129
- parent &&
130
- ((ts.isCallExpression(parent) && parent.arguments.includes(current)) ||
131
- (ts.isVariableDeclaration(parent) && parent.initializer === current) ||
132
- (ts.isParameter(parent) && parent.initializer === current))) {
133
- return current;
134
- }
135
- return null;
136
- }
137
-
138
- function migrate() {
139
- return async (tree) => {
140
- await project_paths.runMigrationInDevkit({
141
- tree,
142
- getMigration: () => new InjectFlagsMigration(),
143
- });
144
- };
145
- }
146
-
147
- exports.migrate = migrate;