refactor: externalize tree shell runtime
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -106,6 +106,10 @@ pub fn build_router(state: AppState) -> Router {
|
||||
"/api/mnote-browser-runtime/tree-live-controller.js",
|
||||
get(web_shell::tree_live_controller_runtime_asset),
|
||||
)
|
||||
.route(
|
||||
"/api/mnote-browser-runtime/tree-shell-runtime.js",
|
||||
get(web_shell::tree_shell_runtime_asset),
|
||||
)
|
||||
.route("/api/search/documents", post(search::documents))
|
||||
.route(
|
||||
"/api/search/local-index/refresh",
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -4409,6 +4409,20 @@ pub async fn tree_live_controller_runtime_asset() -> Response {
|
||||
.unwrap_or_else(|_| Response::new(Body::empty()))
|
||||
}
|
||||
|
||||
pub async fn tree_shell_runtime_asset() -> Response {
|
||||
const JS: &str = include_str!("../../browser/tree-shell-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 leptos_tiptap_manifest() -> Response {
|
||||
let manifest = json!({
|
||||
"entryAssetPath": "mnote-leptos-tiptap-spike-island.js",
|
||||
|
||||
Reference in New Issue
Block a user