You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cd path/to/github.com # in your $GOPATH
mkdir huckridgesw
cd huckridgesw
git clone git@github.com:HuckRidgeSW/hvue.git
cd hvue
git checkout --track origin/wasm
Examples & Demos
Overview
Generally speaking, the examples
follow the examples in the Vue guide.
cd path/to/github.com/huckridgesw/hvue
echo"var hvue_wasm = true;"> examples/maybe_wasm.js
go run examples/server/main.go # Listens on 8081cd examples/??-????# some examples directory
GOARCH=wasm GOOS=js go build -o ${PWD##*/}.wasm main.go # compile wasm
Remember to recompile after any changes. There's no facility yet to
auto-build yet (a-la gopherjs build -w or gopherjs serve).
Switching from GopherJS to WASM and back
Do the appropriate "echo "var hvue_wasm = ?;" > examples/maybe_wasm.js.
(See above.)
Be sure to do "shift-cmd-R" (Chrome, macOS; other browsers / OSes will vary)
to reload without using the cache, to get the new maybe_wasm.js and/or new
wasm. (Actually I'm not sure you need that to get new wasm, since it's
loaded via an explicit fetch() call, but it's probably not a bad idea.)
Alternatively, in Chrome you can open the developer console, go to the
network tab, and check "disable cache". (AIUI only works while said console
window is open.)