Skip to content

Commit

Permalink
refactor: json -> data (for future compat)
Browse files Browse the repository at this point in the history
  • Loading branch information
AviVahl committed Dec 7, 2024
1 parent a21ad04 commit cd7d145
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -30,7 +30,7 @@ export async function loader({ request }: LoaderFunctionArgs) {
const { wixSessionTokens, session, shouldUpdateSessionCookie } =
await initializeEcomSession(request);

const data = {
const payload = {
wixClientId: getWixClientId(),
wixSessionTokens,
};
Expand All @@ -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: '/' }];
Expand Down
6 changes: 6 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down

0 comments on commit cd7d145

Please sign in to comment.