The Fir toolkit is designed for Go developers with moderate html/css & js skills who want to progressively build reactive web apps without mastering complex web frameworks. It includes a Go library and an Alpine.js plugin.
How it works ?
On receiving user-interactions the fir server re-renders html templates and sends it over the wire where the fir client library selectively updates the changed areas.
When a user event is received by a Fir route, an array of html templates are rendered on the server and returned as an array of DOM events to the browser. The DOM events are consumed by the alpinejs plugin and dispatched within the DOM where listeners attached to elements can use the event to update the DOM.
See the demo and quickstart here: https://livefir.fly.dev/
How does Fir handle more complex scenarios such as nested components, handling form submissions with client-side validation, and integrating third-party APIs or libraries?
Does the toolkit offer any built-in functionality or guidelines for handling these cases, or is the developer expected to handle them using custom code and Alpine.js plugins?
Also the site is super slow!
[edit] This is still a work-in-progress so I will certainly add better guides and documentation moving forward. Although its good to get feedback that this approach might be interesting for at least some people.
https://pushup.adhoc.dev
It's got some unique ideas.
This is a very simple and clean Go templating library.
There are plenty of valid criticisms of React/etc, but the one thing they got really really right was making "templates" be normal functions that return a data structure representing the HTML. Logic is way less awkward, no global variables spanning partials in different files and it's impossible to write incorrectly nested markup. I really wish backend-only frameworks would steal that idea.
Dead Comment
Or is it because I first clicked the full reload example several times?
iOS
Anyway I am lazy, so I would probably just use HTMX boosting:
htmx is great!
[1] ilse.ink/components(It's not ready yet)
ilse.ink/components didn't work. Could you post a link to it?
Trying to make universal components is hard, like, I wanted to make all components available trough a "filter" where you could re-use React.js, Vue.js, Svelt, Solid components with each other. When you think about it, components are just I/O with maybe some libraries. I'm thinking this is field is right for some standardization.
I ended up packaging my frontend in an nginx container and using that same nginx container as a proxy for the backend but the whole time I thought maybe this small project would be easier if everything was served by go.
Will definitely keep an eye on this for future stuff.
But I think for future projects I might use HTMX + Tailwind.
[1]: https://gocial.netlify.app/
[2]: https://github.com/dorneanu/gocial