You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
DX: unify SQLite client import surface or explicitly keep separate node/browser packages #48
area:apiPublic interfaces, bindings, events, and cross-backend contractsarea:sqliteSQLite extension, sqlite-node, wa-sqlite persistence, and migrationsdocumentationImprovements or additions to documentation
Decide whether TreeCRDT should expose a single SQLite client import surface across Node and browser, or explicitly keep separate packages for the two runtimes.
The underlying client APIs are now much closer than when this issue was opened, but the package/import story is still split between @treecrdt/sqlite-node and @treecrdt/wa-sqlite.
Current state
Node uses @treecrdt/sqlite-node.
Browser / wa-sqlite uses @treecrdt/wa-sqlite.
There is no unified @treecrdt/sqlite meta-package today.
The high-level client surfaces are already intentionally aligned more closely than before.
Decision to make
Choose one direction:
Option A: Unified import surface
Create a small meta-package (for example @treecrdt/sqlite) that re-exports the right implementation for each environment.
Possible shapes:
one import that resolves differently in Node vs browser via conditional exports
explicit subpaths such as @treecrdt/sqlite/node and @treecrdt/sqlite/browser
Option B: Keep separate packages
Keep @treecrdt/sqlite-node and @treecrdt/wa-sqlite as the long-term public entrypoints, and document that decision clearly.
If we choose this, this issue can close after docs are updated.
Work if we choose Option A
Pick package name and public surface.
Implement the meta-package or subpath exports.
Verify bundler behavior so browser builds do not pull Node-only dependencies and Node builds do not pull wa-sqlite browser assets.
Verify TypeScript resolution in both environments.
Update docs/examples to recommend the unified import when appropriate.
Acceptance criteria
The public import story is explicit and documented.
Browser builds do not accidentally include Node-only dependencies.
Node usage does not require wa-sqlite browser assets.
The chosen import surface matches the already-aligned client semantics across runtimes.
This issue is still open, but the original wording is now partially stale.
What changed since opening it:
there is still no unified meta-package such as @treecrdt/sqlite
the import story is still split between @treecrdt/sqlite-node and @treecrdt/wa-sqlite
however, the two runtimes are now much closer at the API level: the Node package already exposes a high-level createTreecrdtClient(...) surface specifically to match the wa-sqlite client shape
So the remaining question is no longer “make the APIs behave identically” so much as:
do we still want one import surface for SQLite-backed TreeCRDT clients?
if yes, should that be a true meta-package, or explicit subpaths such as /node and /browser?
can we verify bundler behavior so browser builds do not accidentally pull Node-only deps and vice versa?
Suggested rewrite:
keep the issue open
narrow it to the import/package DX decision plus bundler verification
remove the implication that the node/browser client APIs are still fundamentally divergent
Implementation is in #140. It chooses the explicit-package direction (@treecrdt/sqlite-node for Node and @treecrdt/wa-sqlite for browser) instead of adding a @treecrdt/sqlite meta-package, and documents that import surface in a central SQLite clients guide plus package READMEs. The PR uses Fixes #48, so this issue should close automatically once #140 is reviewed and merged.
area:apiPublic interfaces, bindings, events, and cross-backend contractsarea:sqliteSQLite extension, sqlite-node, wa-sqlite persistence, and migrationsdocumentationImprovements or additions to documentation
Activity
marcus-pousette commentedon Apr 22, 2026
Rewrite proposal for current scope:
This issue is still open, but the original wording is now partially stale.
What changed since opening it:
So the remaining question is no longer “make the APIs behave identically” so much as:
Suggested rewrite:
[-]DX: Add unified SQLite driver package (conditional exports node vs wa-sqlite) + verify tree-shaking/bundle size[/-][+]DX: unify SQLite client import surface or explicitly keep separate node/browser packages[/+]marcus-pousette commentedon May 5, 2026
Implementation is in #140. It chooses the explicit-package direction (
@treecrdt/sqlite-nodefor Node and@treecrdt/wa-sqlitefor browser) instead of adding a@treecrdt/sqlitemeta-package, and documents that import surface in a central SQLite clients guide plus package READMEs. The PR usesFixes #48, so this issue should close automatically once #140 is reviewed and merged.