Complete wip: New Application Architecture

Add support for client side routing and updating without loading the AppShell
This commit is contained in:
2025-10-18 16:42:19 -07:00
parent 0890ae3ef9
commit b33ffa3371
5 changed files with 44 additions and 16 deletions

View File

@@ -11,8 +11,8 @@ const index = new Elysia()
console.log(`Request ${request.method} ${request.url}`);
})
.onAfterHandle(({ request, responseValue }) => {
if (request.headers.get("hx-request") === "true") {
return responseValue; // Return the <main> element if the request is an HTMX request
if (request.headers.get("shell-loaded") === "true") {
return responseValue; // Return the <main> element if the AppShell has already been loaded
}
return AppShell(responseValue); // Return the <main> element wrapped by the AppShell
})