Firestorter
Use Firestore in React with zero effort, using MobX 🤘
Added new
isLoaded
property for checking whether data/docs have been loaded initially
Added new
AggregateCollection
classAdded new
GeoQuery
class for performing geographical queriesAdded geographical helper functions
Added flow-typings
Added whole new Documentation website 🤘
Removed the deprecated
DocumentClass
constructor option forCollection
makeContext
has been renamed tomakeFirestorterContext
Improved
Collection.hasDocs
to be more efficient and work nicely withcomputedRequiresReaction
(it's no longer computed)
Fixed
mergeUpdateData
throwing an exception when FieldValue.delete() is used with react-native-firebase
Added
Document.hasDocs
which only reacts when the collection becomes empty/non-empty, but not when the document-count changes (thanks @damonmaria)Added debug logging for
Collection.fetch
Fixed return type definition for
Document.fetch
to bePromise<Document<T>>
(thanks @damonmaria)
Added "context" option which makes it possible to use multiple firebase projects (thanks @justjake)
Added document data generics for
Document
Fixed query function type in TypeScript, which could not return
null
to disable the collectionFixed peer-dependency warning when using Firestorter with MobX 4 (e.g. on react-native)
Improved the (somewhat) confusing TypeScript documentation
Fixed
Mode
import not working
Added support for MobX strict mode (
enforceActions: 'always'
)Added
Document.hasData
, which can be used to check whether the document exists/has been fetchedAdded Document
snapshotOptions
option, to control how Firestore server-timestamps are handled in snapshotsAdded support for handling
Timestamp
s in schemas, using the newisTimestamp
helper function
Fixed various TypeScript type definition errors
Fixed
Document.data
not cleared after getting get a fetch-errorFixed
Collection.docs
not cleared after changing path/ref to a non-accessible collection
Added TypeScript as a first-class language (converted to TypeScript and added type-bindings)
Added Collection
createDocument
factory function, in which documents can be created based on the snapshot data (new Collection({createDocument: (source, options) => return new Document(source, options)}))
)Added documentation for using firestorter with TypeScript and react-native
Removed deprecated
active
property from Collection & Document (useisActive
instead)Removed deprecated
fetching
property from Collection & Document (useisLoading
instead)
The Collection
DocumentClass
constructor option has been deprecated (usecreateDocument
instead)
Fixed exception when accessing
Document.source
orCollection.source
Fixed schema validation in
Document.update
orDocument.set
sometimes failed, when data document data contained arrays or sub-objects
Added ability to disable the Collection by returning
null
from a query function (this may break some things)Added automatic removal of all documents from a Collection when it is disabled (when
path
orref
is cleared or query is set tonull
)
Made snapshot errors more verbose so simplify debugging
Fixed exception when calling
.update()
on a document with a schema, that has not yet been fetched
Fixed
lodash.isequal
not defined as a direct dependency
Added logging of
onSnapshot
errors
Fixed exception when fetching a Document which doesn’t exist and which has a schema defined
Added log-message when Document snapshot failed
Fixed schema validation error not using the
debugName
when specified to constructor
Added support for code-debugging and smaller bundles on react-native (
react-native
entry in package.json)Added support for specifying a specific firebase-app to use, instead of always using the default firebase app (
initFirestorter({firebase, app})
)
Added debug statement to log
Document
snapshot updates
Fixed Document not triggering a reaction after calling
Document.update
with a field-path
Fixed schema violation in
Document.update/set
when using a dotted FieldPath.Fixed schema violation in
Document.update/set
when deleting fields using FieldValue.delete().
Added
Collection.minimizeUpdates
option to prevent multiple updates when starting real-time updates on a Collection. This happens when some of the query results are loally cached, causing Firestore to fire multipleonSnapshot
events. Enabling this option causes Firestorter to skip/debounce the first local snapshot, in favor of the full result received slightly later from the cloud.
Fixed unneccessary re-start of real-time updates on
Collection
when the query changes.
Removed obsolete firestore snapshot fields
Document.createTime
,Document.updateTime
andDocument.readTime
Replaced
fetching
with theisLoading
property (better name + isLoading also causes realtime updates to become active, fixes #18)Renamed
active
prop toisActive
(active still supported but shows deprecation warning)
Fixed
Collection.add
still writing to firestore when schema didn't validate
Fixed
Document.update
throwing exception when schema was used.
Added new method for defining queries using an observed function (e.g.
col.query = (ref) => ref.orderBy('text', 'asc')
). This is now the new recommended way for defining queries.
Added support for MobX 4 (for MobX 3.x, use 0.9.3 or lower)
Added donation link and sponsor acknowledgements
Added CHANGELOG.md & release-notes badge
Made
getFirestore
available externally
Added code coverage
Added additional unit tests
Removed firebase as a peer dependency
Various updates to docs
Fixed Promise not rejected on
Collection.add
, when invalid doc-data was specified
Added
Document.ready
andCollection.ready
Added lots of unit tests
Path observations are now immediate
Updated docs
Added ability to specify reactive-functions to the ref, path and query property of Document & Collection
Added
Document.active
andCollection.active
property which indicates whether real-time updating is current activeAdded
Document.set
operationAdded unit tests for Document & Collection (wip)
The realtimeUpdating property has been renamed to mode (realtimeUpdating has been deprecated and will be removed soon)
Many documentation updates
Minor fixes