Skip to content

feat(router): add configurable link prefetch data strategies#8548

Draft
Varixo wants to merge 2 commits intobuild/v2from
v2-link-prefetch-strategy
Draft

feat(router): add configurable link prefetch data strategies#8548
Varixo wants to merge 2 commits intobuild/v2from
v2-link-prefetch-strategy

Conversation

@Varixo
Copy link
Copy Markdown
Member

@Varixo Varixo commented Apr 11, 2026

This PR adds configuration for prefetch data strategies for Link component.
You can choose between:

  • viewport to prefetch when the link becomes visible
  • hover to prefetch on mouse hover for fine pointers
  • focus to prefetch when the link receives keyboard focus
  • pointerdown to prefetch as soon as the user presses the link

The configuration is independent for coarse and fine pointers.

This can be set globally by setting option

linkDataPrefetch?: {
  coarsePointer?: ('viewport' | 'focus' | 'pointerdown')[];
  finePointer?: ('viewport' | 'hover' | 'focus' | 'pointerdown')[];
};

in qwikRouter vite plugin.
This can be also configured for any Link component.

@Varixo Varixo self-assigned this Apr 11, 2026
@Varixo Varixo added the V2 label Apr 11, 2026
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 11, 2026

🦋 Changeset detected

Latest commit: 099cf29

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@maiieul maiieul moved this from Backlog to In progress in Qwik Development Apr 11, 2026
@Varixo Varixo force-pushed the v2-link-prefetch-strategy branch 2 times, most recently from 543f78b to db8c1bb Compare April 11, 2026 19:45
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 11, 2026

Open in StackBlitz

@qwik.dev/core

npm i https://pkg.pr.new/QwikDev/qwik/@qwik.dev/core@8548

@qwik.dev/router

npm i https://pkg.pr.new/QwikDev/qwik/@qwik.dev/router@8548

eslint-plugin-qwik

npm i https://pkg.pr.new/QwikDev/qwik/eslint-plugin-qwik@8548

create-qwik

npm i https://pkg.pr.new/QwikDev/qwik/create-qwik@8548

@qwik.dev/optimizer

npm i https://pkg.pr.new/QwikDev/qwik/@qwik.dev/optimizer@8548

commit: 099cf29

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 11, 2026

built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
qwik-docs ❌ Failed (View Log) 099cf29

@Varixo Varixo force-pushed the v2-link-prefetch-strategy branch 2 times, most recently from 955ac17 to 85d4adf Compare April 12, 2026 20:08
@Varixo Varixo force-pushed the v2-link-prefetch-strategy branch from 85d4adf to 099cf29 Compare April 12, 2026 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

2 participants