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-tsif needed. - An
index.htmlcontaining<div id="root"></div>.
1. Install the Solid integration
npm install @einfach/solid-excel @einfach/core @einfach/solid solid-jsThe 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)3. Verify the integration
- Run
npm run dev. - Open the Vite URL, then double-click cell A1.
- Enter
=1+2and press Enter. A1 should display3.
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',
],
}