Skip to content

Hangar 2.0: the native tab (0.2.0) - #1

Merged
simnJS merged 9 commits into
mainfrom
rust-rewrite
Nov 5, 2026
Merged

simnJS merged 9 commits into
mainfrom
rust-rewrite

Conversation

@simnJS

@simnJS simnJS commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Brings rust-rewrite to main for Hangar 2.0: the tab is Rust compiled to WebAssembly (manifest schema 2, hangar >=2.0.0), the HTML tab is gone. Version 0.2.0. Hangar 1.x refuses schema 2 with "needs a newer Hangar".

simnJS and others added 9 commits November 3, 2026 13:38
native/ holds the native tab's crate (cdylib and rlib, hangar-kit-sdk
from git): logic.js, model.js and answer.js as logic.rs, model.rs and
answer.rs, with the cases of test/logic.test.js and test/model.test.js
as Rust tests. The marks are drawn as the canvas marks of the SDK, so
Hangar draws them on screen and in the PNG alike.
lib.rs is controller.js and view.js as a Kit of hangar-kit-sdk: the
capture shown where it is (image.size, a canvas over ImageSource::File),
the four tools and five inks, notes typed in the list, undo on Ctrl+Z,
the zoom, the same files written under the same names (canvas.export
then files.write) and the same message to the agent (panes.send).
The file chooser and ui.pasteImage stand in for the drop and the paste
event. The cases of test/controller.test.js and test/view.test.js run on
the SDK's harness.
scripts/build-native.sh builds native/ for wasm32-unknown-unknown into
tabs/annotate.wasm, committed: Hangar runs the module a kit ships. The
toolchain is pinned and the paths of Cargo's home and of the kit are
written out of the module, so a rebuild anywhere gives the same bytes.
The manifest stays at schema 1 with its HTML entry, and adds native.
The manifest tests check the field, and that the module imports only
what Hangar gives and calls only what the three permissions allow.
The README says what the native tab does its own way and what it cannot
do. CI runs its tests and clippy, builds the module again and fails when
the committed tabs/annotate.wasm is not what native/ builds.
@simnJS
simnJS merged commit 8ddbbe0 into main Nov 5, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant