Sunday, November 29, 2026
HomeGolangGoUI – Server-driven UI framework for Go - Technical Dialogue

GoUI – Server-driven UI framework for Go – Technical Dialogue


Hiya everybody,

I’d wish to share a challenge I’ve been engaged on known as GoUI.

GoUI is an experimental server-driven UI framework for Go that goals to simplify internet utility improvement by preserving the applying logic on the server whereas delivering trendy, interactive person interfaces.

Key options embrace:

• Server-driven rendering
• Stateful parts
• Actual-time UI updates through WebSockets
• Search engine optimisation-friendly HTML output
• Minimal JavaScript
• Part-based structure
• Blade-inspired template engine for Go

The challenge continues to be in its early levels, and my major purpose is to assemble suggestions from skilled Go builders.

I’d actually respect your ideas on:

  • The general structure
  • API design
  • Developer expertise
  • Efficiency issues
  • Potential use circumstances
  • Any limitations or issues you see

GitHub:

I’m open to any criticism or ideas. Thanks for taking the time to test it out!



1 Like

It seems like you’re serving minimal HTML like <app id=""> to the consumer after which set off rendering with javascript, which connects to the server through websocket to retrieve the preliminary rendering for statefull parts?

If that is true, this isn’t very Search engine optimisation or first web page load pleasant. Often SSR offers the good thing about the browser getting the ultimate HTML & CSS instantly with none javascript processing or further round-trips on first load. On this approach the browser can begin layouting and rendering the ultimate web page in a streaming trend, whereas nonetheless receiving the HTML content material.

You must prerender the web page to supply a whole secure view on first pageload after which hydrate with javascript so as to add interactivity.

You’re proper that it is a actual drawback for the default mode — but it surely’s already dealt with, not ignored.

GoUI really has three web page modes, chosen per-route:

  • ModeLive (what you’re describing) — empty #app shell, WS connects and does the preliminary render. That is intentional for inside/authenticated views (admin panels, dashboards) the place Search engine optimisation and first-paint don’t matter and also you need the server to personal 100% of the render from the primary body.

  • ModeSEO — precisely what you’re asking for: full HTML + <head> meta (title, description, OG tags) is distributed on the primary response, so the browser can format/paint instantly with zero JS. The WebSocket then connects within the background and hydrates the prevailing DOM in place — no re-render, no flash, no further round-trip earlier than content material is seen.

  • ModeStatic — full HTML, no consumer script, no WebSocket in any respect. For pages with zero interactivity (authorized, about, and so on.), it’s a plain HTTP response, as low cost as a static file.

So the mode you’re pushing again on is the deliberate trade-off for stateful inside UIs, not the framework’s basic habits. Public/Search engine optimisation-sensitive routes use ModeSEO particularly to get the SSR-then-hydrate habits you described. Identical element mannequin, completely different supply technique per route — set with a single parameter on registration.

The “ModeLive” sounds pointless, as a result of the server will “personal 100% of the render” both approach. The one distinction between pre-rendering is, that the primary rendering occurs synchronously on the server and never asynchronously with a separate name.

It’s simply slower and extra noise with further community spherical journeys and format shifts within the browser.

Thanks — it is a truthful level, and we agree.

You’re proper that the server owns rendering both approach. Making ModeLive default to an empty shell + a second async round-trip was principally further latency, further community noise, and format shift.

We’ve adjusted the product accordingly:

  • With the web page renderer, ModeLive now does the primary render synchronously on the HTTP response (SSR), then hydrates over WebSocket.

  • Empty-shell ModeLive continues to be out there, however opt-in through DeferFirstRender.

  • ModeLive vs ModeSEO is principally Head/crawler metadata, not “sync vs async” first paint.

Actually respect you calling this out — it helped us tighten the defaults. Shipped in v1.1.0.

Calling a challenge with 5 commits model 1.1.0 most likely isn’t going to achieve loads of traction within the go group. The truth that you simply modified core performance reveals that this isn’t at v1. To not point out stuff like this.

In any other case, an attention-grabbing thought. Additionally – have you ever really handled websockets in manufacturing? I feel it’s going to be an extended haul to an precise v1. And in sure environments (Google Cloud Run for instance), websockets had been such a ache I ended up ripping them out and going again to long-polling HTTP requests. If I had been you, I’d strive constructing / deploying / operating an utility with this. Instruments that see precise use have a tendency to resolve precise issues in my expertise and be extra secure.



2 Likes

The three modes make the tradeoffs a lot clearer, and ModeSEO seems like the correct default for public pages. I’d hold ModeLive for authenticated views the place the WebSocket price issues much less.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments