Skip to content

Releases: mesqueeb/vuex-easy-firestore

v1.37.0

03 Dec 23:51
Compare
Choose a tag to compare

Since 1.37.0 vuex-easy-firestore now requires Firebase 9.x as peer dependency.
It imports and relies on the compat libraries provided by Firebase 9.x.

Future versions

Maintenance on vuex-easy-firestore from me is now deprecated in favour of the new library I wrote from scratch.

I still accept PRs of course.

Changelog

  • Merge pull request #347 from ajgagnon/patch-1 26a7beb
  • Merge pull request #375 from wifisher/fb-v9-compat 19d4297
  • Upgrade to Firebase v9 using the compat libraries. a1a838e

1.35.2...v1.37.0

openDBChannel improvement + new fetch* actions syntax 🔍

10 Dec 13:55
6895c3c
Compare
Choose a tag to compare

We've completely re-written the openDBChannel action, so it's now much better at reporting and handling errors!

openDBChannel now gets an option and resolves its promise with an objects that allow new features, in the form:

dispatch('moduleName/openDBChannel', {includeMetadataChanges: boolean})
  .then(({refreshed, streaming, stop}) => { })
  .catch(error => {...})

You must take the streaming promise into account to catch errors in the channel.
See the openDBChannel documentation for more info.

There is also a slightly new syntax for fetch, fetchById and openDBChannel, although the old syntax will keep working until the next major version.

Before:

dispatch('moduleName/fetch', { where: [...], orderBy: [...], limit: [...], userId: '...', otherPathVariable: '...', someOption: '...' })

This has become:

dispatch('moduleName/fetch', {
  clauses: { where: [...], orderBy: [...], limit: [...] },
  pathVariables: { userId: '...', otherPathVariable: '...' },
  someOption: '...'
})

better Error handling for actions 📌

24 Nov 15:23
f0c74e7
Compare
Choose a tag to compare

Now any action will properly catch errors from firebase and reject them like any other normal API

// any of these:
dispatch('module/set', {id, data})
dispatch('module/patch', {id, data})
dispatch('module/insert', {data})
dispatch('module/delete', id)
// can now use:
  .then(id => console.log(id))
  .catch(e => console.error(e))

And also for the batch actions:

// any of these:
dispatch('module/patchBatch', {doc, ids})
dispatch('module/insertBatch', docs)
dispatch('module/deleteBatch', ids)
// can now use:
  .then(ids => console.log(ids))
  .catch(e => console.error(e))

Please mind that before v1.35.0 this would only take a split millisecond:

// even though this is a promise:
const newId = await dispatch('module/insert', newDoc)
// it gets resolved with the new ID almost immediately

But now it will wait for the debounce timer (1 sec by default) before it's resolved.

const newId = await dispatch('module/insert', newDoc)
const newId2 = await dispatch('module/insert', newDoc)
const newId3 = await dispatch('module/insert', newDoc)
// these all get resolved when the 1 sec debounce timer finishes

There were further no breaking changes besides the fact that resolving this promise now takes as long as the debounce timer.

Fetch by id 🎣

26 Apr 05:52
08695ae
Compare
Choose a tag to compare

NEW ☘️

Now Vuex Easy Firestore supports fetching a single document by id to have it automatically added to your 'collection' module.

See the updated documentation here on how to use it!

Enjoy!! 🍻

increment me 🏓

15 Apr 03:30
513caba
Compare
Choose a tag to compare

NEW ☘️

Now Vuex Easy Firestore supports incrementing values just like Firebase can with Firebase.firestore.FieldValue.increment.

See the documentation here on how to use it!

Fixes 🖍

Fixed #188 (When reloading an app in offline mode any collections that had pending updates would not populate into Vuex)

Enjoy!! 🌸

Spring has come 🌱

22 Mar 02:41
0fb47dd
Compare
Choose a tag to compare

Some quality of life updates have been integrated over the past couple of weeks.

NEW ☘️

Fixes 🐾

  • multiple bug fixes including #156 #161

Enjoy!! 🌴

Important bug fixes! ‼️

21 Jan 05:17
88307e4
Compare
Choose a tag to compare

I was able to tackle some very tricky bugs related to ArrayUnion and userId in the firestore path!

Updating to this version is recommended for ALL users!!!

Enjoy!! 🔆

Hooks behaviour change 📎

09 Jan 07:56
2bd888f
Compare
Choose a tag to compare

I have had a breakthrough concerning hooks!

Previously vuex-easy-firestore used FieldValue.serverTimestamp() for the default fields "updated_at" and "created_at". However, the problem was that a serverTimestamp makes the hooks execute a "server" change even on a "local" change!

By changing these fields to just use a regular new Date() a "server change" is not triggered at all and thus the Hooks have become much more usable! 🎉

The change is not really a "breaking" change, because even before, on a serverChange.modifiedHook there was no changed data anyway, but nevertheless, if you used hooks before it's important to know the change in behaviour:

dispatch('module/set', {id, field: 'new value'})

Before: because of the "updated_at" field, this would trigger:

  1. sync.patchHook
  2. serverChange.modifiedHook

Now: it only triggers:

  1. sync.patchHook

Please review the "execution timing of hooks" which is now greatly simplified!

Enjoy!!! 🌋

Docs & fetchAndAdd 🌸

29 Dec 14:59
c584f7e
Compare
Choose a tag to compare

Completely rewrote the documentation to be more similar to the Firestore documentation. This makes it easier to navigate and especially for new people everything will make sense.

The main part that was updated was the "query data" section.

Now it's really clear what the difference is between openDBChannel and fetchAndAdd. Made also improvements to fetchAndAdd so it's a first class citizen, just as useful as openDBChannel!

Enjoy!! ☀️

Default values improved! 🎄

16 Dec 08:10
9dae28c
Compare
Choose a tag to compare

All new default values!

Now the library can apply default values on local changes and before a doc is inserted into your vuex module and synced!

Documentation is fully updated.

Before vs now

Before default values were defined in serverChange.defaultValues but now that it also applies on local changes it is changed to sync.defaultValues. Please note that backwards capability was built in, so there are no breaking changes!

closes issues

  • [Feature] defaultValues applied on insert #48
  • [Bug] patching a doc < 1000ms after insert fails #103
  • optimisation planned for fetchAndAdd & setting pathVariable #100 (just need to update docs)

Enjoy!!! 🌚