Skip to content

Releases: feathersjs-ecosystem/feathers-vuex

v3.14.0

30 Oct 00:53
Compare
Choose a tag to compare

🎁 Better Error Messaging, Bulk Event Batching, Improved Store Customization

We have received lots of 🎁 from the community with this release. Here they are in chronological order of contribution:

🎁 Better Error Messaging

First, @JorgenVatle improved the developer experience for anybody using the useFind and useGet composition API utilities. Before this contribution, if you accidentally left out the model arguments, you'd see an error message like the one below. It's admittedly not very clear what the problem is:

Cannot read property `getFromStore` from undefined.

New error messages will now get right to the specifics of the problem, letting you know that the model option is missing. Thank you, @JorgenVatle!

Here's the original PR: #539

🎁 Event Batching / Bulk Event Handling

Feathers-Vuex just got upgraded with automagic and efficient batching of events! This will significantly speed up UI response in our apps, and prevent a lot of locking UI cycles. Events will now be handled in debounced queues of 20 ms, with a maximum debounce window of 1 second. Both of these values are configurable through the debounceEventsTime and debounceEventsMaxWait options.

We recently witnessed a couple of inspiring moments that led to this awesome contribution by @fratzinger.

  • The release of feathers-batch with its new client plugin (which works like magic to speed up an app, by the way). When upgrading a couple of apps to use these new batch tools built by @daffl, I noticed a big difference in startup time for apps, pages, and request-heavy components. It basically enabled one of my favorite GraphQL features for my preferred Restful API solution (In case you missed it, FeathersJS is my favorite;) Now you can query multiple endpoints with a single request to the API server. It's just efficient.
  • This issue filed by @ kshitizshankar about optimizing for bulk patch responses to improve performance.

I think @fratzinger already had a solution for these things in mind before the two events, above. So maybe the inspiration was more to get us on the same page. Whatever the case may be, this is a fantastic contribution that saves a lot of mutation cycles. Thank you, @fratzinger!

Here's the original PR: #546

🎁 Improved Store Customization

We now have a cleaner API for customizing a service's default Vuex store. Introducing the extend option! It's really such a simple thing, but it's a nice update for keeping Vuex code organized. Check it out in this example:

import { makeServicePlugin } from 'feathers-vuex'
import { feathersClient } from './feathers-client.js'

class Todo { /* truncated */ }

makeServicePlugin({
  Model: Todo,
  service: feathersClient.service('todos'),
  extend({ store, module }) {
    // Listen to other parts of the store
    store.watch(/* truncated */)

    return {
      state: {},
      getters: {},
      mutations: {},
      actions: {}
    }
  }
})

The old state, getters, mutations, and actions options for customizing the store still work, but they are deprecated. This means they'll be removed in the next major version of Feathers-Vuex. The biggest improvement here is access to the store object in the same file as other customizations. This means it's easier to keep code organized and grouped together.

Here are the commits where the magic happened:

🐜 A Cleaner Test Experience

In the process of adding the previously-mentioned feature, I (@marshallswain) was also able to track down the cause of hundreds of error messages occurring about five seconds after the tests ended. These error messages were really cluttering the console, making it difficult to see the actual test results. The culprit ended up being the test fixtures for the simulated/mocked Socket.io client. You can see the update here: 8d399fa.

By the way, for anybody cloning the repo to contribute, you can easily debug tests with Visual Studio Code. Included in the repo is a launch.json file which sets up VS Code with a "Mocha Tests" script. Just select it and press play and you can watch the tests run. You can also set breakpoints to inspect variables in the tests. Neat!

🎁 Instance-Level Pending Getters & lots more!

05 Oct 15:19
Compare
Choose a tag to compare

This is a great release, with lots of code contributions from the community! Let's dive right in:

📜 Mixins Docs Cleanup

The mixins documentation is now much more readable thanks to a great contribution by @fratzinger. The main change is that the makeFindMixin and the makeGetMixin have been given their own section in the document rather than grouping similar options and properties. You can see the details of the changes here

🎁 Per-Instance Pending Status

Thanks to an exciting contribution made by @hamiltoes, model instances now have their own pending state for each of the FeathersJS service methods. Before today, Feathers-Vuex would track pending status for create, update, patch and remove only at the service level. This means that if any model is pending, the status for that service reflects the change. It is now much easier to track status for individual instances thanks to additional properties listed below. Check out the full details in the PR.

  • isCreatePending
  • isUpdatePending
  • isPatchPending
  • isSavePending, which is a combination of the above three.
  • isRemovePending
  • isPending, which is a combination of all of the above.

🐜 Fixing the Dirty FormWrapper

The FeathersVuexFormWrapper just got a little bit easier to use thanks to a great catch by @ecirish. He observantly noticed that after calling reset() on the instance, the isDirty boolean status was not getting set back to false. You can check out the details in this commit

🐜 Option Fix for makeFindMixin

In another contribution from a keen eye, @fratzinger noticed that the make-find-mixin had one of its options misnamed. The fetchParams option was accidentally named fetchQuery. This bug fix brings the code up to date with what was already reflected in the docs. See more details in the original commit.

🐜 Fixing the Count Getter

The final contribution packed into this release is another by @fratzinger. He fixed a bug that prevented the count getter from working properly. You can find details in the commit

This is a pretty big release, overall. Many, many thanks to @fratzinger, @ecirish, and @hamiltoes for their contributions!

🎁 🐜 Support all available versions of @vue/composition-api

03 Sep 18:00
Compare
Choose a tag to compare

This update brings greater compatibility with past and future versions of the @vue/composition-api plugin for Vue 2. Thanks to a well-thought-out PR by @phatj and input from @J3m5, feathers-vuex now supports all version fo the composition-api plugin. In version 0.6.7 of the plugin, the createElement export was renamed to h to match the exports in Vue 3. Even though it was a breaking change for the composition api plugin, @phatj was able to produce code that works for all versions without a breaking change for feathers-vuex! 🎉

🐜 Allow getters to be called with refs

03 Sep 17:53
Compare
Choose a tag to compare

Thanks @hamiltoes for this update, which updates the getters to support ref arguments, bringing better support for the Vue Composition API. A few typescript fixes were also published in this release.

🐜 Remove query filtering in the `find` getter

03 Sep 17:48
Compare
Choose a tag to compare

Uncovers an issue found by @kshitizshankar and @J3m5 in #482

The query filtering wasn't really necessary in the find getter. The whitelist and paramsForServer options should now behave as expected.

🎁 A great TypeScript upgrade for BaseModel that really ₁₂₃ Counts

03 Sep 17:39
Compare
Choose a tag to compare

This release brings some great updates to the BaseModel class.

First, a TypeScript update to aid in development, especially when using TS-friendly editors: #487. Thank you, @hamiltoes, for a great update!

Next comes the count and countInStore methods with their accompanying getter, actions, and a matching renderless data component. @fratzinger did the community a great favor by giving this little-known FeathersJS feature a more visible API in feathers-vuex.

Many many thanks from the entire community to @fratzinger and @hamiltoes for the very supportive and highly-comprehensive PRs.

🐜 The `get` getter now supports `id` as a ref

22 Jun 03:58
Compare
Choose a tag to compare

The id passed to get can now be a composition-api ref.

Efficiency release

21 Jun 00:55
Compare
Choose a tag to compare

Updates fast-copy to the latest version: #496

Fixes a loop that occurs when calling addItems with new data: #492

Thanks @fratzinger!

🐜 useFind getter now returns empty array when params are `null`

21 Jun 00:51
Compare
Choose a tag to compare

When params === null, the useFind getter was returning all items in the Model's store instead of an empty array. This release fixes this behavior so that, as with the rest of feathers-vuex, the getter will return an empty set when params are null.

Fix compatibility with client-side feathers-memory

16 Jun 23:05
Compare
Choose a tag to compare

When working with feathers-memory on the client, there's a conflict with the user of the params.paginate attribute. It expected an object, when feathers-vuex has been using it as a boolean. This isn't an issue when working with an API server, but when using feathers-vuex and feathers-memory in a Storybook, for example, it breaks pagination. This update transparently alters the params passed to the service's find method so that it matches what feathers-memory expects.

if (params.paginate === true) {
  params.paginate = { default: true }
}