kyoto
Go server side frontend framework
import "go.kyoto.codes/v3"
Kyoto is a library for creating fast, server side frontend avoiding vanilla templating downsides.
It tries to address complexities in frontend domain like responsibility separation, components structure, asynchronous load and hassle-free dynamic layout updates. These issues are common for frontends written with Go.
The library provides you with primitives for pages and components creation, state and rendering management, dynamic layout updates (with client configuration), utility functions and asynchronous components out of the box. Still, it bundles with minimal dependencies and tries to utilize built-ins as much as possible.
You would probably want to opt out from this library in few cases, like, if you're not ready for drastic API changes between major version, you want to develop SPA/PWA and/or complex client-side logic, or you're just feeling OK with your current setup. Please, don't compare kyoto with a popular JS libraries like React, Vue or Svelte. I know you will have such a desire, but most likely you will be wrong. Use cases and underlying principles are just too different.
If you want to get an idea of what a typical static component would look like, here's some sample code. It's very ascetic and simplistic, as we don't want to overload you with implementation details. Markup is also not included here (it's just a well-known `html/template`).
type ComponentState struct {
component.Universal
Foo string
Bar string
}
func Component(ctx *component.Context) component.State {
state := &ComponentState{}
state.Foo = "foo"
state.Bar = "bar"
return state
}
For details, please check project's website on https://kyoto.codes. Also, you may check the library index to explore available sub-packages and https://pkg.go.dev for Go'ish documentation style.