Skip to content

Conversation

@whilo
Copy link
Member

@whilo whilo commented Aug 30, 2025

This explores a port to ClojureScript (WIP).

@whilo whilo marked this pull request as ready for review December 23, 2025 02:39
… support

This branch implements distributed Datahike connections over kabel with
comprehensive ClojureScript and browser support.

KabelWriter: Distributed database writer using kabel WebSocket transport
- Enables client-server Datahike architecture with remote transactions
- Fressian serialization for efficient data transfer over kabel
- Store registry pattern for CLJS BTSet reconstruction
- Automatic store config replacement for synced databases

TieredStore: Browser-compatible storage layer
- Memory + IndexedDB tiered storage for browsers
- Proper cache optimization and parameter ordering
- Content-hash based schema-meta-key for distributed sync

- Fix persistent-sorted-set settings handling (pass {:branching-factor 512}
  instead of nil in persistent_set.cljc and kabel/fressian_handlers.cljc)
- Fix Datom->JS array conversion in query.cljc
- Update persistent-sorted-set to replikativ fork with deps/prep-lib
- Add prep task for git dependency Java compilation

- Generate TypeScript definitions from api-specification
- Automated version management from config.edn
- Shared JS naming logic in datahike.js.naming
- Comprehensive JS test suite (10 tests)
- Remove redundant version function (use package.json)

- Add browser-test job with Karma + ChromeHeadless
- Add node-cljs-test job for Node.js CLJS tests
- Add npm-test job for JavaScript API tests
- Fix browser-test: working_directory, Java 17, browser-tools orb
- All CLJS/JS tests required for deploy/release gates

- persistent-sorted-set: replikativ fork with deps/prep-lib
- distributed-scope: mvn release 0.1.2
- kabel: 0.3.91
- konserve-sync: 0.1.9
- Add "Streaming writer (Kabel)" subsection to distributed.md
  - Server setup example with middleware stack
  - Browser client setup with TieredStore and IndexedDB
  - Store translation and caching optimization notes

- Create doc/cljs-support.md
  - Async storage model (partial-cps)
  - Node.js file backend
  - Browser backends: memory, IndexedDB, TieredStore
  - JavaScript API reference
  - Known limitations
The connector multimethod now dispatches to connect-kabel internally
when writer backend is :kabel. Update docs and tests to use the
standard d/connect API with {:sync? false} option.

- Remove datahike.kabel.connector require from docs and tests
- Replace kc/connect-kabel calls with d/connect
- Update comments to reflect new API usage
The multimethod implementations for :kabel writer backend are defined
in datahike.kabel.connector and datahike.kabel.writer. These must be
required to register the methods before d/connect or d/create-database
dispatch to them.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants