@angular/core 20.3.2 → 20.3.3
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.d.ts +1 -1
- package/chrome_dev_tools_performance.d.d.ts +2 -2
- package/discovery.d.d.ts +2 -2
- package/effect.d.d.ts +2 -2
- package/event_dispatcher.d.d.ts +1 -1
- package/fesm2022/attribute.mjs +1 -1
- package/fesm2022/attribute.mjs.map +1 -1
- package/fesm2022/core.mjs +1 -1
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/debug_node.mjs +18 -28
- package/fesm2022/debug_node.mjs.map +1 -1
- package/fesm2022/effect.mjs +1 -1
- package/fesm2022/effect.mjs.map +1 -1
- package/fesm2022/not_found.mjs +1 -1
- package/fesm2022/not_found.mjs.map +1 -1
- package/fesm2022/primitives/di.mjs +1 -1
- package/fesm2022/primitives/di.mjs.map +1 -1
- package/fesm2022/primitives/event-dispatch.mjs +1 -1
- package/fesm2022/primitives/event-dispatch.mjs.map +1 -1
- package/fesm2022/primitives/signals.mjs +136 -3
- package/fesm2022/primitives/signals.mjs.map +1 -1
- package/fesm2022/resource.mjs +1 -1
- package/fesm2022/resource.mjs.map +1 -1
- package/fesm2022/root_effect_scheduler.mjs +2 -2
- package/fesm2022/root_effect_scheduler.mjs.map +1 -1
- package/fesm2022/rxjs-interop.mjs +1 -1
- package/fesm2022/rxjs-interop.mjs.map +1 -1
- package/fesm2022/signal.mjs +8 -8
- package/fesm2022/signal.mjs.map +1 -1
- package/fesm2022/testing.mjs +1 -1
- package/fesm2022/testing.mjs.map +1 -1
- package/fesm2022/weak_ref.mjs +1 -1
- package/fesm2022/weak_ref.mjs.map +1 -1
- package/{graph.d.d.ts → formatter.d.d.ts} +14 -2
- package/index.d.ts +7 -6
- package/package.json +2 -2
- package/primitives/di/index.d.ts +1 -1
- package/primitives/event-dispatch/index.d.ts +1 -1
- package/primitives/signals/index.d.ts +3 -3
- package/rxjs-interop/index.d.ts +2 -2
- package/schematics/bundles/add-bootstrap-context-to-server-main.cjs +5 -5
- package/schematics/bundles/{apply_import_manager-Ch2ALAC9.cjs → apply_import_manager-CUBvPp_2.cjs} +3 -3
- package/schematics/bundles/cleanup-unused-imports.cjs +5 -5
- package/schematics/bundles/{compiler_host-Jw4hNUf8.cjs → compiler_host-DJHZ7M9N.cjs} +2 -2
- package/schematics/bundles/control-flow-migration.cjs +3 -3
- package/schematics/bundles/document-core.cjs +5 -5
- package/schematics/bundles/imports-CIX-JgAN.cjs +1 -1
- package/schematics/bundles/{index-Gg0PI_fh.cjs → index-BZJ8bv9v.cjs} +27 -17
- package/schematics/bundles/{index-DWTTHy-7.cjs → index-DU_evmAi.cjs} +4 -4
- package/schematics/bundles/inject-flags.cjs +5 -5
- package/schematics/bundles/inject-migration.cjs +3 -3
- package/schematics/bundles/leading_space-D9nQ8UQC.cjs +1 -1
- package/schematics/bundles/{migrate_ts_type_references-D_xIwAQ5.cjs → migrate_ts_type_references-58gA72Ti.cjs} +5 -5
- package/schematics/bundles/ng_decorators-B5HCqr20.cjs +1 -1
- package/schematics/bundles/nodes-B16H9JUd.cjs +1 -1
- package/schematics/bundles/output-migration.cjs +6 -6
- package/schematics/bundles/{project_paths-CfXVBYVk.cjs → project_paths-DcM18127.cjs} +3 -3
- package/schematics/bundles/{project_tsconfig_paths-C11WBTJF.cjs → project_tsconfig_paths-Dqd0J7st.cjs} +34 -40
- package/schematics/bundles/property_name-BBwFuqMe.cjs +1 -1
- package/schematics/bundles/route-lazy-loading.cjs +3 -3
- package/schematics/bundles/router-current-navigation.cjs +4 -4
- package/schematics/bundles/self-closing-tags-migration.cjs +4 -4
- package/schematics/bundles/signal-input-migration.cjs +67 -8
- package/schematics/bundles/signal-queries-migration.cjs +7 -7
- package/schematics/bundles/signals.cjs +7 -7
- package/schematics/bundles/standalone-migration.cjs +60 -40
- package/schematics/bundles/symbol-VPWguRxr.cjs +1 -1
- package/schematics/bundles/test-bed-get.cjs +4 -4
- package/testing/index.d.ts +2 -2
- package/weak_ref.d.d.ts +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v20.3.
|
|
3
|
+
* @license Angular v20.3.3
|
|
4
4
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -11700,6 +11700,16 @@ function extractAttributeOp(unit, op, elements) {
|
|
|
11700
11700
|
}
|
|
11701
11701
|
}
|
|
11702
11702
|
|
|
11703
|
+
const ARIA_PREFIX = 'aria-';
|
|
11704
|
+
/**
|
|
11705
|
+
* Returns whether `name` is an ARIA attribute name.
|
|
11706
|
+
*
|
|
11707
|
+
* This is a heuristic based on whether name begins with and is longer than `aria-`.
|
|
11708
|
+
*/
|
|
11709
|
+
function isAriaAttribute(name) {
|
|
11710
|
+
return name.startsWith(ARIA_PREFIX) && name.length > ARIA_PREFIX.length;
|
|
11711
|
+
}
|
|
11712
|
+
|
|
11703
11713
|
/**
|
|
11704
11714
|
* Looks up an element in the given map by xref ID.
|
|
11705
11715
|
*/
|
|
@@ -11745,7 +11755,15 @@ function specializeBindings(job) {
|
|
|
11745
11755
|
break;
|
|
11746
11756
|
case BindingKind.Property:
|
|
11747
11757
|
case BindingKind.LegacyAnimation:
|
|
11748
|
-
|
|
11758
|
+
// Convert a property binding targeting an ARIA attribute (e.g. [aria-label]) into an
|
|
11759
|
+
// attribute binding when we know it can't also target an input. Note that a `Host` job is
|
|
11760
|
+
// always `DomOnly`, so this condition must be checked first.
|
|
11761
|
+
if (job.mode === TemplateCompilationMode.DomOnly && isAriaAttribute(op.name)) {
|
|
11762
|
+
OpList.replace(op, createAttributeOp(op.target,
|
|
11763
|
+
/* namespace= */ null, op.name, op.expression, op.securityContext,
|
|
11764
|
+
/* isTextAttribute= */ false, op.isStructuralTemplateAttribute, op.templateKind, op.i18nMessage, op.sourceSpan));
|
|
11765
|
+
}
|
|
11766
|
+
else if (job.kind === CompilationJobKind.Host) {
|
|
11749
11767
|
OpList.replace(op, createDomPropertyOp(op.name, op.expression, op.bindingKind, op.i18nContext, op.securityContext, op.sourceSpan));
|
|
11750
11768
|
}
|
|
11751
11769
|
else {
|
|
@@ -18240,9 +18258,6 @@ class Token {
|
|
|
18240
18258
|
isTemplateLiteralInterpolationStart() {
|
|
18241
18259
|
return this.isOperator('${');
|
|
18242
18260
|
}
|
|
18243
|
-
isTemplateLiteralInterpolationEnd() {
|
|
18244
|
-
return this.isOperator('}');
|
|
18245
|
-
}
|
|
18246
18261
|
toString() {
|
|
18247
18262
|
switch (this.type) {
|
|
18248
18263
|
case TokenType.Character:
|
|
@@ -18415,7 +18430,7 @@ class _Scanner {
|
|
|
18415
18430
|
this.advance();
|
|
18416
18431
|
const currentBrace = this.braceStack.pop();
|
|
18417
18432
|
if (currentBrace === 'interpolation') {
|
|
18418
|
-
this.tokens.push(
|
|
18433
|
+
this.tokens.push(newCharacterToken(start, this.index, $RBRACE));
|
|
18419
18434
|
return this.scanTemplateLiteralPart(this.index);
|
|
18420
18435
|
}
|
|
18421
18436
|
return newCharacterToken(start, this.index, code);
|
|
@@ -19909,6 +19924,7 @@ class _ParseAST {
|
|
|
19909
19924
|
}
|
|
19910
19925
|
else if (token.isTemplateLiteralInterpolationStart()) {
|
|
19911
19926
|
this.advance();
|
|
19927
|
+
this.rbracesExpected++;
|
|
19912
19928
|
const expression = this.parsePipe();
|
|
19913
19929
|
if (expression instanceof EmptyExpr$1) {
|
|
19914
19930
|
this.error('Template literal interpolation cannot be empty');
|
|
@@ -19916,6 +19932,7 @@ class _ParseAST {
|
|
|
19916
19932
|
else {
|
|
19917
19933
|
expressions.push(expression);
|
|
19918
19934
|
}
|
|
19935
|
+
this.rbracesExpected--;
|
|
19919
19936
|
}
|
|
19920
19937
|
else {
|
|
19921
19938
|
this.advance();
|
|
@@ -23851,7 +23868,6 @@ function callVariadicInstruction(config, baseArgs, interpolationArgs, extraArgs,
|
|
|
23851
23868
|
return createStatementOp(callVariadicInstructionExpr(config, baseArgs, interpolationArgs, extraArgs, sourceSpan).toStmt());
|
|
23852
23869
|
}
|
|
23853
23870
|
|
|
23854
|
-
const ARIA_PREFIX = 'aria';
|
|
23855
23871
|
/**
|
|
23856
23872
|
* Map of target resolvers for event listeners.
|
|
23857
23873
|
*/
|
|
@@ -24230,33 +24246,6 @@ function reifyUpdateOperations(unit, ops) {
|
|
|
24230
24246
|
}
|
|
24231
24247
|
}
|
|
24232
24248
|
}
|
|
24233
|
-
/**
|
|
24234
|
-
* Converts an ARIA property name to its corresponding attribute name, if necessary.
|
|
24235
|
-
*
|
|
24236
|
-
* For example, converts `ariaLabel` to `aria-label`.
|
|
24237
|
-
*
|
|
24238
|
-
* https://www.w3.org/TR/wai-aria-1.2/#accessibilityroleandproperties-correspondence
|
|
24239
|
-
*
|
|
24240
|
-
* This must be kept in sync with the the function of the same name in
|
|
24241
|
-
* packages/core/src/render3/instructions/aria_property.ts.
|
|
24242
|
-
*
|
|
24243
|
-
* @param name A property name that starts with `aria`.
|
|
24244
|
-
* @returns The corresponding attribute name.
|
|
24245
|
-
*/
|
|
24246
|
-
function ariaAttrName(name) {
|
|
24247
|
-
return name.charAt(ARIA_PREFIX.length) !== '-'
|
|
24248
|
-
? ARIA_PREFIX + '-' + name.slice(ARIA_PREFIX.length).toLowerCase()
|
|
24249
|
-
: name; // Property already has attribute name.
|
|
24250
|
-
}
|
|
24251
|
-
/**
|
|
24252
|
-
* Returns whether `name` is an ARIA property (or attribute) name.
|
|
24253
|
-
*
|
|
24254
|
-
* This is a heuristic based on whether name begins with and is longer than `aria`. For example,
|
|
24255
|
-
* this returns true for both `ariaLabel` and `aria-label`.
|
|
24256
|
-
*/
|
|
24257
|
-
function isAriaProperty(name) {
|
|
24258
|
-
return name.startsWith(ARIA_PREFIX) && name.length > ARIA_PREFIX.length;
|
|
24259
|
-
}
|
|
24260
24249
|
/**
|
|
24261
24250
|
* Reifies a DOM property binding operation.
|
|
24262
24251
|
*
|
|
@@ -24267,9 +24256,7 @@ function isAriaProperty(name) {
|
|
|
24267
24256
|
* @returns A statement to update the property at runtime.
|
|
24268
24257
|
*/
|
|
24269
24258
|
function reifyDomProperty(op) {
|
|
24270
|
-
return
|
|
24271
|
-
? attribute(ariaAttrName(op.name), op.expression, null, null, op.sourceSpan)
|
|
24272
|
-
: domProperty(DOM_PROPERTY_REMAPPING.get(op.name) ?? op.name, op.expression, op.sanitizer, op.sourceSpan);
|
|
24259
|
+
return domProperty(DOM_PROPERTY_REMAPPING.get(op.name) ?? op.name, op.expression, op.sanitizer, op.sourceSpan);
|
|
24273
24260
|
}
|
|
24274
24261
|
/**
|
|
24275
24262
|
* Reifies a property binding operation.
|
|
@@ -24281,7 +24268,7 @@ function reifyDomProperty(op) {
|
|
|
24281
24268
|
* @returns A statement to update the property at runtime.
|
|
24282
24269
|
*/
|
|
24283
24270
|
function reifyProperty(op) {
|
|
24284
|
-
return
|
|
24271
|
+
return isAriaAttribute(op.name)
|
|
24285
24272
|
? ariaProperty(op.name, op.expression, op.sourceSpan)
|
|
24286
24273
|
: property(op.name, op.expression, op.sanitizer, op.sourceSpan);
|
|
24287
24274
|
}
|
|
@@ -29403,6 +29390,13 @@ class HtmlAstToIvyAst {
|
|
|
29403
29390
|
}
|
|
29404
29391
|
else {
|
|
29405
29392
|
const attrs = this.categorizePropertyAttributes(element.name, parsedProperties, i18nAttrsMeta);
|
|
29393
|
+
if (element.name === 'ng-container') {
|
|
29394
|
+
for (const bound of attrs.bound) {
|
|
29395
|
+
if (bound.type === exports.BindingType.Attribute) {
|
|
29396
|
+
this.reportError(`Attribute bindings are not supported on ng-container. Use property bindings instead.`, bound.sourceSpan);
|
|
29397
|
+
}
|
|
29398
|
+
}
|
|
29399
|
+
}
|
|
29406
29400
|
parsedElement = new Element$1(element.name, attributes, attrs.bound, boundEvents, directives, children, references, element.isSelfClosing, element.sourceSpan, element.startSourceSpan, element.endSourceSpan, element.isVoid, element.i18n);
|
|
29407
29401
|
}
|
|
29408
29402
|
if (elementHasInlineTemplate) {
|
|
@@ -32774,7 +32768,7 @@ function isAttrNode(ast) {
|
|
|
32774
32768
|
* @description
|
|
32775
32769
|
* Entry point for all public APIs of the compiler package.
|
|
32776
32770
|
*/
|
|
32777
|
-
const VERSION = new Version('20.3.
|
|
32771
|
+
const VERSION = new Version('20.3.3');
|
|
32778
32772
|
|
|
32779
32773
|
//////////////////////////////////////
|
|
32780
32774
|
// THIS FILE HAS GLOBAL SIDE EFFECT //
|
|
@@ -33836,7 +33830,7 @@ class NodeJSPathManipulation {
|
|
|
33836
33830
|
// G3-ESM-MARKER: G3 uses CommonJS, but externally everything in ESM.
|
|
33837
33831
|
// CommonJS/ESM interop for determining the current file name and containing dir.
|
|
33838
33832
|
const isCommonJS = typeof __filename !== 'undefined';
|
|
33839
|
-
const currentFileUrl = isCommonJS ? null : (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('project_tsconfig_paths-
|
|
33833
|
+
const currentFileUrl = isCommonJS ? null : (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('project_tsconfig_paths-Dqd0J7st.cjs', document.baseURI).href));
|
|
33840
33834
|
// Note, when this code loads in the browser, `url` may be an empty `{}` due to the Closure shims.
|
|
33841
33835
|
const currentFileName = isCommonJS
|
|
33842
33836
|
? __filename
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v20.3.
|
|
3
|
+
* @license Angular v20.3.3
|
|
4
4
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
var schematics = require('@angular-devkit/schematics');
|
|
10
10
|
var fs = require('fs');
|
|
11
11
|
var p = require('path');
|
|
12
|
-
var compiler_host = require('./compiler_host-
|
|
13
|
-
var project_tsconfig_paths = require('./project_tsconfig_paths-
|
|
12
|
+
var compiler_host = require('./compiler_host-DJHZ7M9N.cjs');
|
|
13
|
+
var project_tsconfig_paths = require('./project_tsconfig_paths-Dqd0J7st.cjs');
|
|
14
14
|
var ts = require('typescript');
|
|
15
15
|
var property_name = require('./property_name-BBwFuqMe.cjs');
|
|
16
16
|
require('os');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v20.3.
|
|
3
|
+
* @license Angular v20.3.3
|
|
4
4
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
|
|
9
9
|
var ts = require('typescript');
|
|
10
10
|
require('os');
|
|
11
|
-
require('./project_tsconfig_paths-
|
|
12
|
-
require('./index-
|
|
11
|
+
require('./project_tsconfig_paths-Dqd0J7st.cjs');
|
|
12
|
+
require('./index-BZJ8bv9v.cjs');
|
|
13
13
|
require('path');
|
|
14
14
|
require('node:path');
|
|
15
|
-
var project_paths = require('./project_paths-
|
|
15
|
+
var project_paths = require('./project_paths-DcM18127.cjs');
|
|
16
16
|
var imports = require('./imports-CIX-JgAN.cjs');
|
|
17
17
|
var symbol = require('./symbol-VPWguRxr.cjs');
|
|
18
18
|
require('@angular-devkit/core');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v20.3.
|
|
3
|
+
* @license Angular v20.3.3
|
|
4
4
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
|
|
9
9
|
var ts = require('typescript');
|
|
10
10
|
require('os');
|
|
11
|
-
var project_tsconfig_paths = require('./project_tsconfig_paths-
|
|
12
|
-
require('./index-
|
|
11
|
+
var project_tsconfig_paths = require('./project_tsconfig_paths-Dqd0J7st.cjs');
|
|
12
|
+
require('./index-BZJ8bv9v.cjs');
|
|
13
13
|
require('path');
|
|
14
14
|
require('node:path');
|
|
15
|
-
var project_paths = require('./project_paths-
|
|
15
|
+
var project_paths = require('./project_paths-DcM18127.cjs');
|
|
16
16
|
var ng_decorators = require('./ng_decorators-B5HCqr20.cjs');
|
|
17
17
|
var property_name = require('./property_name-BBwFuqMe.cjs');
|
|
18
18
|
require('@angular-devkit/core');
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v20.3.
|
|
3
|
+
* @license Angular v20.3.3
|
|
4
4
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
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-58gA72Ti.cjs');
|
|
10
10
|
var ts = require('typescript');
|
|
11
11
|
require('os');
|
|
12
|
-
var project_tsconfig_paths = require('./project_tsconfig_paths-
|
|
13
|
-
var index$1 = require('./index-
|
|
12
|
+
var project_tsconfig_paths = require('./project_tsconfig_paths-Dqd0J7st.cjs');
|
|
13
|
+
var index$1 = require('./index-BZJ8bv9v.cjs');
|
|
14
14
|
require('path');
|
|
15
15
|
require('node:path');
|
|
16
|
-
var project_paths = require('./project_paths-
|
|
17
|
-
var index = require('./index-
|
|
16
|
+
var project_paths = require('./project_paths-DcM18127.cjs');
|
|
17
|
+
var index = require('./index-DU_evmAi.cjs');
|
|
18
18
|
var assert$1 = require('assert');
|
|
19
19
|
var assert = require('node:assert');
|
|
20
|
-
var apply_import_manager = require('./apply_import_manager-
|
|
20
|
+
var apply_import_manager = require('./apply_import_manager-CUBvPp_2.cjs');
|
|
21
21
|
require('@angular-devkit/core');
|
|
22
22
|
require('node:path/posix');
|
|
23
23
|
require('./leading_space-D9nQ8UQC.cjs');
|
|
@@ -970,6 +970,12 @@ function populateKnownInputsFromGlobalData(knownInputs, globalData) {
|
|
|
970
970
|
* @returns Replacements for converting the input.
|
|
971
971
|
*/
|
|
972
972
|
function convertToSignalInput(node, { resolvedMetadata: metadata, resolvedType, preferShorthandIfPossible, originalInputDecorator, initialValue, leadingTodoText, }, info, checker, importManager, result) {
|
|
973
|
+
// Check for 'this' references in initializer before doing anything else
|
|
974
|
+
if (node.initializer &&
|
|
975
|
+
(ts.isArrowFunction(node.initializer) || ts.isFunctionExpression(node.initializer)) &&
|
|
976
|
+
containsThisReferences(node.initializer)) {
|
|
977
|
+
return []; // Skip migration for this input by returning empty replacements
|
|
978
|
+
}
|
|
973
979
|
let optionsLiteral = null;
|
|
974
980
|
// We need an options array for the input because:
|
|
975
981
|
// - the input is either aliased,
|
|
@@ -1039,7 +1045,23 @@ function convertToSignalInput(node, { resolvedMetadata: metadata, resolvedType,
|
|
|
1039
1045
|
if (!modifiersWithoutInputDecorator?.some((s) => s.kind === ts.SyntaxKind.ReadonlyKeyword)) {
|
|
1040
1046
|
modifiersWithoutInputDecorator.push(ts.factory.createModifier(ts.SyntaxKind.ReadonlyKeyword));
|
|
1041
1047
|
}
|
|
1042
|
-
|
|
1048
|
+
// Skip migration if the input is a function that references class members via 'this'
|
|
1049
|
+
if (inputInitializer &&
|
|
1050
|
+
(ts.isArrowFunction(inputInitializer) || ts.isFunctionExpression(inputInitializer))) {
|
|
1051
|
+
if (containsThisReferences(inputInitializer)) {
|
|
1052
|
+
return []; // Skip migration for this input by returning empty replacements
|
|
1053
|
+
}
|
|
1054
|
+
}
|
|
1055
|
+
let finalInitializer = inputInitializer;
|
|
1056
|
+
if (inputInitializer === undefined) {
|
|
1057
|
+
if (preferShorthandIfPossible === null) {
|
|
1058
|
+
finalInitializer = ts.factory.createIdentifier('undefined');
|
|
1059
|
+
}
|
|
1060
|
+
else {
|
|
1061
|
+
resolvedType = preferShorthandIfPossible.originalType;
|
|
1062
|
+
}
|
|
1063
|
+
}
|
|
1064
|
+
const newNode = ts.factory.createPropertyDeclaration(modifiersWithoutInputDecorator, node.name, undefined, undefined, finalInitializer);
|
|
1043
1065
|
const newPropertyText = result.printer.printNode(ts.EmitHint.Unspecified, newNode, node.getSourceFile());
|
|
1044
1066
|
const replacements = [];
|
|
1045
1067
|
if (leadingTodoText !== null) {
|
|
@@ -1083,6 +1105,43 @@ function extractTransformOfInput(transform, resolvedType, checker) {
|
|
|
1083
1105
|
leadingTodoText,
|
|
1084
1106
|
};
|
|
1085
1107
|
}
|
|
1108
|
+
/**
|
|
1109
|
+
* Checks if a function node contains any references to 'this'.
|
|
1110
|
+
* This is used to skip migration for functions that reference class members.
|
|
1111
|
+
*/
|
|
1112
|
+
function containsThisReferences(node) {
|
|
1113
|
+
let hasThis = false;
|
|
1114
|
+
const visit = (node) => {
|
|
1115
|
+
if (hasThis)
|
|
1116
|
+
return;
|
|
1117
|
+
if (node.kind === ts.SyntaxKind.ThisKeyword) {
|
|
1118
|
+
hasThis = true;
|
|
1119
|
+
return;
|
|
1120
|
+
}
|
|
1121
|
+
if (ts.isPropertyAccessExpression(node)) {
|
|
1122
|
+
const expr = node.expression;
|
|
1123
|
+
if (ts.isIdentifier(expr) && expr.text === 'this') {
|
|
1124
|
+
hasThis = true;
|
|
1125
|
+
return;
|
|
1126
|
+
}
|
|
1127
|
+
}
|
|
1128
|
+
ts.forEachChild(node, visit);
|
|
1129
|
+
};
|
|
1130
|
+
if (ts.isArrowFunction(node) || ts.isFunctionExpression(node)) {
|
|
1131
|
+
if (node.body) {
|
|
1132
|
+
if (node.body.kind === ts.SyntaxKind.Block) {
|
|
1133
|
+
node.body.statements.forEach(visit);
|
|
1134
|
+
}
|
|
1135
|
+
else {
|
|
1136
|
+
visit(node.body);
|
|
1137
|
+
}
|
|
1138
|
+
}
|
|
1139
|
+
}
|
|
1140
|
+
else {
|
|
1141
|
+
ts.forEachChild(node, visit);
|
|
1142
|
+
}
|
|
1143
|
+
return hasThis;
|
|
1144
|
+
}
|
|
1086
1145
|
|
|
1087
1146
|
/**
|
|
1088
1147
|
* Phase that migrates `@Input()` declarations to signal inputs and
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v20.3.
|
|
3
|
+
* @license Angular v20.3.3
|
|
4
4
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
7
7
|
'use strict';
|
|
8
8
|
|
|
9
|
-
var project_tsconfig_paths = require('./project_tsconfig_paths-
|
|
9
|
+
var project_tsconfig_paths = require('./project_tsconfig_paths-Dqd0J7st.cjs');
|
|
10
10
|
var ts = require('typescript');
|
|
11
11
|
require('os');
|
|
12
|
-
var index$1 = require('./index-
|
|
12
|
+
var index$1 = require('./index-BZJ8bv9v.cjs');
|
|
13
13
|
require('path');
|
|
14
14
|
require('node:path');
|
|
15
|
-
var project_paths = require('./project_paths-
|
|
16
|
-
var apply_import_manager = require('./apply_import_manager-
|
|
17
|
-
var migrate_ts_type_references = require('./migrate_ts_type_references-
|
|
15
|
+
var project_paths = require('./project_paths-DcM18127.cjs');
|
|
16
|
+
var apply_import_manager = require('./apply_import_manager-CUBvPp_2.cjs');
|
|
17
|
+
var migrate_ts_type_references = require('./migrate_ts_type_references-58gA72Ti.cjs');
|
|
18
18
|
var assert = require('assert');
|
|
19
19
|
require('node:assert');
|
|
20
|
-
var index = require('./index-
|
|
20
|
+
var index = require('./index-DU_evmAi.cjs');
|
|
21
21
|
require('@angular-devkit/core');
|
|
22
22
|
require('node:path/posix');
|
|
23
23
|
require('fs');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v20.3.
|
|
3
|
+
* @license Angular v20.3.3
|
|
4
4
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -10,7 +10,7 @@ var schematics = require('@angular-devkit/schematics');
|
|
|
10
10
|
var signalQueriesMigration = require('./signal-queries-migration.cjs');
|
|
11
11
|
var signalInputMigration = require('./signal-input-migration.cjs');
|
|
12
12
|
var outputMigration = require('./output-migration.cjs');
|
|
13
|
-
require('./project_tsconfig_paths-
|
|
13
|
+
require('./project_tsconfig_paths-Dqd0J7st.cjs');
|
|
14
14
|
require('typescript');
|
|
15
15
|
require('os');
|
|
16
16
|
require('fs');
|
|
@@ -18,14 +18,14 @@ require('module');
|
|
|
18
18
|
require('path');
|
|
19
19
|
require('url');
|
|
20
20
|
require('@angular-devkit/core');
|
|
21
|
-
require('./index-
|
|
21
|
+
require('./index-BZJ8bv9v.cjs');
|
|
22
22
|
require('node:path');
|
|
23
|
-
require('./project_paths-
|
|
23
|
+
require('./project_paths-DcM18127.cjs');
|
|
24
24
|
require('node:path/posix');
|
|
25
|
-
require('./apply_import_manager-
|
|
26
|
-
require('./migrate_ts_type_references-
|
|
25
|
+
require('./apply_import_manager-CUBvPp_2.cjs');
|
|
26
|
+
require('./migrate_ts_type_references-58gA72Ti.cjs');
|
|
27
27
|
require('assert');
|
|
28
|
-
require('./index-
|
|
28
|
+
require('./index-DU_evmAi.cjs');
|
|
29
29
|
require('./leading_space-D9nQ8UQC.cjs');
|
|
30
30
|
require('node:assert');
|
|
31
31
|
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v20.3.
|
|
3
|
+
* @license Angular v20.3.3
|
|
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 schematics = require('@angular-devkit/schematics');
|
|
10
|
-
var index = require('./index-
|
|
10
|
+
var index = require('./index-BZJ8bv9v.cjs');
|
|
11
11
|
var fs = require('fs');
|
|
12
12
|
var p = require('path');
|
|
13
13
|
var ts = require('typescript');
|
|
14
|
-
var compiler_host = require('./compiler_host-
|
|
15
|
-
var project_tsconfig_paths = require('./project_tsconfig_paths-
|
|
14
|
+
var compiler_host = require('./compiler_host-DJHZ7M9N.cjs');
|
|
15
|
+
var project_tsconfig_paths = require('./project_tsconfig_paths-Dqd0J7st.cjs');
|
|
16
16
|
var ng_decorators = require('./ng_decorators-B5HCqr20.cjs');
|
|
17
17
|
var nodes = require('./nodes-B16H9JUd.cjs');
|
|
18
18
|
var symbol = require('./symbol-VPWguRxr.cjs');
|
|
@@ -477,33 +477,42 @@ function moveDeclarationsToImports(literal, allDeclarations, typeChecker, templa
|
|
|
477
477
|
ts.isArrayLiteralExpression(prop.initializer) &&
|
|
478
478
|
prop.initializer.elements.hasTrailingComma);
|
|
479
479
|
// Separate the declarations that we want to keep and ones we need to copy into the `imports`.
|
|
480
|
-
if (ts.isPropertyAssignment(declarationsProp)
|
|
481
|
-
|
|
482
|
-
//
|
|
483
|
-
if (ts.
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
480
|
+
if (ts.isPropertyAssignment(declarationsProp) ||
|
|
481
|
+
ts.isShorthandPropertyAssignment(declarationsProp)) {
|
|
482
|
+
// Handle both regular and shorthand property assignments
|
|
483
|
+
if (ts.isPropertyAssignment(declarationsProp)) {
|
|
484
|
+
// If the declarations are an array, we can analyze it to
|
|
485
|
+
// find any classes from the current migration.
|
|
486
|
+
if (ts.isArrayLiteralExpression(declarationsProp.initializer)) {
|
|
487
|
+
for (const el of declarationsProp.initializer.elements) {
|
|
488
|
+
if (ts.isIdentifier(el)) {
|
|
489
|
+
const correspondingClass = findClassDeclaration(el, typeChecker);
|
|
490
|
+
if (!correspondingClass ||
|
|
491
|
+
// Check whether the declaration is either standalone already or is being converted
|
|
492
|
+
// in this migration. We need to check if it's standalone already, in order to correct
|
|
493
|
+
// some cases where the main app and the test files are being migrated in separate
|
|
494
|
+
// programs.
|
|
495
|
+
isStandaloneDeclaration(correspondingClass, allDeclarations, templateTypeChecker)) {
|
|
496
|
+
declarationsToCopy.push(el);
|
|
497
|
+
}
|
|
498
|
+
else {
|
|
499
|
+
declarationsToPreserve.push(el);
|
|
500
|
+
}
|
|
494
501
|
}
|
|
495
502
|
else {
|
|
496
|
-
|
|
503
|
+
declarationsToCopy.push(el);
|
|
497
504
|
}
|
|
498
505
|
}
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
506
|
+
}
|
|
507
|
+
else {
|
|
508
|
+
// Otherwise create a spread that will be copied into the `imports`.
|
|
509
|
+
declarationsToCopy.push(ts.factory.createSpreadElement(declarationsProp.initializer));
|
|
502
510
|
}
|
|
503
511
|
}
|
|
504
512
|
else {
|
|
505
|
-
//
|
|
506
|
-
|
|
513
|
+
// For shorthand properties, treat them as unanalyzable and use spread syntax
|
|
514
|
+
// shorthand properties were being ignored, now they're detected and treated as spreads
|
|
515
|
+
declarationsToCopy.push(ts.factory.createSpreadElement(declarationsProp.name));
|
|
507
516
|
}
|
|
508
517
|
}
|
|
509
518
|
// If there are no `imports`, create them with the declarations we want to copy.
|
|
@@ -511,35 +520,38 @@ function moveDeclarationsToImports(literal, allDeclarations, typeChecker, templa
|
|
|
511
520
|
properties.push(ts.factory.createPropertyAssignment('imports', ts.factory.createArrayLiteralExpression(ts.factory.createNodeArray(declarationsToCopy, hasAnyArrayTrailingComma && declarationsToCopy.length > 2))));
|
|
512
521
|
}
|
|
513
522
|
for (const prop of literal.properties) {
|
|
514
|
-
if (!isNamedPropertyAssignment(prop)) {
|
|
523
|
+
if (!isNamedPropertyAssignment(prop) && !ts.isShorthandPropertyAssignment(prop)) {
|
|
515
524
|
properties.push(prop);
|
|
516
525
|
continue;
|
|
517
526
|
}
|
|
518
527
|
// If we have declarations to preserve, update the existing property, otherwise drop it.
|
|
519
528
|
if (prop === declarationsProp) {
|
|
520
529
|
if (declarationsToPreserve.length > 0) {
|
|
521
|
-
const hasTrailingComma = ts.isArrayLiteralExpression(prop.initializer)
|
|
530
|
+
const hasTrailingComma = ts.isPropertyAssignment(prop) && ts.isArrayLiteralExpression(prop.initializer)
|
|
522
531
|
? prop.initializer.elements.hasTrailingComma
|
|
523
532
|
: hasAnyArrayTrailingComma;
|
|
524
|
-
properties.push(ts.factory.
|
|
533
|
+
properties.push(ts.factory.createPropertyAssignment(prop.name, ts.factory.createArrayLiteralExpression(ts.factory.createNodeArray(declarationsToPreserve, hasTrailingComma && declarationsToPreserve.length > 2))));
|
|
525
534
|
}
|
|
526
535
|
continue;
|
|
527
536
|
}
|
|
528
537
|
// If we have an `imports` array and declarations
|
|
529
538
|
// that should be copied, we merge the two arrays.
|
|
530
539
|
if (prop === importsProp && declarationsToCopy.length > 0) {
|
|
531
|
-
|
|
532
|
-
if (ts.
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
+
// Only regular property assignments have initializers that we can merge
|
|
541
|
+
if (ts.isPropertyAssignment(prop)) {
|
|
542
|
+
let initializer;
|
|
543
|
+
if (ts.isArrayLiteralExpression(prop.initializer)) {
|
|
544
|
+
initializer = ts.factory.updateArrayLiteralExpression(prop.initializer, ts.factory.createNodeArray([...prop.initializer.elements, ...declarationsToCopy], prop.initializer.elements.hasTrailingComma));
|
|
545
|
+
}
|
|
546
|
+
else {
|
|
547
|
+
initializer = ts.factory.createArrayLiteralExpression(ts.factory.createNodeArray([ts.factory.createSpreadElement(prop.initializer), ...declarationsToCopy],
|
|
548
|
+
// Expect the declarations to be greater than 1 since
|
|
549
|
+
// we have the pre-existing initializer already.
|
|
550
|
+
hasAnyArrayTrailingComma && declarationsToCopy.length > 1));
|
|
551
|
+
}
|
|
552
|
+
properties.push(ts.factory.updatePropertyAssignment(prop, prop.name, initializer));
|
|
553
|
+
continue;
|
|
540
554
|
}
|
|
541
|
-
properties.push(ts.factory.updatePropertyAssignment(prop, prop.name, initializer));
|
|
542
|
-
continue;
|
|
543
555
|
}
|
|
544
556
|
// Retain any remaining properties.
|
|
545
557
|
properties.push(prop);
|
|
@@ -649,8 +661,14 @@ function findImportLocation(target, inContext, importMode, typeChecker) {
|
|
|
649
661
|
* but not `declarations: []`.
|
|
650
662
|
*/
|
|
651
663
|
function hasNgModuleMetadataElements(node) {
|
|
652
|
-
|
|
653
|
-
|
|
664
|
+
if (ts.isPropertyAssignment(node)) {
|
|
665
|
+
return !ts.isArrayLiteralExpression(node.initializer) || node.initializer.elements.length > 0;
|
|
666
|
+
}
|
|
667
|
+
if (ts.isShorthandPropertyAssignment(node)) {
|
|
668
|
+
// For shorthand properties, we assume they have elements since they reference a variable
|
|
669
|
+
return true;
|
|
670
|
+
}
|
|
671
|
+
return false;
|
|
654
672
|
}
|
|
655
673
|
/** Finds all modules whose declarations can be migrated. */
|
|
656
674
|
function findNgModuleClassesToMigrate(sourceFile, typeChecker) {
|
|
@@ -827,6 +845,7 @@ function analyzeTestingModules(testObjects, typeChecker) {
|
|
|
827
845
|
const importsProp = findLiteralProperty(obj, 'imports');
|
|
828
846
|
const importElements = importsProp &&
|
|
829
847
|
hasNgModuleMetadataElements(importsProp) &&
|
|
848
|
+
ts.isPropertyAssignment(importsProp) &&
|
|
830
849
|
ts.isArrayLiteralExpression(importsProp.initializer)
|
|
831
850
|
? importsProp.initializer.elements.filter((el) => {
|
|
832
851
|
// Filter out calls since they may be a `ModuleWithProviders`.
|
|
@@ -871,6 +890,7 @@ function extractDeclarationsFromTestObject(obj, typeChecker) {
|
|
|
871
890
|
const declarations = findLiteralProperty(obj, 'declarations');
|
|
872
891
|
if (declarations &&
|
|
873
892
|
hasNgModuleMetadataElements(declarations) &&
|
|
893
|
+
ts.isPropertyAssignment(declarations) &&
|
|
874
894
|
ts.isArrayLiteralExpression(declarations.initializer)) {
|
|
875
895
|
for (const element of declarations.initializer.elements) {
|
|
876
896
|
const declaration = findClassDeclaration(element, typeChecker);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v20.3.
|
|
3
|
+
* @license Angular v20.3.3
|
|
4
4
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
|
|
9
9
|
var ts = require('typescript');
|
|
10
10
|
require('os');
|
|
11
|
-
require('./project_tsconfig_paths-
|
|
12
|
-
require('./index-
|
|
11
|
+
require('./project_tsconfig_paths-Dqd0J7st.cjs');
|
|
12
|
+
require('./index-BZJ8bv9v.cjs');
|
|
13
13
|
require('path');
|
|
14
14
|
require('node:path');
|
|
15
|
-
var project_paths = require('./project_paths-
|
|
15
|
+
var project_paths = require('./project_paths-DcM18127.cjs');
|
|
16
16
|
var imports = require('./imports-CIX-JgAN.cjs');
|
|
17
17
|
var symbol = require('./symbol-VPWguRxr.cjs');
|
|
18
18
|
require('@angular-devkit/core');
|
package/testing/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v20.3.
|
|
2
|
+
* @license Angular v20.3.3
|
|
3
3
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
import '../formatter.d.js';
|
|
7
8
|
import '../event_dispatcher.d.js';
|
|
8
9
|
import { InjectionToken, Type, ProviderToken, InjectOptions } from '../chrome_dev_tools_performance.d.js';
|
|
9
10
|
import { DeferBlockDetails, DeferBlockState, ComponentRef, DebugElement, ElementRef, ChangeDetectorRef, NgZone, SchemaMetadata, DeferBlockBehavior, Binding, PlatformRef, NgModule, Component, Directive, Pipe, Navigation, NavigationNavigateOptions, NavigationOptions, NavigateEvent, NavigationCurrentEntryChangeEvent, NavigationTransition, NavigationUpdateCurrentEntryOptions, NavigationReloadOptions, NavigationResult, NavigationHistoryEntry, NavigationDestination, NavigationInterceptOptions } from '../discovery.d.js';
|
|
10
11
|
import * as i0 from '@angular/core';
|
|
11
|
-
import '../graph.d.js';
|
|
12
12
|
import 'rxjs';
|
|
13
13
|
import '../effect.d.js';
|
|
14
14
|
import '@angular/core/primitives/di';
|