Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: prefetch link preloads #569

Merged
merged 1 commit into from
Dec 3, 2021
Merged

feat: prefetch link preloads #569

merged 1 commit into from
Dec 3, 2021

Conversation

ryanflorence
Copy link
Member

If a route exports <link rel="preload">, those are added as prefetches for <Link prefetch>.

If the route says they are important enough to make high priority when the route becomes active, then we can speed it up even more by prefetching before the user gets there.

This enables routes to tell links to prefetch any kind of asset without the linking component needing to know.

@@ -8,6 +8,7 @@ import type { RouteMatch } from "./routeMatching";
// import { matchClientRoutes } from "./routeMatching";
import type { RouteModules, RouteModule } from "./routeModules";
import { loadRouteModule } from "./routeModules";
import invariant from "./invariant";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not being used

@kentcdodds kentcdodds force-pushed the dev branch 2 times, most recently from ab9dac4 to 172ecc9 Compare December 2, 2021 06:15
If a route exports `<link rel="preload">`, those are added as prefetches for `<Link prefetch>`. If the route says they are important enough to make high priority, then we can speed it up even more by prefetching before the user gets there.

This enables routes to tell links to prefetch any kind of asset without the linking component needing to know.
@ryanflorence ryanflorence force-pushed the ryan/prefetch-preloads branch from b31ecf4 to fe4d395 Compare December 3, 2021 17:17
@remix-cla-bot
Copy link
Contributor

remix-cla-bot bot commented Dec 3, 2021

Thank you for signing the Contributor License Agreement. Let's get this merged! 🥳

@ryanflorence ryanflorence merged commit 541e27c into dev Dec 3, 2021
@chaance chaance deleted the ryan/prefetch-preloads branch December 9, 2021 23:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants