refactor: split tree shell renderer

This commit is contained in:
lix-2026
2026-05-26 03:51:06 +08:00
parent 0f0e37ed54
commit c65135f7ed
6 changed files with 1126 additions and 916 deletions
@@ -938,6 +938,20 @@ pub async fn tree_shell_runtime_asset() -> Response {
.unwrap_or_else(|_| Response::new(Body::empty()))
}
pub async fn tree_shell_render_runtime_asset() -> Response {
const JS: &str = include_str!("../../browser/tree-shell-render-runtime.js");
Response::builder()
.status(StatusCode::OK)
.header(
header::CONTENT_TYPE,
"application/javascript; charset=utf-8",
)
.header(header::CACHE_CONTROL, "no-store")
.header(HEADER_MNOTE_WEB_OWNER, "mnote-web")
.body(Body::from(JS))
.unwrap_or_else(|_| Response::new(Body::empty()))
}
pub async fn tree_shell_page_runtime_asset() -> Response {
const JS: &str = include_str!("../../browser/tree-shell-page-runtime.js");
Response::builder()