Merge branch 'master' into jk/remove_node_safety
This commit is contained in:
commit
db0004758c
45 files changed
+156
-156
No files matched your search
@@ -161,11 +161,11 @@ Dioxus is heavily inspired by React, but we want your transition to feel like an
|
||||
Remember: Dioxus is a library - not a compiler like Svelte. Plus, the inner VirtualDOM allows Dioxus to easily port into different runtimes, support SSR, and run remotely in the cloud. VDOMs tend to more ergonomic to work with and feel roughly like natural Rust code. The overhead of Dioxus is **extraordinarily** minimal... sure, there may be some overhead but on an order of magnitude lower than the time required to actually update the page.
|
||||
|
||||
|
||||
### Isn't the overhead for interacting with the DOM from WASM too much?
|
||||
The overhead layer between WASM and JS APIs is extremely poorly understood. Rust web benchmarks typically suffer from differences in how Rust and JS cache strings. In Dioxus, we solve most of these issues and our JS Framework Benchmark actually beats the WASM Bindgen benchmark in many cases. Compared to a "pure vanilla JS" solution, Dioxus adds less than 5% of overhead and takes advantage of batched DOM manipulation.
|
||||
### Isn't the overhead for interacting with the DOM from Wasm too much?
|
||||
The overhead layer between Wasm and JS APIs is extremely poorly understood. Rust web benchmarks typically suffer from differences in how Rust and JS cache strings. In Dioxus, we solve most of these issues and our JS Framework Benchmark actually beats the Wasm Bindgen benchmark in many cases. Compared to a "pure vanilla JS" solution, Dioxus adds less than 5% of overhead and takes advantage of batched DOM manipulation.
|
||||
|
||||
### Aren't WASM binaries too huge to deploy in production?
|
||||
WASM binary sizes are another poorly understood characteristic of Rust web apps. 50kb of WASM and 50kb of JS are _not_ made equally. In JS, the code must be downloaded _first_ and _then_ JIT-ted. Just-in-time compiling 50kb of JavaScript takes a while which is why 50kb of JavaScript sounds like a lot! However, with WASM, the code is downloaded and JIT-ted _simultaneously_ through the magic of streaming compilation. By the time the 50kb of Rust is finished downloading, it is already ready to go. Again, Dioxus beats out many benchmarks with time-to-interactivity.
|
||||
### Aren't Wasm binaries too huge to deploy in production?
|
||||
Wasm binary sizes are another poorly understood characteristic of Rust web apps. 50kb of Wasm and 50kb of JS are _not_ made equally. In JS, the code must be downloaded _first_ and _then_ JIT-ted. Just-in-time compiling 50kb of JavaScript takes a while which is why 50kb of JavaScript sounds like a lot! However, with Wasm, the code is downloaded and JIT-ted _simultaneously_ through the magic of streaming compilation. By the time the 50kb of Rust is finished downloading, it is already ready to go. Again, Dioxus beats out many benchmarks with time-to-interactivity.
|
||||
|
||||
For reference, Dioxus `hello-world` clocks in at around 70kb gzip or 60kb brotli, and Dioxus supports SSR.
|
||||
|
||||
@@ -176,7 +176,7 @@ There are plenty Rust Elm-like frameworks in the world - we were not interested
|
||||
The `RSX` DSL is _barely_ a DSL. Rustaceans will find the DSL very similar to simply assembling nested structs, but without the syntactical overhead of "Default" everywhere or having to jump through hoops with the builder pattern. Between RSX, HTML, the Raw Factory API, and the NodeBuilder syntax, there's plenty of options to choose from.
|
||||
|
||||
### What are the build times like? Why on earth would I choose Rust instead of JS/TS/Elm?
|
||||
Dioxus builds as roughly as fast as a complex WebPack-TypeScript site. Compile times will be slower than an equivalent TypeScript site, but not unbearably slow. The WASM compiler backend for Rust is very fast. Iterating on small components is basically instant and larger apps takes a few seconds. In practice, the compiler guarantees of Rust balance out the rebuild times.
|
||||
Dioxus builds as roughly as fast as a complex WebPack-TypeScript site. Compile times will be slower than an equivalent TypeScript site, but not unbearably slow. The Wasm compiler backend for Rust is very fast. Iterating on small components is basically instant and larger apps takes a few seconds. In practice, the compiler guarantees of Rust balance out the rebuild times.
|
||||
|
||||
### What about Yew/Seed/Sycamore/Dominator/Dodrio/Percy?
|
||||
- Yew and Seed use an Elm-like pattern and don't support SSR or any alternate rendering platforms
|
||||
@@ -193,7 +193,7 @@ In the future, we are interested in using Webrenderer to provide a fully native
|
||||
You shouldn't use Dioxus if:
|
||||
- You don't like the React Hooks approach to frontend
|
||||
- You need a no-std renderer
|
||||
- You want to support browsers where WASM or asm.js are not supported.
|
||||
- You want to support browsers where Wasm or asm.js are not supported.
|
||||
|
||||
|
||||
## License
|
||||
|
||||
Reference in new issue
Block a user