"vapor mode" explainer & getCurrentInstance
prep
#13629
43081j
started this conversation in
General Discussions
Replies: 1 comment
-
I wonder too because vapor components have an instance attached to them, this instance is used when for lifecycle hooks (onMounted, onUpdated, etc...) and getCurrentInstance is especially set to return null on vapor component export const getCurrentInstance: () => ComponentInternalInstance | null = () =>
currentInstance && !currentInstance.vapor
? (currentInstance as ComponentInternalInstance) // exist but skip on vapor mode
: currentRenderingInstance // never set on vapor component |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
For those of us maintaining popular vue packages (vueuse in my case), we could do with a proper explainer doc of "vapor mode" that goes beyond what the various changelogs and blog posts mention.
similarly, the reason i'm looking for this is that
getCurrentInstance
will now benull
invapor
components. nothing seems to explain why this is, though.the explanation of how vapor works (or what it is) will probably make that obvious. i'd rather understand the architecture than this individual change.
this particular change will break a lot of libraries when people try use them with
vapor
set. so it would be good if each of those major changes had migration info, at least.Beta Was this translation helpful? Give feedback.
All reactions