wip: more tweaks

This commit is contained in:
Jonathan Kelley committed 2022-11-14 18:09:09 -08:00
1 parent baab2b9b4f
commit 7a6b58d793
4 files changed
+41 -21

No files matched your search

+15
View File
@@ -13,6 +13,7 @@ pub struct Autoformat {
}
impl Autoformat {
// Todo: autoformat the entire crate
pub fn autoformat(self) -> Result<()> {
if let Some(raw) = self.raw {
if let Some(inner) = dioxus_autofmt::fmt_block(&raw, 0) {
@@ -59,3 +60,17 @@ rsx! {
dbg!(out);
}
/*
parse the whole doc
find all the comment blocks
*/
+21 -18
View File
@@ -34,26 +34,29 @@ pub async fn startup(config: CrateConfig) -> Result<()> {
// file watcher: check file change
let watcher_conf = config.clone();
let mut watcher = RecommendedWatcher::new(move |_: notify::Result<notify::Event>| {
if chrono::Local::now().timestamp() > last_update_time {
log::info!("Start to rebuild project...");
if builder::build(&watcher_conf).is_ok() {
// change the websocket reload state to true;
// the page will auto-reload.
if watcher_conf
.dioxus_config
.web
.watcher
.reload_html
.unwrap_or(false)
{
let _ = Serve::regen_dev_page(&watcher_conf);
let mut watcher = RecommendedWatcher::new(
move |_: notify::Result<notify::Event>| {
if chrono::Local::now().timestamp() > last_update_time {
log::info!("Start to rebuild project...");
if builder::build(&watcher_conf).is_ok() {
// change the websocket reload state to true;
// the page will auto-reload.
if watcher_conf
.dioxus_config
.web
.watcher
.reload_html
.unwrap_or(false)
{
let _ = Serve::regen_dev_page(&watcher_conf);
}
let _ = reload_tx.send("reload".into());
last_update_time = chrono::Local::now().timestamp();
}
let _ = reload_tx.send("reload".into());
last_update_time = chrono::Local::now().timestamp();
}
}
})
},
notify::Config::default(),
)
.unwrap();
let allow_watch_path = config
.dioxus_config