Releases: mesqueeb/vuex-easy-firestore
Fillables & guard improved! 🐳
Vuex easy firestore now supports nested fields for fillables & guard!
Nested usage
In the example below we will prevent the nested field called notAllowed
from being synced:
const docToPatch = {nested: {allowed: true, notAllowed: true}}
// in your module config, either set the fillables like so:
fillables: ['nested.allowed']
// OR set your guard like so:
guard: ['nested.notAllowed']
Wildcard usage
You can also use wildcards now!
In this example you have a document with an object called lists. The lists each have an id as the key, and a nested property you want to prevent from being synced:
const docToPatch = {
lists: {
'list-id1': {allowed: true, notAllowed: true},
'list-id2': {allowed: true, notAllowed: true}
}
}
// in your module config, either set the fillables like so:
fillables: ['lists.*.allowed']
// OR set your guard like so:
guard: ['lists.*.notAllowed']
Enjoy! 💫
Bojack 🐴
Phew! A lot has happened over the past few weeks!
Lots of requests, bug fixes and new features!
- support arrayUnion and arrayRemove 🐥 (see documentation)
- can now disable auto gen. fields. 🦞 (see documentation)
- Update hooks documentation 🦆 (see documentation)
- Allow updating filters on openDBChannel 🦈 (see #87)
- Multiple pathVars in where filters 🐙 (see #86)
Auto gen. fields
updated_at
, updated_by
, created_at
, created_by
, id
can all be disabled now by adding them to guard.
Hooks!
Be careful of the execution timing of hooks!! I have carefully updated the documentation on the timings. There are some "gotcha's" in there, so recommended for all to double check the docs!
arrayUnion and arrayRemove
I made it so it's very similar to the usage with Firestore! Hurray!
Enjoy!! ☃️
Duplicating all day long! 👭👬
Time for some new stuff! 🌱
- new
duplicate
andduplicateBatch
actions! See documentation. resolves #38 - new
closeDBChannel
action! See documentation. resolves #58
Improved documentation 🛫
- clarification on 'doc' vs 'collection' mode (documentation)
- how to manually assign IDs (documentation) resolves #37
Enjoy!! 🚤
Critical fixes 🐡
It's recommended for everyone to update to the latest version!
npm i vuex-easy-firestore@latest
// or
yarn add vuex-easy-firestore@latest
There have been several critical issues fixed related to:
'%convertTimestamp%'
see documentation here- Usage of Firestore reference fields #55
- Multiple Firestore collections, with quick inserts behind one another failing #50
- custom pathVariables #59
TypeScript
Excited to announce that I've converted the codebase to TypeScript! Giving some awesome feedback for all of you TypeScripters out there!!
Enjoy!! 🐯
Make Firebase a peer dependency 🦁
Peer pressure 👥
I made Firebase a peer dependency to make sure there is no version difference causing potential bugs.
New users will need to use the following install method going forward:
npm i vuex-easy-firestore firebase
Console logging control 🎙
All new documentation with VuePress! 📗
If you haven't seen it yet, I've made an all now documentation website! Check it out here!!
Also see the blog post I wrote on Medium!
Logging 📌
Changed the behaviour that console logging on API calls is now turned off by default.
It can be enabled like so:
import createEasyFirestore from 'vuex-easy-firestore'
const easyFirestore = createEasyFirestore(userDataModule, {logging: true}) // here
store: {
plugins: [easyFirestore]
}
Updated the relevant documentation.
Enjoy!! 🎇
fetchAndAdd action 🎢
Whoah! Two new updates in 1 day! : D
New! 🌱
You can now use the all new fetchAndAdd
action!
Please read the updated documentation on fetching to see how.
Also see the other new update (v1.10.0) below!
Enjoy 🌆
Auto convert firebase Timestamps! 🕰
New! 🌱
You can set '%convertTimestamp%'
as a default value to automatically convert Firestore Timestamps' to new Date()
objects!
Please read the updated documentation on defaultValues to see how.
Enjoy 🌇
custom variables for firestorepath and filters 🐸
v1.8.0 introduced a bug related to fillables
which has been fixed. 🐞
New! 🌱
Since v1.9.0 you can use `'{userId}' in the where filter as well as any other custom variable you can set!
This is useful in cases like eg.:
You have custom groups per user; You need a user's groupId
from the user's document, to use that value in the firestorePath
(like groups/{groupId}/users/{userId}/data
) to this other document to retrieve more information.
Please see the docs here.
Enjoy! 🌻