diff --git a/README.md b/README.md
index 9c1c751f..80d8ff47 100644
--- a/README.md
+++ b/README.md
@@ -131,7 +131,9 @@ network provider.
y-libp2p
-Uses libp2p to propagate updates via GossipSub. Also includes a peer-sync mechanism to catch up on missed updates.
+Uses libp2p to propagate updates via
+GossipSub.
+Also includes a peer-sync mechanism to catch up on missed updates.
y-dat
@@ -717,7 +719,7 @@ Y.applyUpdate(ydoc1, diff2)
Y.applyUpdate(ydoc2, diff1)
```
-### Example: Syncing clients without loading the Y.Doc
+#### Example: Syncing clients without loading the Y.Doc
It is possible to sync clients and compute delta updates without loading the Yjs
document to memory. Yjs exposes an API to compute the differences directly on the
@@ -741,6 +743,17 @@ currentState1 = Y.mergeUpdates([currentState1, diff2])
currentState1 = Y.mergeUpdates([currentState1, diff1])
```
+#### Using V2 update format
+
+Yjs implements two update formats. By default you are using the V1 update format.
+You can opt-in into the V2 update format wich provides much better compression.
+It is not yet used by all providers. However, you can already use it if
+you are building your own provider. All below functions are available with the
+suffix "V2". E.g. `Y.applyUpdate` ⇒ `Y.applyUpdateV2`. We also support conversion
+functions between both formats: `Y.convertUpdateFormatV1ToV2` & `Y.convertUpdateFormatV2ToV1`.
+
+#### Update API
+
Y.applyUpdate(Y.Doc, update:Uint8Array, [transactionOrigin:any])
-
@@ -773,6 +786,14 @@ Encode the missing differences to another update message. This function works
similarly to
Y.encodeStateAsUpdate(ydoc, stateVector)
but works
on updates instead.
+ convertUpdateFormatV1ToV2
+ -
+Convert V1 update format to the V2 update format.
+
+ convertUpdateFormatV2ToV1
+ -
+Convert V2 update format to the V1 update format.
+
### Relative Positions
diff --git a/src/index.js b/src/index.js
index fe74a1d2..07bc2044 100644
--- a/src/index.js
+++ b/src/index.js
@@ -85,12 +85,16 @@ export {
encodeRelativePosition,
decodeRelativePosition,
diffUpdate,
- diffUpdateV2
+ diffUpdateV2,
+ convertUpdateFormatV1ToV2,
+ convertUpdateFormatV2ToV1
} from './internals.js'
const glo = /** @type {any} */ (typeof window !== 'undefined'
? window
+ // @ts-ignore
: typeof global !== 'undefined' ? global : {})
+
const importIdentifier = '__ $YJS$ __'
if (glo[importIdentifier] === true) {