-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
[v4] Vue rc.5 unwrapping changes #2873
Comments
Thanks for pointing this out, I have tried both And if I understand correctly this
would break because destructing disables reactivity for the properties, unless being refs themselves prevents this. I will try to resolve the issues that come out of that breaking change but I'm not sure if this workaround would be in userland or in the library. I will resolve the issues first and see what I can do. |
I managed to get the lib working again with some hacks, will properly debug this later. But for the suggestion to wrap everything in I think the |
@logaretm 👍 I gave a try to alpha.9, and our tests are green again with the latest Vue RC. |
@logaretm In fact I still have an issue (I can open a dedicated one if needed). With a simple <Form @submit="register($event)" v-slot="{ meta: formMeta }">
<Field name="login" rules="required" v-slot="{ field }" v-model="user.name">
<label for="login">Login</label>
<input id="login" v-bind="field" />
<ErrorMessage name="login" />
</Field>
<button :disabled="formMeta.invalid">Register</button>
</Form> The button is disabled with Vue rc.4 (as the form is invalid), but not with Vue rc.5, so I think there is a regression somewhere. See cexbrayat/vee-infinite-loop#1 for a repro. This is working with rc.4, but not with rc.5 to rc.9. |
Thank you for the update, it looks like an issue with reactivity. Surprisingly adding these lines seem to fix it: // FIXME: for whatever reason that's beyond me, this fixes the reactivity issue
watch(errors, () => { });
watch(meta, () => { }); Will try to find a real fix in the meantime, otherwise, I will tag a release with this hack. |
Tagged alpha 10 with the hotfix. |
@logaretm I confirm that alpha.10 does fix the issue. Thank you for the quick fix and release! |
Versions
Describe the bug
Vue 3.0.0-rc.5 introduced a breaking change on how unwrapping works vuejs/core#1682
and that breaks a lot of use cases of VeeValidate.
To reproduce
This can be easily reproduced by bumping Vue in VeeValidate repo: a lot of tests start failing.
As a simple example in our application, this used to work:
And now does not with Vue rc.8, as the automatic unwrapping no longer exists.
The workaround here is to wrap
useField
into areactive()
call:Even if this is all fixable in user land, maybe it would be worth tweaking the returned value from
useField
anduseForm
so they could work directly?The text was updated successfully, but these errors were encountered: