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:45
dotenv.js, answer.js, validate.js, diff.js, gitignore.js and logic.js as
modules of a native/ crate, on Hangar's kit SDK, each with the cases of its
test file. The ignore rules match the page's patterns without a regular
expression, the JSON walk has no depth limit, and no cut of a text can panic:
a panic's message is logged, and Rust's would quote the text.
controller.js becomes the Kit's update: each await is a call answered by a
message, measured against the generation as the page's were. view.js becomes
its view, in Hangar's widgets: values dotted until revealed, a multi-line one
a dotted one-line field until shown, a numbered editor marking the asked and
the broken line, the diff given in parts, the conflict key by key. Ctrl+S
saves the form and reviews the text.

The tests of controller.test.js, view.test.js and
no-value-reaches-an-agent.test.js are ported through the SDK's harness, on a
fake Hangar that holds the tab to the manifest's three permissions; the fuzz
also reads the tab's log.
scripts/build-native.sh builds native/ for wasm32-unknown-unknown into
tabs/editor.wasm, committed since Hangar never builds a kit. The paths of the
machine are taken out of the module and native/rust-toolchain.toml pins Rust,
so the same source makes the same bytes anywhere.

The manifest stays at schema 1 with its HTML entry, and adds native: Hangar
1.x opens the page, the native Hangar the module. The manifest tests check the
field, and that the module imports only hangar.log and hangar.now.
The README says the tab is native on the native Hangar, how the module is
built and tested, and what the native tab does otherwise than the page. CI
gets a native job: the Rust tests, then the module built again and compared
with the committed one, failing when it is stale.
@simnJS
simnJS merged commit db97bfa into main Nov 5, 2026
4 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