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