浏览代码

doc formatting and cleanup

Evan Almloff 2 年之前
父节点
当前提交
6b4a300880
共有 2 个文件被更改,包括 6 次插入11 次删除
  1. 2 7
      docs/guide/src/en/getting_started/hot_reload.md
  2. 4 4
      packages/hot-reload/README.md

+ 2 - 7
docs/guide/src/en/getting_started/hot_reload.md

@@ -5,16 +5,13 @@
 3. Currently the cli only implements hot reloading for the web renderer. For TUI, desktop, and LiveView you can use the hot reload macro instead.
 
 # Web
-
 For the web renderer, you can use the dioxus cli to serve your application with hot reloading enabled.
 
 ## Setup
-
 Install [dioxus-cli](https://github.com/DioxusLabs/cli).
 Hot reloading is automatically enabled when using the web renderer on debug builds.
 
 ## Usage
-
 1. Run:
 ```bash 
 dioxus serve --hot-reload
@@ -24,12 +21,10 @@ dioxus serve --hot-reload
 4. Save and watch the style change without recompiling
 
 # Desktop/Liveview/TUI
-
 For desktop, LiveView, and tui, you can place the hot reload macro at the top of your main function to enable hot reloading.
 Hot reloading is automatically enabled on debug builds.
 
 ## Setup
-
 Add the following to your main function:
 
 ```rust
@@ -48,5 +43,5 @@ cargo run
 3. Save and watch the style change without recompiling
 
 # Limitations
-1. The interpreter can only use expressions that existed on the last full recompile. If you introduce a new variable or expression to the rsx call, it will trigger a full recompile to capture the expression.
-2. Components and Iterators can contain arbitrary rust code and will trigger a full recompile when changed.
+1. The interpreter can only use expressions that existed on the last full recompile. If you introduce a new variable or expression to the rsx call, it will require a full recompile to capture the expression.
+2. Components, Iterators, and some attributes can contain arbitrary rust code and will trigger a full recompile when changed.

+ 4 - 4
packages/hot-reload/README.md

@@ -68,9 +68,9 @@ rsx! {
 
 ## Usage
 
-> For hot relaoding with the web renderer, see the [dioxus-cli](https://github.com/DioxusLabs/cli) project.
+> This crate implements hot reloading for native compilation targets not WASM. For hot relaoding with the web renderer, see the [dioxus-cli](https://github.com/DioxusLabs/cli) project.
 
-For renderers that support hot reloading add this to your main function before you launch your app to start the hot reloading server:
+Add this to the top of your main function on any renderer that supports hot reloading to start the hot reloading server:
 
 ```rust
 fn main(){
@@ -79,7 +79,7 @@ fn main(){
 }
 ```
 
-The dev server watches on the `src` and `examples` folders in the crate directory by default. To watch on custom paths pass the paths into the hot relaod macro:
+By default the dev server watches on the `src` and `examples` folders in the root crate directory. To watch on custom paths pass the paths into the hot relaod macro:
 
 ```rust
 fn main(){
@@ -108,7 +108,7 @@ fn main(){
 }
 ```
 
-## Implementing hot reloading for a custom renderer
+## Implementing Hot Reloading for a Custom Renderer
 
 To add hot reloading support to your custom renderer you can use the connect function. This will connect to the dev server you just need to provide a way to transfer `Template`s to the `VirtualDom`. Once you implement this your users can use the hot_reload_init function just like any other render.