Uh oh!
There was an error while loading. Please reload this page.
This repository was archived by the owner on Apr 6, 2023. It is now read-only.
Merged
Conversation
✅ Deploy Preview for nuxt3-docs canceled.
|
atinux
commented
Apr 14, 2022
Member
Thank you for the PR @Mini-ghost 💚 From what I see, So I guess we need a polyfill for it, what would be the preferred approach to do so @pi0 ? |
MemberAuthor
@pi0@atinux I will add polyfill for
constrequestIdleCallback=process.client
? window.requestIdleCallback||function(cb){conststart=Date.now()constidleDeadline={didTimeout: false,timeRemaining(){returnMath.max(0,50-(Date.now()-start))}}returnwindow.setTimeout(function(){cb(idleDeadline)},1)}
: (()=>{})asanyasWindow['requestIdleCallback']
letrequestIdleCallback: Window['requestIdleCallback']|null=nullonMounted(()=>{if(!shouldPrefetch.value){return}// add `requestIdleCallback` polyfill if not supported and need prefetchif(!requestIdleCallback){requestIdleCallback=window.requestIdleCallback||function(cb){conststart=Date.now()constidleDeadline={didTimeout: false,timeRemaining(){returnMath.max(0,50-(Date.now()-start))}}returnwindow.setTimeout(function(){cb(idleDeadline)},1)}}})Which is the preferred approach? |
feat(nuxt3): support `prefetchedClass` prop for `<nuxt-link>`
danielroe
commented
Jun 9, 2022
Member
@Mini-ghost The first approach seems better to me 👍 |
6 tasks
This was referenced Aug 15, 2022
Merged
we are preloading all 3 links in initial request.
pi0
approved these changes
Sep 13, 2022
pi0
commented
Sep 13, 2022
Member
Thank you so much for helping on this feature @Mini-ghost <3 I've made few more reactors to the PR to simplify do small fixes and also integrated with new payload prerendering using |
prefetch prop for <nuxt-link><nuxt-link>pi0 added a commit
that referenced
this pull request
Sep 14, 2022
Co-authored-by: Pooya Parsa <pooya@pi0.io>
Merged
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔗 Linked issue
nuxt/nuxt#13482 #2086
❓ Type of change
📚 Description
Support
prefetchprop for<nuxt-link>. This implementation is refer to https://github.com/nuxt/framework/discussions/2086#discussioncomment-1683819. Need a polyfill forrequestIdleCallback?Also, I'm not sure how to use Link Prefetching like below, because
pathare unpredictable.The implementation of this PR refers to nuxt2, maybe we can generate a router manifest. and mapping file path when triggering prefetch ?
📝 Checklist