🎁 Vue Composition API & better Realtime Defaults
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
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.
A Single Breaking Change
Since Feathers-Vuex follows semantic versioning, a single, small breaking change is the reason for the major version bump. Feathers-Vuex 3.0 has only one breaking change:
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.
}
}
}
}
That's the only breaking change in this release. This behavior exactly matches the new useFind
utility.
One Deprecation
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.