-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
3.5.0 __asyncHydrate is not a function #11793
Comments
|
Maybe this should be solved by vue3-lazy-hydration |
Closing as it is outside of vue's scope. |
It should yes, but vue should also avoid breaking a widely used lib it's aiming to replace in a minor upgrade and use the default hydration method if none is provided from a TS pov
They are both optionnal properties and proper checking should be implemented before any of them is used, right now vue is only checking for It will take a while for this to be fixed in vue3-lazy-hydration because the feature that was added is actually something that this lib also solves, so the next update has to use the new api. While vue in the meantime can easily patch this in a one line additional check |
Vue checks I do not believe Vue should cater to such cases because it is exactly this kind of patterns in ecosystem libraries that cuased so much pain during the Vue 2 to Vue 3 transition. We need to take a stance to discourage any use of internal properties. My suggestions:
|
While I agree in general, this lib had to do this because there was no api to do this yet and this should not be penalised, in fact it's the adding of the native api to do what this library originally provided that broke it. Now we should only aim to not break this lib while it transition to the new api without using the internals which now we can do thanks to the new api. But I don't think users should be stuck on 3.4 while this happens as this will likely take a few months I also don't think we should encourage migrating from vue3-lazy-hydration to use built-in lazy hydration, because the lib itself can update the wrapper to the new api without users having to migrate anything. The lib is a high level wrapper as opposed to the API which is low level. So the lib needs to migrate all it's strategies What I propose is to merge the patch and remove it in 3.6 so we get a small transition period to adapt while still saying "don't use Internals" |
Vue version
3.5.0
Steps to reproduce
Create a nuxt-project with vue 3.5.0 and vue3-lazy-hydration
What is expected?
Builds and serves fine
What is actually happening?
After upgrading from 3.4 to 3.5, on client hydration
__asyncHydrate is not a function
on theLazyHydrateWrapper
componentSystem Info
No response
Any additional comments?
Caused by d14a11c
Issue tracked in vue3-lazy-hydration
freddy38510/vue3-lazy-hydration#91
Relevant code in the lib
https://github.com/freddy38510/vue3-lazy-hydration/blob/1550633c47bf726e18510299fb1e9ed9bfb7e249/src/utils/create-hydration-wrapper.ts#L95
The text was updated successfully, but these errors were encountered: