@angular/core 20.0.0-rc.0 → 20.0.0-rc.2
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/{api.d-CRxC7NlU.d.ts → api.d-B0vztftH.d.ts} +15 -15
- package/{chrome_dev_tools_performance.d-B0FzTuRf.d.ts → chrome_dev_tools_performance.d-DvzAxqBc.d.ts} +9 -29
- package/{discovery.d-CBxzK1ay.d.ts → discovery.d-Cf_r2Ojk.d.ts} +7 -13
- package/{event_dispatcher.d-DlbccpYq.d.ts → event_dispatcher.d-BReQpZfC.d.ts} +27 -1
- package/fesm2022/attribute-BWp59EjE.mjs +1 -1
- package/fesm2022/attribute-BWp59EjE.mjs.map +1 -1
- package/fesm2022/core.mjs +21 -14
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/{debug_node-3mmnD06K.mjs → debug_node-Nc-zr65s.mjs} +11161 -11262
- package/fesm2022/debug_node-Nc-zr65s.mjs.map +1 -0
- package/fesm2022/primitives/di.mjs +1 -1
- package/fesm2022/primitives/di.mjs.map +1 -1
- package/fesm2022/primitives/event-dispatch.mjs +3 -2
- package/fesm2022/primitives/event-dispatch.mjs.map +1 -1
- package/fesm2022/primitives/signals.mjs +1 -1
- package/fesm2022/primitives/signals.mjs.map +1 -1
- package/fesm2022/{resource-nrAenwIA.mjs → resource-DOwetGLU.mjs} +64 -14
- package/fesm2022/resource-DOwetGLU.mjs.map +1 -0
- package/fesm2022/{root_effect_scheduler-B_EWGyLU.mjs → root_effect_scheduler-BgGHQ80j.mjs} +29 -17
- package/fesm2022/root_effect_scheduler-BgGHQ80j.mjs.map +1 -0
- package/fesm2022/rxjs-interop.mjs +27 -12
- package/fesm2022/rxjs-interop.mjs.map +1 -1
- package/fesm2022/signal-ePSl6jXn.mjs +1 -1
- package/fesm2022/signal-ePSl6jXn.mjs.map +1 -1
- package/fesm2022/testing.mjs +86 -77
- package/fesm2022/testing.mjs.map +1 -1
- package/fesm2022/untracked-2ouAFbCz.mjs +1 -1
- package/fesm2022/untracked-2ouAFbCz.mjs.map +1 -1
- package/fesm2022/weak_ref-BaIq-pgY.mjs +1 -1
- package/fesm2022/weak_ref-BaIq-pgY.mjs.map +1 -1
- package/graph.d-BcIOep_B.d.ts +1 -1
- package/index.d.ts +205 -325
- package/package.json +3 -3
- package/primitives/di/index.d.ts +1 -1
- package/primitives/event-dispatch/index.d.ts +3 -3
- package/primitives/signals/index.d.ts +1 -1
- package/rxjs-interop/index.d.ts +4 -4
- package/schematics/bundles/{apply_import_manager-Coc7Hewu.js → apply_import_manager-BqwxKJiu.cjs} +3 -3
- package/schematics/bundles/{change_tracker-CDJPOAni.js → change_tracker-B1qegJFu.cjs} +3 -3
- package/schematics/bundles/{checker-BAl7CJ0l.js → checker-DmucNdBi.cjs} +55 -45
- package/schematics/bundles/{cleanup-unused-imports.js → cleanup-unused-imports.cjs} +30 -62
- package/schematics/bundles/{compiler-BSv6JWRF.js → compiler-DPq1iS19.cjs} +142 -95
- package/schematics/bundles/{compiler_host-CAfDJO3W.js → compiler_host-CAfDJO3W.cjs} +1 -1
- package/schematics/bundles/{control-flow-migration.js → control-flow-migration.cjs} +4 -4
- package/schematics/bundles/{document-core.js → document-core.cjs} +9 -9
- package/schematics/bundles/{imports-CIX-JgAN.js → imports-CIX-JgAN.cjs} +1 -1
- package/schematics/bundles/{index-CxuDmkeg.js → index-1H-qYSW6.cjs} +101 -37
- package/schematics/bundles/{index-CnKffIJ6.js → index-CFmTQ_wx.cjs} +29 -20
- package/schematics/bundles/{inject-flags.js → inject-flags.cjs} +9 -9
- package/schematics/bundles/{inject-migration.js → inject-migration.cjs} +9 -9
- package/schematics/bundles/{leading_space-D9nQ8UQC.js → leading_space-D9nQ8UQC.cjs} +1 -1
- package/schematics/bundles/{migrate_ts_type_references-DE1AlxIs.js → migrate_ts_type_references-B2aJNuIK.cjs} +7 -7
- package/schematics/bundles/{ng_decorators-DznZ5jMl.js → ng_decorators-B5HCqr20.cjs} +2 -2
- package/schematics/bundles/{nodes-B16H9JUd.js → nodes-B16H9JUd.cjs} +1 -1
- package/schematics/bundles/{output-migration.js → output-migration.cjs} +14 -17
- package/schematics/bundles/{project_paths-Bl-H7Vlb.js → project_paths-DmvzlTQL.cjs} +71 -42
- package/schematics/bundles/{project_tsconfig_paths-CDVxT6Ov.js → project_tsconfig_paths-CDVxT6Ov.cjs} +1 -1
- package/schematics/bundles/{property_name-BBwFuqMe.js → property_name-BBwFuqMe.cjs} +1 -1
- package/schematics/bundles/{route-lazy-loading.js → route-lazy-loading.cjs} +7 -7
- package/schematics/bundles/{self-closing-tags-migration.js → self-closing-tags-migration.cjs} +17 -34
- package/schematics/bundles/{signal-input-migration.js → signal-input-migration.cjs} +28 -27
- package/schematics/bundles/{signal-queries-migration.js → signal-queries-migration.cjs} +18 -21
- package/schematics/bundles/{signals.js → signals.cjs} +13 -13
- package/schematics/bundles/{standalone-migration.js → standalone-migration.cjs} +11 -11
- package/schematics/bundles/{symbol-VPWguRxr.js → symbol-VPWguRxr.cjs} +1 -1
- package/schematics/bundles/{test-bed-get.js → test-bed-get.cjs} +9 -9
- package/schematics/collection.json +9 -9
- package/schematics/migrations.json +4 -4
- package/signal.d-D6VJ67xi.d.ts +1 -1
- package/testing/index.d.ts +21 -7
- package/weak_ref.d-eGOEP9S1.d.ts +1 -1
- package/fesm2022/debug_node-3mmnD06K.mjs.map +0 -1
- package/fesm2022/resource-nrAenwIA.mjs.map +0 -1
- package/fesm2022/root_effect_scheduler-B_EWGyLU.mjs.map +0 -1
- package/schematics/package.json +0 -3
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular/core",
|
|
3
|
-
"version": "20.0.0-rc.
|
|
3
|
+
"version": "20.0.0-rc.2",
|
|
4
4
|
"description": "Angular - the core framework",
|
|
5
5
|
"author": "angular",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"engines": {
|
|
8
|
-
"node": "^20.
|
|
8
|
+
"node": "^20.19.0 || ^22.12.0 || >=24.0.0"
|
|
9
9
|
},
|
|
10
10
|
"exports": {
|
|
11
11
|
"./schematics/*": {
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"tslib": "^2.3.0"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"@angular/compiler": "20.0.0-rc.
|
|
49
|
+
"@angular/compiler": "20.0.0-rc.2",
|
|
50
50
|
"rxjs": "^6.5.3 || ^7.4.0",
|
|
51
51
|
"zone.js": "~0.15.0"
|
|
52
52
|
},
|
package/primitives/di/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v20.0.0-rc.
|
|
2
|
+
* @license Angular v20.0.0-rc.2
|
|
3
3
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { EarlyJsactionDataContainer, EventInfo, Restriction } from '../../event_dispatcher.d-
|
|
8
|
-
export { EventContract, EventContractContainer, EventDispatcher, EventInfoWrapper, EventPhase, registerDispatcher } from '../../event_dispatcher.d-
|
|
7
|
+
import { EarlyJsactionDataContainer, EventInfo, Restriction } from '../../event_dispatcher.d-BReQpZfC.js';
|
|
8
|
+
export { EventContract, EventContractContainer, EventDispatcher, EventInfoWrapper, EventPhase, registerDispatcher } from '../../event_dispatcher.d-BReQpZfC.js';
|
|
9
9
|
|
|
10
10
|
declare const Attribute: {
|
|
11
11
|
/**
|
package/rxjs-interop/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v20.0.0-rc.
|
|
2
|
+
* @license Angular v20.0.0-rc.2
|
|
3
3
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { OutputRef, DestroyRef, Signal, Injector } from '../chrome_dev_tools_performance.d-
|
|
8
|
-
import { OutputOptions, BaseResourceOptions, ResourceLoaderParams, ResourceRef } from '../api.d-
|
|
7
|
+
import { OutputRef, DestroyRef, Signal, Injector } from '../chrome_dev_tools_performance.d-DvzAxqBc.js';
|
|
8
|
+
import { OutputOptions, BaseResourceOptions, ResourceLoaderParams, ResourceRef } from '../api.d-B0vztftH.js';
|
|
9
|
+
import '../event_dispatcher.d-BReQpZfC.js';
|
|
9
10
|
import { Observable, MonoTypeOperatorFunction, Subscribable } from 'rxjs';
|
|
10
11
|
import { ValueEqualityFn } from '../graph.d-BcIOep_B.js';
|
|
11
|
-
import '../event_dispatcher.d-DlbccpYq.js';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Declares an Angular output that is using an RxJS observable as a source
|
package/schematics/bundles/{apply_import_manager-Coc7Hewu.js → apply_import_manager-BqwxKJiu.cjs}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v20.0.0-rc.
|
|
3
|
+
* @license Angular v20.0.0-rc.2
|
|
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-
|
|
12
|
-
var project_paths = require('./project_paths-
|
|
11
|
+
var checker = require('./checker-DmucNdBi.cjs');
|
|
12
|
+
var project_paths = require('./project_paths-DmvzlTQL.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.
|
|
3
|
+
* @license Angular v20.0.0-rc.2
|
|
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-
|
|
11
|
-
var checker = require('./checker-
|
|
10
|
+
require('./compiler-DPq1iS19.cjs');
|
|
11
|
+
var checker = require('./checker-DmucNdBi.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.
|
|
3
|
+
* @license Angular v20.0.0-rc.2
|
|
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-
|
|
9
|
+
var compiler = require('./compiler-DPq1iS19.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-
|
|
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));
|
|
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.
|
|
@@ -1803,14 +1803,14 @@ exports.ClassMemberKind = void 0;
|
|
|
1803
1803
|
ClassMemberKind[ClassMemberKind["Method"] = 4] = "Method";
|
|
1804
1804
|
})(exports.ClassMemberKind || (exports.ClassMemberKind = {}));
|
|
1805
1805
|
/** Possible access levels of a class member. */
|
|
1806
|
-
|
|
1806
|
+
exports.ClassMemberAccessLevel = void 0;
|
|
1807
1807
|
(function (ClassMemberAccessLevel) {
|
|
1808
1808
|
ClassMemberAccessLevel[ClassMemberAccessLevel["PublicWritable"] = 0] = "PublicWritable";
|
|
1809
1809
|
ClassMemberAccessLevel[ClassMemberAccessLevel["PublicReadonly"] = 1] = "PublicReadonly";
|
|
1810
1810
|
ClassMemberAccessLevel[ClassMemberAccessLevel["Protected"] = 2] = "Protected";
|
|
1811
1811
|
ClassMemberAccessLevel[ClassMemberAccessLevel["Private"] = 3] = "Private";
|
|
1812
1812
|
ClassMemberAccessLevel[ClassMemberAccessLevel["EcmaScriptPrivate"] = 4] = "EcmaScriptPrivate";
|
|
1813
|
-
})(ClassMemberAccessLevel || (ClassMemberAccessLevel = {}));
|
|
1813
|
+
})(exports.ClassMemberAccessLevel || (exports.ClassMemberAccessLevel = {}));
|
|
1814
1814
|
/** Indicates that a declaration is referenced through an ambient type. */
|
|
1815
1815
|
const AmbientImport = {};
|
|
1816
1816
|
|
|
@@ -2089,15 +2089,15 @@ function isIdentifier(node) {
|
|
|
2089
2089
|
*/
|
|
2090
2090
|
function classMemberAccessLevelToString(level) {
|
|
2091
2091
|
switch (level) {
|
|
2092
|
-
case ClassMemberAccessLevel.EcmaScriptPrivate:
|
|
2092
|
+
case exports.ClassMemberAccessLevel.EcmaScriptPrivate:
|
|
2093
2093
|
return 'ES private';
|
|
2094
|
-
case ClassMemberAccessLevel.Private:
|
|
2094
|
+
case exports.ClassMemberAccessLevel.Private:
|
|
2095
2095
|
return 'private';
|
|
2096
|
-
case ClassMemberAccessLevel.Protected:
|
|
2096
|
+
case exports.ClassMemberAccessLevel.Protected:
|
|
2097
2097
|
return 'protected';
|
|
2098
|
-
case ClassMemberAccessLevel.PublicReadonly:
|
|
2098
|
+
case exports.ClassMemberAccessLevel.PublicReadonly:
|
|
2099
2099
|
return 'public readonly';
|
|
2100
|
-
case ClassMemberAccessLevel.PublicWritable:
|
|
2100
|
+
case exports.ClassMemberAccessLevel.PublicWritable:
|
|
2101
2101
|
default:
|
|
2102
2102
|
return 'public';
|
|
2103
2103
|
}
|
|
@@ -2601,7 +2601,7 @@ function extractModifiersOfMember(node) {
|
|
|
2601
2601
|
const modifiers = ts.getModifiers(node);
|
|
2602
2602
|
let isStatic = false;
|
|
2603
2603
|
let isReadonly = false;
|
|
2604
|
-
let accessLevel = ClassMemberAccessLevel.PublicWritable;
|
|
2604
|
+
let accessLevel = exports.ClassMemberAccessLevel.PublicWritable;
|
|
2605
2605
|
if (modifiers !== undefined) {
|
|
2606
2606
|
for (const modifier of modifiers) {
|
|
2607
2607
|
switch (modifier.kind) {
|
|
@@ -2609,10 +2609,10 @@ function extractModifiersOfMember(node) {
|
|
|
2609
2609
|
isStatic = true;
|
|
2610
2610
|
break;
|
|
2611
2611
|
case ts.SyntaxKind.PrivateKeyword:
|
|
2612
|
-
accessLevel = ClassMemberAccessLevel.Private;
|
|
2612
|
+
accessLevel = exports.ClassMemberAccessLevel.Private;
|
|
2613
2613
|
break;
|
|
2614
2614
|
case ts.SyntaxKind.ProtectedKeyword:
|
|
2615
|
-
accessLevel = ClassMemberAccessLevel.Protected;
|
|
2615
|
+
accessLevel = exports.ClassMemberAccessLevel.Protected;
|
|
2616
2616
|
break;
|
|
2617
2617
|
case ts.SyntaxKind.ReadonlyKeyword:
|
|
2618
2618
|
isReadonly = true;
|
|
@@ -2620,11 +2620,11 @@ function extractModifiersOfMember(node) {
|
|
|
2620
2620
|
}
|
|
2621
2621
|
}
|
|
2622
2622
|
}
|
|
2623
|
-
if (isReadonly && accessLevel === ClassMemberAccessLevel.PublicWritable) {
|
|
2624
|
-
accessLevel = ClassMemberAccessLevel.PublicReadonly;
|
|
2623
|
+
if (isReadonly && accessLevel === exports.ClassMemberAccessLevel.PublicWritable) {
|
|
2624
|
+
accessLevel = exports.ClassMemberAccessLevel.PublicReadonly;
|
|
2625
2625
|
}
|
|
2626
2626
|
if (node.name !== undefined && ts.isPrivateIdentifier(node.name)) {
|
|
2627
|
-
accessLevel = ClassMemberAccessLevel.EcmaScriptPrivate;
|
|
2627
|
+
accessLevel = exports.ClassMemberAccessLevel.EcmaScriptPrivate;
|
|
2628
2628
|
}
|
|
2629
2629
|
return { accessLevel, isStatic };
|
|
2630
2630
|
}
|
|
@@ -7464,9 +7464,9 @@ const INPUT_INITIALIZER_FN = {
|
|
|
7464
7464
|
// cases where the input is intentionally not part of the public API, programmatically.
|
|
7465
7465
|
// Note: `private` is omitted intentionally as this would be a conceptual confusion point.
|
|
7466
7466
|
allowedAccessLevels: [
|
|
7467
|
-
ClassMemberAccessLevel.PublicWritable,
|
|
7468
|
-
ClassMemberAccessLevel.PublicReadonly,
|
|
7469
|
-
ClassMemberAccessLevel.Protected,
|
|
7467
|
+
exports.ClassMemberAccessLevel.PublicWritable,
|
|
7468
|
+
exports.ClassMemberAccessLevel.PublicReadonly,
|
|
7469
|
+
exports.ClassMemberAccessLevel.Protected,
|
|
7470
7470
|
],
|
|
7471
7471
|
};
|
|
7472
7472
|
/**
|
|
@@ -7505,9 +7505,9 @@ const MODEL_INITIALIZER_FN = {
|
|
|
7505
7505
|
// accessing `protected` or `private` members works at runtime, so we can allow
|
|
7506
7506
|
// cases where the input is intentionally not part of the public API, programmatically.
|
|
7507
7507
|
allowedAccessLevels: [
|
|
7508
|
-
ClassMemberAccessLevel.PublicWritable,
|
|
7509
|
-
ClassMemberAccessLevel.PublicReadonly,
|
|
7510
|
-
ClassMemberAccessLevel.Protected,
|
|
7508
|
+
exports.ClassMemberAccessLevel.PublicWritable,
|
|
7509
|
+
exports.ClassMemberAccessLevel.PublicReadonly,
|
|
7510
|
+
exports.ClassMemberAccessLevel.Protected,
|
|
7511
7511
|
],
|
|
7512
7512
|
};
|
|
7513
7513
|
/**
|
|
@@ -7550,9 +7550,9 @@ function tryParseSignalModelMapping(member, reflector, importTracker) {
|
|
|
7550
7550
|
// component API, programmatically.
|
|
7551
7551
|
// Note: `private` is omitted intentionally as this would be a conceptual confusion point.
|
|
7552
7552
|
const allowedAccessLevels = [
|
|
7553
|
-
ClassMemberAccessLevel.PublicWritable,
|
|
7554
|
-
ClassMemberAccessLevel.PublicReadonly,
|
|
7555
|
-
ClassMemberAccessLevel.Protected,
|
|
7553
|
+
exports.ClassMemberAccessLevel.PublicWritable,
|
|
7554
|
+
exports.ClassMemberAccessLevel.PublicReadonly,
|
|
7555
|
+
exports.ClassMemberAccessLevel.Protected,
|
|
7556
7556
|
];
|
|
7557
7557
|
/** Possible functions that can declare an output. */
|
|
7558
7558
|
const OUTPUT_INITIALIZER_FNS = [
|
|
@@ -7615,10 +7615,10 @@ const QUERY_INITIALIZER_FNS = queryFunctionNames.map((fnName) => ({
|
|
|
7615
7615
|
// Support for ES private fields requires special caution and complexity when partial
|
|
7616
7616
|
// output is linked— hence not supported. TS private members are allowed in static blocks.
|
|
7617
7617
|
allowedAccessLevels: [
|
|
7618
|
-
ClassMemberAccessLevel.PublicWritable,
|
|
7619
|
-
ClassMemberAccessLevel.PublicReadonly,
|
|
7620
|
-
ClassMemberAccessLevel.Protected,
|
|
7621
|
-
ClassMemberAccessLevel.Private,
|
|
7618
|
+
exports.ClassMemberAccessLevel.PublicWritable,
|
|
7619
|
+
exports.ClassMemberAccessLevel.PublicReadonly,
|
|
7620
|
+
exports.ClassMemberAccessLevel.Protected,
|
|
7621
|
+
exports.ClassMemberAccessLevel.Private,
|
|
7622
7622
|
],
|
|
7623
7623
|
}));
|
|
7624
7624
|
// The `descendants` option is enabled by default, except for content children.
|
|
@@ -17089,6 +17089,7 @@ class TemplateTypeCheckerImpl {
|
|
|
17089
17089
|
*/
|
|
17090
17090
|
elementTagCache = new Map();
|
|
17091
17091
|
isComplete = false;
|
|
17092
|
+
priorResultsAdopted = false;
|
|
17092
17093
|
constructor(originalProgram, programDriver, typeCheckAdapter, config, refEmitter, reflector, compilerHost, priorBuild, metaReader, localMetaReader, ngModuleIndex, componentScopeReader, typeCheckScopeRegistry, perf) {
|
|
17093
17094
|
this.originalProgram = originalProgram;
|
|
17094
17095
|
this.programDriver = programDriver;
|
|
@@ -17336,26 +17337,36 @@ class TemplateTypeCheckerImpl {
|
|
|
17336
17337
|
this.completionCache.set(component, engine);
|
|
17337
17338
|
return engine;
|
|
17338
17339
|
}
|
|
17339
|
-
|
|
17340
|
-
|
|
17341
|
-
if (this.state.has(sfPath)) {
|
|
17342
|
-
const existingResults = this.state.get(sfPath);
|
|
17343
|
-
if (existingResults.isComplete) {
|
|
17344
|
-
// All data for this file has already been generated, so no need to adopt anything.
|
|
17345
|
-
return;
|
|
17346
|
-
}
|
|
17347
|
-
}
|
|
17348
|
-
const previousResults = this.priorBuild.priorTypeCheckingResultsFor(sf);
|
|
17349
|
-
if (previousResults === null || !previousResults.isComplete) {
|
|
17340
|
+
maybeAdoptPriorResults() {
|
|
17341
|
+
if (this.priorResultsAdopted) {
|
|
17350
17342
|
return;
|
|
17351
17343
|
}
|
|
17352
|
-
this.
|
|
17353
|
-
|
|
17344
|
+
for (const sf of this.originalProgram.getSourceFiles()) {
|
|
17345
|
+
if (sf.isDeclarationFile || isShim(sf)) {
|
|
17346
|
+
continue;
|
|
17347
|
+
}
|
|
17348
|
+
const sfPath = absoluteFromSourceFile(sf);
|
|
17349
|
+
if (this.state.has(sfPath)) {
|
|
17350
|
+
const existingResults = this.state.get(sfPath);
|
|
17351
|
+
if (existingResults.isComplete) {
|
|
17352
|
+
// All data for this file has already been generated, so no need to adopt anything.
|
|
17353
|
+
continue;
|
|
17354
|
+
}
|
|
17355
|
+
}
|
|
17356
|
+
const previousResults = this.priorBuild.priorTypeCheckingResultsFor(sf);
|
|
17357
|
+
if (previousResults === null || !previousResults.isComplete) {
|
|
17358
|
+
continue;
|
|
17359
|
+
}
|
|
17360
|
+
this.perf.eventCount(exports.PerfEvent.ReuseTypeCheckFile);
|
|
17361
|
+
this.state.set(sfPath, previousResults);
|
|
17362
|
+
}
|
|
17363
|
+
this.priorResultsAdopted = true;
|
|
17354
17364
|
}
|
|
17355
17365
|
ensureAllShimsForAllFiles() {
|
|
17356
17366
|
if (this.isComplete) {
|
|
17357
17367
|
return;
|
|
17358
17368
|
}
|
|
17369
|
+
this.maybeAdoptPriorResults();
|
|
17359
17370
|
this.perf.inPhase(exports.PerfPhase.TcbGeneration, () => {
|
|
17360
17371
|
const host = new WholeProgramTypeCheckingHost(this);
|
|
17361
17372
|
const ctx = this.newContext(host);
|
|
@@ -17363,7 +17374,6 @@ class TemplateTypeCheckerImpl {
|
|
|
17363
17374
|
if (sf.isDeclarationFile || isShim(sf)) {
|
|
17364
17375
|
continue;
|
|
17365
17376
|
}
|
|
17366
|
-
this.maybeAdoptPriorResultsForFile(sf);
|
|
17367
17377
|
const sfPath = absoluteFromSourceFile(sf);
|
|
17368
17378
|
const fileData = this.getFileData(sfPath);
|
|
17369
17379
|
if (fileData.isComplete) {
|
|
@@ -17377,8 +17387,8 @@ class TemplateTypeCheckerImpl {
|
|
|
17377
17387
|
});
|
|
17378
17388
|
}
|
|
17379
17389
|
ensureAllShimsForOneFile(sf) {
|
|
17390
|
+
this.maybeAdoptPriorResults();
|
|
17380
17391
|
this.perf.inPhase(exports.PerfPhase.TcbGeneration, () => {
|
|
17381
|
-
this.maybeAdoptPriorResultsForFile(sf);
|
|
17382
17392
|
const sfPath = absoluteFromSourceFile(sf);
|
|
17383
17393
|
const fileData = this.getFileData(sfPath);
|
|
17384
17394
|
if (fileData.isComplete) {
|
|
@@ -17393,10 +17403,10 @@ class TemplateTypeCheckerImpl {
|
|
|
17393
17403
|
});
|
|
17394
17404
|
}
|
|
17395
17405
|
ensureShimForComponent(component) {
|
|
17406
|
+
this.maybeAdoptPriorResults();
|
|
17396
17407
|
const sf = component.getSourceFile();
|
|
17397
17408
|
const sfPath = absoluteFromSourceFile(sf);
|
|
17398
17409
|
const shimPath = TypeCheckShimGenerator.shimFor(sfPath);
|
|
17399
|
-
this.maybeAdoptPriorResultsForFile(sf);
|
|
17400
17410
|
const fileData = this.getFileData(sfPath);
|
|
17401
17411
|
if (fileData.shimData.has(shimPath)) {
|
|
17402
17412
|
// All data for this component is available.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v20.0.0-rc.
|
|
3
|
+
* @license Angular v20.0.0-rc.2
|
|
4
4
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -8,16 +8,16 @@
|
|
|
8
8
|
|
|
9
9
|
require('@angular-devkit/core');
|
|
10
10
|
require('node:path/posix');
|
|
11
|
-
var project_paths = require('./project_paths-
|
|
11
|
+
var project_paths = require('./project_paths-DmvzlTQL.cjs');
|
|
12
12
|
var ts = require('typescript');
|
|
13
13
|
require('os');
|
|
14
|
-
var checker = require('./checker-
|
|
15
|
-
require('./compiler-
|
|
16
|
-
var index = require('./index-
|
|
14
|
+
var checker = require('./checker-DmucNdBi.cjs');
|
|
15
|
+
require('./compiler-DPq1iS19.cjs');
|
|
16
|
+
var index = require('./index-1H-qYSW6.cjs');
|
|
17
17
|
require('path');
|
|
18
|
-
var apply_import_manager = require('./apply_import_manager-
|
|
18
|
+
var apply_import_manager = require('./apply_import_manager-BqwxKJiu.cjs');
|
|
19
19
|
require('@angular-devkit/schematics');
|
|
20
|
-
require('./project_tsconfig_paths-CDVxT6Ov.
|
|
20
|
+
require('./project_tsconfig_paths-CDVxT6Ov.cjs');
|
|
21
21
|
require('fs');
|
|
22
22
|
require('module');
|
|
23
23
|
require('url');
|
|
@@ -38,83 +38,57 @@ class UnusedImportsMigration extends project_paths.TsurgeFunnelMigration {
|
|
|
38
38
|
async analyze(info) {
|
|
39
39
|
const nodePositions = new Map();
|
|
40
40
|
const replacements = [];
|
|
41
|
-
|
|
41
|
+
let removedImports = 0;
|
|
42
42
|
let changedFiles = 0;
|
|
43
43
|
info.ngCompiler?.getDiagnostics().forEach((diag) => {
|
|
44
44
|
if (diag.file !== undefined &&
|
|
45
45
|
diag.start !== undefined &&
|
|
46
46
|
diag.length !== undefined &&
|
|
47
47
|
diag.code === checker.ngErrorCode(checker.ErrorCode.UNUSED_STANDALONE_IMPORTS)) {
|
|
48
|
+
// Skip files that aren't owned by this compilation unit.
|
|
49
|
+
if (!info.sourceFiles.includes(diag.file)) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
48
52
|
if (!nodePositions.has(diag.file)) {
|
|
49
53
|
nodePositions.set(diag.file, new Set());
|
|
50
54
|
}
|
|
51
|
-
nodePositions.get(diag.file).add(this.
|
|
55
|
+
nodePositions.get(diag.file).add(this.getNodeKey(diag.start, diag.length));
|
|
52
56
|
}
|
|
53
57
|
});
|
|
54
58
|
nodePositions.forEach((locations, sourceFile) => {
|
|
55
59
|
const resolvedLocations = this.resolveRemovalLocations(sourceFile, locations);
|
|
56
60
|
const usageAnalysis = this.analyzeUsages(sourceFile, resolvedLocations);
|
|
57
61
|
if (resolvedLocations.allRemovedIdentifiers.size > 0) {
|
|
62
|
+
removedImports += resolvedLocations.allRemovedIdentifiers.size;
|
|
58
63
|
changedFiles++;
|
|
59
|
-
resolvedLocations.allRemovedIdentifiers.forEach((identifier) => {
|
|
60
|
-
removedIdentifiers.push(this.getNodeID(identifier.getStart(), identifier.getWidth()));
|
|
61
|
-
});
|
|
62
64
|
}
|
|
63
65
|
this.generateReplacements(sourceFile, resolvedLocations, usageAnalysis, info, replacements);
|
|
64
66
|
});
|
|
65
|
-
return project_paths.confirmAsSerializable({ replacements,
|
|
67
|
+
return project_paths.confirmAsSerializable({ replacements, removedImports, changedFiles });
|
|
66
68
|
}
|
|
67
69
|
async migrate(globalData) {
|
|
68
70
|
return project_paths.confirmAsSerializable(globalData);
|
|
69
71
|
}
|
|
70
72
|
async combine(unitA, unitB) {
|
|
71
|
-
const combinedReplacements = [];
|
|
72
|
-
const combinedRemovedIdentifiers = [];
|
|
73
|
-
const seenReplacements = new Set();
|
|
74
|
-
const seenIdentifiers = new Set();
|
|
75
|
-
const changedFileIds = new Set();
|
|
76
|
-
[unitA, unitB].forEach((unit) => {
|
|
77
|
-
for (const replacement of unit.replacements) {
|
|
78
|
-
const key = this.getReplacementID(replacement);
|
|
79
|
-
changedFileIds.add(replacement.projectFile.id);
|
|
80
|
-
if (!seenReplacements.has(key)) {
|
|
81
|
-
seenReplacements.add(key);
|
|
82
|
-
combinedReplacements.push(replacement);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
for (const identifier of unit.removedIdentifiers) {
|
|
86
|
-
if (!seenIdentifiers.has(identifier)) {
|
|
87
|
-
seenIdentifiers.add(identifier);
|
|
88
|
-
combinedRemovedIdentifiers.push(identifier);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
73
|
return project_paths.confirmAsSerializable({
|
|
93
|
-
replacements:
|
|
94
|
-
|
|
95
|
-
changedFiles:
|
|
74
|
+
replacements: [...unitA.replacements, ...unitB.replacements],
|
|
75
|
+
removedImports: unitA.removedImports + unitB.removedImports,
|
|
76
|
+
changedFiles: unitA.changedFiles + unitB.changedFiles,
|
|
96
77
|
});
|
|
97
78
|
}
|
|
98
79
|
async globalMeta(combinedData) {
|
|
99
80
|
return project_paths.confirmAsSerializable(combinedData);
|
|
100
81
|
}
|
|
101
82
|
async stats(globalMetadata) {
|
|
102
|
-
return {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
},
|
|
107
|
-
};
|
|
83
|
+
return project_paths.confirmAsSerializable({
|
|
84
|
+
removedImports: globalMetadata.removedImports,
|
|
85
|
+
changedFiles: globalMetadata.changedFiles,
|
|
86
|
+
});
|
|
108
87
|
}
|
|
109
|
-
/** Gets
|
|
110
|
-
|
|
88
|
+
/** Gets a key that can be used to look up a node based on its location. */
|
|
89
|
+
getNodeKey(start, length) {
|
|
111
90
|
return `${start}/${length}`;
|
|
112
91
|
}
|
|
113
|
-
/** Gets a unique ID for a replacement. */
|
|
114
|
-
getReplacementID(replacement) {
|
|
115
|
-
const { position, end, toInsert } = replacement.update.data;
|
|
116
|
-
return replacement.projectFile.id + '/' + position + '/' + end + '/' + toInsert;
|
|
117
|
-
}
|
|
118
92
|
/**
|
|
119
93
|
* Resolves a set of node locations to the actual AST nodes that need to be migrated.
|
|
120
94
|
* @param sourceFile File in which to resolve the locations.
|
|
@@ -136,7 +110,7 @@ class UnusedImportsMigration extends project_paths.TsurgeFunnelMigration {
|
|
|
136
110
|
if (!parent) {
|
|
137
111
|
return;
|
|
138
112
|
}
|
|
139
|
-
if (locations.has(this.
|
|
113
|
+
if (locations.has(this.getNodeKey(node.getStart(), node.getWidth()))) {
|
|
140
114
|
// When the entire array needs to be cleared, the diagnostic is
|
|
141
115
|
// reported on the property assignment, rather than an array element.
|
|
142
116
|
if (ts.isPropertyAssignment(parent) &&
|
|
@@ -145,7 +119,7 @@ class UnusedImportsMigration extends project_paths.TsurgeFunnelMigration {
|
|
|
145
119
|
result.fullRemovals.add(parent.initializer);
|
|
146
120
|
parent.initializer.elements.forEach((element) => {
|
|
147
121
|
if (ts.isIdentifier(element)) {
|
|
148
|
-
result.allRemovedIdentifiers.add(element);
|
|
122
|
+
result.allRemovedIdentifiers.add(element.text);
|
|
149
123
|
}
|
|
150
124
|
});
|
|
151
125
|
}
|
|
@@ -154,7 +128,7 @@ class UnusedImportsMigration extends project_paths.TsurgeFunnelMigration {
|
|
|
154
128
|
result.partialRemovals.set(parent, new Set());
|
|
155
129
|
}
|
|
156
130
|
result.partialRemovals.get(parent).add(node);
|
|
157
|
-
result.allRemovedIdentifiers.add(node);
|
|
131
|
+
result.allRemovedIdentifiers.add(node.text);
|
|
158
132
|
}
|
|
159
133
|
}
|
|
160
134
|
};
|
|
@@ -248,13 +222,8 @@ class UnusedImportsMigration extends project_paths.TsurgeFunnelMigration {
|
|
|
248
222
|
names.forEach((symbolName, localName) => {
|
|
249
223
|
// Note that in the `identifierCounts` lookup both zero and undefined
|
|
250
224
|
// are valid and mean that the identifiers isn't being used anymore.
|
|
251
|
-
if (!identifierCounts.get(localName)) {
|
|
252
|
-
|
|
253
|
-
if (identifier.text === localName) {
|
|
254
|
-
importManager.removeImport(sourceFile, symbolName, moduleName);
|
|
255
|
-
break;
|
|
256
|
-
}
|
|
257
|
-
}
|
|
225
|
+
if (allRemovedIdentifiers.has(localName) && !identifierCounts.get(localName)) {
|
|
226
|
+
importManager.removeImport(sourceFile, symbolName, moduleName);
|
|
258
227
|
}
|
|
259
228
|
});
|
|
260
229
|
});
|
|
@@ -281,8 +250,7 @@ function migrate() {
|
|
|
281
250
|
afterAnalysisFailure: () => {
|
|
282
251
|
context.logger.error('Schematic failed unexpectedly with no analysis data');
|
|
283
252
|
},
|
|
284
|
-
whenDone: (
|
|
285
|
-
const { removedImports, changedFiles } = stats.counters;
|
|
253
|
+
whenDone: ({ removedImports, changedFiles }) => {
|
|
286
254
|
let statsMessage;
|
|
287
255
|
if (removedImports === 0) {
|
|
288
256
|
statsMessage = 'Schematic could not find unused imports in the project';
|