Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
dom
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

go-hyperscript

  • Simple hyperscript like script implemented in Go.
  • You can use this package in these ways:
    • Write HTML using Go function.
    • Update existing DOM based on previous VNode tree.

Usage

Write HTML using Go function

func main() {
	node := h.H("div", nil,
		h.H("h1", nil, h.Text("Example App")),
		h.H("strong", nil,
			h.H("font", h.Object{"color": "red"}, h.Text("Hello, world!")),
		),
		...
	)
	body := js.Global().Get("document").Get("body")
	dom.NewRenderer().Render(node, body)
}

Example

Update DOM

  • Now go-hyperscript provides basic support for reusing and updating existing DOM.
  • To use this function, please render multiple times using same renderer.

Examples

Environment

  • go 1.13

Development

make build
make test

Author

syumai

License

MIT

About

hyperscript implementation in Go.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published