Repository navigation
Conversation
|
@danielroe Would you mind reviewing if you have a chance? |
|
The API for pausing updates looks good to me and I think this would resolve the nuxt-linked issue. (cc: @pi0) I'm not 100% sure either about tracking node id from ssr -> client. In case there are issues, what do you think about exposing a fallback API for 'forcing' hydrating of the head? Nuxt, for example, could call this when we believe the page is ready (when all suspenses have resolved). |
|
Thanks for the review! The code may have changed when I pinged you, but the tracking node id simply toggles the pausing. So if you wanted to force the hydration you could set this value to true. nuxtApp.hooks.hookOnce("page:finish", () => {
head._pauseDOMUpdates.value = false
})I agree the tracking node seems a bit too risky though. For Nuxt you wouldn't need it if you can do the pause/unpause yourself. I'll move it to a separate PR |
Problem
See nuxt/framework#98, nuxt/framework#75, nuxt/nuxt#14438
Solution
Simple boolean ref for toggling the DOM updates.
The
updateDOMcalls will automatically be re-done when unpaused as they are wrapped in awatchEffects.In Nuxt this allows you to wait for
<Suspense>to resolve with the below code. I don't think it's possible to add a way for@vueuse/headto handle this generically without introducing a router dependency.Other notes
The Nuxt example module now completely removes the native meta module in favour of our custom implementation, which makes testing changes like this simpler.