-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Conversation
Reviewpad Report ℹ️ Messages
|
@@ -9,6 +9,7 @@ export default function Link({ children, className, rel, ...restProps }) { | |||
? className | |||
: "text-blue-600 underline decoration-dotted dark:text-blue-500 hover:underline hover:decoration-solid" | |||
} | |||
prefetch={false} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to have a condition so it only happens on mobile?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried that, but webpack still bundles the code to preload the JavaScript files if the preload is set by a conditional. It is around 700k of JS that gets loaded by the main-XXX chunk of the bundle without preload set to false.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ouch, ok thank you for clarifying 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 👍
Changes proposed
The additional JavaScript loaded by preload causes performance issues on mobile.
The NextJS configuration of Webpack will not create a separate main chunk for links that are preloaded on desktop only.
This PR will set all links using our Link component to
preload={false}
.Check List (Check all the applicable boxes)