-
-
Notifications
You must be signed in to change notification settings - Fork 162
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
Why is @vue/composition-api a dependency? #7
Comments
I actually can't tell if it's this module, which is causing 2 copies of |
update: this does indeed look like it's causing my issues. Here's my packages, before - with Before downgrade
After downgrade to @vue/apollo-composable
The errors I would get are, Maximum call stack exceeded. It was an infinite loop in nextTick, and I tracked it down, in my case, to being called by the first nuxt module that initialized and tried to use a composition API. In my case that was I'm still unclear why this was an actual issue, since I would expect yarn to dedupe the package and only have one copy. but it really appears that this is the issue to me. |
Could you share a minimal reproduce repo? Thanks.
|
@NickBolles I had similar issue with yarn and found out that yarn does not always dedupe on update. Removing lock file and installing packages again fixed dedupe issues for me. But that is exactly what peer dependencies are for, so package does not install dependency itself but uses dependency from parent package. composition-api could even be optional peer dependency so users that use vue@3 don't get warning that composition-api is not installed. Right now users that use vue@3 will have composition-api installed even though it is not needed. Same deal with Vue. It should be in peer dependencies. With range that allows vue@2 and vue@3. I'm using yarn@2 and it is stricter about checking dependencies. It does not allow package to import dependency that is not in dependencies or peer dependencies. I will create issue about yarn@2 with reproduce repo later. |
Thanks for the confirmation @Demivan I'm also using Yarn 2 @antfu honestly I tried, but in my case it requires setting up Nuxt, Nuxt auth, composition API and Apollo. It takes a while. But I did do the investigation. To find the root cause and we have at least one other confirmation. Our argument is that dependency is wrong. It happens to also have been causing a functional issue for me, and probably will for others. Either way, optional peer dependency is the right thing to do. If you really need a repro I can spend some time later today putting it together. |
Sure, I will change it to peerDeps. Thanks |
Done with v0.3.0. Check it out :) |
using vue-demi requires that vue2.6 projects install "@vue/composition-api", always! Even though I believe is the norm in 2.6.x projects but still kind of bummer to get an install error. vue-demi lists @vue/composition-api as optional peer dependency because it would otherwise install it for vue2.7 and vue3.x projects. We could list @vue/composition-api as dependency as well to overcome the install issue, but we're not using anything on this package so why complicate things? 1. I've removed vue-demi altogether, replaced the only thing we've use isVue3 with simply version regexp 1. the swap-vue.js from vuelidate allow us to keep the isomorphic testing to ensure it works everything Related issues: vueuse/vue-demi#67 vueuse/vue-demi#7
using vue-demi requires that vue2.6 projects install "@vue/composition-api", always! Even though I believe is the norm in 2.6.x projects but still kind of bummer to get an install error. vue-demi lists @vue/composition-api as optional peer dependency because it would otherwise install it for vue2.7 and vue3.x projects. We could list @vue/composition-api as dependency as well to overcome the install issue, but we're not using anything on this package so why complicate things? 1. I've removed vue-demi altogether, replaced the only thing we've use isVue3 with simply version regexp 1. the swap-vue.js from vuelidate allow us to keep the isomorphic testing to ensure it works everything Related issues: vueuse/vue-demi#67 vueuse/vue-demi#7
using vue-demi requires that vue2.6 projects install "@vue/composition-api", always! Even though I believe is the norm in 2.6.x projects but still kind of bummer to get an install error. vue-demi lists @vue/composition-api as optional peer dependency because it would otherwise install it for vue2.7 and vue3.x projects. We could list @vue/composition-api as dependency as well to overcome the install issue, but we're not using anything on this package so why complicate things? 1. I've removed vue-demi altogether, replaced the only thing we've use isVue3 with simply version regexp 1. the swap-vue.js from vuelidate allow us to keep the isomorphic testing to ensure it works everything Related issues: vueuse/vue-demi#67 vueuse/vue-demi#7
using vue-demi requires that vue2.6 projects install "@vue/composition-api", always! Even though I believe is the norm in 2.6.x projects but still kind of bummer to get an install error. vue-demi lists @vue/composition-api as optional peer dependency because it would otherwise install it for vue2.7 and vue3.x projects. We could list @vue/composition-api as dependency as well to overcome the install issue, but we're not using anything on this package so why complicate things? 1. I've removed vue-demi altogether, replaced the only thing we've use isVue3 with simply version regexp 1. the swap-vue.js from vuelidate allow us to keep the isomorphic testing to ensure it works everything Related issues: vueuse/vue-demi#67 vueuse/vue-demi#7
Shouldn't it be a peer dependency? I think that this is messing with my app after updating @vue/apollo-composable from 4.0 alpha 9 to alpha 10, which adds vue-demi
The text was updated successfully, but these errors were encountered: