2023-06-21 14:13:31 +02:00
== Changeset Library
2012-08-03 22:04:06 +02:00
2023-06-21 14:13:31 +02:00
The https://github.com/ether/etherpad-lite/blob/develop/src/static/js/Changeset.js[changeset
library]
2021-10-25 01:42:59 +02:00
provides tools to create, read, and apply changesets.
2012-08-03 22:04:06 +02:00
2023-06-21 14:13:31 +02:00
=== Changeset
2012-08-03 22:04:06 +02:00
2023-06-21 14:13:31 +02:00
[source,javascript]
----
2021-10-25 01:42:59 +02:00
const Changeset = require('ep_etherpad-lite/static/js/Changeset');
2023-06-21 14:13:31 +02:00
----
2012-08-03 22:04:06 +02:00
2021-10-25 01:42:59 +02:00
A changeset describes the difference between two revisions of a document. When a
user edits a pad, the browser generates and sends a changeset to the server,
which relays it to the other users and saves a copy (so that every past revision
is accessible).
2012-08-03 22:04:06 +02:00
2021-10-25 01:42:59 +02:00
A transmitted changeset looks like this:
2012-08-03 22:04:06 +02:00
2023-06-21 14:13:31 +02:00
[source]
----
2021-10-25 01:42:59 +02:00
'Z:z>1|2=m=b*0|1+1$\n'
2023-06-21 14:13:31 +02:00
----
2012-08-03 22:04:06 +02:00
2023-06-21 14:13:31 +02:00
=== Attribute Pool
2012-08-07 20:29:44 +02:00
2023-06-21 14:13:31 +02:00
[source,javascript]
----
2021-10-25 01:42:59 +02:00
const AttributePool = require('ep_etherpad-lite/static/js/AttributePool');
2023-06-21 14:13:31 +02:00
----
2012-08-07 20:29:44 +02:00
2021-10-25 01:42:59 +02:00
Changesets do not include any attribute key– value pairs. Instead, they use
2023-06-21 14:13:31 +02:00
numeric identifiers that reference attributes kept in an https://github.com/ether/etherpad-lite/blob/develop/src/static/js/AttributePool.js[attribute pool].
2021-10-25 01:42:59 +02:00
This attribute interning reduces the transmission overhead of attributes that
are used many times.
2012-08-07 20:29:44 +02:00
2021-10-25 01:42:59 +02:00
There is one attribute pool per pad, and it includes every current and
historical attribute used in the pad.
2012-08-03 22:04:06 +02:00
2023-06-21 14:13:31 +02:00
=== Further Reading
2021-04-06 21:07:36 +02:00
Detailed information about the changesets & Easysync protocol:
2023-06-21 14:13:31 +02:00
* https://github.com/ether/etherpad-lite/blob/develop/doc/easysync/easysync-notes.pdf[Easysync Protocol]
* https://github.com/ether/etherpad-lite/blob/develop/doc/easysync/easysync-full-description.pdf[Etherpad and EasySync Technical Manual]