feathersjs-ecosystem / feathers-vuex

Integration of FeathersJS, Vue, and Nuxt for the artisan developer
https://vuex.feathersjs.com
MIT License
445 stars 108 forks source link

Vue 3 Support #555

Open marshallswain opened 3 years ago

marshallswain commented 3 years ago

This issue is for tracking progress towards Vue 3.

marshallswain commented 3 years ago

Breaking Changes

Package name

For Vue 3, the package name must be changed from feathers-vuex to @feathersjs/vuex.

v-model Compatibility

This will definitely be a breaking change due to the changes in the component v-model syntax. However, we will break as little as possible in this release. FeathersVuexPagination is the only component that uses v-model. To prevent v-model usage from breaking, the component will be updated to have a model property like this:

{
  model: {
    prop: 'modelValue'
  }
}

This means that any usage of v-model="someVal" will not break for Vue 2 apps. However, usage like :value="someVal" will need to be changed to :modelValue="someVal"

Event Compatibility

The component will now emit both the input and the update:modelValue events to be compatible with both versions of Vue.

New Features

Customize the injected property name

Instead of always having to use this.$FeathersVuex (or Vue.$FeathersVuex in Vue 2), you can now pass an alias attribute to the FeathersVuex plugin options. The provided string will work alongside $FeathersVuex.

tasker204 commented 3 years ago

Super excited for this. Any idea on timeline for completion?

briancbarrow commented 3 years ago

@marshallswain thanks for taking this on! I'm super excited for it!

marshallswain commented 3 years ago

Hey, @briancbarrow and @tasker204, I'm glad you're excited. I'm testing it out on my production apps, right now. I'm running into some issues with SSG and hydration, and I don't think feathers-vuex is the problem, but I need to confirm and figure out solutions before I can publish. Plus with the Nuxt 3 announcement next week, I'd like to make sure it works with that, too, and not have to do another breaking release because of some tiny change. So it's at least a week away. You can definitely test @feathersjs/vuex right now. It seems to work great in plain PWAs.

briancbarrow commented 3 years ago

@marshallswain awesome! I'll see if I can give it a try this weekend.

I'm pretty new to FeathersJS. Is there anything special I'll need to do to get it working with the vite app i just started up?

For example, i saw this in the description above:

Example Vue 3 app with Vite

Can I get access to that?

marshallswain commented 3 years ago

@briancbarrow you can find it here: https://github.com/marshallswain/feathers-vuex-vite-spa

marshallswain commented 3 years ago

Status update, I'm still testing this out in a couple of applications. I have a utility that I'm updating for the new release that will assist in working with cloned values. So far it's really working well.

FossPrime commented 3 years ago

UPDATE: TRY FEATHERS PINIATA https://github.com/marshallswain/feathers-pinia


As I'm working to catch up on Vue 3, Vuex and Feathers developments... Made this Vue 3 app on their cheap "Serverless" sandbox https://codesandbox.io/s/vue-3-worker-fibonacci-9v1li

It also uses CORS with a free runkit sandbox... so that's interesting. If it gets too annoying to update the demo sandbox I could use the container version, but that requires logging in, and cant' be embedded in websites/docs, so not as useful.

thomasvds commented 3 years ago

Hi @marshallswain could you kindly provide an updated status on Vue 3 compatibility? We're big fans of FeathersVuex at my company and for us this is the key lib that we wait to be compatible before we move to Vue 3. Thanks a lot 🙏

marshallswain commented 3 years ago

The prerelease should already work with Vue 3.   You may want to give feathers pinia a try, too. It is more like what Vuex 5 will be in the future.

On August 29, 2021, GitHub @.***> wrote:

Hi @marshallswain https://github.com/marshallswain could you kindly provide an updated status on Vue 3 compatibility? We're big fans of FeathersVuex at my company and for us this is the key lib that we wait to be compatible before we move to Vue 3. Thanks a lot 🙏

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/feathersjs-ecosystem/feathers- vuex/issues/555#issuecomment-908190798, or unsubscribe https://github.com/notifications/unsubscribe- auth/AAA7OWP4WUCRCDG4BNARYKDT7NFMLANCNFSM4UMXLFKQ.

thomasvds commented 3 years ago

Thanks @marshallswain , we'll try it out!

ap1969 commented 3 years ago

Hi @marshallswain

Am I correct in assuming it's the @feathersjs/vuex@4.0.1-pre.xx releases that support vue 3?

Thanks for your work on this.

Andy

marshallswain commented 3 years ago

That's correct.

On September 6, 2021, GitHub @.***> wrote:

Hi @marshallswain https://github.com/marshallswain

Am I correct in assuming it's the @@.*** releases that support vue 3?

Thanks for your work on this.

Andy

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/feathersjs-ecosystem/feathers- vuex/issues/555#issuecomment-914155187, or unsubscribe https://github.com/notifications/unsubscribe- auth/AAA7OWOF54GIHGKSRS5DW7TUAXMSLANCNFSM4UMXLFKQ.

ap1969 commented 3 years ago

Excellent, thanks Marshall

ymarcon commented 3 years ago

Hi @marshallswain, I can't manage to install the @feathersjs/vuex@4.0.1-pre.xx pre-release because npm says "Missing package version", and indeed there is no version in the package.json. Am I missing something?

marshallswain commented 3 years ago

If you run npm view @feathersjs/vuex, you should see that there's a 4.0.1-pre.16 published on npm.  The only way it would publish is if it had a version.  My suggestion is to install that version specifically.  Even just npm i @***@***.*** should work.

On September 13, 2021, GitHub @.***> wrote:

Hi @marshallswain https://github.com/marshallswain, I can't manage to install the @@.*** pre- release because npm says "Missing package version", and indeed there is no version in the package.json. Am I missing something?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/feathersjs-ecosystem/feathers- vuex/issues/555#issuecomment-918274475, or unsubscribe https://github.com/notifications/unsubscribe- auth/AAA7OWI3LQWHQKGYTAAIQM3UBYF4PANCNFSM4UMXLFKQ.

ymarcon commented 3 years ago

Oh ok, I assumed the pre-release was not in npm's registry and was installing it from the tarball. Thanks!

FossPrime commented 2 years ago

I couldn't get the classical $FeathersVuex Vue 3 app mixin to register with @feathersjs/vuex@4. Not sure if that's intentional, I assume we should register it ourselves if we want the classical API access

https://codesandbox.io/s/xk52mqm7o

DimitriMichel commented 2 years ago

@marshallswain seems like the pre-release still relies on the old Composition API any plans to change this?

marshallswain commented 2 years ago

@DimitriMichel is there a new package for it? I thought Vue-Demi was the way to go. Enlighten me, please

DimitriMichel commented 2 years ago

@marshallswain Actually it turns out there was an error emitting from an unrelated dependency conflict. Thanks for the quick response though!