@hyperfixi/server-bridge 7.5.1 → 7.6.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/CHANGELOG.md +103 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,109 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [7.6.0] - 2026-11-10
|
|
11
|
+
|
|
12
|
+
The engine takes extensions: upstream's `tailwind` and `socket` load from a script tag or
|
|
13
|
+
`register(...)`, and the Vite plugin bundles them. Spanish and Portuguese handlers agree with their
|
|
14
|
+
event (`a la entrada`, `à mudança`), and German writes an event as the noun it is (`wenn Klick`).
|
|
15
|
+
A minor: new features, and renders that change in es, pt and de; everything written before still
|
|
16
|
+
reads.
|
|
17
|
+
|
|
18
|
+
### Added
|
|
19
|
+
|
|
20
|
+
- **`@hyperfixi/vite-plugin`: `extensions: ['socket', 'tailwind']`.** The generated bundle
|
|
21
|
+
imports each `@hyperfixi/engine/ext/<name>` and registers it after the modules, and the dev
|
|
22
|
+
`everything` fallback does too. Extensions are opt-in, so the scan never adds one. A project
|
|
23
|
+
that lists an extension gets an engine bundle even when the scan found nothing else (a page
|
|
24
|
+
whose only hyperscript is a `socket`).
|
|
25
|
+
- **Which module comes with `toggle` is now read from the grammar.** The plugin used to have
|
|
26
|
+
the rule "`toggleElement` comes with `toggle`" written in; it now reads which modules add
|
|
27
|
+
a reading to a command (`Grammar.fallbacks`).
|
|
28
|
+
- **`verify:reference` checks the engine's extensions as its own.** It registers each
|
|
29
|
+
`dist/ext/<name>.esm.js`, documents their keywords like the engine's, and parses their
|
|
30
|
+
examples: `socket`'s hover example is now checked, where it was skipped as "upstream's".
|
|
31
|
+
|
|
32
|
+
- **`@hyperfixi/engine`: extensions that a script tag can load.** After `hyperfixi-hs.js`, a page
|
|
33
|
+
can load `ext/<name>.js`, which registers its module with the page's engine. Or, from ESM,
|
|
34
|
+
`register(...everything, tailwind)` with `@hyperfixi/engine/ext/tailwind`.
|
|
35
|
+
- **The first extension is upstream's `tailwind`** (the `twDisplay`, `twVisibility` and
|
|
36
|
+
`twOpacity` hide/show strategies), and upstream's 12 tests for it are now in the engine's
|
|
37
|
+
gate: 1,434 of 1,498.
|
|
38
|
+
- **The public object gains `register` and `extensions`, and the script-tag bundle's also gains
|
|
39
|
+
`kit`.** `register` adds modules. `extensions` lists the extension files the page has
|
|
40
|
+
loaded. `kit` holds what a module may call: the same names the library entry exports for
|
|
41
|
+
module authors. Only `hyperfixi-hs.js` carries the kit, so a bundle built from ESM (the Vite
|
|
42
|
+
plugin's) keeps only the parts of the engine it uses; it registers extensions from ESM, and an
|
|
43
|
+
extension file loaded beside it says so.
|
|
44
|
+
- **`register` skips a module it has already added.** When it does add one, it reads again
|
|
45
|
+
the elements whose scripts failed to parse, so an `async` or late-loaded extension still
|
|
46
|
+
applies.
|
|
47
|
+
- **Upstream's own `ext/tailwind.js` also runs on the engine unchanged**, through `use`.
|
|
48
|
+
- **`@hyperfixi/engine/ext/socket`: upstream's `socket` feature.** `socket Chat ws://… [with
|
|
49
|
+
timeout n] [on message [as JSON] …] end` defines `Chat`, a WebSocket with `raw`,
|
|
50
|
+
`dispatchEvent` (`send ping to Chat` sends the event as JSON) and an `rpc` proxy
|
|
51
|
+
(`Chat.rpc.f(…)` returns a promise for the reply).
|
|
52
|
+
- **Upstream's 16 socket tests pass:** the suite is 1,450 of 1,498, with 48 known failures.
|
|
53
|
+
- **Two differences from upstream:** the socket opens when the feature is installed, not
|
|
54
|
+
when it is parsed, so a parse alone opens nothing; and with `as JSON` a message that is
|
|
55
|
+
JSON `0`, `false` or `null` is that value, where upstream rejects it.
|
|
56
|
+
- **The kit grows to what a feature needs:** `dotOrColonPath`, `urlOrExpression`,
|
|
57
|
+
`evalStatic`, `commandList`, `makeContext`, `runList` and `assignToNamespace`. Each is
|
|
58
|
+
exported from `@hyperfixi/engine` and carried on `hyperfixi-hs.js`'s `_hyperscript.kit`.
|
|
59
|
+
|
|
60
|
+
### Changed
|
|
61
|
+
|
|
62
|
+
- **`@lokascript/semantic`: a Spanish or Portuguese handler's head agrees with its event, and
|
|
63
|
+
German writes an event as a noun.** Renders only; everything written before still reads.
|
|
64
|
+
- **es, pt:** `al` and `ao` hold the masculine article, and were written before every event
|
|
65
|
+
(`al entrada agregar .a`, `ao mudança de #search …`). A feminine event takes `a la` and `à`:
|
|
66
|
+
`a la entrada agregar .a`, `à mudança de #search disparar envio em #form`. The first event of
|
|
67
|
+
an `or` decides; an infinitive (`al redimensionar`) and a custom name (`al my:event`) keep the
|
|
68
|
+
masculine. Each profile lists its feminine event words (`eventHandler.feminineEventMarker`).
|
|
69
|
+
es reads `a la` as the head only before one of them, so `poner x a la` is still a put into a
|
|
70
|
+
variable named `la`. pt's `à` joins its letters and prepositions.
|
|
71
|
+
- **de:** an event's word takes its capital wherever a command names one: `wenn Klick`,
|
|
72
|
+
`wenn Änderung von #search auslösen Absenden auf #form`, `warten Änderung`. An event with no
|
|
73
|
+
German word stays code (`wenn keyup`). The event table lists each one-word name both ways, so
|
|
74
|
+
`wenn klick` and `wenn doppelklick` read as before.
|
|
75
|
+
|
|
76
|
+
- **`@hyperfixi/engine`: a module can add a reading to a command without changing what the
|
|
77
|
+
command reads (`Grammar.fallbacks`).** A fallback registered for a keyword is tried, from just
|
|
78
|
+
after the keyword, only when the command's own rule fails to parse, and it counts only if it
|
|
79
|
+
reads at least as far as that rule got. `toggle <element>` (the `toggleElement` module) is now
|
|
80
|
+
one. Every `toggle` that upstream reads now goes through upstream's rule exactly (registering
|
|
81
|
+
`toggleElement` used to send every `toggle <target>` through a different expression rule).
|
|
82
|
+
An unfinished upstream `toggle` now reports upstream's error: `toggle #d as` used to say
|
|
83
|
+
`Expected 'modal'`, and now says `Expected dotOrColonPath`, as upstream does. The
|
|
84
|
+
`Grammar.toggleElement` slot is gone; a module that set it registers a fallback instead.
|
|
85
|
+
`Parser` gains `mark()` and `reset()`.
|
|
86
|
+
|
|
87
|
+
### Fixed
|
|
88
|
+
|
|
89
|
+
- **`@lokascript/semantic`: a translated `socket` comes back as the socket upstream reads.**
|
|
90
|
+
A socket's `on message [as JSON] …` is its own clause, closed by the socket's one `end` (or
|
|
91
|
+
by the end of the script). Semantic read it as an event handler, eventsource's shape, so:
|
|
92
|
+
- a clause closed by `end` came back with a second `end`, in every language. The engine
|
|
93
|
+
rejects that, so a translated socket failed to parse on the page;
|
|
94
|
+
- a clause with no `end` (upstream's tests write them that way) lost its body, and a
|
|
95
|
+
clause's `as JSON` was read as leftover input. `translate` refused both;
|
|
96
|
+
- a dotted name came back split: `socket MyApp.chat …` became `socket MyApp .chat …`, a
|
|
97
|
+
different socket.
|
|
98
|
+
|
|
99
|
+
`as JSON` is now written with the language's own word for `as`, as a conversion is (es
|
|
100
|
+
`como JSON`, ja `として JSON`). Text semantic wrote before, with two `end`s, still reads as
|
|
101
|
+
the one socket it was.
|
|
102
|
+
|
|
103
|
+
Where a language puts its handler word after the event (ja `messageで`, tr `message da`), a
|
|
104
|
+
socket or eventsource whose body starts with a word that looks like an event (ja
|
|
105
|
+
`messageで messageを 記録`, "on message log message") now reads. The handler word used to
|
|
106
|
+
be taken as the start of the body.
|
|
107
|
+
- **Measured by the command-shape gate, which now reads extension syntax.** Its engine
|
|
108
|
+
registers every extension the engine builds. Its harvest reads upstream's `ext/` tests,
|
|
109
|
+
and the scripts a test writes as `textContent` (how upstream's socket tests write theirs).
|
|
110
|
+
That adds 33 cases (1,168 in all), and each passes in all 24 lanes. Before this fix, 4 of
|
|
111
|
+
the 16 socket cases were refused in every language and 1 was silent in every language.
|
|
112
|
+
|
|
10
113
|
## [7.5.1] - 2026-10-23
|
|
11
114
|
|
|
12
115
|
The last two silent misreads of hand-written non-English hyperscript that the 7.3.0 live test
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hyperfixi/server-bridge",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.6.0",
|
|
4
4
|
"description": "Extract server route contracts from hyperscript/htmx HTML and generate server-side route scaffolding",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@lokascript/domains": "^7.1.0",
|
|
33
|
-
"@types/node": "^26.6.
|
|
33
|
+
"@types/node": "^26.6.6",
|
|
34
34
|
"tsup": "^9.0.0",
|
|
35
35
|
"typescript": "^5.0.0",
|
|
36
36
|
"vitest": "^5.0.5"
|