Known trade-offs
These aren't to-dos; they're by design:
- Client state always resets on reload. It's memory only, never touches storage, and isn't a draft-saving mechanism.
- Server instances don't survive a reload either. The uuid goes away with the DOM, and the next
linker::mountcreates a new one. To let users resume, save a draft in the database. - No arithmetic in attributes. You can compare (
data-state-is="step=2"), not compute. - Replacing whole blocks sends more bytes than a diff. You decide how big a fragment is.
- Pages that need SEO or must work without JS use normal routes. This is progressive enhancement, not the only path.
The Rust version adds a few trade-offs of its own:
- Each component has to be written once in Rust. Blade views can't be used directly; every component is ported to a builder, and a snapshot test proves the output matches. So far there are Badge, Button and Icon.
- Fragment functions can't see the logged-in user.
RenderInputhas onlymethod,params,targetandurl. When content depends on the user, let Linker decide (it knowscontext.user); see Server-side checks. - No attribute macros. PHP's
#[Validate],#[RequiresAuth]and#[Authorize]become a few lines in thecallmethod. You lose the declarative overview and gain compiler checks. - Linker always requires a login. The endpoints answer 401 when there's no user. Anonymous features use normal routes or render fragments.
When not to use this
| Situation | Why |
|---|---|
| Public content pages that need SEO | Normal routes and server rendering are enough; render fragments / Linker are progressive enhancement |
| Offline-first, drafts saved locally | Client state deliberately doesn't write to storage |
| Heavy real-time collaboration (several people editing at once) | There's no push channel, and a Stateful instance belongs to one user |
| You already have a full SPA and API | Mixing two mental models usually costs more than it gains. This starter's / is itself Inertia + React, so they can coexist, but don't mix them on one page |
| You need large components the PHP version has but Rust hasn't ported (Table, Chart, Modal…) | The JS is here; the Rust builders aren't yet. See vs the PHP version |
| You want a stable dependency | Both sides are still moving: no releases, no compatibility promise |
Why it's still worth it
- You can see the whole attack surface: the registry in
src/cg/mod.rs, each component'sMETHODS, and the action table. Those three lists are everything. - Error handling is written once: zero lines of JS per module.
- You debug values, not algorithms: there's no diff, so when the page is wrong you look at keys and fragments.
- Types catch mistakes at compile time: component colors and sizes are enums, and Linker action arguments are checked when the response is built.