diff options
| author | nsfisis <nsfisis@gmail.com> | 2025-03-10 01:08:18 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2025-03-10 01:08:18 +0900 |
| commit | 84f3996f48d7a962685edfc09f12b8684cc76d93 (patch) | |
| tree | 3c0132b62770c5f6d6d6a2a8fe587997347f2104 | |
| parent | d14fd1f6751cec8923a79c15851562640a861b8c (diff) | |
| download | phperkaigi-2025-albatross-84f3996f48d7a962685edfc09f12b8684cc76d93.tar.gz phperkaigi-2025-albatross-84f3996f48d7a962685edfc09f12b8684cc76d93.tar.zst phperkaigi-2025-albatross-84f3996f48d7a962685edfc09f12b8684cc76d93.zip | |
feat(frontend): enable Remix future flags
| -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/", }), |
