@fluixi/babel-plugin-jsx
Compiles JSX into fine-grained reactive DOM calls for Fluixi: no virtual DOM.
✨ Overview
@fluixi/babel-plugin-jsx transforms JSX at build time into direct, surgical DOM operations wired to signals: so updates touch only the nodes that actually change, with no diffing and no virtual DOM. It pairs with the runtime in @fluixi/jsx.
You probably want
@fluixi/vite-plugininstead. Fluixi compiles through@fluixi/compiler, which has no babel dependency, handleshtml`` templates as well as JSX, and is where component resolution,load:strategies and the$intrinsics live. This plugin exists for a build that has to run through babel: an existing babel pipeline whose own plugins need to see the output, or a toolchain with no Vite in it. It compiles JSX and nothing else.
📦 Installation
pnpm add -D @fluixi/babel-plugin-jsx
🚀 Usage
babel.config.js
module.exports = {
plugins: ['@fluixi/babel-plugin-jsx'],
};
Or via the automatic JSX runtime in tsconfig.json:
{
"compilerOptions": {
"jsx": "react-jsx",
"jsxImportSource": "@fluixi/jsx"
}
}
The plugin rewrites JSX such as:
<button onClick={() => setCount(c => c + 1)}>Count: {count()}</button>
into fine-grained DOM instructions that update only the text node bound to count().
📋 Requirements
- @babel/core ≥ 7.27
- Use together with
@fluixi/jsxat runtime.