All Projects → HuckRidgeSW → Hvue

HuckRidgeSW / Hvue

Licence: mit
A GopherJS & go/wasm binding for Vue.js

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Hvue

Json2excel
Generate excel file from json data
Stars: ✭ 40 (-20%)
Mutual labels:  webassembly, wasm
Asm Dom Boilerplate
A simple boilerplate to start using asm-dom without configuration.
Stars: ✭ 49 (-2%)
Mutual labels:  webassembly, wasm
Cppwasm Book
📚 WebAssembly friendly programming with C/C++ -- Emscripten practice
Stars: ✭ 956 (+1812%)
Mutual labels:  webassembly, wasm
Smartcircle
✂️Automatically determine where to crop a circular image out of a rectangular.
Stars: ✭ 29 (-42%)
Mutual labels:  webassembly, wasm
Tinygo
Go compiler for small places. Microcontrollers, WebAssembly (WASM/WASI), and command-line tools. Based on LLVM.
Stars: ✭ 9,068 (+18036%)
Mutual labels:  webassembly, wasm
Wasm Check
TypeScript / JavaScript library for detect WebAssembly features in node.js & browser
Stars: ✭ 30 (-40%)
Mutual labels:  webassembly, wasm
Rhai
Rhai - An embedded scripting language for Rust.
Stars: ✭ 958 (+1816%)
Mutual labels:  webassembly, wasm
Wagon
wagon, a WebAssembly-based Go interpreter, for Go.
Stars: ✭ 882 (+1664%)
Mutual labels:  webassembly, wasm
Wasm Sort
WebAssembly sort algorithms compiled by C.
Stars: ✭ 34 (-32%)
Mutual labels:  webassembly, wasm
Photon
⚡ Rust/WebAssembly image processing library
Stars: ✭ 963 (+1826%)
Mutual labels:  webassembly, wasm
Node Wasm
Import and use wasm in node
Stars: ✭ 28 (-44%)
Mutual labels:  webassembly, wasm
Winter
Haskell port of the WebAssembly OCaml reference interpreter
Stars: ✭ 42 (-16%)
Mutual labels:  webassembly, wasm
Bionic
** Bionic - An Ionic CLI clone for Blazor projects ** moved to:
Stars: ✭ 28 (-44%)
Mutual labels:  webassembly, wasm
Uno.ch9
Ch9 - Uno Reference Implementation project
Stars: ✭ 45 (-10%)
Mutual labels:  webassembly, wasm
Terrarium Templates
Template and example projects for Fastly Labs Terrarium https://wasm.fastlylabs.com
Stars: ✭ 21 (-58%)
Mutual labels:  webassembly, wasm
Wasmsign
A tool to add and verify digital signatures to/from WASM binaries
Stars: ✭ 31 (-38%)
Mutual labels:  webassembly, wasm
Webrtc
Pure Go implementation of the WebRTC API
Stars: ✭ 8,399 (+16698%)
Mutual labels:  webassembly, wasm
Notecalc3
NoteCalc is a handy calculator trying to bring the advantages of Soulver to the web.
Stars: ✭ 879 (+1658%)
Mutual labels:  webassembly, wasm
Wasmboy
Game Boy / Game Boy Color Emulator Library, 🎮written for WebAssembly using AssemblyScript. 🚀Demos built with Preact and Svelte. ⚛️
Stars: ✭ 963 (+1826%)
Mutual labels:  webassembly, wasm
Hidamari
Modern operating system aimed at running WebAssembly code.
Stars: ✭ 49 (-2%)
Mutual labels:  webassembly, wasm

Intro

hvue is a GopherJS and wasm wrapper for the Vue Javascript framework.

This (the "master" branch) is the go/wasm + GopherJS version. It uses gopherwasm to provide a compatability layer between go/wasm and GopherJS. go/wasm is patterned on GopherJS, but doesn't have all of its capabilities and language-specific "magic". In particular, go/wasm doesn't have GopherJS's "dual struct/object" magic, which allows you to embed a *js.Object in a struct, define struct fields with js:"jsName" tags, and have the compiler automatically change references to those fields into references to fields in the inner *js.Object. So to access a JavaScript object in go/wasm, you have to use a "naked" js.Value and either use thing.Get("jsField") (and related functions) everywhere (ew) or write access functions (less ew). You can also write GopherJS in the same style, and gopherwasm creates a compatability layer so the go/wasm style compiles under GopherJS.

The GopherJS-only version is tagged as v1, and also as gopherjs.

The wasm branch still exists, because I shared it pretty widely, and I want those links to keep working for a while.

So if you want to use the go/wasm code, and/or also use this exact code in GopherJS, use this branch. If you want the GopherJS-only code, use the v1 or gopherjs branch. Click on over to the README in that branch for installation instructions. They may need modification, since they still date to when hvue's "master" branch was GopherJS-only.

Install

Install Go 1.11

See https://golang.org/dl/.

Install hvue

(Side note: If you skipped it, please make sure you've read the Intro above about the difference between this (the go/wasm + GopherJS code), and previous GopherJS-only versions.)

cd path/to/github.com # in your $GOPATH
mkdir huckridgesw
cd huckridgesw
git clone [email protected]:HuckRidgeSW/hvue.git

Examples & Demos

Overview

Generally speaking, the examples follow the examples in the Vue guide. Some don't, because the Guide has changed since I wrote the examples. But most of them do.

01-introduction has examples from the Vue Introduction page.

02-lifecycle demos Vue lifecycle hooks but does not correspond to any specific example on that page.

03-computed-basic and 04-computed-with-setter have examples from Computed Properties and Watchers.

And so on. Links are in the code.

Running the examples

GopherJS

cd path/to/github.com/huckridgesw/hvue
echo "var hvue_wasm = false;" > examples/maybe_wasm.js
gopherjs serve github.com/huckridgesw/hvue # listens on 8080

and then

WASM

cd path/to/github.com/huckridgesw/hvue
echo "var hvue_wasm = true;" > examples/maybe_wasm.js
go run examples/server/main.go # Listens on 8081
cd examples/??-???? # some examples directory
GOARCH=wasm GOOS=js go build -o ${PWD##*/}.wasm main.go # compile wasm

and then

Remember to recompile after any changes. There's no facility yet to auto-build (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.)

GoDoc

http://godoc.org/github.com/HuckRidgeSW/hvue

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].