Releases: share/sharedb
Releases · share/sharedb
v1.0.0-beta.13
More work by @alecgibson on the under-development fetchSnapshot
feature:
- #237 - [feature] Expose
snapshotType
(current
orbyVersion
) inreadSnapshots
middleware, based on whetherfetch
orfetchSnapshot
is being called. - #242 - [bugfix] Close milestone database when calling
Backend.close
. - #244 - [refactor] Add a
NoOpMilestoneDB
implementation, used as default MilestoneDB- This introduces a technically backwards-incompatible change for the arguments passed when invoking the callback to
MilestoneDB::saveMilestoneSnapshot
. The callback was invoked withcb(error, wasSaved)
, and it's now invoked withcb(error)
. - This shouldn't affect any existing code, as the previous default implementation did not save milestone snapshots, and there are no actual implementations published.
- This introduces a technically backwards-incompatible change for the arguments passed when invoking the callback to
v1.0.0-beta.12
Changes
- #236 - Add milestone snapshots, which are persisted snapshots of documents at previous versions, used to speed up
Backend#fetchSnapshot
. (@alecgibson)
About MilestoneDB
This adds a new MilestoneDB class, which handles persisting milestone snapshots, with a default no-op base implementation. Methods:
MilestoneDB.getMilestoneSnapshot(collection, id, version, callback): void
MilestoneDB.saveMilestoneSnapshot(collection, snapshot, callback): void
To persist milestone snapshots:
- Pass in a real implementation of MilestoneDB (to come later) when constructing Backend:
new Backend({milestoneDb})
- When constructing a real MilestoneDB, decide whether to save milestone snapshots by default for all collections:
- Pass in the
interval
option to save milestone snapshots everyinterval
versions by default. - Or don't pass the
interval
option to turn off saving of milestone snapshots by default.
- Pass in the
- For fine-grained control over when to save a milestone snapshot, register middleware on the
'commit'
action and set therequest.saveMilestoneSnapshot
property totrue
orfalse
to explicitly enable or disable milestone snapshot saving on that commit. If the property is left at its default value ofnull
, then the defaultinterval
is used, if that was specified when constructing the MilestoneDB.
v1.0.0-beta.11
Changes
- #220 - Add
connection.fetchSnapshot(collection, id, version, callback): void
method, for fetching a snapshot at a particular version. (@alecgibson)- See the README for more API documentation.
- Performance note: This method could be slow if requesting a very large version number. ShareDB only stores the most recent snapshot, so this method internally fetches all ops up to the requested version and applies each op in sequence to get the snapshot.
v1.0.0-beta.10
Changes
- #217 - Allow ops received by the server to be non-objects, for consistency with client (@gkubisa)
- #204 - Fix memory leak where
Doc.destroy
leaves around a stub object (@gkubisa) - #228 - Log warning when using deprecated middleware actions
"doc"
and"after submit"
(@gkubisa)
Tests
- #226 - Update to Mocha 5 (@gkubisa)
- #227 - Fix flaky
maxSubmitRetries
test (@alecgibson) - #230 - Remove
devDependency
on sharedb-mingo-memory, breaking a circular dependency when developing in share/sharedb (@ericyhwang)