- Breaking:
Collection
'sget
method return type is now typed toT | undefined
.
- Fixed: optimistic destroys for models in collections.
- Simplify
Collection
andModel
api, removing theRequest
wrapper.
- Add missing fromEntries polyfill (second try)
- Add missing fromEntries polyfill
- Remove decorators
- Added missing actions
- Fix the issue #101 caused by generated declaration files path changes
- Migrated to mobx 6
- Added
path
option toCollection#create
,Model#destroy
andModel#save
- Added
Collection#last
method
- One more performance improvement by optimizing
Collection#constructor
to just reset the collection
- Breaking: Moved indexes as getters so they are available during the first
Collection#set
call in the constructor - Refactored
Collection#set
to batch all the additions so indexes are not recalculated for each addition. - Refactored
Model#constructor
to directly set the attributes instead of initialize with an empty map and replace it.
- Fix peformance regression for
set
introduced in 4.0.0 with the addition of indexes: We were creating a model just to call theprimaryKey
method instead of just calling the prototype.
- Remove mustFind and mustGet methods
- Improved error messages when an invariant fails.
- Defend some cases when data is not present.
- Avoids
add
adding duplicated records and switchesmodel.save
to use add instead ofset
- Fixes another edge case when passing a model to
collection.set
- Fixes edge case when a request fails and no collection was given
- Fixes edge case where a model without
id
would makecollection.set
fail.
- Made
set
accept models too, not only attributes. - Now,
save
will add the model to the collection if one is assigned. This allows people to usecollection.build + save
effectively.
- Fixes
filter
throwing errors when targeting non-existing attributes.
- Allow a default primary key if model didn't return a class
- Added indexes to optimize filter and find
- Rollback default
patch
flag value totrue
.
New features 🎩:
- Reimplemented
mustFind
andmustGet
methods in Collection. - Brought back the
request
attribute in Model. The attribute tracks the last issued request. - Brought back
onProgress
hook insave
method.
Solved bugs 🐛:
What's changed 💅:
- Migrated to Typescript
- Made RPC label optional with a default
fetching
value
Breaking changes ☢️:
- Migrated to Mobx 5+
- Rollback default
keepChanges
flag value tofalse
. - Compatible adapters need to implement
data
as their second argument as such.
✨
Full description here: #39 Kudos to @rdiazv
💅
- Remove flow-typed
- Improve bundle size with babel-lodash (kudos @ryedin)
🎩
- Fixed
reset
on models. Use mobxreplace
🎩
- Added
reset
to models.
🎩
- Added
length
for conveniently checking the length of the collection
🎩
- Added
reset
for conveniently resetting a whole collection
💅
- Defined
mobx
as apeerDependency
🐛
- Fixed: Nested attributes couldn't be saved. (kudos to @rdiazv)
🐛
- Fixed: Creating a new model didn't merge the attribute in some cases. (kudos to @rdiazv)
🎩
- Added
mustGet
andmustFind
as whinny versions ofget
andfind
💅
- Added flow types in the build process
- Updated dependencies
💅
- Improved error handling (kudos to @p3drosola)
🐛 Bugfix:
- Stop publishing
babelrc
since it breaks React native
🐛 Bugfix:
- Fix models not being observable after
add
🐛 Fixes:
- Added
transform-runtime
🐛 Fixes:
- Removed need for a runtime by using babel's
transform-async-to-generator
🚀 New features:
- Add
isRequest
for models (it was already inCollection
). - Add
primaryKey
so you can use a different key than'id'
.
🔧 Tooling:
- Add
prettier-standard
- Add flow linting
- Set test coverage