DEV Community

John Still
John Still

Posted on

🧵 I Tried Building Frontend with Rust + Yew — Is It Just Spaghetti 2.0?

From the ashes of ASP and JSP rises a new breed of “component soup.” Is Rust + Yew the evolution or just history repeating itself?


TL;DR

Rust + Yew offers a unique, type-safe, full-Rust frontend experience powered by WebAssembly — but it comes with sharp edges.

If you’ve been burned by JavaScript fatigue or React overengineering, this is refreshing. Still, the ecosystem is young, tooling is thin, and you might just end up writing modern “spaghetti” if you're not careful.


🍝 From Spaghetti Code to Component Fusion: Have We Really Evolved?

Remember the early 2000s?

Back when HTML, JavaScript, server logic, and even CSS were tangled together in ASP and JSP pages. The result: spaghetti code that was impossible to debug and painful to maintain.

Today’s frameworks — React, Vue, Yew — claim to “componentize” our UIs. But by blending logic, state, and view into single files again, are we really fixing the problem… or just rewriting it with fancier syntax?


🦀 Why Rust for Frontend?

Rust has already proven itself on the backend with frameworks like actix-web and ORMs like Diesel. It offers:

  • âś… Memory safety
  • âś… Concurrency without fear
  • âś… Fast, small binaries

So the question became: can we push Rust to the frontend — and make it the real full-stack dream?


đź§Ş The Stack I Tried

I built a real app using:

  • Backend: actix-web + Diesel + PostgreSQL
  • Frontend: Yew — a Rust-based WebAssembly frontend framework
  • Communication: WebSocket + Cap’n Proto
  • Tooling: trunk, wasm-pack, Docker, and ServBay for local development

The idea was simple: keep everything in Rust. One language. One toolchain. One build system.


⚙️ Developer Experience: The Good, The Weird, and The WIP

🔼 Backend? Rock solid.

  • actix-web is battle-tested. Multithreading and TLS worked flawlessly.
  • Diesel gave me type-safe SQL. No runtime errors, real compile-time validation.
  • Docker + Rust’s static binaries = effortless deployments.

🌀 Frontend? A bit of a rollercoaster.

  • Yew is clean and component-based. Feels a bit like React with html! {} macros.
  • Pure Rust + WASM means no JavaScript glue... mostly.
  • Debugging? Let’s just say console.log doesn’t exist here unless you bridge back to JS.

🧪 Testing? That’s the catch.

  • No mature component testing tools.
  • End-to-end testing is mostly DIY.
  • Cap’n Proto support under wasm32-unknown-unknown is buggy.

⚙️ Build system? Surprisingly smooth (thanks, ServBay).

ServBay made it easy to spin up local environments with:

  • âś… Instant HTTPS (WASM demands secure context)
  • âś… Built-in Rust + Node + DB environments
  • âś… One-click config for cargo, rustup, trunk — no global pollution

🤔 Are We Just Repeating the Past?

Some say:

“Yew’s macro-heavy, all-in-one file style is just modern ASP — where's the separation of concerns?”

Fair. Component complexity does increase with state logic. And nesting macros isn’t for everyone.

But others argue:

“It’s structured fusion — a purposeful design to reduce mental overhead.”

I tend to agree. It's about boundaries, not physical file separation. With clear architecture, components can be expressive, testable, and maintainable — even in a single file.


âś… Who Should Try Fullstack Rust?

Good fit if you:

  • đź’ˇ Already write Rust on the backend
  • 📊 Build internal tools or data dashboards
  • đź§  Value type safety and compile-time guarantees
  • đź§Ş Enjoy exploring new stacks

❌ Who Should Avoid (For Now)?

Probably not for you if:

  • You need strong SEO (WASM-generated DOM is invisible to crawlers)
  • You care about pixel-perfect animations or visual design tools
  • You rely on rich JS ecosystems (like charts, modals, UI kits)

đź”® Final Thoughts

We’re not going backward — we’re rewriting the rules.

Yes, the structure looks familiar. But with better tooling, static typing, memory safety, and WASM’s performance, we’re solving old problems with new tools.

Just like spaghetti 🍝 can be organized into well-layered lasagna, modern components — even fused — can be elegant when designed well.

It’s not about what’s fused.
It’s about how you organize the fusion.


🧑‍💻 Have You Tried Rust Frontend?

Share your experience! What worked for you? Where did you struggle?
Let’s figure out this lasagna vs spaghetti debate once and for all.

Top comments (1)

Collapse
 
igit profile image
Markus

Thank you for your post, I find it very useful, especially your stack.

I compared yew with dioxus and settled for yew, which lead me to your post.

Could you please publish your app?