DOM library for Go and WASM
Branch: master
Clone or download
thegrumpylion and dennwc Introduce HTMLElement & Update Element
* HTMLElement with all properties implemented
* Update Element to implement all properties
* Elements' Style method moved to HTMLElement
* Imput inherits from HTMLElement instead of element

Signed-off-by: Nikolas Sepos <nikolas.sepos@gmail.com>
Latest commit 7f87333 Feb 6, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
cmd wasm-server: use GOROOT when building the module and serving exec file Oct 12, 2018
examples webrtc: refactor interfaces and update example Oct 6, 2018
extension/chrome add a readme, missing build tags, fix old code; addresses #4 Sep 27, 2018
js add missing build tags; fixes #12 Feb 8, 2019
net webrtc: add build tags Oct 15, 2018
storage add missing build tags; fixes #12 Feb 8, 2019
svg add a readme, missing build tags, fix old code; addresses #4 Sep 27, 2018
.gitignore fix gitignore Aug 12, 2018
LICENSE Create LICENSE Jun 30, 2018
README.md Add link to wiki, similar projects, env variables with vs code. Oct 18, 2018
color.go implement more methods and provide helper for events Jul 10, 2018
document.go add missing build tags; fixes #12 Feb 8, 2019
element.go Introduce HTMLElement & Update Element Feb 10, 2019
event.go add missing build tags; fixes #12 Feb 8, 2019
global.go add missing build tags; fixes #12 Feb 8, 2019
htmlElement.go Introduce HTMLElement & Update Element Feb 10, 2019
input.go
node.go add missing build tags; fixes #12 Feb 8, 2019
require.go add missing build tags; fixes #12 Feb 8, 2019
shadowRoot.go add missing build tags; fixes #12 Feb 8, 2019
style.go Introduce HTMLElement & Update Element Feb 10, 2019
tokenList.go add missing build tags; fixes #12 Feb 8, 2019
units.go add missing build tags; fixes #12 Feb 8, 2019
window.go add missing build tags; fixes #12 Feb 8, 2019

README.md

Go DOM binding (and more) for WebAssembly

This library provides a Go API for different Web APIs for WebAssembly target.

It's in an active development, but an API will be carefully versioned to avoid breaking users. Use Go dependency management tools to lock a specific version.

More information about Go's WebAssembly support can be found on Go's WebAssembly wiki page.

Features:

  • Better JS API (wrappers for syscall/js)
  • Basic DOM manipulation, styles, events
  • Input elements
  • SVG elements and transforms
  • LocalStorage and SessionStorage
  • Extension APIs (tested on Chrome):
    • Native Messaging
    • Bookmarks
    • Tabs
  • net-like library for WebSockets
    • Tested with gRPC
  • wasm-server for fast prototyping

Quickstart

Pull the library and install wasm-server (optional):

go get -u github.com/dennwc/dom
go install github.com/dennwc/dom/cmd/wasm-server

Run an example app:

cd $GOPATH/src/github.com/dennwc/dom
wasm-server

Check result: http://localhost:8080/

The source code is recompiled on each page refresh, so feel free to experiment!

Similar Projects

Editor Configuration

If you are using Visual Studio Code, you can use workspace settings to configure the environment variables for the go tools.

Your settings.json file should look something like this:

{
    "go.toolsEnvVars": { "GOARCH": "wasm", "GOOS": "js" }
}