What I did:
- Described a form for registration using templ (a Go templating language).
- Specified the necessary Vue tags within it.
- Described the Vue component's logic in a JS file.
- Linked it into the template via
<script>.
As a result, the form is rendered on the backend, and on the client-side, Vue picks it up and handles the logic itself.
The awesomeness (and there's no other word for it) is that I can now write frontend code almost entirely in Go, adding plain JS in simple places, HTMX in templates, and describing the logic for more complex components in Vue (instead of the old-school jQuery).
This doesn't solve all the problems that arise with user experience when working with server-side rendering, but I will continue to gradually address them.
For example, the next thing I want to add is rendering only parts of the page (like islands in Astro's style), and for that, I'll only need HTMX.
The question: "Why, if you can just use an SPA?" โ SPAs and frontend developers have completely worn me out, and I want to find any ways to minimize their involvement in my projects.
I'll explain what, how, and why in upcoming posts.