Svelte frontend vs HTMX and hyperscript

This page summarizes the projects mentioned and recommended in the original post on /r/golang

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • html

  • On template partials, they definitely don’t feel like the rest of a Go app, but are they really that different from using handlebars or JSX? Once I figured out a good architecture for my templates, I’ve been pretty happy rendering htmx on the server. You could also use an HTML library like https://github.com/benpate/html but it works best in small doses, instead of for a whole app.

  • gomponents-htmx

    HTMX attributes and helpers for gomponents.

  • I've built www.gomponents.com for stuff like this and, in my not so humble opinion, it works great. I've got an HTMX extension for it as well: https://github.com/maragudk/gomponents-htmx

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • uhtml

    A micro HTML/SVG render

  • I have to say that I am an extremist minimalist, so I use a nano-framework I developed for the frontend, with uhtml (https://github.com/WebReflection/uhtml) and some JavaScript libraries to help.

  • esbuild

    An extremely fast bundler for the web

  • I use ESBuild (https://esbuild.github.io/) as a library for my almost pure Go toolchain, and it covers my requirements for almost 2 years now. ESBuild is the Go tool used in Vite, an incredible tool that I stopped using when I discovered that ESBuild covered all my needs.

  • svelte-mpa

    Svelte MPA, Multipage Svelte

  • air

    ☁️ Live reload for Go apps

  • Do you use anything for live reloading? This is one aspect I miss when using gomponents compared to go templates, where I had a setup using Browsersync, which immediately refreshed whenever html/css/js changed. Now, since all HTML is within Go code, I have to recompile my go program to see changes, which takes up to ~5sec (I use https://github.com/cosmtrek/air for this).

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts