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

Add support for preloading links in react framework #1158

Merged
merged 11 commits into from
Sep 17, 2023
Merged

Add support for preloading links in react framework #1158

merged 11 commits into from
Sep 17, 2023

Conversation

AlecAivazis
Copy link
Collaborator

@AlecAivazis AlecAivazis commented Sep 16, 2023

This PR allows users to opt into link-specific preloading by setting data-houdini-preload on the <a> tags:

<a href="/shows" data-houdini-preload>

Houdini will detect when the user hovers over this element and fetch whatever is necessary to
render the page before they click on the link. By default, this means loading both the page component
source as well sending the actual query.

You can customize this by setting the prop to one of 3 values:

  • "data": only request the page's data
  • "component": only request the page's component source
  • "page": request both values. This is the default.

For example,

<a href="/shows" data-houdini-preload="data">

@changeset-bot
Copy link

changeset-bot bot commented Sep 16, 2023

🦋 Changeset detected

Latest commit: 8425d0a

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

This PR includes changesets to release 5 packages
Name Type
houdini-react Patch
houdini-adapter-cloudflare Patch
houdini-plugin-svelte-global-stores Patch
houdini-svelte Patch
houdini Patch

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

@netlify
Copy link

netlify bot commented Sep 16, 2023

Deploy Preview for houdini-docs-next canceled.

Name Link
🔨 Latest commit 8425d0a
🔍 Latest deploy log https://app.netlify.com/sites/houdini-docs-next/deploys/650653bcc972070008085598

@netlify
Copy link

netlify bot commented Sep 16, 2023

Deploy Preview for houdinigraphql canceled.

Name Link
🔨 Latest commit 8425d0a
🔍 Latest deploy log https://app.netlify.com/sites/houdinigraphql/deploys/650653bc3e04040008e3aa32

@AlecAivazis AlecAivazis changed the title Add support for preloading links to react framework Add support for preloading links in react framework Sep 17, 2023
@AlecAivazis AlecAivazis merged commit daa13c1 into main Sep 17, 2023
15 checks passed
@AlecAivazis AlecAivazis deleted the preload branch September 17, 2023 01:25
@github-actions github-actions bot mentioned this pull request Sep 17, 2023
endigma pushed a commit to endigma/houdini that referenced this pull request Nov 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant