Skip to content

Releases: HoneIDE/editor

v0.4.2

22 May 13:31

Choose a tag to compare

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; because mount() 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 via treeSitter: { 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. New initTreeSitterSafe() helper in native/web/tree-sitter-bridge.ts.

+4 regression tests.

v0.4.1

22 May 12:56

Choose a tag to compare

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 return undefined inside 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 web dom-ffi.ts re-resolves the color JS-side via the shared resolveTokenScope table. Also fixed obj.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. onKeyDown re-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

22 May 08:38

Choose a tag to compare

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 text
  • setText(value) — replace all text (load examples / hydrate permalinks)
  • onTextChange(cb) — observe edits; returns an unsubscribe
  • setCursor(line, column) — 0-based, scrolls the line into view
  • focus()

gh#2 — per-range diagnostics

  • setRangeDiagnostics(json) / clearRangeDiagnostics() where json = [{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 Editor methods (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)

19 May 10:38

Choose a tag to compare

Patch release fixing two issues reported against the v0.3.0 tarball.

Fixed

  • examples/ now shipped. native/{macos,ios,windows,linux}/Cargo.toml declare [[example]] blocks (demo_editor, etc.) but examples/ wasn't in the npm files: list. cargo build failed with can't find demo_editor example at examples/demo_editor.rs. Tarball grew from 121 → 140 files.

  • perry-ffi resolution documented. native/{macos,ios}/Cargo.toml use perry-ffi = { path = \"../../../../perry/perry/crates/perry-ffi\" } — a sibling-checkout path that doesn't survive npm install. The real fix needs Perry to publish perry-ffi to 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-ffi line in each affected Cargo.toml points at both.

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

19 May 08:00

Choose a tag to compare

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 every hone_editor_* symbol the Perry-compiled WASM imports.
  • native/web/tree-sitter-bridge.ts — web-tree-sitter v0.20.8 bridge for the hone_editor_ts_* FFI. Mappers for TypeScript, JavaScript, Python, Rust, JSON, CSS.
  • examples/web/build.ts produces a clean dist/ with hone-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.ts split into token-theme.ts (scope-string resolver, no Lezer) and tag-theme.ts (Lezer Tag resolver). Keeps Lezer off the Perry-native critical path.
  • EditorOptions.syntaxEngine so consumers can pick KeywordSyntaxEngine vs CompositeEngine per-platform.
  • core/buffer/rope.ts: renamed local pathnodePath (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

12 May 10:42

Choose a tag to compare

Initial npm publish of @honeide/editor (ships TS + native Rust source for all platforms).