Repository navigation
Validation now reads code the way the _hyperscript runtime reads element scripts, the shipped docs are corrected and parser-checked, and the editor-assist tools are hardened.
Upgrading
- Default parse mode changed.
validate_hyperscriptandparse_hyperscriptnow read code as an element script (a program of features), the way the runtime parses_="…"attributes and<script type="text/hyperscript">. A bare command such astoggle .active, or an expression such as1 + 2, is now reported invalid with a hint. Passmode: "snippet"to validate fragments. - Node 22 or later is required.
mainis removed from the package; it pointed at the server entry point, so importing the package started the server. Run the server through itsbin, which is unchanged.
Changes
- Verdicts match the runtime. Scripts that begin with
setorjs, or contain only comments, are now valid, as they are in the browser. Checked against_hyperscriptrunning in Chromium: 41 cases, 0 mismatches. - Corrected docs and examples. Examples the parser rejected are fixed (
focus/blur,scroll … into view,halt the default,while …, and others), and so are semantics the parser can't catch:- Dotted "modifiers" such as
on click.oncelisten for an event literally namedclick.once. youis thetelltarget, not the event target.- Conversions are case-sensitive (
as JSON, notas json). :nameis element-scoped, not local.
- Dotted "modifiers" such as
- Events guide rewritten around the real
onmodifiers:every,first, counts,[filter],from,elsewhere,infor delegation,debounced at,throttled atandqueue.get_completionsoffers these instead of dotted modifiers. Every example the server ships is now parse-checked by the test suite. - Editor assist.
- Bad input returns an
isErrortool result instead of a JSON-RPC internal error. - Completion context works:
onoffers events,toggle .active onoffers targets, and results narrow to the word being typed. get_document_symbolscoversset,when,bind,live,installandjs.
- Bad input returns an
- Error positions are filled in for end-of-input and tokenizer errors (line 1-based, column 0-based).
- Input limit. Code over 100,000 characters is rejected, since parsing blocks the server.
- AST view shows receivers and values that were hidden before, such as
set's value and theunlesscondition. - Dependencies refreshed.
npm auditreports 0 findings (was 9, 3 high). MCP SDK 1.30.1.
Notes
- The first release cut by pushing a version tag: the Publish workflow publishes to npm and creates this release.
- Published via GitHub Actions trusted publishing (OIDC) with provenance.
What's Changed
- chore(ci): add Dependabot config, bump actions to v5 by @codetalcott in #2
- fix(mcp-server): parse element scripts like the runtime; correct shipped docs; two-way drift test by @codetalcott in #21
- Follow-up: remaining review items (tool hardening, positions, AST view, deps/CI) by @codetalcott in #22
- chore(release): bump @hyperscript-tools/mcp-server to 2.9.0 by @codetalcott in #23
- ci: publish and create the GitHub release when a version tag is pushed by @codetalcott in #24
Full Changelog: v2.8.0...v2.9.0