remix-server icon indicating copy to clipboard operation
remix-server copied to clipboard

updated remix dep

Open christopherpickering opened this issue 2 years ago • 1 comments

This pr updates remix to v 1.16.1 to resolve this issue.

Thanks for the great example!

christopherpickering avatar May 26 '23 12:05 christopherpickering

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):

image

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},
    ];
};

christopherpickering avatar May 26 '23 13:05 christopherpickering