@astrojs/compiler 0.14.0 → 0.14.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,33 @@
1
1
  # @astrojs/compiler
2
2
 
3
+ ## 0.14.3
4
+
5
+ ### Patch Changes
6
+
7
+ - 6177620: Fix edge case with expressions inside of tables
8
+ - 79b1ed6: Provides a better error message when we can't match client:only usage to an import statement
9
+ - a4e1957: Fix Astro scoping when `class:list` is used
10
+ - fda859a: Fix json escape
11
+
12
+ ## 0.14.2
13
+
14
+ ### Patch Changes
15
+
16
+ - 6f30e2e: Fix edge case with nested expression inside `<>`
17
+ - 15e3ff8: Fix panic when using a `<slot />` in `head`
18
+ - c048567: Fix edge case with `select` elements and expression children
19
+ - 13d2fc2: Fix #340, fixing behavior of content after an expression inside of `<select>`
20
+ - 9e37a72: Fix issue when multiple client-only components are used
21
+ - 67993d5: Add support for block comment only expressions, block comment only shorthand attributes and block comments in shorthand attributes
22
+ - 59fbea2: Fix #343, edge case with `<tr>` inside component
23
+ - 049dadf: Fix usage of expressions inside `caption` and `colgroup` elements
24
+
25
+ ## 0.14.1
26
+
27
+ ### Patch Changes
28
+
29
+ - 1a82892: Fix bug with `<script src>` not being hoisted
30
+
3
31
  ## 0.14.0
4
32
 
5
33
  ### Minor Changes
package/README.md CHANGED
@@ -19,6 +19,7 @@ _Note: Public APIs are likely to change before 1.0! Use at your own discretion._
19
19
  The Astro compiler can convert `.astro` syntax to a TypeScript Module whose default export generates HTML.
20
20
 
21
21
  **Some notes**...
22
+
22
23
  - TypeScript is valid `.astro` syntax! The output code may need an additional post-processing step to generate valid JavaScript.
23
24
  - `.astro` files rely on a server implementation exposed as `astro/internal` in the Node ecosystem. Other runtimes currently need to bring their own rendering implementation and reference it via `internalURL`. This is a pain point we're looking into fixing.
24
25
 
@@ -38,6 +39,7 @@ const result = await transform(source, {
38
39
  The Astro compiler can emit an AST using the `parse` method.
39
40
 
40
41
  **Some notes**...
42
+
41
43
  - Position data is currently incomplete and in some cases incorrect. We're working on it!
42
44
  - A `TextNode` can represent both HTML `text` and JavaScript/TypeScript source code.
43
45
  - The `@astrojs/compiler/utils` entrypoint exposes a `walk` function that can be used to traverse the AST. It also exposes the `is` helper which can be used as guards to derive the proper types for each `node`.
@@ -55,7 +57,7 @@ walk(result.ast, (node) => {
55
57
  if (is.tag(node)) {
56
58
  console.log(node.name);
57
59
  }
58
- })
60
+ });
59
61
  ```
60
62
 
61
63
  ## Contributing
package/astro.wasm CHANGED
Binary file
package/node/index.js CHANGED
@@ -38,7 +38,16 @@ const startRunningService = async () => {
38
38
  go.run(wasm.instance);
39
39
  const _service = globalThis['@astrojs/compiler'];
40
40
  return {
41
- transform: (input, options) => new Promise((resolve) => resolve(_service.transform(input, options || {}))),
41
+ transform: (input, options) => new Promise((resolve) => {
42
+ try {
43
+ resolve(_service.transform(input, options || {}));
44
+ }
45
+ catch (err) {
46
+ // Recreate the service next time on panic
47
+ longLivedService = void 0;
48
+ throw err;
49
+ }
50
+ }),
42
51
  parse: (input, options) => new Promise((resolve) => resolve(_service.parse(input, options || {}))).then((result) => ({ ...result, ast: JSON.parse(result.ast) })),
43
52
  };
44
53
  };
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "type": "module",
6
6
  "bugs": "https://github.com/withastro/compiler/issues",
7
7
  "homepage": "https://astro.build",
8
- "version": "0.14.0",
8
+ "version": "0.14.3",
9
9
  "scripts": {
10
10
  "build": "tsc -p ."
11
11
  },
package/types.d.ts CHANGED
@@ -1 +1 @@
1
- export * from './shared/ast'
1
+ export * from './shared/ast';