Skip to content

Epic: JavaScript/WASM bindings with fusio #556

@ethe

Description

@ethe

Summary

Provide first-class JavaScript bindings for Tonbo via WebAssembly, supporting browser, Node.js, Deno, Bun, and Cloudflare Workers. Leverage fusio's executor abstraction to deliver native Promise integration across all runtimes, with platform-appropriate storage backends (OPFS, filesystem, R2/S3).

Current State

  • WASM compilation works (wasm32-unknown-unknown target)
  • Cloudflare Worker example exists
  • No npm package
  • No browser support (OPFS)
  • No Node.js/Deno/Bun support
  • No Arrow JS interop
  • No TypeScript types

Why Multi-Runtime?

┌────────────────────────────────────────────────────────────┐
│                    JavaScript Runtimes                     │
├─────────────┬─────────────┬─────────────┬──────────────────┤
│   Browser   │   Node.js   │    Deno     │ Cloudflare/Edge  │
├─────────────┼─────────────┼─────────────┼──────────────────┤
│   OPFS      │     fs      │   Deno.fs   │    R2 / KV       │
│  IndexedDB  │    S3 SDK   │   S3 SDK    │  Durable Objects │
│  (fallback) │             │             │                  │
└─────────────┴─────────────┴─────────────┴──────────────────┘

Each runtime has different:

  • File system APIs
  • Async primitives
  • Module systems (ESM, CJS)
  • Bundle constraints

Goals

  1. Single npm package: npm install @tonbo/core works everywhere
  2. Runtime detection: Auto-select appropriate storage/executor
  3. Arrow JS interop: Zero-copy where possible with apache-arrow
  4. TypeScript-first: Full type definitions
  5. Tree-shakeable: Minimal bundle for browser
  6. Promise-native: Idiomatic async/await

Non-Goals

  • React/Vue/Svelte framework bindings (future)
  • GraphQL/REST API layer (user responsibility)
  • Offline-first sync engine (separate project)
  • Legacy browser support (modern browsers only)

Metadata

Metadata

Assignees

No one assigned

    Labels

    XL - Extra LargeSystem architecture overhaul, adding support for new platforms, large-scale dependency updates.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions