@fluixi/compiler
v1.0.0-alpha.57
Published
Fluixi JSX compiler — host-agnostic IR + pluggable codegen backends. Babel/SWC are front-end adapters.
Readme
@fluixi/compiler
The Fluixi JSX compiler — host-agnostic IR + pluggable codegen backends.
✨ Overview
@fluixi/compiler turns Fluixi JSX into fine-grained reactive output. A Babel
front-end parses source into a host-agnostic IR; a codegen backend emits the result:
imperative(default) — compiles straight into@fluixi/domruntime calls (createNativeElement/spread/insert/createComponent/…). No VDOM.jsx— emits the automatic runtimejsx()/jsxs()(the@fluixi/jsxruntime).
It also provides the "use server" transform (server functions): the client build
gets an RPC stub, the server build keeps and registers the body.
Most apps don't use this package directly — @fluixi/vite-plugin (and
@fluixi/start) wrap it.
📦 Installation
pnpm add -D @fluixi/compiler🚀 Usage
Via the Vite integration (the common path):
import { defineConfig } from 'vite';
import { createVitePlugin, serverFunctionsVitePlugin } from '@fluixi/compiler/integrations';
export default defineConfig({
plugins: [
serverFunctionsVitePlugin(), // "use server" transform
createVitePlugin({ backend: 'imperative' }),
],
});Or transform a string directly:
import { transform } from '@fluixi/compiler';
const { code } = transform(source, { backend: 'imperative' });🔌 Subpaths
| Import | What |
| --- | --- |
| @fluixi/compiler | transform() + the compile pipeline |
| @fluixi/compiler/integrations | createVitePlugin, serverFunctionsVitePlugin, webpack/rollup/esbuild adapters |
| @fluixi/compiler/babel | the Babel plugin front-end |
