@pyreon/compiler 0.11.4 → 0.11.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -11,11 +11,14 @@ bun add @pyreon/compiler
11
11
  ## Quick Start
12
12
 
13
13
  ```ts
14
- import { transformJSX } from "@pyreon/compiler"
14
+ import { transformJSX } from '@pyreon/compiler'
15
15
 
16
- const result = transformJSX(`
16
+ const result = transformJSX(
17
+ `
17
18
  const App = () => <div class={color()}>{count()}</div>
18
- `, "app.tsx")
19
+ `,
20
+ 'app.tsx',
21
+ )
19
22
 
20
23
  console.log(result.code)
21
24
  // Dynamic expressions are wrapped: {() => count()}, class={() => color()}
@@ -26,13 +29,13 @@ console.log(result.code)
26
29
 
27
30
  The compiler transforms JSX expression containers and props so the Pyreon runtime receives reactive getters instead of eagerly-evaluated values.
28
31
 
29
- | Input | Output | Reason |
30
- |---|---|---|
31
- | `<div>{expr}</div>` | `<div>{() => expr}</div>` | Dynamic child |
32
- | `<div class={expr}>` | `<div class={() => expr}>` | Dynamic prop |
33
- | `<button onClick={fn}>` | unchanged | Event handler |
34
- | `<div>{() => expr}</div>` | unchanged | Already wrapped |
35
- | `<div>{"literal"}</div>` | unchanged | Static value |
32
+ | Input | Output | Reason |
33
+ | ------------------------- | -------------------------- | --------------- |
34
+ | `<div>{expr}</div>` | `<div>{() => expr}</div>` | Dynamic child |
35
+ | `<div class={expr}>` | `<div class={() => expr}>` | Dynamic prop |
36
+ | `<button onClick={fn}>` | unchanged | Event handler |
37
+ | `<div>{() => expr}</div>` | unchanged | Already wrapped |
38
+ | `<div>{"literal"}</div>` | unchanged | Static value |
36
39
 
37
40
  ### Static Hoisting
38
41