@astrojs/compiler 1.4.1 → 1.5.0

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.
Files changed (53) hide show
  1. package/{astro.wasm → dist/astro.wasm} +0 -0
  2. package/dist/browser/index.cjs +2 -0
  3. package/dist/browser/index.d.ts +11 -0
  4. package/dist/browser/index.js +1 -0
  5. package/dist/browser/utils.cjs +3 -0
  6. package/{browser → dist/browser}/utils.d.ts +10 -7
  7. package/dist/browser/utils.js +3 -0
  8. package/dist/browser/wasm_exec.cjs +2 -0
  9. package/{node → dist/browser}/wasm_exec.d.ts +3 -1
  10. package/dist/browser/wasm_exec.js +1 -0
  11. package/dist/chunk-GFDH6LQW.js +1 -0
  12. package/dist/chunk-XZNZIE5X.js +2 -0
  13. package/dist/node/index.cjs +1 -0
  14. package/dist/node/index.d.ts +12 -0
  15. package/dist/node/index.js +1 -0
  16. package/dist/node/sync.cjs +1 -0
  17. package/dist/node/sync.d.ts +16 -0
  18. package/dist/node/sync.js +1 -0
  19. package/dist/node/utils.cjs +3 -0
  20. package/{node → dist/node}/utils.d.ts +10 -7
  21. package/dist/node/utils.js +3 -0
  22. package/dist/node/wasm_exec.cjs +1 -0
  23. package/{browser → dist/node}/wasm_exec.d.ts +3 -1
  24. package/dist/node/wasm_exec.js +1 -0
  25. package/dist/shared/ast.cjs +1 -0
  26. package/dist/shared/ast.d.ts +73 -0
  27. package/dist/shared/ast.js +0 -0
  28. package/dist/shared/diagnostics.cjs +1 -0
  29. package/{shared → dist/shared}/diagnostics.d.ts +3 -1
  30. package/dist/shared/diagnostics.js +1 -0
  31. package/dist/shared/types.cjs +1 -0
  32. package/{shared → dist/shared}/types.d.ts +26 -24
  33. package/dist/shared/types.js +1 -0
  34. package/package.json +29 -15
  35. package/sync.d.ts +1 -1
  36. package/types.d.ts +1 -1
  37. package/utils.d.ts +1 -1
  38. package/CHANGELOG.md +0 -1277
  39. package/browser/index.d.ts +0 -6
  40. package/browser/index.js +0 -67
  41. package/browser/utils.js +0 -116
  42. package/browser/wasm_exec.js +0 -559
  43. package/node/index.d.ts +0 -7
  44. package/node/index.js +0 -75
  45. package/node/sync.cjs +0 -542
  46. package/node/sync.cts +0 -72
  47. package/node/sync.d.cts +0 -12
  48. package/node/utils.js +0 -116
  49. package/node/wasm_exec.js +0 -451
  50. package/shared/ast.d.ts +0 -71
  51. package/shared/ast.js +0 -1
  52. package/shared/diagnostics.js +0 -1
  53. package/shared/types.js +0 -10
package/CHANGELOG.md DELETED
@@ -1,1277 +0,0 @@
1
- # @astrojs/compiler
2
-
3
- ## 1.4.1
4
-
5
- ### Patch Changes
6
-
7
- - 0803e86: Handle crashes when using `parse` and `convertToTSX` by restarting the service
8
-
9
- ## 1.4.0
10
-
11
- ### Minor Changes
12
-
13
- - fc0f470: Implements the scopedStyleStrategy option
14
-
15
- ## 1.3.2
16
-
17
- ### Patch Changes
18
-
19
- - 19c0176: Fix TSX sourcemapping for components using Windows-style line returns
20
- - b0e0cfd: Add a sync entrypoint
21
-
22
- ## 1.3.1
23
-
24
- ### Patch Changes
25
-
26
- - e0baa85: Preserve whitespace in slots
27
-
28
- ## 1.3.0
29
-
30
- ### Minor Changes
31
-
32
- - 95a6610: Expose the `convertToTSX` function in the compiler browser bundle
33
- - 6d168dd: Add ContainsHead flag for metadata
34
-
35
- ## 1.2.2
36
-
37
- ### Patch Changes
38
-
39
- - a8a845f: Fix regression related to self-closing tags
40
-
41
- ## 1.2.1
42
-
43
- ### Patch Changes
44
-
45
- - 348840b: Fix getStaticPaths export when used with a TypeScript type ([#4929](https://github.com/withastro/astro/issues/4929))
46
- - 8ed067e: Fix parse error for multiline `export type` using Unions or Intersections
47
- - 6354e50: Improve handling of self-closing tags returned from expression
48
- - 5a5f91d: Fix `define:vars` when used with a `style` attribute
49
- - b637e9a: Fix ignored `form` elements after a `form` element that contains an expression
50
- - 2658ed4: Correctly apply style when `class` and `class:list` are both used
51
-
52
- ## 1.2.0
53
-
54
- ### Minor Changes
55
-
56
- - b2cfd00: Add teardown API to remove WASM instance after using the compiler
57
-
58
- ## 1.1.2
59
-
60
- ### Patch Changes
61
-
62
- - 2de6128: Preserve namespaced attributes when using expressions
63
- - af13f2d: Fix incorrect `convertToTSX` types. The function accepts `filename`, not `sourcefile`.
64
- - 5eb4fff: Compile `set:html` and `set:text` quoted and template literal attributes as strings
65
-
66
- ## 1.1.1
67
-
68
- ### Patch Changes
69
-
70
- - 6765f01: Fix attributes starting with : not being properly transformed in the TSX output
71
-
72
- ## 1.1.0
73
-
74
- ### Minor Changes
75
-
76
- - a75824d: Allow passing through result to slot call
77
-
78
- ## 1.0.2
79
-
80
- ### Patch Changes
81
-
82
- - 0c27f3f: Collapse multiple trailing text nodes if present
83
-
84
- ## 1.0.1
85
-
86
- ### Patch Changes
87
-
88
- - 94b2c02: Prevent insertion of maybeRenderHead on hoisted scripts
89
-
90
- ## 1.0.0
91
-
92
- ### Major Changes
93
-
94
- - 8e86bc6: The Astro compiler is officially stable! This release is entirely ceremonial, the code is the same as [`@astrojs/compiler@0.33.0`](https://github.com/withastro/compiler/releases/tag/%40astrojs%2Fcompiler%400.33.0)
95
-
96
- ## 0.33.0
97
-
98
- ### Minor Changes
99
-
100
- - 1adac72: Improve error recovery when using the `transform` function. The compiler will now properly reject the promise with a useful message and stacktrace rather than print internal errors to stdout.
101
-
102
- ### Patch Changes
103
-
104
- - 68d3c0c: Fix edge case where `export type` could hang the compiler
105
- - ec1ddf0: Handle edge case with TypeScript generics handling and our TSX output
106
- - 23d1fc0: Ignore trailing whitespace in components
107
-
108
- ## 0.32.0
109
-
110
- ### Minor Changes
111
-
112
- - 2404848: Remove `pathname` option in favour of `sourcefile` option
113
- - 2ca86f6: Remove `site` and `projectRoot` options in favour of the `astroGlobalArgs` option
114
- - edd3e0e: Merge `sourcefile` and `moduleId` options as a single `filename` option. Add a new `normalizedFilename` option to generate stable hashes instead.
115
- - 08843bd: Remove `experimentalStaticExtraction` option. It is now the default.
116
-
117
- ## 0.31.4
118
-
119
- ### Patch Changes
120
-
121
- - 960b853: Rename `SerializeOtions` interface to `SerializeOptions`
122
- - fcab891: Fixes export hoisting edge case
123
- - 47de01a: Handle module IDs containing quotes
124
-
125
- ## 0.31.3
126
-
127
- ### Patch Changes
128
-
129
- - fd5cb57: Rollback https://github.com/withastro/compiler/pull/674
130
-
131
- ## 0.31.2
132
-
133
- ### Patch Changes
134
-
135
- - 89c0cee: fix: corner case that component in head expression will case body tag missing
136
- - 20497f4: Improve fidelity of sourcemaps for frontmatter
137
-
138
- ## 0.31.1
139
-
140
- ### Patch Changes
141
-
142
- - 24dcf7e: Allow `script` and `style` before HTML
143
- - ef391fa: fix: corner case with slot expression in head will cause body tag missing
144
-
145
- ## 0.31.0
146
-
147
- ### Minor Changes
148
-
149
- - abdddeb: Update Go to 1.19
150
-
151
- ## 0.30.1
152
-
153
- ### Patch Changes
154
-
155
- - ff9e7ba: Fix edge case where `<` was not handled properly inside of expressions
156
- - f31d535: Fix edge case with Prop detection for TSX output
157
-
158
- ## 0.30.0
159
-
160
- ### Minor Changes
161
-
162
- - 963aaab: Provide the moduleId of the astro component
163
-
164
- ## 0.29.19
165
-
166
- ### Patch Changes
167
-
168
- - 3365233: Replace internal tokenizer state logs with proper warnings
169
-
170
- ## 0.29.18
171
-
172
- ### Patch Changes
173
-
174
- - 80de395: fix: avoid nil pointer dereference in table parsing
175
- - aa3ad9d: Fix `parse` output to properly account for the location of self-closing tags
176
- - b89dec4: Internally, replace `astro.ParseFragment` in favor of `astro.ParseFragmentWithOptions`. We now check whether an error handler is passed when calling `astro.ParseFragmentWithOptions`
177
-
178
- ## 0.29.17
179
-
180
- ### Patch Changes
181
-
182
- - 1e7e098: Add warning for invalid spread attributes
183
- - 3cc6f55: Fix handling of unterminated template literal attributes
184
- - 48c5677: Update default `internalURL` to `astro/runtime/server/index.js`
185
- - 2893f33: Fix a number of `table` and `expression` related bugs
186
-
187
- ## 0.29.16
188
-
189
- ### Patch Changes
190
-
191
- - ec745f4: Self-closing tags will now retrieve "end" positional data
192
- - a6c2822: Fix a few TSX output errors
193
-
194
- ## 0.29.15
195
-
196
- ### Patch Changes
197
-
198
- - 5f6e69b: Fix expression literal handling
199
-
200
- ## 0.29.14
201
-
202
- ### Patch Changes
203
-
204
- - 6ff1d80: Fix regression introduced by https://github.com/withastro/compiler/pull/617
205
-
206
- ## 0.29.13
207
-
208
- ### Patch Changes
209
-
210
- - 8f3e488: Fix regression introduced to `parse` handling in the last patch
211
-
212
- ## 0.29.12
213
-
214
- ### Patch Changes
215
-
216
- - a41982a: Fix expression edge cases, improve literal parsing
217
-
218
- ## 0.29.11
219
-
220
- ### Patch Changes
221
-
222
- - ee907f1: Fix #5308, duplicate style bug when using `define:vars`
223
-
224
- ## 0.29.10
225
-
226
- ### Patch Changes
227
-
228
- - 07a65df: Print `\r` when printing TSX output
229
- - 1250d0b: Add warning when `define:vars` won't work because of compilation limitations
230
-
231
- ## 0.29.9
232
-
233
- ### Patch Changes
234
-
235
- - 1fe92c0: Fix TSX sourcemaps on Windows (take 4)
236
-
237
- ## 0.29.8
238
-
239
- ### Patch Changes
240
-
241
- - 01b62ea: Fix sourcemap bug on Windows (again x2)
242
-
243
- ## 0.29.7
244
-
245
- ### Patch Changes
246
-
247
- - 108c6c9: Fix TSX sourcemap bug on Windows (again)
248
-
249
- ## 0.29.6
250
-
251
- ### Patch Changes
252
-
253
- - 4b3fafa: Fix TSX sourcemaps on Windows
254
-
255
- ## 0.29.5
256
-
257
- ### Patch Changes
258
-
259
- - 73a2b69: Use an IIFE for define:vars scripts
260
-
261
- ## 0.29.4
262
-
263
- ### Patch Changes
264
-
265
- - 4381efa: Return proper diagnostic code for warnings
266
-
267
- ## 0.29.3
268
-
269
- ### Patch Changes
270
-
271
- - 85e1d31: AST: move `start` position of elements to the first index of their opening tag
272
-
273
- ## 0.29.2
274
-
275
- ### Patch Changes
276
-
277
- - 035829b: AST: move end position of elements to the last index of their end tag
278
-
279
- ## 0.29.1
280
-
281
- ### Patch Changes
282
-
283
- - a99c014: Ensure comment and text nodes have end positions when generating an AST from `parse`
284
-
285
- ## 0.29.0
286
-
287
- ### Minor Changes
288
-
289
- - fd2fc28: Fix some utf8 compatibility issues
290
-
291
- ### Patch Changes
292
-
293
- - 4b68670: TSX: fix edge case with spread attribute printing
294
- - 6b204bd: Fix bug with trailing `style` tags being moved into the `html` element
295
- - 66fe230: Fix: include element end location in `parse` AST
296
-
297
- ## 0.28.1
298
-
299
- ### Patch Changes
300
-
301
- - aac8c89: Fix end tag sourcemappings for TSX mode
302
- - d7f3288: TSX: Improve self-closing tag behavior and mappings
303
- - 75dd7cc: Fix spread attribute mappings
304
-
305
- ## 0.28.0
306
-
307
- ### Minor Changes
308
-
309
- - 5da0dc2: Add `resolvePath` option to control hydration path resolution
310
- - e816a61: Remove metadata export if `resolvePath` option provided
311
-
312
- ## 0.27.2
313
-
314
- ### Patch Changes
315
-
316
- - 959f96b: Fix "missing sourcemap" issue
317
- - 94f6f3e: Fix edge case with multi-line comment usage
318
- - 85a654a: Fix `parse` causing a compiler panic when a component with a client directive was imported but didn't have a matching import
319
- - 5e32cbe: Improvements to TSX output
320
-
321
- ## 0.27.1
322
-
323
- ### Patch Changes
324
-
325
- - cc9f174: fixed regression caused by #546
326
-
327
- ## 0.27.0
328
-
329
- ### Minor Changes
330
-
331
- - c770e7b: The compiler will now return `diagnostics` and unique error codes to be handled by the consumer. For example:
332
-
333
- ```js
334
- import type { DiagnosticSeverity, DiagnosticCode } from '@astrojs/compiler/types';
335
- import { transform } from '@astrojs/compiler';
336
-
337
- async function run() {
338
- const { diagnostics } = await transform(file, opts);
339
-
340
- function log(severity: DiagnosticSeverity, message: string) {
341
- switch (severity) {
342
- case DiagnosticSeverity.Error:
343
- return console.error(message);
344
- case DiagnosticSeverity.Warning:
345
- return console.warn(message);
346
- case DiagnosticSeverity.Information:
347
- return console.info(message);
348
- case DiagnosticSeverity.Hint:
349
- return console.info(message);
350
- }
351
- }
352
-
353
- for (const diagnostic of diagnostics) {
354
- let message = diagnostic.text;
355
- if (diagnostic.hint) {
356
- message += `\n\n[hint] ${diagnostic.hint}`;
357
- }
358
-
359
- // Or customize messages for a known DiagnosticCode
360
- if (diagnostic.code === DiagnosticCode.ERROR_UNMATCHED_IMPORT) {
361
- message = `My custom message about an unmatched import!`;
362
- }
363
- log(diagnostic.severity, message);
364
- }
365
- }
366
- ```
367
-
368
- ### Patch Changes
369
-
370
- - 0b24c24: Implement automatic typing for Astro.props in the TSX output
371
-
372
- ## 0.26.1
373
-
374
- ### Patch Changes
375
-
376
- - 920898c: Handle edge case with `noscript` tags
377
- - 8ee78a6: handle slots that contains the head element
378
- - 244e43e: Do not hoist import inside object
379
- - b8cd954: Fix edge case with line comments and export hoisting
380
- - 52ebfb7: Fix parse/tsx output to gracefully handle invalid HTML (style outside of body, etc)
381
- - 884efc6: Fix edge case with multi-line export hoisting
382
-
383
- ## 0.26.0
384
-
385
- ### Minor Changes
386
-
387
- - 0be58ab: Improve sourcemap support for TSX output
388
-
389
- ### Patch Changes
390
-
391
- - e065e29: Prevent head injection from removing script siblings
392
-
393
- ## 0.25.2
394
-
395
- ### Patch Changes
396
-
397
- - 3a51b8e: Ensure that head injection occurs if there is only a hoisted script
398
-
399
- ## 0.25.1
400
-
401
- ### Patch Changes
402
-
403
- - 41fae67: Do not scope empty style blocks
404
- - 1ab8280: fix(#517): fix edge case with TypeScript transform
405
- - a3678f9: Fix import.meta.env usage above normal imports
406
-
407
- ## 0.25.0
408
-
409
- ### Minor Changes
410
-
411
- - 6446ea3: Make Astro styles being printed after user imports
412
-
413
- ### Patch Changes
414
-
415
- - 51bc60f: Fix edge cases with `getStaticPaths` where valid JS syntax was improperly handled
416
-
417
- ## 0.24.0
418
-
419
- ### Minor Changes
420
-
421
- - 6ebcb4f: Allow preprocessStyle to return an error
422
-
423
- ### Patch Changes
424
-
425
- - abda605: Include filename when calculating scope
426
-
427
- ## 0.23.5
428
-
429
- ### Patch Changes
430
-
431
- - 6bc8e0b: Prevent import assertion from being scanned too soon
432
-
433
- ## 0.23.4
434
-
435
- ### Patch Changes
436
-
437
- - 3b9f0d2: Remove css print escape for experimentalStaticExtraction
438
-
439
- ## 0.23.3
440
-
441
- ### Patch Changes
442
-
443
- - 7693d76: Fix resolution of .jsx modules
444
-
445
- ## 0.23.2
446
-
447
- ### Patch Changes
448
-
449
- - 167ad21: Improve handling of namespaced components when they are multiple levels deep
450
- - 9283258: Fix quotations in pre-quoted attributes
451
- - 76fcef3: Better handling for imports which use special characters
452
-
453
- ## 0.23.1
454
-
455
- ### Patch Changes
456
-
457
- - 79376f3: Fix regression with expression rendering
458
-
459
- ## 0.23.0
460
-
461
- ### Minor Changes
462
-
463
- - d8448e2: Prevent printing the doctype in the JS output
464
-
465
- ### Patch Changes
466
-
467
- - a28c3d8: Fix handling of unbalanced quotes in expression attributes
468
- - 28d1d4d: Fix handling of TS generics inside of expressions
469
- - 356d3b6: Prevent wrapping module scripts with scope
470
-
471
- ## 0.22.1
472
-
473
- ### Patch Changes
474
-
475
- - 973103c: Prevents unescaping attribute expressions
476
-
477
- ## 0.22.0
478
-
479
- ### Minor Changes
480
-
481
- - 558c9dd: Generate a stable scoped class that does _NOT_ factor in local styles. This will allow us to safely do style HMR without needing to update the DOM as well.
482
- - c19cd8c: Update Astro's CSS scoping algorithm to implement zero-specificity scoping, according to [RFC0012](https://github.com/withastro/rfcs/blob/main/proposals/0012-scoped-css-with-preserved-specificity.md).
483
-
484
- ## 0.21.0
485
-
486
- ### Minor Changes
487
-
488
- - 8960d82: New handling for `define:vars` scripts and styles
489
-
490
- ### Patch Changes
491
-
492
- - 4b318d5: Do not attempt to hoist styles or scripts inside of `<noscript>`
493
- - d6ebab6: Fixing missing semicolon on TSX Frontmatter last-entries
494
-
495
- ## 0.20.0
496
-
497
- ### Minor Changes
498
-
499
- - 48d33ff: Removes compiler special casing for the Markdown component
500
- - 4a5352e: Removes limitation where imports/exports must be at the top of an `.astro` file. Fixes various edge cases around `getStaticPaths` hoisting.
501
-
502
- ### Patch Changes
503
-
504
- - 245d73e: Add support for HTML minification by passing `compact: true` to `transform`.
505
- - 3ecdd24: Update TSX output to also generate TSX-compatible code for attributes containing dots
506
-
507
- ## 0.19.0
508
-
509
- ### Minor Changes
510
-
511
- - fcb4834: Removes fallback for the site configuration
512
-
513
- ### Patch Changes
514
-
515
- - 02add77: Fixes many edge cases around tables when used with components, slots, or expressions
516
- - b23dd4d: Fix handling of unmatched close brace in template literals
517
- - 9457a91: Fix issue with `{` in template literal attributes
518
- - c792161: Fix nested expression handling with a proper expression tokenizer stack
519
-
520
- ## 0.18.2
521
-
522
- ### Patch Changes
523
-
524
- - f8547a7: Revert [#448](https://github.com/withastro/compiler/pull/448) for now
525
-
526
- ## 0.18.1
527
-
528
- ### Patch Changes
529
-
530
- - aff2f23: Warning on client: usage on scripts
531
-
532
- ## 0.18.0
533
-
534
- ### Minor Changes
535
-
536
- - 4b02776: Fix handling of `slot` attribute used inside of expressions
537
-
538
- ### Patch Changes
539
-
540
- - 62d2a8e: Properly handle nested expressions that return multiple elements
541
- - 571d6b9: Ensure `html` and `body` elements are scoped
542
-
543
- ## 0.17.1
544
-
545
- ### Patch Changes
546
-
547
- - 3885217: Support `<slot is:inline />` and preserve slot attribute when not inside component
548
- - ea94a26: Fix issue with fallback content inside of slots
549
-
550
- ## 0.17.0
551
-
552
- ### Minor Changes
553
-
554
- - 3a9d166: Add renderHead injection points
555
-
556
- ## 0.16.1
557
-
558
- ### Patch Changes
559
-
560
- - 9fcc43b: Build JS during the release
561
-
562
- ## 0.16.0
563
-
564
- ### Minor Changes
565
-
566
- - 470efc0: Adds component metadata to the TransformResult
567
-
568
- ### Patch Changes
569
-
570
- - c104d4f: Fix #418: duplicate text when only text
571
-
572
- ## 0.15.2
573
-
574
- ### Patch Changes
575
-
576
- - f951822: Fix wasm `parse` to save attribute namespace
577
- - 5221e09: Fix serialize spread attribute
578
-
579
- ## 0.15.1
580
-
581
- ### Patch Changes
582
-
583
- - 26cbcdb: Prevent side-effectual CSS imports from becoming module metadata
584
-
585
- ## 0.15.0
586
-
587
- ### Minor Changes
588
-
589
- - 702e848: Trailing space at the end of Astro files is now stripped from Component output.
590
-
591
- ### Patch Changes
592
-
593
- - 3a1a24b: Fix long-standing bug where a `class` attribute inside of a spread prop will cause duplicate `class` attributes
594
- - 62faceb: Fixes an issue where curly braces in `<math>` elements would get parsed as expressions instead of raw text.
595
-
596
- ## 0.14.3
597
-
598
- ### Patch Changes
599
-
600
- - 6177620: Fix edge case with expressions inside of tables
601
- - 79b1ed6: Provides a better error message when we can't match client:only usage to an import statement
602
- - a4e1957: Fix Astro scoping when `class:list` is used
603
- - fda859a: Fix json escape
604
-
605
- ## 0.14.2
606
-
607
- ### Patch Changes
608
-
609
- - 6f30e2e: Fix edge case with nested expression inside `<>`
610
- - 15e3ff8: Fix panic when using a `<slot />` in `head`
611
- - c048567: Fix edge case with `select` elements and expression children
612
- - 13d2fc2: Fix #340, fixing behavior of content after an expression inside of `<select>`
613
- - 9e37a72: Fix issue when multiple client-only components are used
614
- - 67993d5: Add support for block comment only expressions, block comment only shorthand attributes and block comments in shorthand attributes
615
- - 59fbea2: Fix #343, edge case with `<tr>` inside component
616
- - 049dadf: Fix usage of expressions inside `caption` and `colgroup` elements
617
-
618
- ## 0.14.1
619
-
620
- ### Patch Changes
621
-
622
- - 1a82892: Fix bug with `<script src>` not being hoisted
623
-
624
- ## 0.14.0
625
-
626
- ### Minor Changes
627
-
628
- - c0da4fe: Implements [RFC0016](https://github.com/withastro/rfcs/blob/main/proposals/0016-style-script-defaults.md), the new `script` and `style` behavior.
629
-
630
- ## 0.13.2
631
-
632
- ### Patch Changes
633
-
634
- - 014370d: Fix issue with named slots in <head> element
635
- - da831c1: Fix handling of RegExp literals in frontmatter
636
-
637
- ## 0.13.1
638
-
639
- ### Patch Changes
640
-
641
- - 2f8334c: Update `parse` and `serialize` functions to combine `attributes` and `directives`, fix issue with `serialize` not respecting `attributes`.
642
- - b308955: Add self-close option to serialize util
643
-
644
- ## 0.13.0
645
-
646
- ### Minor Changes
647
-
648
- - ce3f1a5: Update CSS parser to use `esbuild`, adding support for CSS nesting, `@container`, `@layer`, and other modern syntax features
649
-
650
- ### Patch Changes
651
-
652
- - 24a1185: Parser: Always output the `children` property in an element node, even if it has no children
653
-
654
- ## 0.12.1
655
-
656
- ### Patch Changes
657
-
658
- - 097ac47: Parser: Always output the `attribute` property in an element node, even if empty
659
- - ad62437: Add `serialize` util
660
- - eb7eb95: Parse: fix escaping of `&` characters in AST output
661
-
662
- ## 0.12.0
663
-
664
- ### Minor Changes
665
-
666
- - c6dd41d: Do not render implicit tags created during the parsing process
667
- - c6dd41d: Remove "as" option, treats all documents as fragments that generate no implicit tags
668
- - c6dd41d: Add `parse` function which generates an AST
669
- - c6dd41d: Adds support for `Astro.self` (as accepted in the [Recursive Components RFC](https://github.com/withastro/rfcs/blob/main/active-rfcs/0000-recursive-components.md)).
670
-
671
- ### Patch Changes
672
-
673
- - c6dd41d: Add `fragment` node types to AST definitions, expose Fragment helper to utils
674
- - c6dd41d: Adds metadata on client:only components
675
- - c6dd41d: Expose AST types via `@astrojs/compiler/types`
676
- - c6dd41d: Export `./types` rather than `./types.d.ts`
677
- - c6dd41d: Fix edge case with Fragment parsing in head, add `fragment` node to AST output
678
- - c6dd41d: Fix <slot> behavior inside of head
679
- - c6dd41d: Improve head injection behavior
680
- - ef0b4b3: Move `typescript` dependency to development dependencies, as it is not needed in the package runtime.
681
- - c6dd41d: Update exposed types
682
- - c6dd41d: Remove usage of `escapeHTML` util
683
- - c6dd41d: Export all types from shared types
684
- - c6dd41d: Fix `head` behavior and a bug related to ParseFragment
685
- - c6dd41d: Adds a warning when using an expression with a hoisted script
686
-
687
- ## 0.12.0-next.9
688
-
689
- ### Patch Changes
690
-
691
- - 95ec808: Fix <slot> behavior inside of head
692
- - 95ec808: Remove usage of `escapeHTML` util
693
-
694
- ## 0.12.0-next.8
695
-
696
- ### Patch Changes
697
-
698
- - 4497628: Improve head injection behavior
699
-
700
- ## 0.12.0-next.7
701
-
702
- ### Patch Changes
703
-
704
- - e26b9d6: Fix edge case with Fragment parsing in head, add `fragment` node to AST output
705
-
706
- ## 0.12.0-next.6
707
-
708
- ### Patch Changes
709
-
710
- - 37ef1c1: Fix `head` behavior and a bug related to ParseFragment
711
-
712
- ## 0.12.0-next.5
713
-
714
- ### Patch Changes
715
-
716
- - 97cf66b: Adds metadata on client:only components
717
-
718
- ## 0.12.0-next.4
719
-
720
- ### Patch Changes
721
-
722
- - e2061dd: Export all types from shared types
723
-
724
- ## 0.12.0-next.3
725
-
726
- ### Patch Changes
727
-
728
- - ef69b74: Export `./types` rather than `./types.d.ts`
729
-
730
- ## 0.12.0-next.2
731
-
732
- ### Patch Changes
733
-
734
- - 073b0f1: Adds a warning when using an expression with a hoisted script
735
-
736
- ## 0.12.0-next.1
737
-
738
- ### Patch Changes
739
-
740
- - a539d53: Update exposed types
741
-
742
- ## 0.12.0-next.0
743
-
744
- ### Minor Changes
745
-
746
- - 8ce39c7: Do not render implicit tags created during the parsing process
747
- - 41b825a: Remove "as" option, treats all documents as fragments that generate no implicit tags
748
- - 483b34b: Add `parse` function which generates an AST
749
- - 9e5e2f8: Adds support for `Astro.self` (as accepted in the [Recursive Components RFC](https://github.com/withastro/rfcs/blob/main/active-rfcs/0000-recursive-components.md)).
750
-
751
- ### Patch Changes
752
-
753
- - 16b167c: Expose AST types via `@astrojs/compiler/types`
754
-
755
- ## 0.11.4
756
-
757
- ### Patch Changes
758
-
759
- - 99b5de2: Reset tokenizer state when a raw element that is self-closing is encountered.
760
-
761
- This fixes the handling of self-closing elements like `<title />` and `<script />` when used with `set:html`.
762
-
763
- ## 0.11.3
764
-
765
- ### Patch Changes
766
-
767
- - dcf15bf: Fixes bug causing a crash when using Astro.resolve on a hoisted script
768
-
769
- ## 0.11.2
770
-
771
- ### Patch Changes
772
-
773
- - 41cc6ef: Fix memory issue caused by duplicate WASM instantiations
774
-
775
- ## 0.11.1
776
-
777
- ### Patch Changes
778
-
779
- - 4039682: Fixes hoist script tracking when passed a variable
780
-
781
- ## 0.11.0
782
-
783
- ### Minor Changes
784
-
785
- - f5d4006: Switch from TinyGo to Go's built-in WASM output. While this is an unfortunate size increase for our `.wasm` file, it should also be significantly more stable and cut down on hard-to-reproduce bugs.
786
-
787
- Please see https://github.com/withastro/compiler/pull/291 for more details.
788
-
789
- ## 0.11.0-next--wasm.0
790
-
791
- ### Minor Changes
792
-
793
- - 9212ccc: Switch from TinyGo to Go's built-in WASM output. While this is an unfortunate size increase for our `WASM` file, it should also be significantly more stable and cut down on hard-to-reproduce bugs.
794
-
795
- Please see https://github.com/withastro/compiler/pull/291 for more details.
796
-
797
- ## 0.10.2
798
-
799
- ### Patch Changes
800
-
801
- - 7f7c65c: Fix conditional rendering for special elements like `iframe` and `noscript`
802
- - 9d789c9: Fix handling of nested template literals inside of expressions
803
- - 5fa9e53: Fix handling of special characters inside of expressions
804
- - 8aaa956: Formalize support for magic `data-astro-raw` attribute with new, official `is:raw` directive
805
- - c698350: Improve MathML support. `{}` inside of `<math>` is now treated as raw text rather than an expression construct.
806
-
807
- ## 0.10.1
808
-
809
- ### Patch Changes
810
-
811
- - 38ae39a: Add support for `set:html` and `set:text` directives, as designed in the [`set:html` RFC](https://github.com/withastro/rfcs/blob/main/active-rfcs/0000-set-html.md).
812
-
813
- ## 0.10.0
814
-
815
- ### Minor Changes
816
-
817
- - 02d41a8: Adds support for `Astro.self` (as accepted in the [Recursive Components RFC](https://github.com/withastro/rfcs/blob/main/active-rfcs/0000-recursive-components.md)).
818
-
819
- ### Patch Changes
820
-
821
- - 4fe522b: Fixes inclusion of define:vars scripts/styles using the StaticExtraction flag
822
-
823
- ## 0.9.2
824
-
825
- ### Patch Changes
826
-
827
- - 92cc76b: Fix wasm build for use in Astro
828
-
829
- ## 0.9.1
830
-
831
- ### Patch Changes
832
-
833
- - 85d35a5: Revert previous change that broke Windows
834
-
835
- ## 0.9.0
836
-
837
- ### Minor Changes
838
-
839
- - c1a0172: changing raw_with_expression_loop in tokenizer to only handle string that has '`' differently otherwise it should treat it as normal string
840
-
841
- ### Patch Changes
842
-
843
- - 1fa2162: Improved types for TransformResult with hoisted scripts
844
-
845
- ## 0.8.2
846
-
847
- ### Patch Changes
848
-
849
- - 502f8b8: Adds a new property, `scripts`, to `TransformResult`
850
-
851
- ## 0.8.1
852
-
853
- ### Patch Changes
854
-
855
- - cd277e2: Fix bug with data-astro-raw detection
856
-
857
- ## 0.8.0
858
-
859
- ### Minor Changes
860
-
861
- - 3690968: Passes the Pathname to createAstro instead of import.meta.url
862
-
863
- ## 0.7.4
864
-
865
- ### Patch Changes
866
-
867
- - afc1e82: Remove console log (sorry!)
868
-
869
- ## 0.7.3
870
-
871
- ### Patch Changes
872
-
873
- - cc24069: Fix some edge cases with expressions inside of `<table>` elements
874
- - 086275c: Fix edge case with textarea inside expression
875
-
876
- ## 0.7.2
877
-
878
- ### Patch Changes
879
-
880
- - 899e48d: Fix issue with active formatting elements by marking expressions as unique scopes
881
-
882
- ## 0.7.1
883
-
884
- ### Patch Changes
885
-
886
- - fa039dd: Fix tokenization of attribute expression containing the solidus (`/`) character
887
- - e365c3c: Fix bug with expressions inside of <table> elements (without reverting a previous fix to expressions inside of <a> elements)
888
- - 7c5889f: Fix bug with `@keyframes` scoping
889
- - df74ab3: Fix bug where named grid columns (like `[content-start]`) would be scoped, producing invalid CSS
890
- - abe37ca: Fix handling of components and expressions inside of `<noscript>`
891
- - 8961cf4: Fix a logical error with expression tokenization when using nested functions. Previously, only the first brace pair would be respected and following pairs would be treated as expression boundaries.
892
-
893
- ## 0.7.0
894
-
895
- ### Minor Changes
896
-
897
- - 43cbac3: Adds metadata on hydration directives used by the component
898
-
899
- ## 0.6.2
900
-
901
- ### Patch Changes
902
-
903
- - e785310: Fix issue with import assertions creating additional imports
904
-
905
- ## 0.6.1
906
-
907
- ### Patch Changes
908
-
909
- - e40ea9c: Include LICENSE information
910
-
911
- ## 0.6.0
912
-
913
- ### Minor Changes
914
-
915
- - b9e2b4b: Adds option to make CSS be extracted statically
916
-
917
- ## 0.5.7
918
-
919
- ### Patch Changes
920
-
921
- - 75bd730: Fix regression with Components mixed with active formatting elements
922
-
923
- ## 0.5.6
924
-
925
- ### Patch Changes
926
-
927
- - 7ca419e: Improve behavior of empty expressions in body and attributes, where `{}` is equivalent to `{(void 0)}`
928
-
929
- ## 0.5.5
930
-
931
- ### Patch Changes
932
-
933
- - 7a41d7b: Fix `<>` syntax edge case inside of expressions
934
- - b0d35b9: Fix edge case with conditional scripts
935
-
936
- ## 0.5.4
937
-
938
- ### Patch Changes
939
-
940
- - f2e0322: Do not reconstruct active formatting elements on expression start
941
- - 0103285: Bugfix: expressions in table context
942
-
943
- ## 0.5.3
944
-
945
- ### Patch Changes
946
-
947
- - 50cbc57: Fix fragment expression behavior edge case
948
-
949
- ## 0.5.2
950
-
951
- ### Patch Changes
952
-
953
- - 8f0e3d7: Fix fragment parsing bugs when frontmatter is missing or top-level expressions are present
954
-
955
- ## 0.5.1
956
-
957
- ### Patch Changes
958
-
959
- - 1f0ba41: Fix bug when fragment parsing frontmatter is missing
960
-
961
- ## 0.5.0
962
-
963
- ### Minor Changes
964
-
965
- - 901faef: Passes projectRoot to createAstro
966
-
967
- ## 0.4.0
968
-
969
- ### Minor Changes
970
-
971
- - 7e1aded: Change behavior of `as: "fragment"` option to support arbitrary `head` and `body` tags
972
-
973
- ## 0.3.9
974
-
975
- ### Patch Changes
976
-
977
- - 2884a82: Bugfix: CSS comments insert semicolon
978
-
979
- ## 0.3.8
980
-
981
- ### Patch Changes
982
-
983
- - 2c8f5d8: Fix another component-only edge case
984
-
985
- ## 0.3.7
986
-
987
- ### Patch Changes
988
-
989
- - eb0d17f: Fix edge case with files that contain a single component
990
-
991
- ## 0.3.6
992
-
993
- ### Patch Changes
994
-
995
- - af003e9: Fix syntax error in transformed output
996
-
997
- ## 0.3.5
998
-
999
- ### Patch Changes
1000
-
1001
- - bca7e00: Fixed issue where an Astro Components could only add one style or script
1002
- - 2a2f951: Fix regression where leading `<style>` elements could break generated tags
1003
- - db162f8: Fix case-sensitivity of void elements
1004
- - 44ee189: Fixed issue where expressions did not work within SVG elements
1005
- - 9557113: Fix panic when preprocessed style is empty
1006
-
1007
- ## 0.3.4
1008
-
1009
- ### Patch Changes
1010
-
1011
- - 351f298: Fix edge case with with `textarea` inside of a Component when the document generated an implicit `head` tag
1012
- - 0bcfd4b: Fix CSS scoping of \* character inside of calc() expressions
1013
- - 4be512f: Encode double quotes inside of quoted attributes
1014
- - ad865e5: Fix behavior of expressions inside of <table> elements
1015
-
1016
- ## 0.3.3
1017
-
1018
- ### Patch Changes
1019
-
1020
- - 6d2a3c2: Fix handling of top-level component nodes with leading styles
1021
- - 2ce10c6: Fix "call to released function" issue
1022
-
1023
- ## 0.3.2
1024
-
1025
- ### Patch Changes
1026
-
1027
- - 8800f80: Fix comments and strings inside of attribute expressions
1028
-
1029
- ## 0.3.1
1030
-
1031
- ### Patch Changes
1032
-
1033
- - 432eaaf: Fix for compiler regression causing nil pointer
1034
-
1035
- ## 0.3.0
1036
-
1037
- ### Minor Changes
1038
-
1039
- - 1255477: Drop support for elements inside of Frontmatter, which was undefined behavior that caused lots of TypeScript interop problems
1040
-
1041
- ### Patch Changes
1042
-
1043
- - 44dc0c6: Fixes issue with \x00 character on OSX
1044
- - d74acfa: Fix regression with expressions inside of <select> elements
1045
- - f50ae69: Bugfix: don’t treat import.meta as import statement
1046
-
1047
- ## 0.2.27
1048
-
1049
- ### Patch Changes
1050
-
1051
- - 460c1e2: Use `$metadata.resolvePath` utility to support the `client:only` directive
1052
-
1053
- ## 0.2.26
1054
-
1055
- ### Patch Changes
1056
-
1057
- - 3e5ef91: Implement getStaticPaths hoisting
1058
- - 8a434f9: Fix namespace handling to support attributes like `xmlns:xlink`
1059
-
1060
- ## 0.2.25
1061
-
1062
- ### Patch Changes
1063
-
1064
- - 59f36cb: Fix custom-element slot behavior to remain spec compliant
1065
- - 79b2e6f: Fix style/script ordering
1066
- - 6041ee5: Add support for `client:only` directive
1067
- - 2cd35f6: Fix apostrophe handling inside of elements which are inside of expressions ([#1478](https://github.com/snowpackjs/astro/issues/1478))
1068
-
1069
- ## 0.2.24
1070
-
1071
- ### Patch Changes
1072
-
1073
- - bfd1b94: Fix issue with `style` and `script` processing where siblings would be skipped
1074
- - 726d272: Fix <Fragment> and <> handling
1075
- - f052465: Fix CSS variable parsing in the scoped CSS transform
1076
-
1077
- ## 0.2.23
1078
-
1079
- ### Patch Changes
1080
-
1081
- - 632c29b: Fix nil pointer dereference when every element on page is a component
1082
- - 105a159: Fix bug where text inside of elements inside of an expression was not read properly (https://github.com/snowpackjs/astro/issues/1617)
1083
-
1084
- ## 0.2.22
1085
-
1086
- ### Patch Changes
1087
-
1088
- - 04c1b63: Fix bug with dynamic classes
1089
-
1090
- ## 0.2.21
1091
-
1092
- ### Patch Changes
1093
-
1094
- - 7b46e9f: Revert automatic DOCTYPE injection to fix package
1095
-
1096
- ## 0.2.20
1097
-
1098
- ### Patch Changes
1099
-
1100
- - 39298e4: Fix small bugs with script/style hoisting behavior
1101
- - bd1014a: Bugfix: style tags in SVG
1102
-
1103
- ## 0.2.19
1104
-
1105
- ### Patch Changes
1106
-
1107
- - 318dd69: Fix handling of self-closing "raw" tags like <script /> and <style />
1108
- - 9372c10: Support `define:vars` with root `html` element on pages
1109
- - c4491cd: Fix bug with <script define:vars> when not using the `hoist` attribute
1110
-
1111
- ## 0.2.18
1112
-
1113
- ### Patch Changes
1114
-
1115
- - 2f4b772: Prevents overrunning an array when checking for raw attribute
1116
-
1117
- ## 0.2.17
1118
-
1119
- ### Patch Changes
1120
-
1121
- - 4f9155a: Bugfix: fix character limit of 4096 characters
1122
- - 83df04c: Upgrade to Go 1.17
1123
-
1124
- ## 0.2.16
1125
-
1126
- ### Patch Changes
1127
-
1128
- - 9ad8da7: Allows a data-astro-raw attr to parse children as raw text
1129
- - 61b77de: Bugfix: CSS and selector scoping
1130
-
1131
- ## 0.2.15
1132
-
1133
- ### Patch Changes
1134
-
1135
- - 8fbae5e: Bugfix: fix component detection bug in parser
1136
- - 37b5b6e: Bugfix: wait to release processStyle() until after fn call
1137
-
1138
- ## 0.2.14
1139
-
1140
- ### Patch Changes
1141
-
1142
- - f59c886: Bugfix: allow for detection of void tags (e.g. <img>)
1143
- - 4c8d14a: Fixes textContent containing a forward slash
1144
-
1145
- ## 0.2.13
1146
-
1147
- ### Patch Changes
1148
-
1149
- - f262b61: Fix for string template usage within expressions
1150
-
1151
- ## 0.2.12
1152
-
1153
- ### Patch Changes
1154
-
1155
- - c9fa9eb: Fix for apostrophe within elements
1156
-
1157
- ## 0.2.11
1158
-
1159
- ### Patch Changes
1160
-
1161
- - 27629b2: Reverts the apostrophe change that broke markdown parsing
1162
-
1163
- ## 0.2.10
1164
-
1165
- ### Patch Changes
1166
-
1167
- - 57eb728: Fixes hydrated scripts not recognized when using fragment transformation
1168
-
1169
- ## 0.2.9
1170
-
1171
- ### Patch Changes
1172
-
1173
- - 3ea8d8c: Fix for string interpolation within titles
1174
- - ef7cb1e: Fixes bug with textContent containing apostrophe character
1175
-
1176
- ## 0.2.8
1177
-
1178
- ### Patch Changes
1179
-
1180
- - b2d5564: Fixes wasm build
1181
-
1182
- ## 0.2.6
1183
-
1184
- ### Patch Changes
1185
-
1186
- - fix small issue with `preprocessStyle` handling of `null` or `undefined`
1187
-
1188
- ## 0.2.5
1189
-
1190
- ### Patch Changes
1191
-
1192
- - Fix issue with CI deployment
1193
-
1194
- ## 0.2.4
1195
-
1196
- ### Patch Changes
1197
-
1198
- - 4410c5a: Add support for a `preprocessStyle` function
1199
- - 934e6a6: Chore: add linting, format code
1200
-
1201
- ## 0.1.15
1202
-
1203
- ### Patch Changes
1204
-
1205
- - 5c02abf: Fix split so it always splits on first non-import/export
1206
- - 93c1cd9: Bugfix: handle RegExp in Astro files
1207
- - 94c59fa: Bugfix: tokenizer tries to parse JS comments
1208
- - 46a5c75: Adds the top-level Astro object
1209
- - 7ab9148: Improve JS scanning algorithm to be more fault tolerant, less error prone
1210
-
1211
- ## 0.1.12
1212
-
1213
- ### Patch Changes
1214
-
1215
- - 96dc356: Adds hydrationMap support for custom elements
1216
-
1217
- ## 0.1.11
1218
-
1219
- ### Patch Changes
1220
-
1221
- - 939283d: Adds the component export for use in hydration
1222
-
1223
- ## 0.1.10
1224
-
1225
- ### Patch Changes
1226
-
1227
- - 3a336ef: Adds a hydration map to enable hydration within Astro components
1228
-
1229
- ## 0.1.9
1230
-
1231
- ### Patch Changes
1232
-
1233
- - 7d887de: Allows the Astro runtime to create the Astro.slots object
1234
-
1235
- ## 0.1.8
1236
-
1237
- ### Patch Changes
1238
-
1239
- - d159658: Publish via PR
1240
-
1241
- ## 0.1.7
1242
-
1243
- ### Patch Changes
1244
-
1245
- - c52e69b: Include astro.wasm in the package
1246
-
1247
- ## 0.1.6
1248
-
1249
- ### Patch Changes
1250
-
1251
- - bd05f7c: Actually include _any_ files?
1252
-
1253
- ## 0.1.5
1254
-
1255
- ### Patch Changes
1256
-
1257
- - c4ed69e: Includes the wasm binary in the npm package
1258
-
1259
- ## 0.1.4
1260
-
1261
- ### Patch Changes
1262
-
1263
- - 2f1f1b8: Pass custom element tag names to renderComponent as strings
1264
-
1265
- ## 0.1.3
1266
-
1267
- ### Patch Changes
1268
-
1269
- - e4e2de5: Update to [`tinygo@0.20.0`](https://github.com/tinygo-org/tinygo/releases/tag/v0.20.0) and remove `go@1.16.x` restriction.
1270
- - ae71546: Add support for `fragment` compilation, to be used with components rather than pages
1271
- - 8c2aaf9: Allow multiple top-level conditional expressions
1272
-
1273
- ## 0.1.0
1274
-
1275
- ### Patch Changes
1276
-
1277
- - c9407cd: Fix for using conditionals at the top-level