From cd7d14552e3e8fbab0fc12c6aa4a28d66f6144a3 Mon Sep 17 00:00:00 2001 From: Avi Vahl Date: Tue, 12 Nov 2024 14:20:49 +0200 Subject: [PATCH] refactor: json -> data (for future compat) --- app/root.tsx | 6 +++--- vite.config.ts | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/root.tsx b/app/root.tsx index 68795265..d005b41d 100644 --- a/app/root.tsx +++ b/app/root.tsx @@ -4,7 +4,7 @@ import '~/src/styles/typography.scss'; import '~/src/styles/global.scss'; import '~/src/styles/utils.scss'; -import { json, LoaderFunctionArgs } from '@remix-run/node'; +import { data, type LoaderFunctionArgs } from '@remix-run/node'; import { Links, Meta, @@ -30,7 +30,7 @@ export async function loader({ request }: LoaderFunctionArgs) { const { wixSessionTokens, session, shouldUpdateSessionCookie } = await initializeEcomSession(request); - const data = { + const payload = { wixClientId: getWixClientId(), wixSessionTokens, }; @@ -39,7 +39,7 @@ export async function loader({ request }: LoaderFunctionArgs) { ? { 'Set-Cookie': await commitSession(session) } : {}; - return json(data, { headers }); + return data(payload, { headers }); } const breadcrumbs: RouteBreadcrumbs = () => [{ title: 'Home', to: '/' }]; diff --git a/vite.config.ts b/vite.config.ts index 5dd50466..770281e1 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -3,6 +3,12 @@ import { defineConfig } from 'vite'; import tsconfigPaths from 'vite-tsconfig-paths'; import { netlifyPlugin } from '@netlify/remix-adapter/plugin'; +declare module '@remix-run/node' { + interface Future { + v3_singleFetch: true; + } +} + export default defineConfig({ plugins: [ remix({