Skip to content

Commit 5747e00

Browse files
author
Alexandre Kirszenberg
committed
Various typos/grammar/rewording
1 parent f66cda4 commit 5747e00

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+168
-168
lines changed

README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,11 @@ Dioxus is heavily inspired by React, but we want your transition to feel like an
161161
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.
162162

163163

164-
### Isn't the overhead for interacting with the DOM from WASM too much?
165-
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.
164+
### Isn't the overhead for interacting with the DOM from Wasm too much?
165+
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.
166166

167-
### Aren't WASM binaries too huge to deploy in production?
168-
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.
167+
### Aren't Wasm binaries too huge to deploy in production?
168+
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.
169169

170170
For reference, Dioxus `hello-world` clocks in at around 70kb gzip or 60kb brotli, and Dioxus supports SSR.
171171

@@ -176,7 +176,7 @@ There are plenty Rust Elm-like frameworks in the world - we were not interested
176176
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.
177177

178178
### What are the build times like? Why on earth would I choose Rust instead of JS/TS/Elm?
179-
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.
179+
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.
180180

181181
### What about Yew/Seed/Sycamore/Dominator/Dodrio/Percy?
182182
- 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
193193
You shouldn't use Dioxus if:
194194
- You don't like the React Hooks approach to frontend
195195
- You need a no-std renderer
196-
- You want to support browsers where WASM or asm.js are not supported.
196+
- You want to support browsers where Wasm or asm.js are not supported.
197197

198198

199199
## License

docs/src/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
![dioxuslogo](./images/dioxuslogo_full.png)
44

5-
**Dioxus** is a framework and ecosystem for building fast, scalable, and robust user interfaces with the Rust programming language. This guide will help you get up-and-running with Dioxus running on the Web, Desktop, Mobile, and more.
5+
**Dioxus** is a framework and ecosystem for building fast, scalable, and robust user interfaces with the Rust programming language. This guide will help you get up-and-running with Dioxus running on the Web, Desktop, Mobile, and more.
66

77
```rust, ignore
88
// An example Dioxus app - closely resembles React
@@ -24,7 +24,7 @@ The Dioxus API and patterns closely resemble React - if this guide is lacking in
2424
### Web Support
2525
---
2626

27-
The Web is the most-supported target platform for Dioxus. To run on the Web, your app must be compiled to WebAssembly and depend on the `dioxus` crate with the `web` feature enabled. Because of the WASM limitation, not every crate will work with your web-apps, so you'll need to make sure that your crates work without native system calls (timers, IO, etc).
27+
The Web is the most-supported target platform for Dioxus. To run on the Web, your app must be compiled to WebAssembly and depend on the `dioxus` crate with the `web` feature enabled. Because of the Wasm limitation, not every crate will work with your web-apps, so you'll need to make sure that your crates work without native system calls (timers, IO, etc).
2828

2929
Because the web is a fairly mature platform, we expect there to be very little API churn for web-based features.
3030

@@ -88,7 +88,7 @@ Examples:
8888
### LiveView Support
8989
---
9090

91-
The internal architecture of Dioxus was designed from day one to support the `LiveView` use-case, where a web server hosts a running app for each connected user. As of today, there is no out-of-the-box LiveView support - you'll need to wire this up yourself. While not currently fully implemented, the expectation is that LiveView apps can be a hybrid between WASM and server-rendered where only portions of a page are "live" and the rest of the page is either server-rendered, statically generated, or handled by the host SPA.
91+
The internal architecture of Dioxus was designed from day one to support the `LiveView` use-case, where a web server hosts a running app for each connected user. As of today, there is no out-of-the-box LiveView support - you'll need to wire this up yourself. While not currently fully implemented, the expectation is that LiveView apps can be a hybrid between Wasm and server-rendered where only portions of a page are "live" and the rest of the page is either server-rendered, statically generated, or handled by the host SPA.
9292

9393

9494

docs/src/advanced-guides/custom-renderer.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ enum DomEdit {
4949
}
5050
```
5151

52-
The Dioxus diffing mechanism operates as a [stack machine](https://en.wikipedia.org/wiki/Stack_machine) where the "push_root" method pushes a new "real" DOM node onto the stack and "append_child" and "replace_with" both remove nodes from the stack.
52+
The Dioxus diffing mechanism operates as a [stack machine](https://en.wikipedia.org/wiki/Stack_machine) where the "push_root" method pushes a new "real" DOM node onto the stack and "append_child" and "replace_with" both remove nodes from the stack.
5353

5454

5555
### An example
@@ -60,7 +60,7 @@ For the sake of understanding, lets consider this example - a very simple UI dec
6060
rsx!( h1 {"hello world"} )
6161
```
6262

63-
To get things started, Dioxus must first navigate to the container of this h1 tag. To "navigate" here, the internal diffing algorithm generates the DomEdit `PushRoot` where the ID of the root is the container.
63+
To get things started, Dioxus must first navigate to the container of this h1 tag. To "navigate" here, the internal diffing algorithm generates the DomEdit `PushRoot` where the ID of the root is the container.
6464

6565
When the renderer receives this instruction, it pushes the actual Node onto its own stack. The real renderer's stack will look like this:
6666

@@ -228,7 +228,7 @@ For example, the `div` element is (approximately!) defined as such:
228228
```rust
229229
struct div;
230230
impl div {
231-
/// Some glorious documentaiton about the class proeprty.
231+
/// Some glorious documentation about the class property.
232232
#[inline]
233233
fn class<'a>(&self, cx: NodeFactory<'a>, val: Arguments) -> Attribute<'a> {
234234
cx.attr("class", val, None, false)
@@ -251,7 +251,7 @@ There are three opportunities for platform incompatibilities to break your progr
251251

252252
The best hooks will properly detect the target platform and still provide functionality, failing gracefully when a platform is not supported. We encourage - and provide - an indication to the user on what platforms a hook supports. For issues 1 and 2, these return a result as to not cause panics on unsupported platforms. When designing your hooks, we recommend propagating this error upwards into user facing code, making it obvious that this particular service is not supported.
253253

254-
This particular code _will panic_ due to the unwrap on downcast_ref. Try to avoid these types of patterns.
254+
This particular code _will panic_ due to the unwrap on downcast_ref. Try to avoid these types of patterns.
255255

256256
```rust
257257
let div_ref = use_node_ref(cx);

docs/src/advanced-guides/liveview.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Dioxus Liveview
2-
Liveview is a configuration where a server and a client work together to render a Dioxus app. Liveview monomorphizes a web application, eliminating the need for frontend-specific APIs.
2+
Liveview is a configuration where a server and a client work together to render a Dioxus app. Liveview monomorphizes a web application, eliminating the need for frontend-specific APIs.
33

4-
This is a developer-friendly alternative to the JAM-stack (Javascript + API + Markdown), combining the WASM-compatibility and async performance of Rust.
4+
This is a developer-friendly alternative to the JAM-stack (Javascript + API + Markdown), combining the Wasm-compatibility and async performance of Rust.
55

66
## Why liveview?
77

8-
### No APIs necessary!
9-
Because Liveview combines the server and the client, you'll find dedicated APIs unnecessary. You'll still want to implement a datafetching service for Live-apps, but this can be implemented as a crate and shared between apps. This approach was designed to let you model out your data requirements without needing to maintain a public versioned API.
8+
### No APIs necessary!
9+
Because Liveview combines the server and the client, you'll find dedicated APIs unnecessary. You'll still want to implement a data-fetching service for Live-apps, but this can be implemented as a crate and shared between apps. This approach was designed to let you model out your data requirements without needing to maintain a public versioned API.
1010

1111
You can find more information to data modeling and fetching for LiveApps in the "Book of Dioxus Patterns".
1212

docs/src/concepts/00-index.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
In this chapter of the book, we'll cover some core topics on how Dioxus works and how to best leverage the features to build a beautiful, reactive app.
44

5-
At a very high level, Dioxus is simply a Rust framework for _declaring_ user interfaces and _reacting_ to changes.
5+
At a very high level, Dioxus is simply a Rust framework for _declaring_ user interfaces and _reacting_ to changes.
66

77
1) We declare what we want our user interface to look like given a state using Rust-based logic and control flow.
88
2) We declare how we want our state to change when the user triggers an event.
@@ -12,7 +12,7 @@ At a very high level, Dioxus is simply a Rust framework for _declaring_ user int
1212

1313
Dioxus is a *declarative* framework. This means that instead of manually writing calls to "create element" and "set element background to red," we simply *declare* what we want the element to look like and let Dioxus handle the differences.
1414

15-
Let's pretend that we have a stoplight we need to control - it has a color state with red, yellow, and green as options.
15+
Let's pretend that we have a stoplight we need to control - it has a color state with red, yellow, and green as options.
1616

1717

1818
Using an imperative approach, we would have to manually declare each element and then handlers for advancing the stoplight.

docs/src/concepts/06-subscription-api.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Yew subscriptions are used to schedule update for components into the future. Th
66
fn Component(cx: Component<()>) -> DomTree {
77
let update = cx.schedule();
88

9-
// Now, when the subscription is called, the component will be re-evaluted
9+
// Now, when the subscription is called, the component will be re-evaluated
1010
update.consume();
1111
}
1212
```

docs/src/concepts/10-concurrent-mode.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ async fn ExampleLoader(cx: Context<()>) -> Vnode {
5656

5757
match name {
5858
Ok(name) => rsx! { <div> "Hello {something}" </div> },
59-
Err(e) => rsx! { <div> "An error occured :(" </div>}
59+
Err(e) => rsx! { <div> "An error occurred :(" </div>}
6060
}
6161
}
6262
```

docs/src/concepts/11-arena-memo.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,4 @@ fn test(cx: Context<()>) -> DomTree {
5353
}
5454
```
5555

56-
While the contents of the destructued bundle might change, not every child component will need to be re-rendered.
56+
While the contents of the destructured bundle might change, not every child component will need to be re-rendered.

docs/src/concepts/vnodes.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# VNodes and Elements
22

3-
At the heart of Dioxus is the concept of an "element" - a container that can have children, properties, event handlers, and other important attributes. Dioxus only knows how to render the `VNode` datastructure - an Enum variant of an Element, Text, Components, Fragments, and Anchors.
3+
At the heart of Dioxus is the concept of an "element" - a container that can have children, properties, event handlers, and other important attributes. Dioxus only knows how to render the `VNode` data structure - an Enum variant of an Element, Text, Components, Fragments, and Anchors.
44

55
Because Dioxus is meant for the Web and uses WebView as a desktop and mobile renderer, almost all elements in Dioxus share properties with their HTML counterpart. When we declare our elements, we'll do so using HTML semantics:
66

@@ -27,8 +27,8 @@ And produce the corresponding html structure:
2727
<div>hello world</div>
2828
```
2929

30-
Our structure declared above is made of two variants of the `VNode` datastructure:
31-
- A VElement with a tagname of `div`
30+
Our structure declared above is made of two variants of the `VNode` data structure:
31+
- A VElement with a tag name of `div`
3232
- A VText with contents of `"hello world"`
3333

3434
## All the VNode types
@@ -49,7 +49,7 @@ To speed up the process of building our elements and text, Dioxus uses a special
4949
- Bumpalo: [https://github.com/fitzgen/bumpalo](https://github.com/fitzgen/bumpalo)
5050
- Dodrio: [https://github.com/fitzgen/dodrio](https://github.com/fitzgen/dodrio)
5151

52-
In other frontend frameworks for Rust, nearly every string is allocated using the global allocator. This means that strings in Rust do not benefit from the immutable string interning optimizations that JavaScript engines employ. By using a smaller, faster, more limited allocator, we can increase framework performance, bypassing even the naive WasmBindgen benchmarks for very quick renders.
52+
In other frontend frameworks for Rust, nearly every string is allocated using the global allocator. This means that strings in Rust do not benefit from the immutable string interning optimizations that JavaScript engines employ. By using a smaller, faster, more limited allocator, we can increase framework performance, bypassing even the naive wasm-bindgen benchmarks for very quick renders.
5353

5454
It's important to note that VNodes are not `'static` - the VNode definition has a lifetime attached to it:
5555

docs/src/gettingstarted/fromjs.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ let val = 10; // rust
1818
const val = 10; // js
1919
```
2020

21-
However, `const` in JS does not prohibit you from modify the value itself only disallowing assignment. In Rust, immutable **is immutable**. You _never_ have to work about accidentally mutating data; mutating immutable data in Rust requires deliberate advanced datastructures that you won't find in your typical frontend code.
21+
However, `const` in JS does not prohibit you from modify the value itself only disallowing assignment. In Rust, immutable **is immutable**. You _never_ have to work about accidentally mutating data; mutating immutable data in Rust requires deliberate advanced data structures that you won't find in your typical frontend code.
2222

2323
## How do strings work?
2424

docs/src/hello_world.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ If you plan to develop extensions for the `Dioxus` ecosystem, please use the `di
7878
Now, let's edit our `main.rs` file:
7979

8080
```rust
81-
use diouxs::prelude::*;
81+
use dioxus::prelude::*;
8282

8383

8484
fn main() {
@@ -97,7 +97,7 @@ Let's dissect our example a bit.
9797
This bit of code imports everything from the the `prelude` module. This brings into scope the right traits, types, and macros needed for working with Dioxus.
9898

9999
```rust
100-
use diouxs::prelude::*;
100+
use dioxus::prelude::*;
101101
```
102102

103103
This initialization code launches a Tokio runtime on a helper thread - where your code will run, and then the WebView on the main-thread. Due to platform requirements, the main thread is blocked by this call.
@@ -124,7 +124,7 @@ The closure `FC<()>` syntax is identical to the function syntax, but with lifeti
124124
fn App<'a>(cx: Context<'a>, props: &'a ()) -> DomTree<'a> {
125125
cx.render(rsx! {
126126
div { "Hello, world!" }
127-
})
127+
})
128128
}
129129
```
130130

docs/src/platforms/00-index.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
## Running Examples
44

5-
We use the dedicated `dioxus-cli` to build and test dioxus web-apps. This can run examples, tests, build web workers, launch development servers, bundle, and more. It's general purpose, but currently very tailored to Dioxus for liveview and bundling. If you've not used it before, `cargo install --path pacakages/dioxus-cli` will get it installed. This CLI tool should feel like using `cargo` but with 1st party support for assets, bundling, and other important dioxus-specific features.
5+
We use the dedicated `dioxus-cli` to build and test dioxus web-apps. This can run examples, tests, build web workers, launch development servers, bundle, and more. It's general purpose, but currently very tailored to Dioxus for liveview and bundling. If you've not used it before, `cargo install --path packages/dioxus-cli` will get it installed. This CLI tool should feel like using `cargo` but with 1st party support for assets, bundling, and other important dioxus-specific features.
66

77
Alternatively, `trunk` works but can't run examples.
88

99
- tide_ssr: Handle an HTTP request and return an html body using the html! macro. `cargo run --example tide_ssr`
1010
- doc_generator: Use dioxus SSR to generate the website and docs. `cargo run --example doc_generator`
1111
- fc_macro: Use the functional component macro to build terse components. `cargo run --example fc_macro`
12-
- hello_web: Start a simple wasm app. Requires a web packer like dioxus-cli or trunk `cargo run --example hello`
12+
- hello_web: Start a simple Wasm app. Requires a web packer like dioxus-cli or trunk `cargo run --example hello`
1313
- router: `cargo run --example router`
1414
- tide_ssr: `cargo run --example tide_ssr`
1515
- webview: Use liveview to bridge into a webview context for a simple desktop application. `cargo run --example webview`

docs/src/platforms/02-wasm.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
# The WASM Guide
1+
# The Wasm Guide
22

3-
This guide will help you build your first app that leverages WASM in the browser to display the user interface.
3+
This guide will help you build your first app that leverages Wasm in the browser to display the user interface.

docs/src/platforms/05-liveview.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ fn live_component(cx: &Context<()>) -> DomTree {
1212
#[cfg(target_arch = "wasm32")]
1313
|| html! { <div> {"Loading data from server..."} </div> },
1414

15-
// Renderered on the server
15+
// Rendered on the server
1616
#[cfg(not(target_arch = "wasm32"))]
1717
|| html! { <div> {"Server Data Loaded!"} </div> },
1818
)

0 commit comments

Comments
 (0)