Comments (7)
Done with v0.3.0. Check it out :)
from vue-demi.
I actually can't tell if it's this module, which is causing 2 copies of @Vue/Composition-api
, or if it's the upgrade in @vue/composition-api
itself. Either way, I don't think that vue-demi should have @vue/composition-api
as a dependency.
from vue-demi.
update: this does indeed look like it's causing my issues. Here's my packages, before - with @vue/apollo-composable
@ alpha10 and after downgrade - @vue/apollo-composable
@ alpha9. This is the same version of @vue/composition-api
Before downgrade
client> yarn why @vue/composition-api
├─ @nuxtjs/composition-api@npm:0.12.2
│ └─ @vue/composition-api@npm:1.0.0-beta.10 (via npm:^1.0.0-beta.10)
│
├─ @nuxtjs/composition-api@npm:0.12.2 [0c378]
│ └─ @vue/composition-api@npm:1.0.0-beta.10 [c4e01] (via npm:^1.0.0-beta.10 [c4e01])
│
└─ vue-demi@npm:0.2.0
└─ @vue/composition-api@npm:1.0.0-beta.10 [c4e01] (via npm:^1.0.0-beta.10 [c4e01])
client> yarn why vue-demi
├─ @vue/apollo-composable@npm:4.0.0-alpha.10
│ └─ vue-demi@npm:0.2.0 (via npm:latest)
│
└─ @vue/apollo-composable@npm:4.0.0-alpha.10 [68254]
└─ vue-demi@npm:0.2.0 (via npm:latest)
After downgrade to @vue/apollo-composable
graphql> yarn why @vue/composition-api
├─ @nuxtjs/composition-api@npm:0.12.2
│ └─ @vue/composition-api@npm:1.0.0-beta.10 (via npm:^1.0.0-beta.10)
│
└─ @nuxtjs/composition-api@npm:0.12.2 [0c378]
└─ @vue/composition-api@npm:1.0.0-beta.10 [c4e01] (via npm:^1.0.0-beta.10 [c4e01])
graphql> yarn why @vue/apollo-composable
└─ @App/Client@workspace:packages/client
└─ @vue/apollo-composable@npm:4.0.0-alpha.9 [0c378] (via npm:4.0.0-alpha.9 [0c378])
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 @nuxtjs/auth-next
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.
from vue-demi.
Could you share a minimal reproduce repo? Thanks.
@vue/composition-api
becomes a dependency because the philosophy of vue-demi
is trying to abstract the lower layer of details to exposing the APIs for 2 & 3 as the same as possible.
from vue-demi.
@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.
from vue-demi.
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.
from vue-demi.
Sure, I will change it to peerDeps. Thanks
from vue-demi.
Related Issues (20)
- Vue 2.6: Error "VueCompositionAPI.getCurrentInstance is not a function" in hasInjectionContext() HOT 1
- Pinia2.1.3 + vue3.3.4 does not work: hasInjectionContext is not defined HOT 6
- about 2.7 exports Vue.util.warn HOT 2
- Remove peerDependencies
- Can't use Vue 2 library in Vue 3 HOT 1
- The requested module 'vue-demi' does not provide an export named 'computed' HOT 3
- Packaged a custom hook with rollup, ref did not unpack it automatically in the template HOT 2
- vue3.3 + ts, when v-for the computed array, the item type reference error
- Uses the wrong vue version in monorepo HOT 4
- How we resolve dependency issue for ? HOT 1
- v0.14.5 recently overwritten? and v0.14.6 does not work... HOT 11
- vue-demi-fix is missing HOT 5
- 这个文件前边都是es5语法,最后加的这一行箭头函数让我们构建时不得不对vue-demi单独加一条适配规则 HOT 1
- `postinstall` script doesn't play well with `pnpm` on Windows HOT 8
- vue.use 和 vue.default.use问题导致报错 HOT 1
- [HELP] The requested module '/node_modules/.vite/deps/vue.js?v=3af26c34' does not provide an export named 'Fragment'
- Reactivity loss when using with @vue/compat HOT 1
- TypeScript got incorrect vue version with pnpm workspace HOT 1
- Refactor with typescript ?
- Bun install segfault in Docker
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vue-demi.