perf(client): defer chat persistence dependencies

This commit is contained in:
2026-07-15 17:58:06 +08:00
parent 86ffbbcdbc
commit 05ca15be48
15 changed files with 115 additions and 81 deletions
@@ -0,0 +1,13 @@
import type { IChatRepository } from "./interfaces/ichat_repository";
/**
* Loads the browser-only chat repository behind an explicit async boundary.
*
* The repository owns the Dexie-backed history and media stores. Keeping this
* loader separate prevents those stores from entering every route's eager
* client graph through shared providers.
*/
export async function loadChatRepository(): Promise<IChatRepository> {
const { getChatRepository } = await import("./chat_repository");
return getChatRepository();
}