swrv icon indicating copy to clipboard operation
swrv copied to clipboard

Incompatibility with Vue 2.7

Open ZeroThe2nd opened this issue 3 years ago • 6 comments

Due to the direct requirements of @vue/composition-api, the package is not compatible with Vue 2. Instead, dependency tree building fails when attempting to install.

How to reproduce

  1. Init an empty npm project
  2. npm i vue@^2.7
  3. npm i swrv
  4. Result:
npm ERR! Found: [email protected]
npm ERR! node_modules/vue
npm ERR!   vue@"^2.7.8" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer vue@">= 2.5 < 2.7" from @vue/[email protected]
npm ERR! node_modules/@vue/composition-api
npm ERR!   peer @vue/composition-api@"^0.5.0 || ^1.0.0-beta.17 || ^1.0.0-rc.5" from [email protected]
npm ERR!   node_modules/swrv
npm ERR!     swrv@"^0.9.6" from the root project

ZeroThe2nd avatar Aug 02 '22 11:08 ZeroThe2nd

super exciting release! but yes you're right that swrv does not currently support vue 2.7. Would be good to support it since it's the final minor release of vue 2

darrenjennings-stripe avatar Aug 02 '22 14:08 darrenjennings-stripe

@darrenjennings-stripe Do you perhaps have a handle on making something compatible with both Vue 2.6 and 2.7? I wouldn't mind giving it a try. Otherwise I think it'll have to be a breaking change, and require a major release number.

ZeroThe2nd avatar Aug 03 '22 11:08 ZeroThe2nd

I recommend vue-demi to support Vue 2.6 / 2.7 / 3.

mascii avatar Aug 04 '22 03:08 mascii

@mascii Thanks, I'll take a look at it and see what I can do 😺

ZeroThe2nd avatar Aug 04 '22 11:08 ZeroThe2nd

@ZeroThe2nd I'm planning on upgrading the master branch to Vue 2.7 and bumping the minor version (following the logic for other Vue libs) in the coming weeks.

I don't recommend adding vue-demi as a dependency as there is already a next branch that we plan on bringing up-to-date for Vue 3 support.

adamdehaven avatar Aug 05 '22 17:08 adamdehaven

@ZeroThe2nd I have a draft PR in progress if you'd like to take a look: https://github.com/Kong/swrv/pull/304

adamdehaven avatar Aug 06 '22 16:08 adamdehaven

@ZeroThe2nd our plan is to merge this in next week. More details can be found in the Release strategy section of the PR.

Note: This will break SSR support

adamdehaven avatar Aug 26 '22 22:08 adamdehaven

@adamdehaven Thanks for the heads-up. The missing SSR support doesn't affect me, but I appreciate the warning. It makes sense as well to drop it for now and re-do it right for Vue 3 + Nuxt 3 once it releases past an RC.

I'll close the issue now it's on the near-future roadmap to merge. Thanks for the time and responses!

ZeroThe2nd avatar Aug 27 '22 11:08 ZeroThe2nd

#304 has been merged - Vue 2.7 compatibility is now available as of version 0.10.0 🎉

adamdehaven avatar Aug 29 '22 13:08 adamdehaven