opengridv0.3.0

Installation

Install the elements and the engine from npm, and add an adapter for React, Vue or Svelte.

From npm

npm install @casoon/opengrid

One package, two WebAssembly modules:

In the package Contains Imported as
loader.js, pkg/ <opengrid-table>, <opengrid-grid>, <opengrid-pivot>; the providers and connect @casoon/opengrid
engine/, worker.js Engine (in-memory sources over Apache Arrow) and Planner; the worker that runs the engine @casoon/opengrid/engine/opengrid_wasm.js

A page that only talks to an opengrid-server never loads the engine. One that queries in the tab imports it, and createWorkerProvider() finds it on its own (The public API → Providers).

In React, Vue or Svelte, the components are in the same package, as subpaths — @casoon/opengrid/react, /vue and /svelte. The framework is an optional peer, so it is the page’s own dependency:

npm install @casoon/opengrid react    # React 18 or 19 — import from @casoon/opengrid/react
npm install @casoon/opengrid vue      # Vue 3.3 and later — @casoon/opengrid/vue
npm install @casoon/opengrid svelte   # Svelte 5 — @casoon/opengrid/svelte

What the adapters take and how they bind the view is in Frameworks.

Not on crates.io

No opengrid-* crate is published, so opengrid-server runs from the repository (Where queries run).

Where the modules are found

loadOpengrid() loads the element module from pkg/ next to loader.js, and createWorkerProvider() loads worker.js and the engine from engine/ next to it — after an install, all under node_modules/@casoon/opengrid/. Wherever loader.js goes, those go with it, whole directories.

A bundler does not always keep them together. Vite’s development server does; a production build does not, and the element falls back to the plain table. Serve the directories yourself and pass their URLs — loadOpengrid({ moduleUrl }), createWorkerProvider({ moduleUrl, workerUrl }). Frameworks → Bundlers and the WebAssembly module has the details. The engine imported on the main thread is bundled like any module.

A page without a bundler takes the files from node_modules and serves them as they are:

mkdir -p opengrid
cp -R node_modules/@casoon/opengrid/{loader.js,worker.js,pkg,engine} opengrid/
opengrid/
├── loader.js
├── worker.js
├── pkg/                      # the elements
└── engine/
    ├── opengrid_wasm.js      # the engine
    └── opengrid_wasm_bg.wasm

The Quickstart assumes this layout.

Building from the repository

For working on opengrid itself, or for a version that is not released yet.

Requirements

  • a recent stable Rust with the wasm32-unknown-unknown target (rust-toolchain.toml in the repository asks for it)
  • just
  • wasm-bindgen CLI 0.2.126 — the crate pins the same version, and a different CLI stops with a version error
  • wasm-opt from binaryen 132
  • Node 22 with pnpm, for the adapters and the end-to-end tests

Build the modules

git clone https://github.com/casoon/opengrid.git
cd opengrid
just wasm-build-components   # the elements -> packages/opengrid/pkg/
just wasm-build              # the engine   -> examples/engine-demo/pkg/

The examples and the demo on this site load the engine from examples/engine-demo/pkg/. just package builds both modules again into the element package — the engine into packages/opengrid/engine/ — and packs the package the way a release does, into target/npm-package/. The React, Vue and Svelte adapters are in packages/opengrid/react/, vue/ and svelte/, published as the package’s subpaths.

Check the build

just check         # fmt, clippy -D warnings, the whole test suite
just wasm-check    # every wasm-capable crate builds for wasm32
just e2e           # Playwright + axe-core against a real browser

Edit this page on GitHub · Docs for v0.3.0