Skip to content
Maxence Charriere edited this page Jun 28, 2020 · 37 revisions

Welcome to the go-app wiki, a collection of information about how to build a progressive web app with the go-app package.

Table of Contents

Install

# Init go module (if not initialized):
go mod init

# Get package:
go get -u -v github.com/maxence-charriere/go-app/v7

Commands

# Build wasm app:
GOARCH=wasm GOOS=js go build -o app.wasm

# Install wasm test env:
go get -u github.com/agnivade/wasmbrowsertest && \
	mv $GOPATH/bin/wasmbrowsertest $GOPATH/bin/go_js_wasm_exec

# Test wasm app:
GOARCH=wasm GOOS=js go test

FAQ

Why changing how to describe the UI in the new version?

In the previous version of this package, describing UI was done by writing HTML code as templated strings where Go code was called by hidden mechanisms.

While it was working well, it had some drawback related to HTML written in Go strings:

  • No linter
  • No code format
  • No code editor auto-complete

The result was that it was easy to make mistakes when writing HTML.

It was also hard to maintain internally.