js-bao 0.12.0-alpha.14 → 0.12.0-alpha.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -0
- package/dist/browser.cjs +7833 -1415
- package/dist/browser.d.cts +2491 -189
- package/dist/browser.d.ts +2491 -189
- package/dist/browser.js +7828 -1409
- package/dist/client.cjs +274 -81
- package/dist/client.d.cts +1215 -107
- package/dist/client.d.ts +1215 -107
- package/dist/client.js +274 -81
- package/dist/cloudflare-do.cjs +1927 -688
- package/dist/cloudflare-do.d.cts +1631 -116
- package/dist/cloudflare-do.d.ts +1631 -116
- package/dist/cloudflare-do.js +1927 -688
- package/dist/cloudflare.cjs +804 -147
- package/dist/cloudflare.d.cts +1261 -108
- package/dist/cloudflare.d.ts +1261 -108
- package/dist/cloudflare.js +804 -147
- package/dist/codegen-v2.cjs +1193 -208
- package/dist/codegen.cjs +15 -4
- package/dist/format2-worker.js +13810 -7757
- package/dist/index.cjs +9577 -2662
- package/dist/index.d.cts +2729 -198
- package/dist/index.d.ts +2729 -198
- package/dist/index.js +9509 -2674
- package/dist/node.cjs +8015 -1192
- package/dist/node.d.cts +2623 -189
- package/dist/node.d.ts +2623 -189
- package/dist/node.js +7957 -1189
- package/dist/record-log.cjs +475 -23
- package/dist/record-log.d.cts +290 -9
- package/dist/record-log.d.ts +290 -9
- package/dist/record-log.js +475 -23
- package/dist/sqlite3.wasm +0 -0
- package/package.json +16 -5
package/README.md
CHANGED
|
@@ -1599,6 +1599,24 @@ See the `examples/` directory for complete working examples:
|
|
|
1599
1599
|
Changes a consumer of this package can observe, including the on-disk
|
|
1600
1600
|
behaviour of `js-bao/cloudflare/do` (`DurableObjectEngine`). Newest first.
|
|
1601
1601
|
|
|
1602
|
+
- **A db3 binds with no `Y.Doc`; the browser entry loads Yjs on demand**
|
|
1603
|
+
(unreleased). `connectDocument(id, null, permission, { documentFormat: 3 })`
|
|
1604
|
+
binds a db3, and the connected record's `yDoc` is `null` for a format-3
|
|
1605
|
+
document whatever was passed (`ConnectedDocument.yDoc` is now
|
|
1606
|
+
`Y.Doc | null`). A format-1 connect with `null` is refused, naming the fix.
|
|
1607
|
+
`ModelRegistry.initializeAllForDocument` and `BaseModel.initializeForDocument`
|
|
1608
|
+
take `Y.Doc | null` too. The browser entry (`js-bao/browser`, the `browser`
|
|
1609
|
+
condition) imports `yjs` only at the first format-1 `connectDocument`, or
|
|
1610
|
+
when `loadYjs()` is awaited, so an app that only uses db3s never loads it.
|
|
1611
|
+
Its CommonJS file (`dist/browser.cjs`) loads Yjs at the same moment with
|
|
1612
|
+
`require("yjs")`, so it shares the copy a CommonJS caller requires. Every entry exports `loadYjs()`, `yjsLoaded()` and `YjsNotLoadedError`; on
|
|
1613
|
+
the `node`, default and `cloudflare` entries Yjs is static and `loadYjs()`
|
|
1614
|
+
resolves at once. On the browser entry, every helper that takes a `Y.Doc`
|
|
1615
|
+
(`discoverSchema`, `syncModelMeta` and the rest) throws `YjsNotLoadedError`
|
|
1616
|
+
until Yjs is loaded: `await loadYjs()` first when you use one on a `Y.Doc` of
|
|
1617
|
+
your own before any format-1 document is connected. `yjs` stays a peer
|
|
1618
|
+
dependency; an app that wants it in its startup bundle imports it once
|
|
1619
|
+
statically.
|
|
1602
1620
|
- **Breaking: format 2 (large document) is removed** (0.12.0). Every
|
|
1603
1621
|
`models/format2*` export that served the epoch overlay is gone — the record
|
|
1604
1622
|
store and its asynchronous host, the overlay observer and fold, the epoch
|