-
-
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
fix: client prerender fallback #10295
fix: client prerender fallback #10295
Conversation
🦋 Changeset detectedLatest commit: 8b62a13 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 |
If those extensions block prerendering, wouldn't they also block prefetching? And if Arc disables the feature, wouldn't |
Thanks @bluwy, agreed that it doesn't seem like it should be necessary if the API is supported. Discussing this issue on the Speculation Rules spec repo to ensure the best approach is implemented. |
Thanks for the link (and hooking me on the email conversation). Yeah I think it's nicer if the API can fallback to prefetching if prerender is blocked.
Seems like Domenic also recommended this. If it doesn't cause a double fetch, I like this approach too! |
…tag, improve changeset
Of course! Thanks for looking this over. Domenic suggested still using the Speculation Rules API to prefetch in this case instead of a link tag due to the benefits stated here. I have made those changes, so I think it's all set to fallback using the recommended approach now. |
Changes
Prerendering with the Speculation Rules API can fail---for example, certain Chrome extensions like LastPass can block prerendering, or browsers like Arc have disabled the feature. Currently in this case, neither prerendering or prefetching occurs.
Adding a
link
tag in addition to the speculation rules script does not create an extra request. This change will append the speculation rules script, in addition to prefetching withlink
orfetch
to ensure at least prefetching will occur.Testing
No modifications needed.
Docs
/cc @withastro/maintainers-docs for feedback!