yznts / kyoto

Asynchronous frontends with Go
https://pkg.go.dev/github.com/yznts/kyoto/v3
MIT License
651 stars 28 forks source link

Server Side State #28

Closed yznts closed 2 years ago

yznts commented 3 years ago

Will be useful in case of large state payloads.
Instead of saving state inline as html tag, store state on server side and inject state hash as html tag.
This feature will decrease amount of data, sent with SSA request and total HTML document size.

Key requirements:

yznts commented 2 years ago

Moving to 0.3, not covered by 0.2 features focus group

gedw99 commented 2 years ago

I am not that familiar with kyoto yet but see interfaces used for the Actions in the demo code.

do you think a more formalised data structure for this is needed ? Protobufs can be really nice for this where you want to define a structure. For kyoto its needs to be reusable..

One way is a simple KV structure that is tagged / nested based on a simple namespace. SO each component has a namespace and then can put whatever it wants.

Anyother way is a node, edge point structure. This is a decent example of the concept: https://github.com/simpleiot/simpleiot/blob/master/internal/pb/node.proto

You can use protobufs over SSE btw. Its just a serialisation. You can use protobufs over grpc also and it works with golang WASM client side and server side. here is a nice concise example: https://github.com/tmc/goloz/blob/master/Makefile#L30