fix the macro export and WIP hot reloading docs
This commit is contained in:
1 parent
19aaa0ee5b
commit
82048737f4
5 files changed
+51
-11
No files matched your search
@@ -5,11 +5,11 @@
|
||||
- [Getting Started](getting_started/index.md)
|
||||
- [Desktop](getting_started/desktop.md)
|
||||
- [Web](getting_started/web.md)
|
||||
- [Hot Reload](getting_started/hot_reload.md)
|
||||
- [Server-Side Rendering](getting_started/ssr.md)
|
||||
- [Liveview](getting_started/liveview.md)
|
||||
- [Terminal UI](getting_started/tui.md)
|
||||
- [Mobile](getting_started/mobile.md)
|
||||
- [Hot Reloading](getting_started/hot_reload.md)
|
||||
- [Describing the UI](describing_ui/index.md)
|
||||
- [Special Attributes](describing_ui/special_attributes.md)
|
||||
- [Components](describing_ui/components.md)
|
||||
|
||||
@@ -2,20 +2,53 @@
|
||||
|
||||
1. Hot reloading allows much faster iteration times inside of rsx calls by interpreting them and streaming the edits.
|
||||
2. It is useful when changing the styling/layout of a program, but will not help with changing the logic of a program.
|
||||
3. Currently the cli only implements hot reloading for the web renderer.
|
||||
3. Currently the cli only implements hot reloading for the web renderer. For TUI, desktop, and liveview you can use the hot reload macro.
|
||||
|
||||
# Web
|
||||
|
||||
For the web renderer, you can use the dioxus cli to serve your application with hot reloading enabled.
|
||||
|
||||
## Setup
|
||||
|
||||
# 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:
|
||||
```
|
||||
## Usage
|
||||
|
||||
1. Run:
|
||||
```bash
|
||||
dioxus serve --hot-reload
|
||||
```
|
||||
2. change some code within a rsx macro
|
||||
3. open your localhost in a browser
|
||||
4. save and watch the style change without recompiling
|
||||
2. Change some code within a rsx or render macro
|
||||
3. Open your localhost in a browser
|
||||
4. Save and watch the style change without recompiling
|
||||
|
||||
# Desktop/Liveview/TUI
|
||||
|
||||
For desktop, LiveView, and tui, you can place the hot reload macro before your app runs to enable hot reloading.
|
||||
|
||||
## Setup
|
||||
|
||||
Add the following to your main function:
|
||||
|
||||
```rust
|
||||
fn main() {
|
||||
dioxus::hot_reload_init!();
|
||||
// launch your application
|
||||
}
|
||||
```
|
||||
|
||||
## Usage
|
||||
1. Run:
|
||||
```bash
|
||||
cargo run
|
||||
```
|
||||
2. Change some code within a rsx or render macro
|
||||
3. Save and watch the style change without recompiling
|
||||
|
||||
## Custom renders
|
||||
|
||||
For custom renderers
|
||||
|
||||
# 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.
|
||||
|
||||
Reference in new issue
Block a user