-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Support prefetch in core #8951
Support prefetch in core #8951
Conversation
🦋 Changeset detectedLatest commit: d89b60e 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 |
LVGTM: I am very happy that the different prefetch approaches are unified here and the special handling in ViewTransition.astro is replaced by core functions! |
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.
This PR is blocked because it contains a minor
changeset. A reviewer will merge this at the next release if approved.
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.
Love this, @bluwy and I'm also getting into the docs PR for this too!
I left some suggestions, mostly about getting explicit options shown etc. as this is a reference page and people might be coming here to look something up or check on it quickly. Duplication of content here and in the guide isn't always a bad thing, since the guide will walk through more and this can be for people who already pretty much know what the feature is about, they just don't know for example all the possible hover, tap etc.
Also, I do not know what's up with documenting the options twice. We're going to need to call in someone else to confirm that.
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.
Docs look great!
Co-authored-by: Sarah Rainsberger <[email protected]>
Changes
close #8926
Add new
prefetch
option. Supersedes@astrojs/prefetch
. Check the docs and RFC for more information on how it works.@astrojs/prefetch
integration will be deprecated after this is merged and released.Tip for reviewing
The core logic changes are in
src/core
.src/core/prefetch/index.ts
contains the client-side script.The documentation is in the changeset and
src/@types/astro/ts
. They take a lot of lines, and the docs forprefetch.prefetchAll
andprefetch.defaultStrategy
are duplicated. I think it's needed for docs to detect it.Testing
Added e2e tests to make sure a request is sent
Docs
Main docs: withastro/docs#5271
This PR also has changesets and JSDoc for review.