@angular/core 20.0.0-rc.2 → 20.0.0

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 (62) hide show
  1. package/api.d-B0vztftH.d.ts +1 -1
  2. package/chrome_dev_tools_performance.d-DvzAxqBc.d.ts +1 -1
  3. package/{discovery.d-Cf_r2Ojk.d.ts → discovery.d-DZNIp-Fw.d.ts} +55 -4
  4. package/event_dispatcher.d-BReQpZfC.d.ts +1 -1
  5. package/fesm2022/attribute-BWp59EjE.mjs +1 -1
  6. package/fesm2022/core.mjs +9 -9
  7. package/fesm2022/core.mjs.map +1 -1
  8. package/fesm2022/{debug_node-Nc-zr65s.mjs → debug_node-Dn-GvQJo.mjs} +1470 -2924
  9. package/fesm2022/debug_node-Dn-GvQJo.mjs.map +1 -0
  10. package/fesm2022/primitives/di.mjs +1 -1
  11. package/fesm2022/primitives/event-dispatch.mjs +1 -1
  12. package/fesm2022/primitives/signals.mjs +1 -1
  13. package/fesm2022/{resource-DOwetGLU.mjs → resource-BPCh38bN.mjs} +3 -3
  14. package/fesm2022/{resource-DOwetGLU.mjs.map → resource-BPCh38bN.mjs.map} +1 -1
  15. package/fesm2022/{root_effect_scheduler-BgGHQ80j.mjs → root_effect_scheduler-0BxwqIgm.mjs} +2 -19
  16. package/fesm2022/{root_effect_scheduler-BgGHQ80j.mjs.map → root_effect_scheduler-0BxwqIgm.mjs.map} +1 -1
  17. package/fesm2022/rxjs-interop.mjs +3 -3
  18. package/fesm2022/signal-ePSl6jXn.mjs +1 -1
  19. package/fesm2022/testing.mjs +33 -7
  20. package/fesm2022/testing.mjs.map +1 -1
  21. package/fesm2022/untracked-2ouAFbCz.mjs +1 -1
  22. package/fesm2022/weak_ref-BaIq-pgY.mjs +1 -1
  23. package/graph.d-BcIOep_B.d.ts +1 -1
  24. package/index.d.ts +619 -1730
  25. package/package.json +5 -2
  26. package/primitives/di/index.d.ts +1 -1
  27. package/primitives/event-dispatch/index.d.ts +1 -1
  28. package/primitives/signals/index.d.ts +1 -1
  29. package/rxjs-interop/index.d.ts +1 -1
  30. package/schematics/bundles/{apply_import_manager-BqwxKJiu.cjs → apply_import_manager-Bqnvtho4.cjs} +3 -3
  31. package/schematics/bundles/{change_tracker-B1qegJFu.cjs → change_tracker-DaCWdziV.cjs} +3 -3
  32. package/schematics/bundles/{checker-DmucNdBi.cjs → checker-BHgMyU8j.cjs} +11 -11
  33. package/schematics/bundles/cleanup-unused-imports.cjs +51 -13
  34. package/schematics/bundles/{compiler-DPq1iS19.cjs → compiler-Dl11rH6-.cjs} +63 -330
  35. package/schematics/bundles/compiler_host-CAfDJO3W.cjs +1 -1
  36. package/schematics/bundles/control-flow-migration.cjs +2 -2
  37. package/schematics/bundles/document-core.cjs +6 -6
  38. package/schematics/bundles/imports-CIX-JgAN.cjs +1 -1
  39. package/schematics/bundles/{index-CFmTQ_wx.cjs → index-CYxAVSJC.cjs} +5 -5
  40. package/schematics/bundles/{index-1H-qYSW6.cjs → index-DPvX-lSh.cjs} +14 -16
  41. package/schematics/bundles/inject-flags.cjs +6 -6
  42. package/schematics/bundles/inject-migration.cjs +4 -4
  43. package/schematics/bundles/leading_space-D9nQ8UQC.cjs +1 -1
  44. package/schematics/bundles/{migrate_ts_type_references-B2aJNuIK.cjs → migrate_ts_type_references-DWUePVh6.cjs} +6 -6
  45. package/schematics/bundles/ng_decorators-B5HCqr20.cjs +1 -1
  46. package/schematics/bundles/nodes-B16H9JUd.cjs +1 -1
  47. package/schematics/bundles/output-migration.cjs +7 -7
  48. package/schematics/bundles/{project_paths-DmvzlTQL.cjs → project_paths-BPBAn_A2.cjs} +4 -4
  49. package/schematics/bundles/project_tsconfig_paths-CDVxT6Ov.cjs +1 -1
  50. package/schematics/bundles/property_name-BBwFuqMe.cjs +1 -1
  51. package/schematics/bundles/route-lazy-loading.cjs +4 -4
  52. package/schematics/bundles/self-closing-tags-migration.cjs +5 -5
  53. package/schematics/bundles/signal-input-migration.cjs +8 -8
  54. package/schematics/bundles/signal-queries-migration.cjs +8 -8
  55. package/schematics/bundles/signals.cjs +8 -8
  56. package/schematics/bundles/standalone-migration.cjs +5 -5
  57. package/schematics/bundles/symbol-VPWguRxr.cjs +1 -1
  58. package/schematics/bundles/test-bed-get.cjs +5 -5
  59. package/signal.d-D6VJ67xi.d.ts +1 -1
  60. package/testing/index.d.ts +16 -3
  61. package/weak_ref.d-eGOEP9S1.d.ts +1 -1
  62. package/fesm2022/debug_node-Nc-zr65s.mjs.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/core",
3
- "version": "20.0.0-rc.2",
3
+ "version": "20.0.0",
4
4
  "description": "Angular - the core framework",
5
5
  "author": "angular",
6
6
  "license": "MIT",
@@ -46,13 +46,16 @@
46
46
  "tslib": "^2.3.0"
47
47
  },
48
48
  "peerDependencies": {
49
- "@angular/compiler": "20.0.0-rc.2",
49
+ "@angular/compiler": "20.0.0",
50
50
  "rxjs": "^6.5.3 || ^7.4.0",
51
51
  "zone.js": "~0.15.0"
52
52
  },
53
53
  "peerDependenciesMeta": {
54
54
  "@angular/compiler": {
55
55
  "optional": true
56
+ },
57
+ "zone.js": {
58
+ "optional": true
56
59
  }
57
60
  },
58
61
  "repository": {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v20.0.0-rc.2
2
+ * @license Angular v20.0.0
3
3
  * (c) 2010-2025 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v20.0.0-rc.2
2
+ * @license Angular v20.0.0
3
3
  * (c) 2010-2025 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v20.0.0-rc.2
2
+ * @license Angular v20.0.0
3
3
  * (c) 2010-2025 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v20.0.0-rc.2
2
+ * @license Angular v20.0.0
3
3
  * (c) 2010-2025 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v20.0.0-rc.2
3
+ * @license Angular v20.0.0
4
4
  * (c) 2010-2025 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
@@ -8,8 +8,8 @@
8
8
 
9
9
  var ts = require('typescript');
10
10
  require('os');
11
- var checker = require('./checker-DmucNdBi.cjs');
12
- var project_paths = require('./project_paths-DmvzlTQL.cjs');
11
+ var checker = require('./checker-BHgMyU8j.cjs');
12
+ var project_paths = require('./project_paths-BPBAn_A2.cjs');
13
13
 
14
14
  /**
15
15
  * Applies import manager changes, and writes them as replacements the
@@ -1,14 +1,14 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v20.0.0-rc.2
3
+ * @license Angular v20.0.0
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('./compiler-DPq1iS19.cjs');
11
- var checker = require('./checker-DmucNdBi.cjs');
10
+ require('./compiler-Dl11rH6-.cjs');
11
+ var checker = require('./checker-BHgMyU8j.cjs');
12
12
  require('os');
13
13
 
14
14
  /** Tracks changes that have to be made for specific files. */
@@ -1,12 +1,12 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v20.0.0-rc.2
3
+ * @license Angular v20.0.0
4
4
  * (c) 2010-2025 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
7
7
  'use strict';
8
8
 
9
- var compiler = require('./compiler-DPq1iS19.cjs');
9
+ var compiler = require('./compiler-Dl11rH6-.cjs');
10
10
  var ts = require('typescript');
11
11
  require('os');
12
12
  var fs$1 = require('fs');
@@ -1000,7 +1000,7 @@ class NodeJSPathManipulation {
1000
1000
  // G3-ESM-MARKER: G3 uses CommonJS, but externally everything in ESM.
1001
1001
  // CommonJS/ESM interop for determining the current file name and containing dir.
1002
1002
  const isCommonJS = typeof __filename !== 'undefined';
1003
- const currentFileUrl = isCommonJS ? null : (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('checker-DmucNdBi.cjs', document.baseURI).href));
1003
+ const currentFileUrl = isCommonJS ? null : (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('checker-BHgMyU8j.cjs', document.baseURI).href));
1004
1004
  const currentFileName = isCommonJS ? __filename : url.fileURLToPath(currentFileUrl);
1005
1005
  /**
1006
1006
  * A wrapper around the Node.js file-system that supports readonly operations and path manipulation.
@@ -6069,11 +6069,11 @@ function createImportReference(asTypeReference, ref) {
6069
6069
  }
6070
6070
  }
6071
6071
 
6072
- const UNARY_OPERATORS$1 = new Map([
6072
+ const UNARY_OPERATORS$1 = /* @__PURE__ */ new Map([
6073
6073
  [compiler.UnaryOperator.Minus, '-'],
6074
6074
  [compiler.UnaryOperator.Plus, '+'],
6075
6075
  ]);
6076
- const BINARY_OPERATORS$1 = new Map([
6076
+ const BINARY_OPERATORS$1 = /* @__PURE__ */ new Map([
6077
6077
  [compiler.BinaryOperator.And, '&&'],
6078
6078
  [compiler.BinaryOperator.Bigger, '>'],
6079
6079
  [compiler.BinaryOperator.BiggerEquals, '>='],
@@ -6793,12 +6793,12 @@ var PureAnnotation;
6793
6793
  PureAnnotation["CLOSURE"] = "* @pureOrBreakMyCode ";
6794
6794
  PureAnnotation["TERSER"] = "@__PURE__";
6795
6795
  })(PureAnnotation || (PureAnnotation = {}));
6796
- const UNARY_OPERATORS = {
6796
+ const UNARY_OPERATORS = /* @__PURE__ */ (() => ({
6797
6797
  '+': ts.SyntaxKind.PlusToken,
6798
6798
  '-': ts.SyntaxKind.MinusToken,
6799
6799
  '!': ts.SyntaxKind.ExclamationToken,
6800
- };
6801
- const BINARY_OPERATORS = {
6800
+ }))();
6801
+ const BINARY_OPERATORS = /* @__PURE__ */ (() => ({
6802
6802
  '&&': ts.SyntaxKind.AmpersandAmpersandToken,
6803
6803
  '>': ts.SyntaxKind.GreaterThanToken,
6804
6804
  '>=': ts.SyntaxKind.GreaterThanEqualsToken,
@@ -6819,12 +6819,12 @@ const BINARY_OPERATORS = {
6819
6819
  '+': ts.SyntaxKind.PlusToken,
6820
6820
  '??': ts.SyntaxKind.QuestionQuestionToken,
6821
6821
  'in': ts.SyntaxKind.InKeyword,
6822
- };
6823
- const VAR_TYPES = {
6822
+ }))();
6823
+ const VAR_TYPES = /* @__PURE__ */ (() => ({
6824
6824
  'const': ts.NodeFlags.Const,
6825
6825
  'let': ts.NodeFlags.Let,
6826
6826
  'var': ts.NodeFlags.None,
6827
- };
6827
+ }))();
6828
6828
  /**
6829
6829
  * A TypeScript flavoured implementation of the AstFactory.
6830
6830
  */
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v20.0.0-rc.2
3
+ * @license Angular v20.0.0
4
4
  * (c) 2010-2025 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
@@ -8,14 +8,15 @@
8
8
 
9
9
  require('@angular-devkit/core');
10
10
  require('node:path/posix');
11
- var project_paths = require('./project_paths-DmvzlTQL.cjs');
11
+ var project_paths = require('./project_paths-BPBAn_A2.cjs');
12
12
  var ts = require('typescript');
13
13
  require('os');
14
- var checker = require('./checker-DmucNdBi.cjs');
15
- require('./compiler-DPq1iS19.cjs');
16
- var index = require('./index-1H-qYSW6.cjs');
14
+ var checker = require('./checker-BHgMyU8j.cjs');
15
+ require('./compiler-Dl11rH6-.cjs');
16
+ var index = require('./index-DPvX-lSh.cjs');
17
17
  require('path');
18
- var apply_import_manager = require('./apply_import_manager-BqwxKJiu.cjs');
18
+ var apply_import_manager = require('./apply_import_manager-Bqnvtho4.cjs');
19
+ var leading_space = require('./leading_space-D9nQ8UQC.cjs');
19
20
  require('@angular-devkit/schematics');
20
21
  require('./project_tsconfig_paths-CDVxT6Ov.cjs');
21
22
  require('fs');
@@ -195,6 +196,7 @@ class UnusedImportsMigration extends project_paths.TsurgeFunnelMigration {
195
196
  const { fullRemovals, partialRemovals, allRemovedIdentifiers } = removalLocations;
196
197
  const { importedSymbols, identifierCounts } = usages;
197
198
  const importManager = new checker.ImportManager();
199
+ const sourceText = sourceFile.getFullText();
198
200
  // Replace full arrays with empty ones. This allows preserves more of the user's formatting.
199
201
  fullRemovals.forEach((node) => {
200
202
  replacements.push(new project_paths.Replacement(project_paths.projectFile(sourceFile, info), new project_paths.TextUpdate({
@@ -204,13 +206,10 @@ class UnusedImportsMigration extends project_paths.TsurgeFunnelMigration {
204
206
  })));
205
207
  });
206
208
  // Filter out the unused identifiers from an array.
207
- partialRemovals.forEach((toRemove, node) => {
208
- const newNode = ts.factory.updateArrayLiteralExpression(node, node.elements.filter((el) => !toRemove.has(el)));
209
- replacements.push(new project_paths.Replacement(project_paths.projectFile(sourceFile, info), new project_paths.TextUpdate({
210
- position: node.getStart(),
211
- end: node.getEnd(),
212
- toInsert: this.printer.printNode(ts.EmitHint.Unspecified, newNode, sourceFile),
213
- })));
209
+ partialRemovals.forEach((toRemove, parent) => {
210
+ toRemove.forEach((node) => {
211
+ replacements.push(new project_paths.Replacement(project_paths.projectFile(sourceFile, info), getArrayElementRemovalUpdate(node, parent, sourceText)));
212
+ });
214
213
  });
215
214
  // Attempt to clean up unused import declarations. Note that this isn't foolproof, because we
216
215
  // do the matching based on identifier text, rather than going through the type checker which
@@ -230,6 +229,45 @@ class UnusedImportsMigration extends project_paths.TsurgeFunnelMigration {
230
229
  apply_import_manager.applyImportManagerChanges(importManager, replacements, [sourceFile], info);
231
230
  }
232
231
  }
232
+ /** Generates a `TextUpdate` for the removal of an array element. */
233
+ function getArrayElementRemovalUpdate(node, parent, sourceText) {
234
+ let position = node.getStart();
235
+ let end = node.getEnd();
236
+ let toInsert = '';
237
+ const whitespaceOrLineFeed = /\s/;
238
+ // Usually the way we'd remove the nodes would be to recreate the `parent` while excluding
239
+ // the nodes that should be removed. The problem with this is that it'll strip out comments
240
+ // inside the array which can have special meaning internally. We work around it by removing
241
+ // only the node's own offsets. This comes with another problem in that it won't remove the commas
242
+ // that separate array elements which in turn can look weird if left in place (e.g.
243
+ // `[One, Two, Three, Four]` can turn into `[One,,Four]`). To account for them, we start with the
244
+ // node's end offset and then expand it to include trailing commas, whitespace and line breaks.
245
+ for (let i = end; i < sourceText.length; i++) {
246
+ if (sourceText[i] === ',' || whitespaceOrLineFeed.test(sourceText[i])) {
247
+ end++;
248
+ }
249
+ else {
250
+ break;
251
+ }
252
+ }
253
+ // If we're removing the last element in the array, adjust the starting offset so that
254
+ // it includes the previous comma on the same line. This avoids turning something like
255
+ // `[One, Two, Three]` into `[One,]`. We only do this within the same like, because
256
+ // trailing comma at the end of the line is fine.
257
+ if (parent.elements[parent.elements.length - 1] === node) {
258
+ for (let i = position - 1; i >= 0; i--) {
259
+ if (sourceText[i] === ',' || sourceText[i] === ' ') {
260
+ position--;
261
+ }
262
+ else {
263
+ break;
264
+ }
265
+ }
266
+ // Replace the node with its leading whitespace to preserve the formatting.
267
+ toInsert = leading_space.getLeadingLineWhitespaceOfNode(node);
268
+ }
269
+ return new project_paths.TextUpdate({ position, end, toInsert });
270
+ }
233
271
 
234
272
  function migrate() {
235
273
  return async (tree, context) => {