@hyperfixi/types-browser 7.4.0 → 7.5.1

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 (2) hide show
  1. package/CHANGELOG.md +111 -0
  2. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -7,6 +7,117 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [7.5.1] - 2026-10-23
11
+
12
+ The last two silent misreads of hand-written non-English hyperscript that the 7.3.0 live test
13
+ found: one is now refused, the other reads right.
14
+
15
+ ### Fixed
16
+
17
+ - **ko: an event word followed by its object particle is the verb's object, not a handler.** At
18
+ top level, hand-written `로드 를 대기` (wait for load) read as `on load wait 를`: a handler on
19
+ `load` waiting on a variable named `를`, and translate() did not refuse it. Top level is now
20
+ refused, as ja `ロード を 待つ` and tr `yükleme i bekle` already were; inside a handler,
21
+ `클릭 할 때 로드 를 대기` still reads `wait for load`. ko's own render of
22
+ `trigger click on #btn …` (`#btn에 클릭을 트리거 …`) had been refused for the same reason and now
23
+ translates.
24
+ - **es `eso`, `esto` and a detached `lo` read as `it`, as do pt `isto` and fr `cela`/`ceci`.**
25
+ `poner eso en #o` read `put eso into #o`, a variable nobody set, with no error. Most profiles
26
+ already write `it` as a demonstrative (pt `isso`, fr `ça`, ru `это`, he `זה`, ja `それ`). What
27
+ `it` renders to is unchanged. A variable spelled like one of these words now reads as `it` in
28
+ that language, as one named `isso` already did in pt; MCP `translate_code` reports it
29
+ (`NAME_COLLISION`) with a rename.
30
+
31
+ ## [7.5.0] - 2026-10-22
32
+
33
+ What a live test of 7.3.0 found users hitting. The Vite plugin loads in a CommonJS project and
34
+ ships types. MCP `diff_behaviors` compares whole handlers, and `npx` installs the engine.
35
+ Hand-written non-English hyperscript that ran wrong in silence now reads right or says so. A
36
+ minor: `@lokascript/htmx-adapter`'s `hx-on` change restores what its README always documented
37
+ (bodies are JavaScript by default), and a page that relied on the engine switching them adds
38
+ `<meta name="htmx-i18n-hx-on" content="hyperscript">`.
39
+
40
+ ### Changed
41
+
42
+ - **`@lokascript/htmx-adapter`: `hx-on` bodies stay JavaScript unless the page opts in to
43
+ hyperscript bodies.** The adapter used to switch every `hx-on` body on the page to hyperscript
44
+ whenever a hyperscript engine (`window._hyperscript`) was loaded, and the documented stack (the
45
+ engine, htmx 4 and this adapter) always has one. So a plain-JavaScript
46
+ `hx-on:click="document.getElementById('o').textContent = 'ran'"` failed with a hyperscript parse
47
+ error, although the README says bodies are JavaScript by default. The opt-in is now explicit:
48
+ `<meta name="htmx-i18n-hx-on" content="hyperscript">`, or `setBodyExecutor()` as before. A page
49
+ that wrote hyperscript `hx-on` bodies and relied on the engine alone adds the `<meta>` tag. With
50
+ the tag and no engine on the page, the adapter warns and the bodies stay JavaScript.
51
+
52
+ ### Fixed
53
+
54
+ - **`@hyperfixi/vite-plugin` loads in a CommonJS project.** `npm init -y` writes
55
+ `"type": "commonjs"`, and there the plugin's `require` build failed with
56
+ `ERR_PACKAGE_PATH_NOT_EXPORTED`: it requires `@hyperfixi/engine`, whose `exports` had only an
57
+ `import` condition. The engine's `exports` now name its ES module as the `default` too, which
58
+ Node 20.19+ and 22.12+ (what Vite 8 needs) can `require`.
59
+ - **`@hyperfixi/vite-plugin` ships types for the app side** (`@hyperfixi/vite-plugin/client`):
60
+ the virtual module and `window.hyperfixi` / `window._hyperscript`. A TypeScript 6 project
61
+ rejected `import 'hyperfixi'` (`TS2882`). The README has a TypeScript section, with JSX's
62
+ `data-script` and an augmentation for `_`.
63
+ - **The Vite plugin's scanner reads a `<script type="text/hyperscript">` block that contains
64
+ `<`** (`if n < 10`, a `<div/>` query). It skipped the whole block, so its commands were not
65
+ bundled and the page failed to parse. It also reads the `script` and `data-script` attributes,
66
+ which the engine runs as it runs `_`, and a production build scans Vite's `root` rather than the
67
+ working directory (`vite build app` from a parent directory bundled the siblings' modules).
68
+ - **MCP `diff_behaviors` no longer calls any two multi-command or `if` handlers identical.** It
69
+ compared the operations it could extract, and it extracted single commands only: a `then` chain
70
+ (a `compound` node), an `if`, a loop and every command it had no extractor for gave nothing, so
71
+ `remove .b then wait 2s` and `remove .c then wait 5s` were "No semantic change", and so were an
72
+ English handler and an unrelated Spanish one. It now compares every command of a chain, both
73
+ branches of an `if`, a loop's body, and any other command with all its written roles (a
74
+ `fetch`'s `with` options included), and `this` is no longer read as `me`. Faithful translations
75
+ still compare identical (checked on chains, branches, loops and `wait for` in ja, es and ar).
76
+ - **`npx @hyperfixi/mcp-server` installs the engine.** `@hyperfixi/engine`, `@hyperfixi/core` and
77
+ `@hyperfixi/server-bridge` were optional peers, which `npx` leaves out, so the documented
78
+ install checked nothing on the engine: every error only the engine catches came back `ok`, and
79
+ only stderr said so. They are dependencies now, and a validation whose engine check could not
80
+ run says so in the result (`ENGINE_CHECK_SKIPPED`, `info`; `get_diagnostics`:
81
+ `engine-check-skipped`). release-smoke installs the server alone and checks for the three.
82
+ - **Validation warns on `this`** (`THIS_IS_NOT_ME`): hyperscript has no `this`, so
83
+ `toggle .a on this` or `put this.value.length into #n` reads a variable nobody set and does
84
+ nothing. These validated clean (6 of 10 clean-validating snippets that did nothing, in the 7.3.0
85
+ live test). The inert-shape warnings also reach commands after a `then` and inside an `if`'s
86
+ branches; they read only a block's `body` before.
87
+ - **The IR `validate_and_compile` returns has the commands of a chain, a branch or a loop**: a
88
+ `then` chain is `compound` with each command in `body`, an `if` has `body` and `else`. A chain
89
+ came back as `compound` with no commands, so it could not be checked against an intent.
90
+ - **AGENTS.md** said `this`, `and` or a comma between commands, and `put … in` work; all four fail
91
+ on both engines. Its worked example showed output the server no longer gives, and it quoted a
92
+ fidelity figure ("~76%") from before the renderer reached 100% on the corpus. Rewritten from the
93
+ server's real output.
94
+ - **Multilingual: a native time unit after the event is a duration.** ko `클릭할 때 1초 대기`,
95
+ tr `tıklamada 1 saniye bekle` and ja `クリックで 1 秒 待つ` came back `on click 1 wait s`: the
96
+ number became a click count (the handler ran on the first click only) and the wait waited for
97
+ nothing, with no error. A number and the language's word for a unit after it, glued or spaced,
98
+ are one duration now (`wait 1s`, `wait 150ms`).
99
+ - **Multilingual: a bare URL with a number in it translates.** `fetch /api/items/42` and
100
+ `fetch /api/slow?ms=300` were refused in every language, both ways ("would lose 42"): the check
101
+ counted the URL's numbers alone, and the translation writes the URL quoted. A bare URL is one
102
+ value now, the same as quoted.
103
+ - **Multilingual: es and pt `esperar a <event>` waits for the event.** es `esperar a continue`
104
+ came back `wait continue`, a timed wait on a variable, which waits for nothing. `esperar a`
105
+ (es, pt) and `esperar por` (pt) read as `wait for`, as `esperar evento` already did.
106
+ - **Multilingual: a hover word is `mouseenter`.** Eighteen languages' hover word (es `sobrevolar`,
107
+ fr `survol`, ko `호버`, …) read as `on hover`, which is not a DOM event, so the handler never ran.
108
+ They read as `on mouseenter` now; what `on mouseenter` is written as does not change.
109
+ - **Multilingual: a dropped word with content of its own is refused, not dropped.** es
110
+ `al hacer clic fuera quitar .open de mí` came back `on click remove .open from me` (the dropdown
111
+ closed on every click): a particle the language maps to a word with meaning (`fuera`, `out`) was
112
+ skipped like a role marker. Such a translation is refused now (`LossyTranslationError`).
113
+ - **`@lokascript/hyperscript-adapter` warns when a handler listens for a word nothing fires.**
114
+ A word the language does not know as an event (es `al pulsar …`, de `beim Tippen …`) runs as a
115
+ custom event of that name, and the handler never ran, silently. The adapter now warns once per
116
+ language and word. A name written as code (`miEvento`, `draggable:start`) stays quiet. No event
117
+ words were added: loka-js and our dictionaries ship the noun (`clic`), not the verbs. MCP
118
+ `validate_and_compile` reports the same, as an `UNKNOWN_EVENT_WORD` warning on non-English
119
+ input (`get_code_fixes` has its fix).
120
+
10
121
  ## [7.4.0] - 2026-10-21
11
122
 
12
123
  Content htmx or fixi swaps in runs its hyperscript, as it does on upstream `_hyperscript`: the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperfixi/types-browser",
3
- "version": "7.4.0",
3
+ "version": "7.5.1",
4
4
  "description": "TypeScript definitions for the hyperfixi browser globals: window.hyperfixi / window._hyperscript (the engine), LokaScriptSemantic, LokaScriptI18n",
5
5
  "type": "module",
6
6
  "types": "dist/index.d.ts",
@@ -30,7 +30,7 @@
30
30
  "author": "LokaScript Contributors",
31
31
  "license": "MIT",
32
32
  "devDependencies": {
33
- "@hyperfixi/engine": "^7.4.0",
33
+ "@hyperfixi/engine": "^7.5.1",
34
34
  "typescript": "^5.8.3"
35
35
  },
36
36
  "publishConfig": {