Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chemyl/tax_app_webassembly
webasm project
https://github.com/chemyl/tax_app_webassembly
js rust webassembly
Last synced: about 2 months ago
JSON representation
webasm project
- Host: GitHub
- URL: https://github.com/chemyl/tax_app_webassembly
- Owner: chemyl
- Created: 2024-11-05T06:55:51.000Z (about 2 months ago)
- Default Branch: master
- Last Pushed: 2024-11-06T05:38:49.000Z (about 2 months ago)
- Last Synced: 2024-11-06T06:28:10.236Z (about 2 months ago)
- Topics: js, rust, webassembly
- Language: CSS
- Homepage:
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### Basic project of interpreting Rust code into a web application using WebAssembly
- create library crate -> `cargo new project --lib`
- add dependency to `cargo.toml`-> `wasm-bindgen = "0.2.+"`
- add library annotation for compiler ->` [lib] crate-type = ["cdylib"]`
- include wasm prelude inside `lib.rs`
- create public function with necessary logic in `lib.rs`
- create `index.html` file with simple html template with header and `style.css` inclusion in project root
- create `styles.css` style file
- create skeleton inside `index.html` and extend `script block` with logic of working with wasm inclusion
- install wasm-pack -> `cargo install wasm-pack`
- build project with wasm-pack -> `wasm-pack build --target web`
- include web server -> `npm install -g http-server`
- start server in project root folder -> `http-server .`
- switch to `localhost`![launcher window](https://github.com/chemyl/tax_app_webassembly/blob/master/img.png)