@hyperfixi/vite-plugin 2.3.1 → 2.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.
- package/README.md +14 -0
- package/dist/index.cjs +275 -56
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +75 -15
- package/dist/index.d.ts +75 -15
- package/dist/index.js +275 -56
- package/dist/index.js.map +1 -1
- package/package.json +7 -6
package/README.md
CHANGED
|
@@ -159,6 +159,20 @@ Level 2: + Regional Semantic Bundle +16-61 KB
|
|
|
159
159
|
Level 3: + Grammar Transformation +68 KB
|
|
160
160
|
```
|
|
161
161
|
|
|
162
|
+
## htmx v4 reactive / streaming surface
|
|
163
|
+
|
|
164
|
+
The scanner detects `hx-live`, `sse-connect` / `sse-swap`, `ws-connect` / `ws-send`, and `bind <var> to <expr>.<prop>` inside `_=` bodies. When any of those is found in the project, the generated bundle is the `hyperfixi-hx-v4.js` premade bundle (full runtime + `@hyperfixi/reactivity` + htmx-compat auto-installed + SSE/WS).
|
|
165
|
+
|
|
166
|
+
```html
|
|
167
|
+
<!-- Triggers the hx-v4 fallback automatically -->
|
|
168
|
+
<div hx-live="put $count into me"></div>
|
|
169
|
+
<div sse-connect="/stream" sse-swap="tick" hx-target="#out"></div>
|
|
170
|
+
<form ws-send><input name="msg" /></form>
|
|
171
|
+
<input _="on input bind $val to me.value" />
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
The slim minimal-bundle generator can't satisfy these features (its parser/runtime doesn't know `live`/`when`/`bind`, doesn't route writes through `notifyGlobalWrite`, and doesn't ship the SSE/WS modules), so the plugin opts into the full hx-v4 bundle for correctness over size. If size matters more, drop the v4 attributes and use plain `_=` / v1-v2 htmx attributes.
|
|
175
|
+
|
|
162
176
|
## Options
|
|
163
177
|
|
|
164
178
|
```javascript
|