Use Firestore in React with zero effort, using MobX 🤘
- Fixed
Collection.isLoading
andCollection.isLoaded
not reacting to data updates when accessed #180 (thanks @ghatchue).
- Adds support for the new Firebase v9 API.
- Added
makeWebContext
for initializing a context with the new code-splitted Firebase API (v9+). - Added
makeCompatContext
for initializing using the compat API or react-native-firebase.
- Removed flow-typings.
- Removed
makeFirestorterContext
(replaced bymakeCompatContext
andmakeWebContext
).
- Export all TypeScript types and interfaces.
- Add support for MobX 6! 🤘🤘🤘🤘🤘🤘
- Add
FirestorterConfig
type definition.
- MobX 5 and 4 are no longer supported. Use
firestorter@2
instead. - Removed the deprecated
makeContext
function. UsemakeFirestorterContext
instead.
- Added new
isLoaded
property for checking whether data/docs have been loaded initially
- Added new
AggregateCollection
class - Added new
GeoQuery
class for performing geographical queries - Added geographical helper functions
- Added flow-typings
- Added whole new Documentation website 🤘
makeContext
has been renamed tomakeFirestorterContext
- Removed the deprecated
DocumentClass
constructor option forCollection
- Fixed
mergeUpdateData
throwing an exception when FieldValue.delete() is used with react-native-firebase
- Improved
Collection.hasDocs
to be more efficient and work nicely withcomputedRequiresReaction
(it's no longer computed)
- 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 collection - Fixed 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 fetched - Added Document
snapshotOptions
option, to control how Firestore server-timestamps are handled in snapshots - Added 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-error - Fixed
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
- Fixed exception when accessing
Document.source
orCollection.source
- 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 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})
)
- Fixed Document not triggering a reaction after calling
Document.update
with a field-path
- Added debug statement to log
Document
snapshot updates
- 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.
- 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
- Removed obsolete firestore snapshot fields
Document.createTime
,Document.updateTime
andDocument.readTime
- 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
- Fixed Promise not rejected on
Collection.add
, when invalid doc-data was specified
- Removed firebase as a peer dependency
- Various updates to docs
- 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 active - Added
Document.set
operation - Added 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