# What's new in Feathers-Vuex 3.0

# Vue Composition API Support

Version 3.0 of Feathers-Vuex is the Vue Composition API release! There were quite a few disappointed (and misinformed:) developers in 2019 when the Vue.js team announced what is now called the Vue Composition API. From my perspective:

  • It is the most powerful feature added to Vue since its first release.
  • It improves the ability to create dynamic functionality in components.
  • It greatly enhances organization of code in components.
  • It encourages code re-use. Check out the vue-use-web collection for some great examples.

And now it has become the best way to perform queries with Feathers-Vuex. To find out how to take advantage of the new functionality in your apps, read the Feather-Vuex Composition API docs.

# Custom Handling for Feathers Events 3.1.0+

Version 3.1 of Feathers-Vuex enables ability to add custom handling for each of the FeathersJS realtime events. You can read more about it in the Service Plugin: Events docs.

# Breaking Changes

Feathers-Vuex follows semantic versioning. There are two breaking changes in this release:

# Auth Plugin user Not Reactive New API in 3.2.0+

Due to changes in how reactivity is applied to service state (it's now using Vue.set under the hood), the user state of the auth module is no longer reactive. To fix this issue, two getters have been added to the auth state. They are available when a userService is provided to the makeAuthPlugin options.

  • user: returns the reactive, logged-in user from the userService specified in the options.
  • isAuthenticated: a easy to remember boolean attribute for if the user is logged in.

If you depend on a reactive, logged-in user in your apps, here is how to fix the reactivity:

  • Replace any reference to store.state.auth.user with store.getters['auth/user'].

Because the user state is no longer reactive, it is logical for it to be removed in the next version. It will likely be replaced by a userId attribute in Feathers-Vuex 4.0.

# Server-Side Pagination Support is Off by Default

The makeFindMixin (and the new useFind utility) now have server-side pagination support turned off, by default. Real-time arrays of results are now the default setting. This really improves the development experience, especially for new users.

To migrate your app to version 3.0, you need to update any params where you are using server-side pagination. It will work as it has been in version 2.0 once you explicitly set paginate: true in the params, like this:

import { makeFindMixin } from 'feathers-vuex'

export default {
  name: 'MyComponent',
  mixins: [ makeFindMixin({ service: 'users', watch: true })],
  computed: {
    usersParams() {
      return {
        query: {},
        paginate: true // explicitly enable pagination, now.
      }
    }
  }
}

This behavior exactly matches the new useFind utility.

# Deprecations

# The keepCopiesInStore Option

The keepCopiesInStore option is now deprecated. This was a part of the "clone and commit" API which basically disabled the reason for creating the "clone and commit" API in the first place.

If you're not familiar with the Feathers-Vuex "clone and commit" API, you can learn more about the built-in data modeling API and the section about Working with Forms.

The keepCopiesInStore feature is set to be removed in Feathers-Vuex 4.0.

# Auth Plugin State: user

As described, earlier on this page, since the Auth Plugin's user state is no longer reactive and has been replaced by a user getter that IS reactive, the user state will be removed in the Feathers-Vuex 4.0.