Dev loop: debug-only page scripts from disk + tab rebuild on change (waybetter-host devloop, page_script!), generic devmode watcher, waybetter dev, buildRuntime watch, template scripts

This commit is contained in:
CRTkafa 2026-09-30 22:20:22 +07:00
parent 4740e6b2db
commit 8da1f1b20e
11 changed files with 377 additions and 26 deletions

View file

@ -404,8 +404,10 @@ fn in_site(site: &SiteSpec, hooks: &dyn SiteHooks, url: &Url) -> bool {
/// Reconciles native tab webviews with the shell's panes: creates missing ones, positions and
/// shows/hides all of them, and closes webviews whose tab no longer exists.
#[tauri::command]
async fn tabs_sync(webview: Webview, app: AppHandle, items: Vec<TabLayout>, viewport: Option<[f64; 2]>) -> Result<(), String> {
pub(crate) async fn tabs_sync(webview: Webview, app: AppHandle, items: Vec<TabLayout>, viewport: Option<[f64; 2]>) -> Result<(), String> {
shell_only(&webview)?;
#[cfg(debug_assertions)]
crate::devloop::remember_layout(&items, viewport);
let hooks = host_state(&app).hooks.clone();
let window = webview.window();
// Kept current by the window's resize events (host::follow_window_resizes): no blocking
@ -1106,6 +1108,8 @@ impl App {
});
tauri_app.manage(Page(Mutex::new(PageState { plugins, features, settings, modes })));
tauri_app.manage(Host { config, hooks });
#[cfg(debug_assertions)]
crate::devloop::start(&handle);
if let Some(setup) = setup {
setup(&handle)?;
}