Best UI Framework Options for Golang API Integration?

I’m currently developing a project that involves a Go backend and I’m looking for the optimal strategy to construct the frontend. Although I’ve been utilizing Next.js, I’ve encountered challenges where I often resort to using Next API routes instead of properly interfacing with my Go server, leading to confusion and disarray.

The primary issue I face is that during client-side rendering, users experience a blank page for several seconds while the data is fetched from my Go API. Even with loading indicators, the overall user experience feels sluggish and unrefined.

I’m in search of a solution that merges the advantages of both approaches. On one hand, I require the interactive capabilities offered by JavaScript frameworks (such as handling button clicks, managing forms, and making dynamic updates). On the other hand, I want certain content to be pre-rendered on the server to ensure fast loading times for pages.

A suggestion I received was to use Vite alongside React and connect through a JSON API. However, this still presents the same delay issue. Is there a way to attain the benefits of server-side rendering while retaining React’s component structure? Perhaps similar to PHP which fully renders pages on the server before sending them to the client?

What frontend solutions are effective for integrating with Go backends in this hybrid model?

This sounds more like a hydration strategy problem than a framework issue. I’ve built plenty of Go backends, and adding proper caching layers makes a huge difference in how fast things feel. Try Redis or something similar between your Go API and frontend - it’ll cut down those loading delays. For your specific needs, check out Remix. It handles data loading at the route level instead of the usual SSR approach, and it plays really well with external APIs. You won’t get those waterfall loading problems you’re seeing with Next.js client-side fetching. I’ve also had good luck with GraphQL as a middle layer. You can batch requests and cut down the round trips between your frontend and Go backend. Loading times improve a lot while keeping all the interactivity you want.

htmx + go is exactly what u need here. I’ve been runnng this combo for months - u get server-side renderng with real interactivity, zero js headaches. Your go backend just sends html fragments, htmx handles the swapping. no more blank pages or slow loads. works perfectly with templ or standard html templates.

have u looked into Solid.js with island archtecture? it could be just what u need - instant page loads n reactive comps! it’s kinda like Astro but offers more control. btw, what’s your backend serving? streaming responses might help with that blank page problem.