sse example using datastar
The current example has hard coded js at https://github.com/goadesign/examples/blob/master/sse/public/index.html
Suggest we look at using datastar because it removes all custom JS, by using a htmx pattern: https://github.com/starfederation/datastar/tree/develop/examples/go/hello-world
go run .
The Goa DSL is designed around the notion oF resources and so is datastar. So I think code gen will work really well with it. also they both use Chi.
it makes it possible to essentially gen some of the GUI, because all state is on the server and simple HTML fragments are all that is needed. tailwind css is all there as you can see from the HTML.
Yeah that could be a great example, care to submit a PR?
It will take me a while to do this .
Can you suggest where it should be ? The weather example seems pertinent .
The current SSE example uses an internal SSE system .
I’m not sure Datastar can use that as it has its own SSE system that can also work with NATS Jetstream - as a leaf node typically.
Can you have a look ?
I see yeah doesn't look like Goa would add a lot of value there, seems like a separate tech stack.
Agree . Glue the 2 together , without touching either via a simple middleware extension ?
DS is the frontend ( on the backend ) . All DS wants to do is call down into Goa , get data , and return html fragments.
Plus when a record changes inside Goa ( via a third party call , for example ) , to tell DS ( via sse or web hook ).
Nice and seperate. Will also allow me to add an auth gui to goa, since Goa has a decent auth api now.
if you have any thoughts , example links , etc would be helpful if you have time , so I can work through it as quickly as possible , and OR back stuff that does the right approach .