What Leptos Does
- Fine-grained reactivity — signals (like SolidJS, not VDOM)
- SSR — server-side rendering with streaming
- Hydration — pick up server-rendered HTML on client
- Server functions —
#[server]functions called from client - Routing — file-based or declarative
- Suspense — async data loading boundaries
- Islands — partial hydration for minimal WASM
- Actix or Axum — server integration
Comparison
| Framework | Reactivity | SSR | WASM |
|---|---|---|---|
| Leptos | Signals | Streaming | Yes |
| Dioxus | Signals | Yes | Yes |
| Yew | VDOM | Yes | Yes |
| SolidJS | Signals | Yes | No (JS) |
常见问题 FAQ
Q: 为什么选 signals 而非 VDOM? A: Signals 只更新变化的 DOM 节点(O(1)),VDOM 需要 diff 整个树(O(n))。性能更好、WASM bundle 更小。
Q: 和 SolidJS 类似? A: 非常类似。Leptos 的 API 设计深受 SolidJS 启发,但全栈 Rust(类型安全 + WASM 性能)。
来源与致谢 Sources
- Docs: https://leptos.dev
- GitHub: https://github.com/leptos-rs/leptos
- License: MIT