remix-server
remix-server copied to clipboard
updated remix dep
A few more comments of what would need to be changed to work with remix v2.
remix.config.js
The following could be added to the exports:
future: {
v2_routeConvention: true,
v2_errorBoundary: true,
v2_meta: true,
v2_normalizeFormMethod: true,
},
serverModuleFormat:"cjs",
Routes
The route structure should be flattened (note the double underscore to single as well):
root.tsx
Metadata function could be updated to the new format:
export const meta: MetaFunction = () => ([
{charset: 'utf-8'},
{title: 'Payload CMS & Remix Monorepo'},
{viewport: 'width=device-width,initial-scale=1'},
]);
_page.$page.tsx
Metadata could be updated to the new format (note the change in the findPageBySlug params as well)
export const meta: MetaFunction = ({ params, matches }) => {
const { page: pageSlug } = params;
const page = findPageBySlug(pageSlug ?? 'home', matches);
return [{
title: page?.meta.title},
{description: page?.meta.description},
{keywords: page?.meta.keywords},
];
};