@llui/vite-plugin 0.0.1 → 0.0.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/README.md +38 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,19 +1,53 @@
|
|
|
1
1
|
# @llui/vite-plugin
|
|
2
2
|
|
|
3
|
-
Vite plugin compiler for [LLui](https://github.com/fponticelli/llui).
|
|
4
|
-
|
|
5
|
-
3-pass TypeScript transform: static/dynamic prop split, dependency analysis + bitmask injection, import cleanup. Rewrites element helpers to `elSplit()`/`elTemplate()`, synthesizes `__dirty()` per component, and handles `View<S,M>` destructuring.
|
|
3
|
+
Vite plugin compiler for [LLui](https://github.com/fponticelli/llui). 3-pass TypeScript transform that eliminates the virtual DOM at compile time.
|
|
6
4
|
|
|
7
5
|
```bash
|
|
8
6
|
pnpm add -D @llui/vite-plugin
|
|
9
7
|
```
|
|
10
8
|
|
|
9
|
+
## Setup
|
|
10
|
+
|
|
11
11
|
```ts
|
|
12
|
+
// vite.config.ts
|
|
12
13
|
import { defineConfig } from 'vite'
|
|
13
14
|
import llui from '@llui/vite-plugin'
|
|
14
|
-
|
|
15
|
+
|
|
16
|
+
export default defineConfig({
|
|
17
|
+
plugins: [llui()],
|
|
18
|
+
})
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Options
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
llui({
|
|
25
|
+
mcpPort: 5200, // MCP debug server port (default: 5200, false to disable)
|
|
26
|
+
})
|
|
15
27
|
```
|
|
16
28
|
|
|
29
|
+
## What It Does
|
|
30
|
+
|
|
31
|
+
The compiler runs 3 passes over every `.ts`/`.tsx` file using the TypeScript Compiler API:
|
|
32
|
+
|
|
33
|
+
| Pass | Name | Description |
|
|
34
|
+
| ---- | -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
35
|
+
| 1 | Prop split | Rewrites element helpers to `elSplit()`/`elTemplate()` for template cloning. Separates static props (set once at mount) from dynamic props (updated on state change). |
|
|
36
|
+
| 2 | Mask injection | Analyzes state dependencies, assigns bitmask bits to state paths, injects `__dirty(oldState, newState)` per component. Rewrites `text()` and binding callbacks with mask guards. |
|
|
37
|
+
| 3 | Import cleanup | Removes unused imports introduced or made redundant by earlier passes. |
|
|
38
|
+
|
|
39
|
+
## Diagnostics
|
|
40
|
+
|
|
41
|
+
The compiler emits warnings for common issues:
|
|
42
|
+
|
|
43
|
+
| Diagnostic | Description |
|
|
44
|
+
| --------------------- | ------------------------------------------------ |
|
|
45
|
+
| Missing alt attribute | Accessibility: `img` without `alt` |
|
|
46
|
+
| Non-exhaustive update | `update()` switch missing msg type cases |
|
|
47
|
+
| Empty props | Element helper called with empty props object |
|
|
48
|
+
| Namespace imports | `import * as` prevents tree-shaking |
|
|
49
|
+
| Spread children | Spread in children array defeats static analysis |
|
|
50
|
+
|
|
17
51
|
## License
|
|
18
52
|
|
|
19
53
|
MIT
|