
Security News
Lovable’s OJ Rewrites Vite’s Dev Server in Rust as AI Lowers the Cost of Forking Open Source
Lovable’s OJ rewrites Vite’s dev server in Rust, reducing memory use and preview times as AI lowers the cost of open source reimplementation.
@kubb/renderer-jsx
Advanced tools
Self-contained synchronous JSX renderer for Kubb. Turns JSX into FileNodes with built-in components (File, Function, Type, Const). An alternative for the ast.factory syntax.
Provides a JSX runtime and built-in components (File, Function, Type, Const) for component-based, type-safe code generation inside Kubb plugins.
An alternative for the ast.factory syntax.
bun add @kubb/renderer-jsx
# or
pnpm add @kubb/renderer-jsx
# or
npm install @kubb/renderer-jsx
Use the built-in components inside a Kubb plugin to emit generated files:
import { jsxRenderer } from '@kubb/renderer-jsx'
import { File, Function, Type } from '@kubb/renderer-jsx'
const renderer = jsxRenderer()
await renderer.render(
<File baseName="petStore.ts" path="src/gen/petStore.ts">
<File.Source>
<Type name="Pet">{'{ id: number; name: string }'}</Type>
<Function name="getPet" async>
{"return fetch('/pets')"}
</Function>
</File.Source>
</File>,
)
const files = renderer.files
| Component | Description |
|---|---|
<File> | Declares a generated output file with its path and optional imports/exports |
<File.Source> | The source content block inside a <File> |
<Function> | Generates a TypeScript function declaration |
<Type> | Generates a TypeScript type alias |
<Const> | Generates a const variable declaration |
<Jsx> | Renders JSX expressions inside generated output |
<Callout> | Generates a callout block in markdown output |
<Frontmatter> | Generates a frontmatter block in markdown output |
<Heading> | Generates a heading in markdown output |
<List> | Generates a list in markdown output |
<Paragraph> | Generates a paragraph in markdown output |
jsxRenderer()Creates a renderer instance with render, files, and stream:
const renderer = jsxRenderer()
await renderer.render(<MyComponent />)
const files = renderer.files // FileNode[]
Use stream(element) instead of render to consume files one at a time as they are produced.
@kubb/renderer-jsx ships its own JSX runtime (jsx-runtime and jsx-dev-runtime). Configure your tsconfig.json to use it:
{
"compilerOptions": {
"jsx": "react-jsx",
"jsxImportSource": "@kubb/renderer-jsx"
}
}
Kubb is an open source project, and its development is funded entirely by sponsors. If you would like to become a sponsor, please consider:
FAQs
Self-contained synchronous JSX renderer for Kubb. Turns JSX into FileNodes with built-in components (File, Function, Type, Const). An alternative for the ast.factory syntax.
The npm package @kubb/renderer-jsx receives a total of 14,999 weekly downloads. As such, @kubb/renderer-jsx popularity was classified as popular.
We found that @kubb/renderer-jsx demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Security News
Lovable’s OJ rewrites Vite’s dev server in Rust, reducing memory use and preview times as AI lowers the cost of open source reimplementation.

Security News
It has been one year since Shai-Hulud made its first appearance on npm.

Research
/Security News
Operators behind PolinRider used a compromised GitHub account to plant malware in four development versions of a Packagist package with 700,000+ downloads.