rust-yew-realworld-example-app
rust-yew-realworld-example-app copied to clipboard
Fix bug and Update Yew 0.21.0 with some improvements
Fix a article rendering bug:
Fix use_state(|| props.article.clone())
and props.article
not synchronized in case of partial tab switching.
Add a debug log in file crates/conduit-wasm/src/components/article_preview.rs
log::debug!("DEBUG: props.article: {:?}", props.article.clone());
log::debug!("DEBUG: use_state: {:?}", article.clone());
In some cases their output is different causing the article to be displayed incorrectly
Update dependencies:
Major changes:
- Yew: Replace
use_effect_with_deps
withuse_effect_with
References:
-
0.20.0 Function yew::functional::use_effect_with_deps
- https://docs.rs/yew/0.20.0/yew/functional/fn.use_effect_with_deps.html
-
0.21.0 Function yew::functional::use_effect_with
- https://docs.rs/yew/0.21.0/yew/functional/fn.use_effect_with.html#
Add justfile:
Contains most of the commands found in the README.md file. Justfile:
- Manually:
- Install [wasm-pack]
just install-wasm-pack
- Copy
.env.example
to.env
just env
- Trunk serve
just trunk-serve
- Trunk build
just trunk-build
- Test
just test
- Install [wasm-pack]
- Tauri:
- Install [Tauri]
just install-tauri
- Build and develop
just tauri-dev
- Build and release
just tauri-build
- Install [Tauri]
- Yew-app:
- Create-yew-app
just create-yew-app
- App-serve
just app-serve
- Create-yew-app