@analogjs/vite-plugin-angular 2.0.0-alpha.1 → 2.0.0-alpha.10

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.
@@ -0,0 +1,244 @@
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
+ if (meta?.decorator &&
100
+ meta.isComponent === true) {
101
+ const updatedDecorators = ts.getDecorators(updatedNode);
102
+ const staleDecorators = ts.getDecorators(staleNode);
103
+ if (!staleDecorators ||
104
+ staleDecorators.length !== updatedDecorators?.length) {
105
+ return null;
106
+ }
107
+ // TODO: Check other decorators instead of assuming all multi-decorator components are unsupported
108
+ if (staleDecorators.length > 1) {
109
+ return null;
110
+ }
111
+ // Find index of component metadata decorator
112
+ const metaDecoratorIndex = updatedDecorators?.indexOf(meta.decorator);
113
+ assert(metaDecoratorIndex !== undefined, 'Component metadata decorator should always be present on component class.');
114
+ const updatedDecoratorExpression = meta.decorator.expression;
115
+ assert(ts.isCallExpression(updatedDecoratorExpression) &&
116
+ updatedDecoratorExpression.arguments.length === 1, 'Component metadata decorator should contain a call expression with a single argument.');
117
+ // Check the matching stale index for the component decorator
118
+ const staleDecoratorExpression = staleDecorators[metaDecoratorIndex]?.expression;
119
+ if (!staleDecoratorExpression ||
120
+ !ts.isCallExpression(staleDecoratorExpression) ||
121
+ staleDecoratorExpression.arguments.length !== 1) {
122
+ return null;
123
+ }
124
+ // Check decorator name/expression
125
+ // NOTE: This would typically be `Component` but can also be a property expression or some other alias.
126
+ // To avoid complex checks, this ensures the textual representation does not change. This has a low chance
127
+ // of a false positive if the expression is changed to still reference the `Component` type but has different
128
+ // text. However, it is rare for `Component` to not be used directly and additionally unlikely that it would
129
+ // be changed between edits. A false positive would also only lead to a difference of a full page reload versus
130
+ // an HMR update.
131
+ if (!equalRangeText(updatedDecoratorExpression.expression, updated, staleDecoratorExpression.expression, stale)) {
132
+ return null;
133
+ }
134
+ // Compare component meta decorator object literals
135
+ if (hasUnsupportedMetaUpdates(staleDecoratorExpression, stale, updatedDecoratorExpression, updated)) {
136
+ return null;
137
+ }
138
+ // Compare text of the member nodes to determine if any changes have occurred
139
+ if (!equalRangeText(updatedNode.members, updated, staleNode.members, stale)) {
140
+ // A change to a member outside a component's metadata is unsupported
141
+ return null;
142
+ }
143
+ // If all previous class checks passed, this class is supported for HMR updates
144
+ candidates.push(updatedNode);
145
+ continue;
146
+ }
147
+ }
148
+ // Compare text of the statement nodes to determine if any changes have occurred
149
+ // TODO: Consider expanding this to check semantic updates for each node kind
150
+ if (!equalRangeText(updatedNode, updated, staleNode, stale)) {
151
+ // A change to a statement outside a component's metadata is unsupported
152
+ return null;
153
+ }
154
+ }
155
+ return candidates;
156
+ }
157
+ /**
158
+ * The set of Angular component metadata fields that are supported by HMR updates.
159
+ */
160
+ const SUPPORTED_FIELDS = new Set([
161
+ 'template',
162
+ 'templateUrl',
163
+ 'styles',
164
+ 'styleUrl',
165
+ 'stylesUrl',
166
+ ]);
167
+ /**
168
+ * Analyzes the metadata fields of a decorator call expression for unsupported HMR updates.
169
+ * Only updates to supported fields can be present for HMR to be viable.
170
+ * @param staleCall A call expression instance.
171
+ * @param staleSource The source file instance containing the stale call instance.
172
+ * @param updatedCall A call expression instance.
173
+ * @param updatedSource The source file instance containing the updated call instance.
174
+ * @returns true, if unsupported metadata updates are present; false, otherwise.
175
+ */
176
+ function hasUnsupportedMetaUpdates(staleCall, staleSource, updatedCall, updatedSource) {
177
+ const staleObject = staleCall.arguments[0];
178
+ const updatedObject = updatedCall.arguments[0];
179
+ if (!ts.isObjectLiteralExpression(staleObject) ||
180
+ !ts.isObjectLiteralExpression(updatedObject)) {
181
+ return true;
182
+ }
183
+ const unsupportedFields = [];
184
+ for (const property of staleObject.properties) {
185
+ if (!ts.isPropertyAssignment(property) ||
186
+ ts.isComputedPropertyName(property.name)) {
187
+ // Unsupported object literal property
188
+ return true;
189
+ }
190
+ const name = property.name.text;
191
+ if (SUPPORTED_FIELDS.has(name)) {
192
+ continue;
193
+ }
194
+ unsupportedFields.push(property.initializer);
195
+ }
196
+ let i = 0;
197
+ for (const property of updatedObject.properties) {
198
+ if (!ts.isPropertyAssignment(property) ||
199
+ ts.isComputedPropertyName(property.name)) {
200
+ // Unsupported object literal property
201
+ return true;
202
+ }
203
+ const name = property.name.text;
204
+ if (SUPPORTED_FIELDS.has(name)) {
205
+ continue;
206
+ }
207
+ // Compare in order
208
+ if (!equalRangeText(property.initializer, updatedSource, unsupportedFields[i++], staleSource)) {
209
+ return true;
210
+ }
211
+ }
212
+ return i !== unsupportedFields.length;
213
+ }
214
+ /**
215
+ * Compares the text from a provided range in a source file to the text of a range in a second source file.
216
+ * The comparison avoids making any intermediate string copies.
217
+ * @param firstRange A text range within the first source file.
218
+ * @param firstSource A source file instance.
219
+ * @param secondRange A text range within the second source file.
220
+ * @param secondSource A source file instance.
221
+ * @returns true, if the text from both ranges is equal; false, otherwise.
222
+ */
223
+ function equalRangeText(firstRange, firstSource, secondRange, secondSource) {
224
+ // Check matching undefined values
225
+ if (!firstRange || !secondRange) {
226
+ return firstRange === secondRange;
227
+ }
228
+ // Ensure lengths are equal
229
+ const firstLength = firstRange.end - firstRange.pos;
230
+ const secondLength = secondRange.end - secondRange.pos;
231
+ if (firstLength !== secondLength) {
232
+ return false;
233
+ }
234
+ // Check each character
235
+ for (let i = 0; i < firstLength; ++i) {
236
+ const firstChar = firstSource.text.charCodeAt(i + firstRange.pos);
237
+ const secondChar = secondSource.text.charCodeAt(i + secondRange.pos);
238
+ if (firstChar !== secondChar) {
239
+ return false;
240
+ }
241
+ }
242
+ return true;
243
+ }
244
+ //# 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,CAAC,6BAA6B,CAAC,IAA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b,iBAAiB,CAAC,CAAC,EAAE,CAAC,EACtB,WAAW,CACZ,EACD,CAAC;YACD,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAED,OAAO,CAAC,KAAK,iBAAiB,CAAC,MAAM,CAAC;AACxC,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;