For history-related changes to pubpub, we need to get more exact information from the editor about the latest key in the current branch, so we make the following changes:
The collaborative.js plugin now fires an onUpdateLatestKey event when the latest key in the currently edited branch changes
The object returned by getFirebaseDoc utility now has a historyData property that contains {currentKey, latestKey, timestamp}. latestKey contains the latest key in the branch. currentKey contains the key requested by the version param, or latestKey if it's not specified. timestamp contains the timestamp of the returned document.
Test plan:npm run start and make sure the collab storybook fixture works. That's a pretty weak signal, though — most of the important changes that this enables are happening in pubpub.
For history-related changes to
pubpub
, we need to get more exact information from the editor about the latest key in the current branch, so we make the following changes:collaborative.js
plugin now fires anonUpdateLatestKey
event when the latest key in the currently edited branch changesgetFirebaseDoc
utility now has ahistoryData
property that contains{currentKey, latestKey, timestamp}
.latestKey
contains the latest key in the branch.currentKey
contains the key requested by theversion
param, orlatestKey
if it's not specified.timestamp
contains the timestamp of the returned document.Test plan:
npm run start
and make sure the collab storybook fixture works. That's a pretty weak signal, though — most of the important changes that this enables are happening inpubpub
.