v1.10.0
👀 Highlights
Now pinia-orm has finally all functions and relations from vuex-orm/core
🎈
Also i added the support for pinia setup store syntax. 💯 So now you are getting even more flexibility.
💊 Plugins fixed
I know the plugin system was still buggy. Either the types were wrong or the configs weren't working. It's finally doing well.
But the plugin regestration changed. Since it haven't worked well yet it should be not a big breaking change.
You now need to register plugins that way:
- const piniaOrm = createORM()
- piniaOrm().use(createPiniaOrmAxios({
- axios,
- }))
+ const piniaOrm = createORM({
+ plugins: [
+ createPiniaOrmAxios({
+ axios,
+ }),
+ ],
+ })
🚀 Pina Setup Store Option
You can now also use the pina setup syntax in pinia-orm. You only need to change your piniaOrm options
createPiniaORM({ pinia: { storeType: 'setupStore' } })
class User extends Model {
static entity = 'users'
static piniaOptions = {
newData: ref('1'),
}
static piniaExtend = {
persist: true,
}
@Attr(0) declare id: number
@Str('') declare name: string
@Str('') declare username: string
}
console.log(userRepo.piniaStore().newData) // 1
👉 Changelog
🚀 Enhancements
- pinia-orm: Add
morphedByMany
as relation (#1897) - pinia-orm: Add option for custom pivotKey for relations with pivot (#1907)
- pinia-orm: Pinia setup store syntax support (#1905)
🩹 Fixes
- pinia-orm: Change plugin registration to be still compatible with pinia types (#1902)
- axios: Axios instance is not found (29a91b0)
- pinia-orm: Data was wrong for
belongsTo
&hasOne
with composite key (#1904) - pinia-orm: BelongsToMany relation returns a toplevel 'pivot' reation (#1909)
- pinia-orm:
pivot
helper fields are not deleted or removed. (#1911) - pinia-orm: Model original data is overwritten by different namspace models with same ID (#1954)
- pinia-orm: UID Decorator: Setting Custom Alphabet Results in "undefined" Instead of Characters in UIDs (#1956)
- pinia-orm: Ordering sometimes wrong with Query.orderBy and UseCollect.sortBy (#1957)
💅 Refactors
- pinia-orm: Replace
relation.getKey
withrelation.getResolvedKey
(ad91ce6)
📖 Documentation
- pinia-orm: MorphToMany example Taggable is missing primaryKey (#1959)
🏡 Chore
- Update sponsors (2eed564)
- normalizr: Add missing types export for bundler usage (220b093)
- pinia-orm: Move to moduleResolution
bundler
(#1906) - pinia-orm: Update
WeakCache
types for newest typescript version (dc9d711) - Add .eslintcache to gitignore (3d6c378)
✅ Tests
- axios: Correct axios is not set test (93359fd)
❤️ Contributors
- Gregor Becker (@CodeDredd)
- petrmifek (@petrmifek)