@angular/core 20.0.0-next.2 → 20.0.0-next.4
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/event_dispatcher.d-pVP0-wST.d.ts +345 -0
- package/fesm2022/core.mjs +614 -428
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/injector-BlLwZ2sr.mjs +24 -0
- package/fesm2022/injector-BlLwZ2sr.mjs.map +1 -0
- package/fesm2022/primitives/di.mjs +5 -18
- package/fesm2022/primitives/di.mjs.map +1 -1
- package/fesm2022/primitives/event-dispatch.mjs +1 -1
- package/fesm2022/primitives/signals.mjs +4 -589
- package/fesm2022/primitives/signals.mjs.map +1 -1
- package/fesm2022/rxjs-interop.mjs +1 -8
- package/fesm2022/rxjs-interop.mjs.map +1 -1
- package/fesm2022/testing.mjs +2 -10
- package/fesm2022/testing.mjs.map +1 -1
- package/fesm2022/untracked-DkcXpNb_.mjs +620 -0
- package/fesm2022/untracked-DkcXpNb_.mjs.map +1 -0
- package/index.d.ts +7589 -7510
- package/{navigation_types.d-u4EOrrdZ.d.ts → navigation_types.d-DgDrF5rp.d.ts} +2 -2
- package/package.json +2 -2
- package/primitives/di/index.d.ts +25 -10
- package/primitives/event-dispatch/index.d.ts +5 -340
- package/primitives/signals/index.d.ts +5 -208
- package/rxjs-interop/index.d.ts +1 -10
- package/schematics/bundles/{apply_import_manager-CyRT0UvU.js → apply_import_manager-CeNv8GIG.js} +6 -6
- package/schematics/bundles/{checker-DF8ZaFW5.js → checker-k591b6WQ.js} +856 -180
- package/schematics/bundles/cleanup-unused-imports.js +42 -69
- package/schematics/bundles/{compiler_host-Da636uJ8.js → compiler_host-DwM3ugW3.js} +2 -2
- package/schematics/bundles/control-flow-migration.js +34 -13
- package/schematics/bundles/imports-CIX-JgAN.js +1 -1
- package/schematics/bundles/{program-BZk27Ndu.js → index-B4OAlHh8.js} +2234 -2097
- package/schematics/bundles/{index-DnkWgagp.js → index-BhELUmYx.js} +11 -11
- package/schematics/bundles/inject-flags.js +18 -52
- package/schematics/bundles/inject-migration.js +3 -3
- package/schematics/bundles/leading_space-D9nQ8UQC.js +1 -1
- package/schematics/bundles/{migrate_ts_type_references-DtkOnnv0.js → migrate_ts_type_references-Be0TNYen.js} +20 -20
- package/schematics/bundles/ng_decorators-DznZ5jMl.js +1 -1
- package/schematics/bundles/nodes-B16H9JUd.js +1 -1
- package/schematics/bundles/output-migration.js +62 -90
- package/schematics/bundles/project_tsconfig_paths-CDVxT6Ov.js +1 -1
- package/schematics/bundles/property_name-BBwFuqMe.js +1 -1
- package/schematics/bundles/route-lazy-loading.js +3 -3
- package/schematics/bundles/{project_paths-Jtbi76Bs.js → run_in_devkit-CkvEksWP.js} +262 -197
- package/schematics/bundles/self-closing-tags-migration.js +41 -71
- package/schematics/bundles/signal-input-migration.js +69 -97
- package/schematics/bundles/signal-queries-migration.js +80 -108
- package/schematics/bundles/signals.js +11 -11
- package/schematics/bundles/standalone-migration.js +8 -22
- package/schematics/bundles/symbol-VPWguRxr.js +25 -0
- package/schematics/bundles/test-bed-get.js +98 -0
- package/schematics/migrations.json +5 -0
- package/testing/index.d.ts +2 -4
- package/weak_ref.d-BZ7gyRag.d.ts +216 -0
- package/fesm2022/weak_ref-DrMdAIDh.mjs +0 -12
- package/fesm2022/weak_ref-DrMdAIDh.mjs.map +0 -1
- package/schematics/bundles/index-vGJcp5M7.js +0 -30
- package/weak_ref.d-ttyj86RV.d.ts +0 -9
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v20.0.0-next.
|
|
3
|
+
* @license Angular v20.0.0-next.4
|
|
4
4
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
|
|
9
9
|
var ts = require('typescript');
|
|
10
10
|
require('os');
|
|
11
|
-
var checker = require('./checker-
|
|
12
|
-
var
|
|
11
|
+
var checker = require('./checker-k591b6WQ.js');
|
|
12
|
+
var index = require('./index-B4OAlHh8.js');
|
|
13
13
|
require('path');
|
|
14
|
-
var
|
|
14
|
+
var run_in_devkit = require('./run_in_devkit-CkvEksWP.js');
|
|
15
15
|
|
|
16
16
|
function getMemberName(member) {
|
|
17
17
|
if (member.name === undefined) {
|
|
@@ -611,7 +611,7 @@ function identifyHostBindingReferences(node, programInfo, checker$1, reflector,
|
|
|
611
611
|
readAstPath: ref.readAstPath,
|
|
612
612
|
isObjectShorthandExpression: ref.isObjectShorthandExpression,
|
|
613
613
|
isWrite: ref.isWrite,
|
|
614
|
-
file:
|
|
614
|
+
file: run_in_devkit.projectFile(ref.context.getSourceFile(), programInfo),
|
|
615
615
|
hostPropertyNode: ref.context,
|
|
616
616
|
},
|
|
617
617
|
target: ref.targetField,
|
|
@@ -628,7 +628,7 @@ function identifyHostBindingReferences(node, programInfo, checker$1, reflector,
|
|
|
628
628
|
*/
|
|
629
629
|
function attemptExtractTemplateDefinition(node, checker$1, reflector, resourceLoader) {
|
|
630
630
|
const classDecorators = reflector.getDecoratorsOfDeclaration(node);
|
|
631
|
-
const evaluator = new
|
|
631
|
+
const evaluator = new index.PartialEvaluator(reflector, checker$1, null);
|
|
632
632
|
const ngDecorators = classDecorators !== null
|
|
633
633
|
? checker.getAngularDecorators(classDecorators, ['Component'], /* isAngularCore */ false)
|
|
634
634
|
: [];
|
|
@@ -711,8 +711,8 @@ function identifyTemplateReferences(programInfo, node, reflector, checker$1, eva
|
|
|
711
711
|
readAstPath: res.readAstPath,
|
|
712
712
|
node: res.context,
|
|
713
713
|
isObjectShorthandExpression: res.isObjectShorthandExpression,
|
|
714
|
-
originatingTsFile:
|
|
715
|
-
templateFile:
|
|
714
|
+
originatingTsFile: run_in_devkit.projectFile(node.getSourceFile(), programInfo),
|
|
715
|
+
templateFile: run_in_devkit.projectFile(checker.absoluteFrom(templateFilePath), programInfo),
|
|
716
716
|
isLikelyPartOfNarrowing: res.isLikelyNarrowed,
|
|
717
717
|
isWrite: res.isWrite,
|
|
718
718
|
},
|
|
@@ -738,7 +738,7 @@ function extractTemplateWithoutCompilerAnalysis(node, checker$1, reflector, reso
|
|
|
738
738
|
if (tmplDef === null) {
|
|
739
739
|
return null;
|
|
740
740
|
}
|
|
741
|
-
return
|
|
741
|
+
return index.extractTemplate(node, tmplDef, evaluator, null, resourceLoader, {
|
|
742
742
|
enableBlockSyntax: true,
|
|
743
743
|
enableLetSyntax: true,
|
|
744
744
|
usePoisonedData: true,
|
|
@@ -894,7 +894,7 @@ function identifyPotentialTypeScriptReference(node, programInfo, checker, knownF
|
|
|
894
894
|
kind: exports.ReferenceKind.TsReference,
|
|
895
895
|
from: {
|
|
896
896
|
node,
|
|
897
|
-
file:
|
|
897
|
+
file: run_in_devkit.projectFile(node.getSourceFile(), programInfo),
|
|
898
898
|
isWrite: isWriteReference,
|
|
899
899
|
isPartOfElementBinding: ts.isBindingElement(node.parent),
|
|
900
900
|
},
|
|
@@ -958,7 +958,7 @@ function createFindAllSourceFileReferencesVisitor(programInfo, checker, reflecto
|
|
|
958
958
|
result.references.push({
|
|
959
959
|
kind: exports.ReferenceKind.TsClassTypeReference,
|
|
960
960
|
from: {
|
|
961
|
-
file:
|
|
961
|
+
file: run_in_devkit.projectFile(partialDirectiveInCatalyst.referenceNode.getSourceFile(), programInfo),
|
|
962
962
|
node: partialDirectiveInCatalyst.referenceNode,
|
|
963
963
|
},
|
|
964
964
|
isPartialReference: true,
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v20.0.0-next.
|
|
3
|
+
* @license Angular v20.0.0-next.4
|
|
4
4
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
7
7
|
'use strict';
|
|
8
8
|
|
|
9
|
-
var schematics = require('@angular-devkit/schematics');
|
|
10
|
-
var project_tsconfig_paths = require('./project_tsconfig_paths-CDVxT6Ov.js');
|
|
11
|
-
var project_paths = require('./project_paths-Jtbi76Bs.js');
|
|
12
|
-
require('os');
|
|
13
9
|
var ts = require('typescript');
|
|
14
|
-
|
|
15
|
-
require('./
|
|
10
|
+
require('os');
|
|
11
|
+
var checker = require('./checker-k591b6WQ.js');
|
|
12
|
+
require('./index-B4OAlHh8.js');
|
|
16
13
|
require('path');
|
|
17
|
-
var
|
|
14
|
+
var run_in_devkit = require('./run_in_devkit-CkvEksWP.js');
|
|
15
|
+
var apply_import_manager = require('./apply_import_manager-CeNv8GIG.js');
|
|
18
16
|
var imports = require('./imports-CIX-JgAN.js');
|
|
19
17
|
require('@angular-devkit/core');
|
|
20
18
|
require('node:path/posix');
|
|
21
19
|
require('fs');
|
|
22
20
|
require('module');
|
|
23
21
|
require('url');
|
|
22
|
+
require('@angular-devkit/schematics');
|
|
23
|
+
require('./project_tsconfig_paths-CDVxT6Ov.js');
|
|
24
24
|
|
|
25
25
|
/** Mapping between `InjectFlag` enum members to their object literal equvalients. */
|
|
26
26
|
const FLAGS_TO_FIELDS = {
|
|
@@ -31,7 +31,7 @@ const FLAGS_TO_FIELDS = {
|
|
|
31
31
|
'SkipSelf': 'skipSelf',
|
|
32
32
|
};
|
|
33
33
|
/** Migration that replaces `InjectFlags` usages with object literals. */
|
|
34
|
-
class InjectFlagsMigration extends
|
|
34
|
+
class InjectFlagsMigration extends run_in_devkit.TsurgeFunnelMigration {
|
|
35
35
|
async analyze(info) {
|
|
36
36
|
const locations = {};
|
|
37
37
|
const importRemovals = {};
|
|
@@ -40,7 +40,7 @@ class InjectFlagsMigration extends project_paths.TsurgeFunnelMigration {
|
|
|
40
40
|
if (specifier === null) {
|
|
41
41
|
continue;
|
|
42
42
|
}
|
|
43
|
-
const file =
|
|
43
|
+
const file = run_in_devkit.projectFile(sourceFile, info);
|
|
44
44
|
const importManager = new checker.ImportManager();
|
|
45
45
|
const importReplacements = [];
|
|
46
46
|
// Always remove the `InjectFlags` since it has been removed from Angular.
|
|
@@ -72,7 +72,7 @@ class InjectFlagsMigration extends project_paths.TsurgeFunnelMigration {
|
|
|
72
72
|
}
|
|
73
73
|
});
|
|
74
74
|
}
|
|
75
|
-
return
|
|
75
|
+
return run_in_devkit.confirmAsSerializable({ locations, importRemovals });
|
|
76
76
|
}
|
|
77
77
|
async migrate(globalData) {
|
|
78
78
|
const replacements = [];
|
|
@@ -83,12 +83,12 @@ class InjectFlagsMigration extends project_paths.TsurgeFunnelMigration {
|
|
|
83
83
|
// Declare a property for each flag, except for `default` which does not have a flag.
|
|
84
84
|
const properties = flags.filter((flag) => flag !== 'default').map((flag) => `${flag}: true`);
|
|
85
85
|
const toInsert = properties.length ? `{ ${properties.join(', ')} }` : '{}';
|
|
86
|
-
replacements.push(new
|
|
86
|
+
replacements.push(new run_in_devkit.Replacement(file, new run_in_devkit.TextUpdate({ position, end, toInsert })));
|
|
87
87
|
}
|
|
88
|
-
return
|
|
88
|
+
return run_in_devkit.confirmAsSerializable({ replacements });
|
|
89
89
|
}
|
|
90
90
|
async combine(unitA, unitB) {
|
|
91
|
-
return
|
|
91
|
+
return run_in_devkit.confirmAsSerializable({
|
|
92
92
|
locations: {
|
|
93
93
|
...unitA.locations,
|
|
94
94
|
...unitB.locations,
|
|
@@ -100,7 +100,7 @@ class InjectFlagsMigration extends project_paths.TsurgeFunnelMigration {
|
|
|
100
100
|
});
|
|
101
101
|
}
|
|
102
102
|
async globalMeta(combinedData) {
|
|
103
|
-
return
|
|
103
|
+
return run_in_devkit.confirmAsSerializable(combinedData);
|
|
104
104
|
}
|
|
105
105
|
async stats() {
|
|
106
106
|
return { counters: {} };
|
|
@@ -137,44 +137,10 @@ function getInjectFlagsRootExpression(start) {
|
|
|
137
137
|
|
|
138
138
|
function migrate() {
|
|
139
139
|
return async (tree) => {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
}
|
|
144
|
-
const fs = new project_paths.DevkitMigrationFilesystem(tree);
|
|
145
|
-
checker.setFileSystem(fs);
|
|
146
|
-
const migration = new InjectFlagsMigration();
|
|
147
|
-
const unitResults = [];
|
|
148
|
-
const programInfos = [...buildPaths, ...testPaths].map((tsconfigPath) => {
|
|
149
|
-
const baseInfo = migration.createProgram(tsconfigPath, fs);
|
|
150
|
-
const info = migration.prepareProgram(baseInfo);
|
|
151
|
-
return { info, tsconfigPath };
|
|
140
|
+
await run_in_devkit.runMigrationInDevkit({
|
|
141
|
+
tree,
|
|
142
|
+
getMigration: () => new InjectFlagsMigration(),
|
|
152
143
|
});
|
|
153
|
-
for (const { info } of programInfos) {
|
|
154
|
-
unitResults.push(await migration.analyze(info));
|
|
155
|
-
}
|
|
156
|
-
const combined = await project_paths.synchronouslyCombineUnitData(migration, unitResults);
|
|
157
|
-
if (combined === null) {
|
|
158
|
-
return;
|
|
159
|
-
}
|
|
160
|
-
const globalMeta = await migration.globalMeta(combined);
|
|
161
|
-
const replacementsPerFile = new Map();
|
|
162
|
-
const { replacements } = await migration.migrate(globalMeta);
|
|
163
|
-
const changesPerFile = project_paths.groupReplacementsByFile(replacements);
|
|
164
|
-
for (const [file, changes] of changesPerFile) {
|
|
165
|
-
if (!replacementsPerFile.has(file)) {
|
|
166
|
-
replacementsPerFile.set(file, changes);
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
for (const [file, changes] of replacementsPerFile) {
|
|
170
|
-
const recorder = tree.beginUpdate(file);
|
|
171
|
-
for (const c of changes) {
|
|
172
|
-
recorder
|
|
173
|
-
.remove(c.data.position, c.data.end - c.data.position)
|
|
174
|
-
.insertRight(c.data.position, c.data.toInsert);
|
|
175
|
-
}
|
|
176
|
-
tree.commitUpdate(recorder);
|
|
177
|
-
}
|
|
178
144
|
};
|
|
179
145
|
}
|
|
180
146
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v20.0.0-next.
|
|
3
|
+
* @license Angular v20.0.0-next.4
|
|
4
4
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
|
|
9
9
|
var schematics = require('@angular-devkit/schematics');
|
|
10
10
|
var p = require('path');
|
|
11
|
-
var compiler_host = require('./compiler_host-
|
|
11
|
+
var compiler_host = require('./compiler_host-DwM3ugW3.js');
|
|
12
12
|
var ts = require('typescript');
|
|
13
13
|
var ng_decorators = require('./ng_decorators-DznZ5jMl.js');
|
|
14
14
|
var imports = require('./imports-CIX-JgAN.js');
|
|
15
15
|
var nodes = require('./nodes-B16H9JUd.js');
|
|
16
16
|
var leading_space = require('./leading_space-D9nQ8UQC.js');
|
|
17
|
-
require('./checker-
|
|
17
|
+
require('./checker-k591b6WQ.js');
|
|
18
18
|
require('os');
|
|
19
19
|
require('fs');
|
|
20
20
|
require('module');
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v20.0.0-next.
|
|
3
|
+
* @license Angular v20.0.0-next.4
|
|
4
4
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
7
7
|
'use strict';
|
|
8
8
|
|
|
9
|
-
var checker = require('./checker-
|
|
9
|
+
var checker = require('./checker-k591b6WQ.js');
|
|
10
10
|
var ts = require('typescript');
|
|
11
11
|
require('os');
|
|
12
12
|
var assert = require('assert');
|
|
13
|
-
var index = require('./index-
|
|
14
|
-
var
|
|
13
|
+
var index = require('./index-BhELUmYx.js');
|
|
14
|
+
var run_in_devkit = require('./run_in_devkit-CkvEksWP.js');
|
|
15
15
|
var leading_space = require('./leading_space-D9nQ8UQC.js');
|
|
16
|
-
require('./
|
|
16
|
+
require('./index-B4OAlHh8.js');
|
|
17
17
|
require('path');
|
|
18
18
|
|
|
19
19
|
/**
|
|
@@ -912,7 +912,7 @@ function removeFromUnionIfPossible(union, filter) {
|
|
|
912
912
|
*/
|
|
913
913
|
function insertPrecedingLine(node, info, text) {
|
|
914
914
|
const leadingSpace = leading_space.getLeadingLineWhitespaceOfNode(node);
|
|
915
|
-
return new
|
|
915
|
+
return new run_in_devkit.Replacement(run_in_devkit.projectFile(node.getSourceFile(), info), new run_in_devkit.TextUpdate({
|
|
916
916
|
position: node.getStart(),
|
|
917
917
|
end: node.getStart(),
|
|
918
918
|
toInsert: `${text}\n${leadingSpace}`,
|
|
@@ -1253,20 +1253,20 @@ function createNewBlockToInsertVariable(node, file, toInsert) {
|
|
|
1253
1253
|
const contentSpace = ' '.repeat(character + 2);
|
|
1254
1254
|
return [
|
|
1255
1255
|
// Delete leading whitespace of the concise body.
|
|
1256
|
-
new
|
|
1256
|
+
new run_in_devkit.Replacement(file, new run_in_devkit.TextUpdate({
|
|
1257
1257
|
position: node.body.getFullStart(),
|
|
1258
1258
|
end: node.body.getStart(),
|
|
1259
1259
|
toInsert: '',
|
|
1260
1260
|
})),
|
|
1261
1261
|
// Insert leading block braces, and `toInsert` content.
|
|
1262
1262
|
// Wrap the previous expression in a return now.
|
|
1263
|
-
new
|
|
1263
|
+
new run_in_devkit.Replacement(file, new run_in_devkit.TextUpdate({
|
|
1264
1264
|
position: node.body.getStart(),
|
|
1265
1265
|
end: node.body.getStart(),
|
|
1266
1266
|
toInsert: ` {\n${contentSpace}${toInsert}\n${contentSpace}return `,
|
|
1267
1267
|
})),
|
|
1268
1268
|
// Add trailing brace.
|
|
1269
|
-
new
|
|
1269
|
+
new run_in_devkit.Replacement(file, new run_in_devkit.TextUpdate({
|
|
1270
1270
|
position: node.body.getEnd(),
|
|
1271
1271
|
end: node.body.getEnd(),
|
|
1272
1272
|
toInsert: `;\n${blockSpace}}`,
|
|
@@ -1296,7 +1296,7 @@ function migrateBindingElementInputReference(tsReferencesInBindingElements, info
|
|
|
1296
1296
|
const bindingElement = reference.parent;
|
|
1297
1297
|
const bindingDecl = index.getBindingElementDeclaration(bindingElement);
|
|
1298
1298
|
const sourceFile = bindingElement.getSourceFile();
|
|
1299
|
-
const file =
|
|
1299
|
+
const file = run_in_devkit.projectFile(sourceFile, info);
|
|
1300
1300
|
const inputFieldName = bindingElement.propertyName ?? bindingElement.name;
|
|
1301
1301
|
assert(!ts.isObjectBindingPattern(inputFieldName) && !ts.isArrayBindingPattern(inputFieldName), 'Property of binding element cannot be another pattern.');
|
|
1302
1302
|
const tmpName = nameGenerator.generate(reference.text, bindingElement);
|
|
@@ -1314,7 +1314,7 @@ function migrateBindingElementInputReference(tsReferencesInBindingElements, info
|
|
|
1314
1314
|
console.error(`Could not migrate reference ${reference.text} in ${file.rootRelativePath}`);
|
|
1315
1315
|
continue;
|
|
1316
1316
|
}
|
|
1317
|
-
replacements.push(new
|
|
1317
|
+
replacements.push(new run_in_devkit.Replacement(file, new run_in_devkit.TextUpdate({
|
|
1318
1318
|
position: bindingElement.getStart(),
|
|
1319
1319
|
end: bindingElement.getEnd(),
|
|
1320
1320
|
toInsert: printer.printNode(ts.EmitHint.Unspecified, newBindingToAccessInputField, sourceFile),
|
|
@@ -1339,7 +1339,7 @@ function insertTemporaryVariableForBindingElement(expansionDecl, file, toInsert)
|
|
|
1339
1339
|
const leadingSpace = ' '.repeat(leadingSpaceCount);
|
|
1340
1340
|
const statement = parent.parent;
|
|
1341
1341
|
return [
|
|
1342
|
-
new
|
|
1342
|
+
new run_in_devkit.Replacement(file, new run_in_devkit.TextUpdate({
|
|
1343
1343
|
position: statement.getEnd(),
|
|
1344
1344
|
end: statement.getEnd(),
|
|
1345
1345
|
toInsert: `\n${leadingSpace}${toInsert}`,
|
|
@@ -1357,7 +1357,7 @@ function insertTemporaryVariableForBindingElement(expansionDecl, file, toInsert)
|
|
|
1357
1357
|
const leadingSpaceCount = ts.getLineAndCharacterOfPosition(sf, spaceReferenceNode.getStart()).character + spaceOffset;
|
|
1358
1358
|
const leadingSpace = ' '.repeat(leadingSpaceCount);
|
|
1359
1359
|
return [
|
|
1360
|
-
new
|
|
1360
|
+
new run_in_devkit.Replacement(file, new run_in_devkit.TextUpdate({
|
|
1361
1361
|
position: bodyBlock.getStart() + 1,
|
|
1362
1362
|
end: bodyBlock.getStart() + 1,
|
|
1363
1363
|
toInsert: `\n${leadingSpace}${toInsert}`,
|
|
@@ -1758,7 +1758,7 @@ function migrateStandardTsReference(tsReferencesWithNarrowing, checker, info, re
|
|
|
1758
1758
|
// Unwrap the signal directly.
|
|
1759
1759
|
if (recommendedNode === 'preserve') {
|
|
1760
1760
|
// Append `()` to unwrap the signal.
|
|
1761
|
-
replacements.push(new
|
|
1761
|
+
replacements.push(new run_in_devkit.Replacement(run_in_devkit.projectFile(sf, info), new run_in_devkit.TextUpdate({
|
|
1762
1762
|
position: originalNode.getEnd(),
|
|
1763
1763
|
end: originalNode.getEnd(),
|
|
1764
1764
|
toInsert: '()',
|
|
@@ -1772,7 +1772,7 @@ function migrateStandardTsReference(tsReferencesWithNarrowing, checker, info, re
|
|
|
1772
1772
|
const toInsert = idToSharedField.get(recommendedNode);
|
|
1773
1773
|
const replaceNode = index.traverseAccess(originalNode);
|
|
1774
1774
|
assert(toInsert, 'no shared variable yet available');
|
|
1775
|
-
replacements.push(new
|
|
1775
|
+
replacements.push(new run_in_devkit.Replacement(run_in_devkit.projectFile(sf, info), new run_in_devkit.TextUpdate({
|
|
1776
1776
|
position: replaceNode.getStart(),
|
|
1777
1777
|
end: replaceNode.getEnd(),
|
|
1778
1778
|
toInsert,
|
|
@@ -1792,7 +1792,7 @@ function migrateStandardTsReference(tsReferencesWithNarrowing, checker, info, re
|
|
|
1792
1792
|
parent = parent.parent;
|
|
1793
1793
|
}
|
|
1794
1794
|
const replaceNode = index.traverseAccess(originalNode);
|
|
1795
|
-
const filePath =
|
|
1795
|
+
const filePath = run_in_devkit.projectFile(sf, info);
|
|
1796
1796
|
const initializer = `${replaceNode.getText()}()`;
|
|
1797
1797
|
const fieldName = nameGenerator.generate(originalNode.text, referenceNodeInBlock);
|
|
1798
1798
|
let sharedValueAccessExpr;
|
|
@@ -1814,13 +1814,13 @@ function migrateStandardTsReference(tsReferencesWithNarrowing, checker, info, re
|
|
|
1814
1814
|
}
|
|
1815
1815
|
else {
|
|
1816
1816
|
const leadingSpace = ts.getLineAndCharacterOfPosition(sf, referenceNodeInBlock.getStart());
|
|
1817
|
-
replacements.push(new
|
|
1817
|
+
replacements.push(new run_in_devkit.Replacement(filePath, new run_in_devkit.TextUpdate({
|
|
1818
1818
|
position: referenceNodeInBlock.getStart(),
|
|
1819
1819
|
end: referenceNodeInBlock.getStart(),
|
|
1820
1820
|
toInsert: `${temporaryVariableStr}\n${' '.repeat(leadingSpace.character)}`,
|
|
1821
1821
|
})));
|
|
1822
1822
|
}
|
|
1823
|
-
replacements.push(new
|
|
1823
|
+
replacements.push(new run_in_devkit.Replacement(run_in_devkit.projectFile(sf, info), new run_in_devkit.TextUpdate({
|
|
1824
1824
|
position: replaceNode.getStart(),
|
|
1825
1825
|
end: replaceNode.getEnd(),
|
|
1826
1826
|
toInsert: sharedValueAccessExpr,
|
|
@@ -1929,12 +1929,12 @@ function migrateTypeScriptTypeReferences(host, references, importManager, info)
|
|
|
1929
1929
|
exportSymbolName: 'UnwrapSignalInputs',
|
|
1930
1930
|
requestedFile: sf,
|
|
1931
1931
|
});
|
|
1932
|
-
host.replacements.push(new
|
|
1932
|
+
host.replacements.push(new run_in_devkit.Replacement(run_in_devkit.projectFile(sf, info), new run_in_devkit.TextUpdate({
|
|
1933
1933
|
position: firstArg.getStart(),
|
|
1934
1934
|
end: firstArg.getStart(),
|
|
1935
1935
|
toInsert: `${host.printer.printNode(ts.EmitHint.Unspecified, unwrapImportExpr, sf)}<`,
|
|
1936
1936
|
})));
|
|
1937
|
-
host.replacements.push(new
|
|
1937
|
+
host.replacements.push(new run_in_devkit.Replacement(run_in_devkit.projectFile(sf, info), new run_in_devkit.TextUpdate({ position: firstArg.getEnd(), end: firstArg.getEnd(), toInsert: '>' })));
|
|
1938
1938
|
}
|
|
1939
1939
|
}
|
|
1940
1940
|
}
|