Skip to content
Vecty: your frontend, in Go
Go
Branch: master
Clone or download
Latest commit 2b6fc20 Jul 1, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
doc Add WebAssembly support (#232) Jul 1, 2019
elem elem: Fix lint and generate issues (#205) May 25, 2018
event document func event.Timeout (#233) May 26, 2019
example Add WebAssembly support (#232) Jul 1, 2019
prop #224 changed TypeUrl to TypeURL (#235) May 26, 2019
style Separate Markup from children. Aug 28, 2017
testdata Add WebAssembly support (#232) Jul 1, 2019
.gitignore add new data-driven test suite + move all existing tests to it (#178) Dec 10, 2017
.golangci.yml #224 changed TypeUrl to TypeURL (#235) May 26, 2019
.travis.yml Add WebAssembly support (#232) Jul 1, 2019
CONTRIBUTORS Update CONTRIBUTORS (#237) May 30, 2019
LICENSE LICENSE: add BSD 3-clause license (same as Go) Apr 22, 2016
README.md README: fix straggling KB Jul 1, 2019
dom.go Add WebAssembly support (#232) Jul 1, 2019
dom_native.go Add WebAssembly support (#232) Jul 1, 2019
dom_test.go Add WebAssembly support (#232) Jul 1, 2019
dom_wasmjs_gopherjs.go Add WebAssembly support (#232) Jul 1, 2019
domutil.go Keyed children allow for efficient rendering of reordering children Oct 1, 2017
go.mod Add WebAssembly support (#232) Jul 1, 2019
markup.go Add WebAssembly support (#232) Jul 1, 2019
markup_test.go Separate Markup from children. Aug 28, 2017
require_go_1_12.go Add WebAssembly support (#232) Jul 1, 2019
testsuite_native_test.go Add WebAssembly support (#232) Jul 1, 2019
testsuite_test.go Add WebAssembly support (#232) Jul 1, 2019
testsuite_wasmjs_gopherjs_test.go Add WebAssembly support (#232) Jul 1, 2019

README.md

Vecty is a library for building responsive and dynamic web frontends in Go instead of in JavaScript, HTML & CSS. It competes with modern web frameworks like React & VueJS, and supports compilation to both WebAssembly and vanilla JavaScript.

Build Status GoDoc codecov

Benefits

  • Go developers can be competitive frontend developers.
  • Share Go code between your frontend & backend.
  • Reusability by sharing components via Go packages so that others can simply import them.

Goals

  • Simple
    • Designed from the ground up to be easily mastered by newcomers (like Go).
  • Performant
    • Efficient & understandable performance, small bundle sizes, same performance as raw JS/HTML/CSS.
  • Composable
    • Nest components to form your entire user interface, seperating them logically as you would any normal Go package.
  • Designed for Go (implicit)
    • Written from the ground up asking the question "What is the best way to solve this problem in Go?", not simply asking "How do we translate $POPULAR_LIBRARY to Go?"

Features

  • Compiles to WebAssembly (via standard Go compiler) and vanilla JavaScript (via GopherJS).
  • Small bundle sizes: 0.5 MB hello world (see section below).
  • Fast expectation-based browser DOM diffing ('virtual DOM', but less resource usage).

Current Status

Vecty is currently considered to be an experimental work-in-progress. Prior to widespread production use, we must meet our v1.0.0 milestone goals, which are being completed slowly and steadily as contributors have time (Vecty is over 4 years in the making!).

Early adopters may make use of it for real applications today as long as they are understanding and accepting of the fact that:

  • APIs will change (maybe extensively).
  • A number of important things are not ready:
    • Extensive documentation, examples and tutorials
    • URL-based component routing
    • Ready-to-use component libraries (e.g. material UI)
    • Server-side rendering
    • And more, see milestone: v1.0.0
  • The scope of Vecty is only ~80% defined currently.
  • There are a number of important open issues.

For a list of projects currently using Vecty, see the doc/projects-using-vecty.md file.

Small bundle sizes

Vecty uses extremely minimal dependencies and prides itself on producing very small bundle sizes (mostly limited by the compiler), making it suitable for modern web development:

Example Compiler Bundle size Compressed (gzip)
hellovecty Go + WebAssembly 2.3 MB 0.5 MB
markdown Go + WebAssembly 4.2 MB 0.9 MB
todomvc Go + WebAssembly 3.4 MB 0.7 MB
hellovecty GopherJS 0.5 MB 0.1 MB
markdown GopherJS 2.6 MB 0.4 MB
todomvc GopherJS 1.7 MB 0.3 MB

Community

Changelog

See the doc/CHANGELOG.md file.

You can’t perform that action at this time.