Advanced / Zidom JS

Vite integration

Experimental TSX transform and safe page reloads.

Experimental Vite adapter#

@zidomjs/vite can transform .tsx files with the Zidom compiler during development and production builds. It is build-time only: the Vite adapter is not included in the browser runtime.

ts
●  Zidom
// vite.config.tsimport { defineConfig } from 'vite';import zidom from '@zidomjs/vite';export default defineConfig({  plugins: [zidom({ staticTemplates: true, dynamicTemplates: true })]});

Use Zidom's JSX runtime#

json
●  Zidom
{  "compilerOptions": {    "jsx": "react-jsx",    "jsxImportSource": "@zidomjs/dom"  }}

Development and HMR#

The adapter requests source maps and supports safe full-page reloads on .tsx edits. It does not retain component state across hot code updates. Runtime state changes remain fine-grained; this limitation concerns development hot-module replacement.

The plugin excludes certain runtime entrypoints from dev dependency prebundling and deduplicates @zidomjs/core to prevent duplicate reactive graphs. Use the versioned package testing matrix before assuming compatibility with a given Vite version.

Test as a separate consumer#

bash
●  Zidom
# Run from the Zidom monorepo, with dependencies and browsers availablenpm run release:consumer

A complete current-version Vite/browser matrix and source-map debugging review remain release gates. This is not an approved production toolchain. See the upstream Vite guide.

Run the example#

See the Zidom vite example and inspect the exact source next to the result.