• Stars
    star
    2,790
  • Rank 16,322 (Top 0.4 %)
  • Language
    Go
  • License
    BSD 3-Clause "New...
  • Created about 10 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Vecty lets you build responsive and dynamic web frontends in Go using WebAssembly, competing with modern web frameworks like React & VueJS.

Vecty lets you build responsive and dynamic web frontends in Go using WebAssembly, competing with modern web frameworks like React & VueJS.

Build Status PkgGoDev 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).
  • Small bundle sizes: 0.5 MB hello world (see section below).
  • Fast expectation-based browser DOM diffing ('virtual DOM', but less resource usage).

Vecty vs. Vugu

If you're wondering if you should use Vecty or Vugu, consider reading this Twitter thread for advice from both myself and the creator of Vugu.

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.

Near-zero dependencies

Vecty has nearly zero dependencies, it only relies on reflect from the Go stdlib. Through this, it is able to produce the smallest bundle sizes for Go frontend applications out there, limited only by the Go compiler itself:

Example binary Compiler uncompressed gzip --best brotli
hellovecty.wasm tinygo 0.14.0 252K 97K 81K
hellovecty.wasm go 1.15 2.1M 587K 443K
markdown.wasm go 1.19 5.9M 1.3M 952K
todomvc.wasm go 1.15 2.9M 825K 617K

You can find these examples under the example directory along with a readme on how to go about running a vecty project.

Note: Bundle sizes above do not scale linearly with more code/dependencies in your Vecty project. hellovecty is the smallest base-line bundle that the compiler can produce with just Vecty as a dependency, other examples above pull in more of the Go standard library and you would not e.g. have to pay that total cost again.

Community

Changelog

See the doc/CHANGELOG.md file.

More Repositories

1

dockerfile

Dockerfile best-practices for writing production-worthy Docker images.
Dockerfile
4,033
star
2

mach

zig game engine & graphics toolkit
Zig
3,065
star
3

mach-glfw

Ziggified GLFW bindings with 100% API coverage, zero-fuss installation, cross compilation, and more.
Zig
344
star
4

valast

Convert Go values to their AST
Go
305
star
5

autogold

Automatically update your Go tests
Go
282
star
6

fastfilter

fastfilter: Binary fuse & xor filters for Zig (faster and smaller than bloom filters)
Zig
249
star
7

mach-core

window+input+GPU, truly cross-platform
Zig
184
star
8

mach-gpu

mach/gpu: truly cross-platform WebGPU graphics for Zig
Zig
182
star
9

mach-gpu-dawn

Google's Dawn WebGPU implementation, cross-compiled with Zig into a single static library
Zig
144
star
10

gotextdiff

Unified text diffing in Go (copy of the internal diffing packages the officlal Go language server uses)
Go
129
star
11

mach-sysgpu

Highly experimental, blazingly fast, lean & mean descendant of WebGPU written in Zig
Zig
95
star
12

mach-examples

Mach engine examples
Zig
86
star
13

dawn

Fork of dawn.googlesource.com/dawn with generated code and third-party dependencies committed
C++
78
star
14

zorex

Zorex: the omnipotent regex engine
Zig
66
star
15

mach-dxcompiler

DXC built using Zig
C++
53
star
16

Azure-Kinect-Python

Python 3 bindings for the Azure Kinect SDK
Python
48
star
17

mach-freetype

Ziggified Freetype 2 bindings with zero-fuss installation, cross compilation, and more.
Zig
46
star
18

zgo

Go + Zig = 💕 | Zig and Go are best friends
Go
38
star
19

mach-glfw-vulkan-example

mach-glfw Vulkan example
Zig
37
star
20

mach-glfw-opengl-example

Example for using mach-glfw with zig-opengl
Zig
35
star
21

mach-ecs

Entity Component System from first-principles designed for Zig
34
star
22

mach-sysaudio

cross-platform low-level audio IO in Zig
Zig
29
star
23

mach-sysjs

enables Zig/WASM to speak to JavaScript
Zig
28
star
24

awesome-zig-gamedev

Comprehensive collection of maintained zig gamedev projects & libraries
17
star
25

xcode-frameworks

XCode frameworks packaged for the Zig build system
C
17
star
26

mach-core-starter-project

The result of running through https://machengine.org/core/getting-started
Zig
16
star
27

mach-gamemode

mach-gamemode: make your Linux games go brrr
14
star
28

harfbuzz

A fork of harfbuzz packaged for the Zig build system
C++
13
star
29

brotli

A fork of brotli packaged for the Zig build system
C
12
star
30

cmder

Lightweight Go pattern for writing CLIs with subcommands
Go
12
star
31

pgtrgm_emperical_measurements

Emperical measurements of pg_trgm performance at scale
Shell
11
star
32

zigmonthly.org

Curated Zig news brought to you by @slimsag each month
SCSS
11
star
33

mach-system-sdk

DirectX 12 headers for MinGW/Zig, cross-compile DX12/Metal/etc with Zig, etc.
10
star
34

glfw

A fork of GLFW packaged for the Zig build system
C
10
star
35

machengine.org

machengine.org website, documentation, etc.
SCSS
10
star
36

sdk-macos-11.3

Also see https://github.com/hexops/sdk-macos-12.0
C
9
star
37

libmach

C API to Mach core and Mach engine
C
9
star
38

vulkan-zig-generated

Snektron/vulkan-zig, but generated and comitted for use as a package manager dependency
Zig
9
star
39

wrench

[bot] 🐵 Wrench here! Let's fix this! 🔧
Go
9
star
40

freetype

A fork of freetype packaged for the Zig build system
C
9
star
41

mach-editor

Mach CLI and graphical editor
Zig
8
star
42

devlog

Hexops devlog
SCSS
7
star
43

vulkan-headers

A fork of vulkan-headers packaged for the Zig build system
C++
7
star
44

x11-headers

x11-headers packaged for the Zig build system
C
7
star
45

mach-model3d

compact, featureful model format & alternative to glTF
C
7
star
46

font-assets

Various fonts packaged for the Zig build system
Zig
7
star
47

sinter

Sinter text search engine
Zig
6
star
48

mach-objc

Generated Objective-C bindings for Zig
Zig
6
star
49

basisu

A fork of basisu packaged for the Zig build system
C
6
star
50

sdk-macos-12.0

macOS 12.0 Monterey SDK for Mach engine
C
6
star
51

mach-basisu

basis universal (supercompressed textures) for Zig
Zig
6
star
52

mach-opus

Opus audio decoding and encoding for Zig via the battle-hardened xiph.org libopus
Zig
5
star
53

linux-audio-headers

linux-audio-headers packaged for the Zig build system
C
5
star
54

mach-rs

Rust bindings for Mach
5
star
55

wayland-headers

wayland-headers packaged for the Zig build system
C
5
star
56

spirv-tools

A fork of spirv-tools packaged for the Zig build system
C++
4
star
57

ControlCursor

A C# library for getting and setting global cursor position.
C#
4
star
58

direct3d-headers

Enables using the latest Direct3D headers and libraries with Zig
C
4
star
59

mach-flac

FLAC audio decoding and encoding for Zig via the battle-hardened xiph.org libflac
Zig
4
star
60

hexi-old

Hexi: Game Engine & Graphics Toolkit
Rust
4
star
61

sycl24

Software You Can Love 2024 workshop
Zig
4
star
62

spirv-cross

A fork of spirv-cross packaged for the Zig build system
C++
3
star
63

hexops.com

hexops.com website
SCSS
3
star
64

opengl-headers

opengl-headers packaged for the Zig build system
C
3
star
65

soundio

libsoundio upstream sources used by Mach engine
C
3
star
66

sdk-macos-13.3

macOS 13.3 Ventura SDK for Mach engine
C
3
star
67

sdk-linux-x86_64

Linux x86_64 SDK for Mach engine
C++
3
star
68

mach-ggml

Zig
3
star
69

lordofzero

Shell
3
star
70

opusfile

A fork of opusfile packaged for the Zig build system
C
2
star
71

sdk-linux-aarch64

Linux aarch64 SDK for Mach engine
C++
2
star
72

ogg

A fork of ogg packaged for the Zig build system
C
2
star
73

directx-headers

A fork of DirectX-Headers, packaged with the Zig build system and compatible with cross-compilation
C
2
star
74

sdk-windows-x86_64

Windows x86_64 SDK for Mach engine
C
2
star
75

mach-objc-generator

Zig Objective-C binding generator
Zig
2
star
76

mach-example-assets

mach-core examples assets
Zig
2
star
77

heapbit

1
star
78

tridex-assets

Static contents / assets for Tridex
1
star
79

opus

A fork of opus packaged for the Zig build system
C
1
star
80

opusenc

A fork of libopusenc packaged for the Zig build system
C
1
star
81

ztemplate

Hexops Zig template repository
Zig
1
star
82

flac

A fork of flac packaged for the Zig build system
C
1
star
83

stackptr

1
star