dom
dom copied to clipboard
API comparison to previous DOM package.
How does the API of this package compare to honnef.co/go/js/dom
, a popular DOM package for GopherJS? /cc @dominikh
honnef.co/go/js/dom
has issue dominikh/go-js-dom#57 to make API changes to make it possible to add WebAssembly support.
Just wanted to put this on your radar if it's not already, or ask about the design differences so I can understand this package better. Thanks!
This library was meant to be more opinionated and adapt Web APIs to Go in a more natural way.
Part of the goal is to also reflect the platform-agnostic nature of Go by providing libraries that cover other Web technologies that interoperate with the browser. Right now the package provides a symethric net
-like implementation of WebSockets for both js
and a server environment to cover Browser<->Server commpunication, and an implementation of native messaging to cover Browser<->Desktop communication. WebRTC will also be implemented to provide Browser<->Browser communication channel.
In the same spirit, it will provide high-level interfaces for Local/Session Storage and some of the KV backends for Go.
Thus, the end goal is to provide a set of ready-to-use solutions for common problems related to Web development in Go. I hope this answer your question :)
I see, thanks for the answer!
net
-like implementation of WebSockets for bothjs
Just checking, are you familiar with https://github.com/gopherjs/websocket? You can use it if you don't wish to reimplement that functionality yourself.