INTEGRATION GUIDE

Get a Solid grid running

Install the Solid binding, paste one file, and verify a real formula.

THE RESULT

In five minutes, a Solid + Vite app renders an editable grid backed by a Worker and the Rust/WASM workbook engine. You will type =1+2 and see 3 in the cell.

Choose the route before installing

Before you begin

  • Node.js 22.12 or later.
  • A Vite + Solid TypeScript application. Create one with npm create vite@latest my-sheet -- --template solid-ts if needed.
  • An index.html containing <div id="root"></div>.

1. Install the Solid integration

npm install @einfach/solid-excel @einfach/core @einfach/solid solid-js

The three non-UI packages are peers. Keep one physical copy of each in the application dependency graph; the provider and its consumers must share the same Solid runtime.

2. Paste one working application

Replace src/main.tsx with this example. It uses the bundled Worker backend, so it is the safest default for a first integration.

import { render } from 'solid-js/web'
import {
  createWorkerWorkbookSpreadsheetBackend,
  SpreadsheetGrid,
  SpreadsheetUiProvider,
} from '@einfach/solid-excel/vnext'
import { defaultVNextWorkbookWorkerFactory } from '@einfach/solid-excel/vnext-worker-factory'
import '@einfach/solid-excel/vnext-styles.css'

const backend = createWorkerWorkbookSpreadsheetBackend({
  workerFactory: defaultVNextWorkbookWorkerFactory,
  sheets: [{ id: 'sheet-1', name: 'Sheet1' }],
})

const viewport = {
  scrollTop: 0, scrollLeft: 0, viewportHeight: 480, viewportWidth: 960,
  rowHeight: 24, colWidth: 96, rowCount: 50, colCount: 12,
  overscanRows: 2, overscanCols: 1,
}

const root = document.getElementById('root')
if (!root) throw new Error('Missing #root')

render(() => (
  <SpreadsheetUiProvider backend={backend}>
    <SpreadsheetGrid sheetId="sheet-1" viewport={viewport} />
  </SpreadsheetUiProvider>
), root)
Worker backendOwns workbook data and formula computation away from the main thread.
ProviderConnects that backend to the UI state once at the application boundary.
GridRequests only the projection that is visible inside the viewport.

3. Verify the integration

  1. Run npm run dev.
  2. Open the Vite URL, then double-click cell A1.
  3. Enter =1+2 and press Enter. A1 should display 3.

If the grid renders and the formula resolves, the UI, provider, Worker transport, and workbook engine are connected.

Vite development note for the current 0.1.0 package

Vite 8 is the verified dev path. If the dev server fails while resolving the package's message-format dependency, add the following optimization to vite.config.ts; production build and preview do not need it.

optimizeDeps: {
  include: [
    '@einfach/solid-excel > @lingui/core',
    '@einfach/solid-excel > @lingui/core > @messageformat/parser',
  ],
}

Where to go next