diff options
| -rw-r--r-- | frontend/app/entry.server.tsx | 18 | ||||
| -rw-r--r-- | frontend/vite.config.ts | 2 |
2 files changed, 7 insertions, 13 deletions
diff --git a/frontend/app/entry.server.tsx b/frontend/app/entry.server.tsx index a1ffa99..6234421 100644 --- a/frontend/app/entry.server.tsx +++ b/frontend/app/entry.server.tsx @@ -6,7 +6,7 @@ import { RemixServer } from "@remix-run/react"; import { isbot } from "isbot"; import { renderToPipeableStream } from "react-dom/server"; -const ABORT_DELAY = 5_000; +export const streamTimeout = 5000; export default function handleRequest( request: Request, @@ -38,11 +38,7 @@ function handleBotRequest( return new Promise((resolve, reject) => { let shellRendered = false; const { pipe, abort } = renderToPipeableStream( - <RemixServer - context={remixContext} - url={request.url} - abortDelay={ABORT_DELAY} - />, + <RemixServer context={remixContext} url={request.url} />, { onAllReady() { shellRendered = true; @@ -72,7 +68,7 @@ function handleBotRequest( }, ); - setTimeout(abort, ABORT_DELAY); + +setTimeout(abort, streamTimeout + 1000); }); } @@ -85,11 +81,7 @@ function handleBrowserRequest( return new Promise((resolve, reject) => { let shellRendered = false; const { pipe, abort } = renderToPipeableStream( - <RemixServer - context={remixContext} - url={request.url} - abortDelay={ABORT_DELAY} - />, + <RemixServer context={remixContext} url={request.url} />, { onShellReady() { shellRendered = true; @@ -119,6 +111,6 @@ function handleBrowserRequest( }, ); - setTimeout(abort, ABORT_DELAY); + setTimeout(abort, streamTimeout + 1000); }); } diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index 004af2c..54636cd 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -10,6 +10,8 @@ export default defineConfig({ v3_fetcherPersist: true, v3_relativeSplatPath: true, v3_throwAbortReason: true, + v3_lazyRouteDiscovery: true, + v3_singleFetch: true, }, basename: "/phperkaigi/2025/code-battle/", }), |
