Releases: HoneIDE/editor
v0.4.2
Bug-fix release: resilient tree-sitter init on the web target (gh#5). Native targets are unaffected.
Fixes
- gh#5 — Web
mount({ treeSitter: true })hard-failed in Firefox. web-tree-sitter 0.20.8's Emscripten dynamic-link runtime (tree-sitter.wasm) fails to instantiate in Firefox (reportUndefinedSymbols) and can hang; becausemount()awaited init before constructing the editor, the whole mount rejected and the editor never appeared. Init is now best-effort:mount()races it against a timeout (default 5000ms, override viatreeSitter: { initTimeoutMs }) and falls back to the keyword tokenizer when it fails or times out, so the editor always mounts — with keyword highlighting instead of tree-sitter on browsers that can't load the runtime. NewinitTreeSitterSafe()helper innative/web/tree-sitter-bridge.ts.
+4 regression tests.
v0.4.1
Bug-fix release for the web target (gh#3, gh#4). Native targets are unaffected.
Fixes
- gh#3 — Web TypeScript syntax colors were wrong.
theme.tokens.*reads returnundefinedinside Perry's WASM (PerryTS/perry#1071), so tree-sitter token colors resolved in WASM came through as the string"undefined"and fell back to the foreground. The tree-sitter engine now carries the TextMate scope string on each token; the webdom-ffi.tsre-resolves the color JS-side via the sharedresolveTokenScopetable. Also fixedobj.method()member-call coloring (the called method now gets the function color). - gh#4 — Web arrow keys didn't move the cursor. Arrow/navigation keys (plus word-jumps, Home/End, PageUp/PageDown, Shift+arrow) now move the caret in the browser.
onKeyDownre-syncs the module-level Perry cursor state that the web renderer reads to draw the caret (CommandRegistry dynamic dispatch doesn't fire under Perry's AOT runtime, so the prior path left it stale).
+7 regression tests.
v0.4.0 — web mount() text I/O + per-range diagnostics
First-class read/write + change-observation on the web mount() controller (gh#1) and Monaco-style per-range diagnostics (gh#2).
gh#1 — mount() text I/O
The controller now bridges the WASM↔JS realm boundary:
getText()— current buffer textsetText(value)— replace all text (load examples / hydrate permalinks)onTextChange(cb)— observe edits; returns an unsubscribesetCursor(line, column)— 0-based, scrolls the line into viewfocus()
gh#2 — per-range diagnostics
setRangeDiagnostics(json)/clearRangeDiagnostics()wherejson = [{startLine,startCol,endLine,endCol,severity,message,code?}, …](0-based)- Severity-colored squiggle under the exact span + a hover tooltip with message and code.
Platforms
- Web: full (incl. hover tooltip),
native/web/dom-ffi.ts. - macOS: range-diagnostic squiggle rendering +
focus,native/macos/. - iOS / Windows / Linux / Android / HarmonyOS: link-resolving FFI stubs (same status as their existing line-diagnostics).
- Shared
Editormethods (getText/setText/onTextChange/setCursor/focus/setRangeDiagnostics) work on every platform.
10 new FFI functions added to the manifest; 15 new tests.
v0.3.1 — npm tarball fixes (examples + perry-ffi docs)
Patch release fixing two issues reported against the v0.3.0 tarball.
Fixed
-
examples/now shipped.native/{macos,ios,windows,linux}/Cargo.tomldeclare[[example]]blocks (demo_editor, etc.) butexamples/wasn't in the npmfiles:list.cargo buildfailed withcan't find demo_editor example at examples/demo_editor.rs. Tarball grew from 121 → 140 files. -
perry-ffiresolution documented.native/{macos,ios}/Cargo.tomluseperry-ffi = { path = \"../../../../perry/perry/crates/perry-ffi\" }— a sibling-checkout path that doesn't survivenpm install. The real fix needs Perry to publishperry-ffito crates.io (filed PerryTS/perry#1112). Until then:- New
native/NATIVE_CRATES.md— consumer setup guide with the[patch.crates-io]workaround. - README has a "Consuming the native crates from npm" section linking to it.
- Comment block above the
perry-ffiline in each affected Cargo.toml points at both.
- New
Web target unaffected
native/web/dom-ffi.ts + native/web/tree-sitter-bridge.ts are pure TypeScript — no Rust build path, no perry-ffi. The import { mount } from '@honeide/editor/web' flow added in v0.3.0 just works.
Found by
@honeide/editor consumers using the macOS native crate from a Perry app after npm install.
v0.3.0 — first-class web target
Highlights
Web is now a sibling of every other platform in the same architecture: one TypeScript editor codebase compiled to WASM by Perry; each platform implements the hone_editor_* FFI contract against its native rendering primitive. On the web that primitive is the DOM, so the renderer is also TypeScript.
Web target
import { mount } from './hone-editor.js';
const ed = await mount(document.getElementById('editor'), {
content: '// your code',
language: 'typescript',
theme: 'dark',
fontSize: 14,
treeSitter: true,
});
ed.setFindHighlights('[{"line":2,"col":13,"len":6,"current":1}]');
ed.setLineDiagnostics('5:1:#f87171:type error message');
ed.setBreakpoints('3\n7');native/web/dom-ffi.ts— DOM renderer implementing everyhone_editor_*symbol the Perry-compiled WASM imports.native/web/tree-sitter-bridge.ts— web-tree-sitter v0.20.8 bridge for thehone_editor_ts_*FFI. Mappers for TypeScript, JavaScript, Python, Rust, JSON, CSS.examples/web/build.tsproduces a cleandist/withhone-editor.wasm(~1.4 MB),hone-editor.js(~340 KB),index.html, and per-language grammar wasms.
Other changes
- Bracket-pair colorization in
KeywordSyntaxEngine— three-color VS Code-style cycle. - Tokenizer reorg:
core/tokenizer/token-theme.tssplit intotoken-theme.ts(scope-string resolver, no Lezer) andtag-theme.ts(Lezer Tag resolver). Keeps Lezer off the Perry-native critical path. EditorOptions.syntaxEngineso consumers can pickKeywordSyntaxEnginevsCompositeEngineper-platform.core/buffer/rope.ts: renamed localpath→nodePath(was a false-positive on Perry's stdlib guard).
Requires
Perry past commit 39399fef (PerryTS/perry#1071, cross-module nested-field fix). The published v0.5.1008 binary predates this — build from source until the next Perry release.
Removed
The previous native/web/src/ wasm-bindgen Rust crate was based on the wrong mental model (Perry's web target doesn't link a Rust cdylib; it imports JS FFI directly). Deleted in favor of native/web/dom-ffi.ts.
v0.2.2
Initial npm publish of @honeide/editor (ships TS + native Rust source for all platforms).