Skip to content

Commit cfb089e

Browse files
committed
Futuresolo's changes to website/docs
1 parent 40d307f commit cfb089e

File tree

18 files changed

+29
-29
lines changed

18 files changed

+29
-29
lines changed

website/docs/advanced-topics/server-side-rendering.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ This approach works fine for most websites, with some caveats:
1515

1616
1. Users will not be able to see anything until the entire WebAssembly
1717
bundle is downloaded and the initial render has been completed.
18-
This can result in a poor user experience on a slow network.
18+
This can result in a poor experience for users on a slow network.
1919
2. Some search engines do not support dynamically rendered web content and
2020
those who do usually rank dynamic websites lower in the search results.
2121

@@ -26,7 +26,7 @@ To solve these problems, we can render our website on the server side.
2626
Yew provides a `ServerRenderer` to render pages on the
2727
server side.
2828

29-
To render Yew components on the server-side, you can create a renderer
29+
To render Yew components on the server side, you can create a renderer
3030
with `ServerRenderer::<App>::new()` and call `renderer.render().await`
3131
to render `<App />` into a `String`.
3232

website/docs/advanced-topics/struct-components/introduction.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: 'Components in Yew'
55

66
## What are Components?
77

8-
Components are the building blocks of Yew. They manage their state and can render themselves to the DOM.
8+
Components are the building blocks of Yew. They manage an internal state and can render elements to the DOM.
99
Components are created by implementing the `Component` trait for a type.
1010

1111
## Writing Component's markup

website/docs/advanced-topics/struct-components/lifecycle.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ before it is destroyed. This method is optional and does nothing by default.
213213
### Infinite loops
214214

215215
Infinite loops are possible with Yew's lifecycle methods but are only caused when trying to update
216-
the same component after every rendering, when that update also requests the component to be rendered.
216+
the same component after every render, when that update also requests the component to be rendered.
217217

218218
A simple example can be seen below:
219219

website/docs/concepts/basic-web-technologies/css.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ comment: 'Keep this file as short and simple as possible. Its purpose is to ease
77
import Tabs from '@theme/Tabs'
88
import TabItem from '@theme/TabItem'
99

10-
Yew does not natively provide a CSS in Rust solution but helps with styling by providing
10+
Yew does not natively provide a CSS-in-Rust solution but helps with styling by providing
1111
programmatic ways to interact with the HTML `class` attribute.
1212

1313
## Classes

website/docs/concepts/basic-web-technologies/js.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ sometimes rely on calling JavaScript. What follows is an overview of the involve
1616

1717
## wasm-bindgen
1818

19-
[`wasm-bindgen`](https://github.com/rustwasm/wasm-bindgen) is a library and tool that enables calls to JavaScript from Rust and back to Rust from JavaScript.
19+
[`wasm-bindgen`](https://github.com/rustwasm/wasm-bindgen) is a library and tool that bridges calls between JavaScript and Rust functions.
2020

2121
We highly recommend you take a look at their [documentation](https://rustwasm.github.io/docs/wasm-bindgen/) and our [quick guide](./wasm-bindgen.mdx).
2222

website/docs/concepts/basic-web-technologies/wasm-bindgen.mdx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ for translating between the two. Using this macro is more advanced, and you shou
3838
for it unless you are trying to use an external JavaScript library. The `js-sys` and `web-sys`
3939
crates expose `wasm-bindgen` definitions for built-in JavaScript types and browser APIs.
4040

41-
Let's go over a simple example of using the `#[wasm-bindgen]` macro to import some specific flavors
41+
Let's go over a simple example of using the `#[wasm-bindgen]` macro to import some specific flavours
4242
of the [`console.log`](https://developer.mozilla.org/en-US/docs/Web/API/Console/log) function.
4343

4444
```rust ,no_run
@@ -204,8 +204,9 @@ There are three main interfaces in this crate currently:
204204

205205
1. [`JsFuture`](https://rustwasm.github.io/wasm-bindgen/api/wasm_bindgen_futures/struct.JsFuture.html) -
206206
A type that is constructed with a [`Promise`](https://rustwasm.github.io/wasm-bindgen/api/js_sys/struct.Promise.html)
207-
and can then be used as a `Future<Output=Result<JsValue, JsValue>>`. This Rust future will resolve
208-
or reject the value coming out of the `Promise`.
207+
and can then be used as a `Future<Output=Result<JsValue, JsValue>>`. This `Future` will resolve to `Ok` if
208+
the `Promise` is resolved and `Err` if the `Promise` is rejected, containing the resolved or rejected
209+
value from the `Promise` respectively.
209210

210211
2. [`future_to_promise`](https://rustwasm.github.io/wasm-bindgen/api/wasm_bindgen_futures/fn.future_to_promise.html) -
211212
Converts a Rust `Future<Output=Result<JsValue, JsValue>>` into a

website/docs/concepts/basic-web-technologies/web-sys.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ procedurally generated from browser WebIDL which is why some names are so long a
1313

1414
The `web-sys` crate with all of its features enabled can add lots of bloat to a Wasm application.
1515
To get around this issue most types are feature gated so that you only include the types
16-
you require for your application. Yew includes several features from `web-sys` and
16+
you require for your application. Yew enables several features from `web-sys` and
1717
exposes some types in its public API. You will often need to add `web-sys` as a dependency yourself.
1818

1919
## Inheritance in `web-sys`
@@ -128,8 +128,8 @@ fn with_jscast(node_ref: NodeRef) {
128128

129129
## JavaScript example to Rust
130130

131-
This section shows that examples which use JavaScript to interact with the Web APIs
132-
can be adapted and written using Rust with `web-sys`.
131+
This section demonstrates examples of how JavaScript code which interact with the
132+
Web APIs can be rewritten with `web-sys` in Rust.
133133

134134
### JavaScript example
135135

website/docs/concepts/function-components/hooks/custom-hooks.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: 'Custom Hooks'
44

55
## Defining custom Hooks
66

7-
A component's stateful logic can be extracted into reusable functions by creating custom Hooks.
7+
The stateful logic of a component can be extracted into reusable functions by creating custom Hooks.
88

99
Consider that we wish to create an event listener that listens to an event on the `window`
1010
object.
@@ -34,13 +34,13 @@ pub fn show_storage_changed() -> Html {
3434
```
3535

3636
There's one problem with this code: the logic can't be reused by another component.
37-
If we build another component that keeps track of the event,
37+
If we build another component that listens to a different event,
3838
instead of copying the code, we can move the logic into a custom hook.
3939

4040
We'll start by creating a new function called `use_event`.
4141
The `use_` prefix denotes that a function is a hook.
4242
This function will take an event target, an event type, and a callback.
43-
All hooks must be marked by `#[hook]` to function.
43+
All hooks must be marked by `#[hook]` on their function definition.
4444

4545
```rust
4646
use web_sys::{Event, EventTarget};

website/docs/concepts/function-components/hooks/introduction.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ slug: /concepts/function-components/hooks
77

88
Hooks are functions that let you store state and perform side effects.
99

10-
Yew comes with a few pre-defined Hooks. You can also create your own or discover many [community-made hooks](/community/awesome#hooks).
10+
Yew comes with a few pre-defined hooks. You can also create your own or discover many [community-made hooks](/community/awesome#hooks).
1111

1212
## Rules of hooks
1313

website/docs/concepts/function-components/properties.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ A type has to implement the `Properties` trait before it can be used as the prop
1818

1919
## Reactivity
2020

21-
Yew checks if Props have changed when reconciling the virtual DOM during re-rendering, to know if nested components need to be re-rendered.
21+
Yew checks if props have changed when reconciling the Virtual DOM during re-rendering, to know if nested components need to be re-rendered.
2222
This way Yew can be considered a very reactive framework, as changes from the parent will always be propagated downward,
2323
and the view will never be out of sync with the data coming from props/state.
2424

@@ -102,7 +102,7 @@ fn App() -> Html {
102102
## Derive macro field attributes
103103

104104
When deriving `Properties` all fields are required by default.
105-
The following attributes allow you to give your props default values which will be used when a parent has not set them.
105+
The following attributes allow you to give your props default values which will be used when the parent has not set them.
106106

107107
:::tip
108108
Attributes aren't visible in Rustdoc generated documentation.

0 commit comments

Comments
 (0)