An adapter converts the compiler's IR into a template your server can render. The same JSX source produces correct output for any adapter.
JSX Source
↓
[Phase 1] → IR (backend-agnostic)
↓
[Phase 2a] IR → Adapter → Marked Template (server)
[Phase 2b] IR → Client JS (browser)#Available Adapters
| Adapter | Output | Backend | Package |
|---|---|---|---|
HonoAdapter |
.tsx |
Hono / JSX-based servers | @barefootjs/hono |
GoTemplateAdapter |
.tmpl + _types.go |
Go html/template |
@barefootjs/go-template |
| Perl | .ep / .tx |
Mojolicious, Text::Xslate (PSGI/Plack) | @barefootjs/mojolicious, @barefootjs/xslate |
| Ruby | .erb |
stdlib ERB (any Rack app — Sinatra, Rails) | @barefootjs/erb |
| Python | .jinja |
Jinja2 (Flask, Django, bare WSGI) | @barefootjs/jinja |
| PHP | .twig / .blade.php |
Twig (Slim, plain PHP), Laravel Blade (illuminate/view standalone) |
@barefootjs/twig, @barefootjs/blade |
| Rust | .j2 |
minijinja (axum, actix-web, warp) | @barefootjs/rust |
| CSR | — (client-rendered) | None (browser-only) | @barefootjs/client |
CSR is not an IR→template adapter. It renders components directly in the browser using client-side template functions — use it when the server can't (or shouldn't) emit the initial HTML.
The GoTemplateAdapter is web-framework-agnostic: its html/template output runs on any Go server. npm create barefootjs@latest ships scaffolds for Echo, Gin, Chi, and net/http (via --adapter) — see Go Template Adapter → Server integration.
The Perl adapters share one engine-agnostic runtime (BarefootJS): @barefootjs/mojolicious targets Mojolicious EP, and @barefootjs/xslate targets Text::Xslate (Kolon) and runs under any PSGI/Plack app. See the Perl Adapter page.
The Ruby, Python, and Rust adapters are each single-backend, engine-agnostic ports of that same runtime model to another language: @barefootjs/erb (Ruby/ERB), @barefootjs/jinja (Python/Jinja2), and @barefootjs/rust (Rust/minijinja) — none of them require a specific web framework. The PHP adapters follow the same pattern but, like Perl, share one engine-agnostic runtime (@barefootjs/php) across two backends: @barefootjs/twig targets Twig and @barefootjs/blade targets Laravel Blade (via illuminate/view standalone). @barefootjs/twig, @barefootjs/blade, and @barefootjs/rust are themselves near-mechanical ports of @barefootjs/jinja's Jinja2 syntax, so all emit near-identical templates. See the PHP Adapter page.
#Pages
| Topic | Description |
|---|---|
| Adapter Architecture | How adapters work, the TemplateAdapter interface, and the IR contract |
| Hono Adapter | Configuration and output format for Hono / JSX-based servers |
| Go Template Adapter | Configuration and output format for Go html/template |
| Perl Adapter | Mojolicious and Text::Xslate (PSGI/Plack) backends, sharing one runtime |
| Ruby Adapter | ERB backend, running under any Rack app |
| Python Adapter | Jinja2 backend, running under any Python web framework |
| PHP Adapter | Twig (any PHP web app) and Laravel Blade (illuminate/view standalone) backends |
| Rust Adapter | minijinja backend, running under any Rust web framework |
| CSR | Client-side rendering without a server-rendered template |
| Writing a Custom Adapter | Step-by-step guide to implementing your own adapter |