Replies: 3 comments 7 replies
-
Ugh, Vercel needs to stop pushing breaking changes to React core to patch bugs for Nextjs. |
Beta Was this translation helpful? Give feedback.
-
The feature is a a progressive enhancement, if the browser doesn't support modulepreload the app still works, it just takes longer because the browser couldn't preload all the JS files. But if the browser supports it, then can preload all JS entry-point files which means once they're needed it will be read from cache instead of requested. So even if the browser doesn't support it yet, it may in the future and it will automatically give end-users a better UX when loading an app. |
Beta Was this translation helpful? Give feedback.
-
@lili21 To fix react@canary (18.3) moving the modulepreload links above the stylesheet links in the head you can add a e.g. export const links: LinksFunction = () => [
{ rel: 'stylesheet', href: appStylesHref, precedence: 'high' },
]; Will result in the stylesheet link being placed at the top of the head element. <head>
<meta charSet="utf-8"/>
<meta name="viewport" content="width=device-width,initial-scale=1"/>
<link rel="stylesheet" href="/build/_assets/app-B5PUCUEH.css" data-precedence="high"/>
<title>New Remix App</title>
<meta name="description" content="Welcome to Remix!"/>
<link rel="modulepreload" href="/build/entry.client-4MXBZIKC.js"/>
<link rel="modulepreload" href="/build/_shared/chunk-PNG5AS42.js"/>
<link rel="modulepreload" href="/build/root-XKG6C447.js"/>
<link rel="modulepreload" href="/build/routes/_index-T377ZUPD.js"/>
</head> |
Beta Was this translation helpful? Give feedback.
-
The browser compatibility of this feature is not very good
data from caniuse
it will effect the page performance
there are some issue report the effective.
Currently all the
<link type="modulepreload" />
links are at the end of body, before the bootstrap inline script. However, If you are using react@canary, all the links will be moved to thehead
and before the stylesheet. which will effect the page performance. in my project, it increased about 1 second of FCP.why using react@canary?
because of the hydration error issue. #5244
Beta Was this translation helpful? Give feedback.
All reactions