From c44f37e9ec8912cd5b67855c0853d0f2100ee83c Mon Sep 17 00:00:00 2001 From: xfy Date: Thu, 4 Jun 2026 17:12:07 +0800 Subject: [PATCH] feat: enable wasm_split for non-core routes Split low-frequency routes into separate WASM chunks: - archives, tags, search, about - admin/* (dashboard, write, posts) - login, register Core reading paths (home, post detail) remain in initial bundle. --- src/router.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/router.rs b/src/router.rs index 0e9e0fd..5e5e131 100644 --- a/src/router.rs +++ b/src/router.rs @@ -23,34 +23,34 @@ pub enum Route { Home {}, #[route("/page/:page")] HomePage { page: i32 }, - #[route("/archives")] + #[route("/archives", wasm_split)] Archives {}, - #[route("/tags")] + #[route("/tags", wasm_split)] Tags {}, - #[route("/tags/:tag")] + #[route("/tags/:tag", wasm_split)] TagDetail { tag: String }, #[route("/post/:slug")] PostDetail { slug: String }, - #[route("/search")] + #[route("/search", wasm_split)] Search {}, - #[route("/about")] + #[route("/about", wasm_split)] About {}, #[end_layout] #[nest("/admin")] #[layout(AdminLayout)] - #[route("/")] + #[route("/", wasm_split)] Admin {}, - #[route("/write")] + #[route("/write", wasm_split)] Write {}, - #[route("/posts")] + #[route("/posts", wasm_split)] Posts {}, #[end_layout] #[end_nest] - #[route("/login")] + #[route("/login", wasm_split)] Login {}, - #[route("/register")] + #[route("/register", wasm_split)] Register {}, }