@analogjs/vite-plugin-angular 2.0.0-alpha.1 → 2.0.0-alpha.11
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/README.md +2 -0
- package/package.json +5 -2
- package/src/lib/angular-pending-tasks.plugin.js +3 -2
- package/src/lib/angular-pending-tasks.plugin.js.map +1 -1
- package/src/lib/angular-storybook-plugin.js +2 -2
- package/src/lib/angular-storybook-plugin.js.map +1 -1
- package/src/lib/angular-vite-plugin.d.ts +18 -11
- package/src/lib/angular-vite-plugin.js +405 -105
- package/src/lib/angular-vite-plugin.js.map +1 -1
- package/src/lib/angular-vitest-plugin.js +1 -6
- package/src/lib/angular-vitest-plugin.js.map +1 -1
- package/src/lib/authoring/analog.js +1 -1
- package/src/lib/authoring/analog.js.map +1 -1
- package/src/lib/authoring/markdown-transform.js +7 -2
- package/src/lib/authoring/markdown-transform.js.map +1 -1
- package/src/lib/authoring/marked-setup.service.js +5 -6
- package/src/lib/authoring/marked-setup.service.js.map +1 -1
- package/src/lib/component-resolvers.js.map +1 -1
- package/src/lib/host.d.ts +4 -2
- package/src/lib/host.js +64 -22
- package/src/lib/host.js.map +1 -1
- package/src/lib/live-reload-plugin.d.ts +6 -0
- package/src/lib/live-reload-plugin.js +63 -0
- package/src/lib/live-reload-plugin.js.map +1 -0
- package/src/lib/models.d.ts +11 -0
- package/src/lib/models.js +2 -0
- package/src/lib/models.js.map +1 -0
- package/src/lib/utils/hmr-candidates.d.ts +32 -0
- package/src/lib/utils/hmr-candidates.js +272 -0
- package/src/lib/utils/hmr-candidates.js.map +1 -0
- package/src/lib/utils/source-file-cache.d.ts +2 -2
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
|
+
*/
|
|
8
|
+
import { NgtscProgram } from '@angular/compiler-cli';
|
|
9
|
+
import ts from 'typescript';
|
|
10
|
+
/**
|
|
11
|
+
* Analyzes one or more modified files for changes to determine if any
|
|
12
|
+
* class declarations for Angular components are candidates for hot
|
|
13
|
+
* module replacement (HMR). If any source files are also modified but
|
|
14
|
+
* are not candidates then all candidates become invalid. This invalidation
|
|
15
|
+
* ensures that a full rebuild occurs and the running application stays
|
|
16
|
+
* synchronized with the code.
|
|
17
|
+
* @param modifiedFiles A set of modified files to analyze.
|
|
18
|
+
* @param param1 An Angular compiler instance
|
|
19
|
+
* @param staleSourceFiles A map of paths to previous source file instances.
|
|
20
|
+
* @returns A set of HMR candidate component class declarations.
|
|
21
|
+
*/
|
|
22
|
+
export declare function collectHmrCandidates(modifiedFiles: Set<string>, { compiler }: NgtscProgram, staleSourceFiles: Map<string, ts.SourceFile> | undefined): Set<ts.ClassDeclaration>;
|
|
23
|
+
/**
|
|
24
|
+
* Analyzes the updates of a source file for potential HMR component class candidates.
|
|
25
|
+
* A source file can contain candidates if only the Angular component metadata of a class
|
|
26
|
+
* has been changed and the metadata changes are only of supported fields.
|
|
27
|
+
* @param stale The stale (previous) source file instance.
|
|
28
|
+
* @param updated The updated source file instance.
|
|
29
|
+
* @param compiler An Angular compiler instance.
|
|
30
|
+
* @returns An array of candidate class declarations; or `null` if unsupported changes are present.
|
|
31
|
+
*/
|
|
32
|
+
export declare function analyzeFileUpdates(stale: ts.SourceFile, updated: ts.SourceFile, compiler: NgtscProgram['compiler']): ts.ClassDeclaration[] | null;
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
|
+
*/
|
|
8
|
+
import assert from 'node:assert';
|
|
9
|
+
import ts from 'typescript';
|
|
10
|
+
/**
|
|
11
|
+
* Analyzes one or more modified files for changes to determine if any
|
|
12
|
+
* class declarations for Angular components are candidates for hot
|
|
13
|
+
* module replacement (HMR). If any source files are also modified but
|
|
14
|
+
* are not candidates then all candidates become invalid. This invalidation
|
|
15
|
+
* ensures that a full rebuild occurs and the running application stays
|
|
16
|
+
* synchronized with the code.
|
|
17
|
+
* @param modifiedFiles A set of modified files to analyze.
|
|
18
|
+
* @param param1 An Angular compiler instance
|
|
19
|
+
* @param staleSourceFiles A map of paths to previous source file instances.
|
|
20
|
+
* @returns A set of HMR candidate component class declarations.
|
|
21
|
+
*/
|
|
22
|
+
export function collectHmrCandidates(modifiedFiles, { compiler }, staleSourceFiles) {
|
|
23
|
+
const candidates = new Set();
|
|
24
|
+
for (const file of modifiedFiles) {
|
|
25
|
+
// If the file is a template for component(s), add component classes as candidates
|
|
26
|
+
const templateFileNodes = compiler.getComponentsWithTemplateFile(file);
|
|
27
|
+
if (templateFileNodes.size) {
|
|
28
|
+
templateFileNodes.forEach((node) => candidates.add(node));
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
// If the file is a style for component(s), add component classes as candidates
|
|
32
|
+
const styleFileNodes = compiler.getComponentsWithStyleFile(file);
|
|
33
|
+
if (styleFileNodes.size) {
|
|
34
|
+
styleFileNodes.forEach((node) => candidates.add(node));
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
37
|
+
const staleSource = staleSourceFiles?.get(file);
|
|
38
|
+
if (staleSource === undefined) {
|
|
39
|
+
// Unknown file requires a rebuild so clear out the candidates and stop collecting
|
|
40
|
+
candidates.clear();
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
const updatedSource = compiler.getCurrentProgram().getSourceFile(file);
|
|
44
|
+
if (updatedSource === undefined) {
|
|
45
|
+
// No longer existing program file requires a rebuild so clear out the candidates and stop collecting
|
|
46
|
+
candidates.clear();
|
|
47
|
+
break;
|
|
48
|
+
}
|
|
49
|
+
// Analyze the stale and updated file for changes
|
|
50
|
+
const fileCandidates = analyzeFileUpdates(staleSource, updatedSource, compiler);
|
|
51
|
+
if (fileCandidates) {
|
|
52
|
+
fileCandidates.forEach((node) => candidates.add(node));
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
// Unsupported HMR changes present
|
|
56
|
+
// Only template and style literal changes are allowed.
|
|
57
|
+
candidates.clear();
|
|
58
|
+
break;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return candidates;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Analyzes the updates of a source file for potential HMR component class candidates.
|
|
65
|
+
* A source file can contain candidates if only the Angular component metadata of a class
|
|
66
|
+
* has been changed and the metadata changes are only of supported fields.
|
|
67
|
+
* @param stale The stale (previous) source file instance.
|
|
68
|
+
* @param updated The updated source file instance.
|
|
69
|
+
* @param compiler An Angular compiler instance.
|
|
70
|
+
* @returns An array of candidate class declarations; or `null` if unsupported changes are present.
|
|
71
|
+
*/
|
|
72
|
+
export function analyzeFileUpdates(stale, updated, compiler) {
|
|
73
|
+
if (stale.statements.length !== updated.statements.length) {
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
const candidates = [];
|
|
77
|
+
for (let i = 0; i < updated.statements.length; ++i) {
|
|
78
|
+
const updatedNode = updated.statements[i];
|
|
79
|
+
const staleNode = stale.statements[i];
|
|
80
|
+
if (ts.isClassDeclaration(updatedNode)) {
|
|
81
|
+
if (!ts.isClassDeclaration(staleNode)) {
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
// Check class declaration differences (name/heritage/modifiers)
|
|
85
|
+
if (updatedNode.name?.text !== staleNode.name?.text) {
|
|
86
|
+
return null;
|
|
87
|
+
}
|
|
88
|
+
if (!equalRangeText(updatedNode.heritageClauses, updated, staleNode.heritageClauses, stale)) {
|
|
89
|
+
return null;
|
|
90
|
+
}
|
|
91
|
+
const updatedModifiers = ts.getModifiers(updatedNode);
|
|
92
|
+
const staleModifiers = ts.getModifiers(staleNode);
|
|
93
|
+
if (updatedModifiers?.length !== staleModifiers?.length ||
|
|
94
|
+
!updatedModifiers?.every((updatedModifier) => staleModifiers?.some((staleModifier) => updatedModifier.kind === staleModifier.kind))) {
|
|
95
|
+
return null;
|
|
96
|
+
}
|
|
97
|
+
// Check for component class nodes
|
|
98
|
+
const meta = compiler?.getMeta(updatedNode);
|
|
99
|
+
console.log('meta', stale.fileName, meta);
|
|
100
|
+
if (meta?.decorator &&
|
|
101
|
+
meta.isComponent === true) {
|
|
102
|
+
const updatedDecorators = ts.getDecorators(updatedNode);
|
|
103
|
+
const staleDecorators = ts.getDecorators(staleNode);
|
|
104
|
+
if (!staleDecorators ||
|
|
105
|
+
staleDecorators.length !== updatedDecorators?.length) {
|
|
106
|
+
return null;
|
|
107
|
+
}
|
|
108
|
+
// TODO: Check other decorators instead of assuming all multi-decorator components are unsupported
|
|
109
|
+
if (staleDecorators.length > 1) {
|
|
110
|
+
return null;
|
|
111
|
+
}
|
|
112
|
+
// Find index of component metadata decorator
|
|
113
|
+
const metaDecoratorIndex = updatedDecorators?.indexOf(meta.decorator);
|
|
114
|
+
assert(metaDecoratorIndex !== undefined, 'Component metadata decorator should always be present on component class.');
|
|
115
|
+
const updatedDecoratorExpression = meta.decorator.expression;
|
|
116
|
+
assert(ts.isCallExpression(updatedDecoratorExpression) &&
|
|
117
|
+
updatedDecoratorExpression.arguments.length === 1, 'Component metadata decorator should contain a call expression with a single argument.');
|
|
118
|
+
// Check the matching stale index for the component decorator
|
|
119
|
+
const staleDecoratorExpression = staleDecorators[metaDecoratorIndex]?.expression;
|
|
120
|
+
if (!staleDecoratorExpression ||
|
|
121
|
+
!ts.isCallExpression(staleDecoratorExpression) ||
|
|
122
|
+
staleDecoratorExpression.arguments.length !== 1) {
|
|
123
|
+
return null;
|
|
124
|
+
}
|
|
125
|
+
// Check decorator name/expression
|
|
126
|
+
// NOTE: This would typically be `Component` but can also be a property expression or some other alias.
|
|
127
|
+
// To avoid complex checks, this ensures the textual representation does not change. This has a low chance
|
|
128
|
+
// of a false positive if the expression is changed to still reference the `Component` type but has different
|
|
129
|
+
// text. However, it is rare for `Component` to not be used directly and additionally unlikely that it would
|
|
130
|
+
// be changed between edits. A false positive would also only lead to a difference of a full page reload versus
|
|
131
|
+
// an HMR update.
|
|
132
|
+
if (!equalRangeText(updatedDecoratorExpression.expression, updated, staleDecoratorExpression.expression, stale)) {
|
|
133
|
+
return null;
|
|
134
|
+
}
|
|
135
|
+
// Compare component meta decorator object literals
|
|
136
|
+
const analysis = analyzeMetaUpdates(staleDecoratorExpression, stale, updatedDecoratorExpression, updated);
|
|
137
|
+
if (analysis === MetaUpdateAnalysis.Unsupported) {
|
|
138
|
+
return null;
|
|
139
|
+
}
|
|
140
|
+
// Compare text of the member nodes to determine if any changes have occurred
|
|
141
|
+
if (!equalRangeText(updatedNode.members, updated, staleNode.members, stale)) {
|
|
142
|
+
// A change to a member outside a component's metadata is unsupported
|
|
143
|
+
return null;
|
|
144
|
+
}
|
|
145
|
+
// If all previous class checks passed, this class is supported for HMR updates
|
|
146
|
+
if (analysis === MetaUpdateAnalysis.Supported) {
|
|
147
|
+
candidates.push(updatedNode);
|
|
148
|
+
}
|
|
149
|
+
continue;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
// Compare text of the statement nodes to determine if any changes have occurred
|
|
153
|
+
// TODO: Consider expanding this to check semantic updates for each node kind
|
|
154
|
+
if (!equalRangeText(updatedNode, updated, staleNode, stale)) {
|
|
155
|
+
// A change to a statement outside a component's metadata is unsupported
|
|
156
|
+
return null;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
return candidates;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* The set of Angular component metadata fields that are supported by HMR updates.
|
|
163
|
+
*/
|
|
164
|
+
const SUPPORTED_FIELD_NAMES = new Set([
|
|
165
|
+
'template',
|
|
166
|
+
'templateUrl',
|
|
167
|
+
'styles',
|
|
168
|
+
'styleUrl',
|
|
169
|
+
'stylesUrl',
|
|
170
|
+
]);
|
|
171
|
+
var MetaUpdateAnalysis;
|
|
172
|
+
(function (MetaUpdateAnalysis) {
|
|
173
|
+
MetaUpdateAnalysis[MetaUpdateAnalysis["Supported"] = 0] = "Supported";
|
|
174
|
+
MetaUpdateAnalysis[MetaUpdateAnalysis["Unsupported"] = 1] = "Unsupported";
|
|
175
|
+
MetaUpdateAnalysis[MetaUpdateAnalysis["None"] = 2] = "None";
|
|
176
|
+
})(MetaUpdateAnalysis || (MetaUpdateAnalysis = {}));
|
|
177
|
+
/**
|
|
178
|
+
* Analyzes the metadata fields of a decorator call expression for unsupported HMR updates.
|
|
179
|
+
* Only updates to supported fields can be present for HMR to be viable.
|
|
180
|
+
* @param staleCall A call expression instance.
|
|
181
|
+
* @param staleSource The source file instance containing the stale call instance.
|
|
182
|
+
* @param updatedCall A call expression instance.
|
|
183
|
+
* @param updatedSource The source file instance containing the updated call instance.
|
|
184
|
+
* @returns A MetaUpdateAnalysis enum value.
|
|
185
|
+
*/
|
|
186
|
+
function analyzeMetaUpdates(staleCall, staleSource, updatedCall, updatedSource) {
|
|
187
|
+
const staleObject = staleCall.arguments[0];
|
|
188
|
+
const updatedObject = updatedCall.arguments[0];
|
|
189
|
+
let hasSupportedUpdate = false;
|
|
190
|
+
if (!ts.isObjectLiteralExpression(staleObject) ||
|
|
191
|
+
!ts.isObjectLiteralExpression(updatedObject)) {
|
|
192
|
+
return MetaUpdateAnalysis.Unsupported;
|
|
193
|
+
}
|
|
194
|
+
const supportedFields = new Map();
|
|
195
|
+
const unsupportedFields = [];
|
|
196
|
+
for (const property of staleObject.properties) {
|
|
197
|
+
if (!ts.isPropertyAssignment(property) ||
|
|
198
|
+
ts.isComputedPropertyName(property.name)) {
|
|
199
|
+
// Unsupported object literal property
|
|
200
|
+
return MetaUpdateAnalysis.Unsupported;
|
|
201
|
+
}
|
|
202
|
+
const name = property.name.text;
|
|
203
|
+
if (SUPPORTED_FIELD_NAMES.has(name)) {
|
|
204
|
+
supportedFields.set(name, property.initializer);
|
|
205
|
+
continue;
|
|
206
|
+
}
|
|
207
|
+
unsupportedFields.push(property.initializer);
|
|
208
|
+
}
|
|
209
|
+
let i = 0;
|
|
210
|
+
for (const property of updatedObject.properties) {
|
|
211
|
+
if (!ts.isPropertyAssignment(property) ||
|
|
212
|
+
ts.isComputedPropertyName(property.name)) {
|
|
213
|
+
// Unsupported object literal property
|
|
214
|
+
return MetaUpdateAnalysis.Unsupported;
|
|
215
|
+
}
|
|
216
|
+
const name = property.name.text;
|
|
217
|
+
if (SUPPORTED_FIELD_NAMES.has(name)) {
|
|
218
|
+
const staleInitializer = supportedFields.get(name);
|
|
219
|
+
// If the supported field was added or has its content changed, there has been a supported update
|
|
220
|
+
if (!staleInitializer ||
|
|
221
|
+
!equalRangeText(property.initializer, updatedSource, staleInitializer, staleSource)) {
|
|
222
|
+
hasSupportedUpdate = true;
|
|
223
|
+
}
|
|
224
|
+
// Remove the field entry to allow tracking removed fields
|
|
225
|
+
supportedFields.delete(name);
|
|
226
|
+
continue;
|
|
227
|
+
}
|
|
228
|
+
// Compare in order
|
|
229
|
+
if (!equalRangeText(property.initializer, updatedSource, unsupportedFields[i++], staleSource)) {
|
|
230
|
+
return MetaUpdateAnalysis.Unsupported;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
if (i !== unsupportedFields.length) {
|
|
234
|
+
return MetaUpdateAnalysis.Unsupported;
|
|
235
|
+
}
|
|
236
|
+
// Any remaining supported field indicates a field removal. This is also considered a supported update.
|
|
237
|
+
hasSupportedUpdate ||= supportedFields.size > 0;
|
|
238
|
+
return hasSupportedUpdate
|
|
239
|
+
? MetaUpdateAnalysis.Supported
|
|
240
|
+
: MetaUpdateAnalysis.None;
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Compares the text from a provided range in a source file to the text of a range in a second source file.
|
|
244
|
+
* The comparison avoids making any intermediate string copies.
|
|
245
|
+
* @param firstRange A text range within the first source file.
|
|
246
|
+
* @param firstSource A source file instance.
|
|
247
|
+
* @param secondRange A text range within the second source file.
|
|
248
|
+
* @param secondSource A source file instance.
|
|
249
|
+
* @returns true, if the text from both ranges is equal; false, otherwise.
|
|
250
|
+
*/
|
|
251
|
+
function equalRangeText(firstRange, firstSource, secondRange, secondSource) {
|
|
252
|
+
// Check matching undefined values
|
|
253
|
+
if (!firstRange || !secondRange) {
|
|
254
|
+
return firstRange === secondRange;
|
|
255
|
+
}
|
|
256
|
+
// Ensure lengths are equal
|
|
257
|
+
const firstLength = firstRange.end - firstRange.pos;
|
|
258
|
+
const secondLength = secondRange.end - secondRange.pos;
|
|
259
|
+
if (firstLength !== secondLength) {
|
|
260
|
+
return false;
|
|
261
|
+
}
|
|
262
|
+
// Check each character
|
|
263
|
+
for (let i = 0; i < firstLength; ++i) {
|
|
264
|
+
const firstChar = firstSource.text.charCodeAt(i + firstRange.pos);
|
|
265
|
+
const secondChar = secondSource.text.charCodeAt(i + secondRange.pos);
|
|
266
|
+
if (firstChar !== secondChar) {
|
|
267
|
+
return false;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
return true;
|
|
271
|
+
}
|
|
272
|
+
//# sourceMappingURL=hmr-candidates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hmr-candidates.js","sourceRoot":"","sources":["../../../../../../packages/vite-plugin-angular/src/lib/utils/hmr-candidates.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,oBAAoB,CAClC,aAA0B,EAC1B,EAAE,QAAQ,EAAgB,EAC1B,gBAAwD;IAExD,MAAM,UAAU,GAAG,IAAI,GAAG,EAAuB,CAAC;IAElD,KAAK,MAAM,IAAI,IAAI,aAAa,EAAE,CAAC;QACjC,kFAAkF;QAClF,MAAM,iBAAiB,GAAG,QAAQ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AAkB;QACvB,CAAC,CAAC,kBAAkB,CAAC,SAAS;QAC9B,CAAC,CAAC,kBAAkB,CAAC,IAAI,CAAC;AAC9B,CAAC;AAED;;;;;;;;GAQG;AACH,SAAS,cAAc,CACrB,UAA4C,EAC5C,WAA0B,EAC1B,WAA6C,EAC7C,YAA2B;IAE3B,kCAAkC;IAClC,IAAI,CAAC,UAAU,IAAI,CAAC,WAAW,EAAE,CAAC;QAChC,OAAO,UAAU,KAAK,WAAW,CAAC;IACpC,CAAC;IAED,2BAA2B;IAC3B,MAAM,WAAW,GAAG,UAAU,CAAC,GAAG,GAAG,UAAU,CAAC,GAAG,CAAC;IACpD,MAAM,YAAY,GAAG,WAAW,CAAC,GAAG,GAAG,WAAW,CAAC,GAAG,CAAC;IACvD,IAAI,WAAW,KAAK,YAAY,EAAE,CAAC;QACjC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,uBAAuB;IACvB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,WAAW,EAAE,EAAE,CAAC,EAAE,CAAC;QACrC,MAAM,SAAS,GAAG,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC;QAClE,MAAM,UAAU,GAAG,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;QACrE,IAAI,SAAS,KAAK,UAAU,EAAE,CAAC;YAC7B,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -9,8 +9,8 @@ import type ts from 'typescript';
|
|
|
9
9
|
export declare class SourceFileCache extends Map<string, ts.SourceFile> {
|
|
10
10
|
readonly persistentCachePath?: string | undefined;
|
|
11
11
|
readonly modifiedFiles: Set<string>;
|
|
12
|
-
readonly babelFileCache: Map<string, Uint8Array
|
|
13
|
-
readonly typeScriptFileCache: Map<string, string | Uint8Array
|
|
12
|
+
readonly babelFileCache: Map<string, Uint8Array<ArrayBufferLike>>;
|
|
13
|
+
readonly typeScriptFileCache: Map<string, string | Uint8Array<ArrayBufferLike>>;
|
|
14
14
|
referencedFiles?: readonly string[];
|
|
15
15
|
constructor(persistentCachePath?: string | undefined);
|
|
16
16
|
invalidate(files: Iterable<string>): void;
|