Repository navigation
Hangar 2.0: the native tab (0.2.0) - #1
Merged
Merged
Conversation
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.
…k, describe the native tab
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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".