Circular Calendar (rust wasm)
  • Rust 86.9%
  • CSS 5.4%
  • Makefile 3.9%
  • HTML 2.9%
  • JavaScript 0.9%
Find a file
2019-10-04 15:32:49 +13:00
src style changes 2019-10-04 15:32:49 +13:00
websrc updates 2019-10-04 11:21:25 +13:00
.gitignore Initial rust WASM example app 2019-10-02 16:52:11 +13:00
Cargo.lock Chrono needed wasmbind feature 2019-10-04 10:13:11 +13:00
Cargo.toml Chrono needed wasmbind feature 2019-10-04 10:13:11 +13:00
Makefile Working, basic setup for NZ seasons 2019-10-04 10:49:55 +13:00
README.md more README 2019-10-03 12:10:23 +13:00

Circular Calendar

This will be a WASM webpage generator that dynamically constructs and SVG showing a Southern Hemisphere based circular seasonal calendar.

Install Build Tools

wasm-pack

This is the tool that the Rust WebAssembly Working Group wants you to use for your workflow. It used to be mostly about deploying to npm but it deploys everywhere now.

  1. Run wasm-pack build --target web to build

wasm-opt

A tool in the binaryen system package, this shrinks .wasm files

$ wasm-opt -Os -o output.wasm input.wasm

terser

Numerous javascript minimization programs have been released in the past including yui-compressor, jsmin, minify, uglifyjs (1,2,and3), uglify-es, and terser. Terser is a fork of uglify-es that handles the newest ECMA versions of javascript, is maintained, and gives the best compression ratio (I ran tests). It runs on node; install globally with

$ npm install terser -g

Building

Run make and then make deploy.

Output will be in deploy/ folder, ready to serve from a webserver or via a file:/// URL.

Technology and Notes

WASM related libraries used:

  • wasm-bindgen
  • web-sys

See also: