Dev iconDevSep 11, 2026 ~1 min source read

Server functions in Fitz: call the server from a WASM component, no plumbing

No hand-written HTTP handler, no fetch, no JSON glue, no route strings, no external deps. (Part 7 of the FitzLiveViews series — the "whole stack, no plumbing" moment.) Earlier parts showed a.fitzv component compiling two ways: to server-rendered HTML (LiveViews over a WebSocket) and to a standalone WebAssembly SPA.

Server functions in Fitz: call the server from a WASM component, no plumbing

Share this story

Send the public story page.

Useful takeaways from this story.

No hand-written HTTP handler, no fetch, no JSON glue, no route strings, no external deps.

Anything real — reading the database, checking a token — has to happen on the server, and the classic bridge is plumbing: write an endpoint, write a fetch, marshal the JSON both ways, and keep the types in...

(Part 7 of the FitzLiveViews series — the "whole stack, no plumbing" moment.) Earlier parts showed a.fitzv component compiling two ways: to server-rendered HTML (LiveViews over a WebSocket) and to a...

Building the complete brief

The page is ready to read now. The fuller skim-friendly version will appear here automatically.

The useful part

No hand-written HTTP handler, no fetch, no JSON glue, no route strings, no external deps. (Part 7 of the FitzLiveViews series — the "whole stack, no plumbing" moment.) Earlier parts showed a.fitzv component compiling two ways: to server-rendered HTML (LiveViews over a WebSocket) and to a standalone WebAssembly SPA. Anything real — reading the database, checking a token — has to happen on the server, and the classic bridge is plumbing: write an endpoint, write a fetch, marshal the JSON both ways, and keep the types in sync by hand.

How it works

  • It's a normal async fn — it could open a Postgres connection, run an ORM query, verify a JWT.

Details worth keeping

Both are great — but a component in the browser is an island. This part erases all of that with one decorator.

Keep reading in the app

Open the app view to save this story, compare related coverage, and continue from the same source.

Open in app