Skip to content

aiibe/chevalier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

79 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chevalier mascot

Chevalier

A file-routed Deno meta-framework
that ships islands, not bundles.


JSR JSR Score Built with Deno Preact License: MIT

Chevalier (knight in French) is a small, file-routed Deno meta-framework that renders with Preact and ships islands, not bundles.

It keeps Hono for the HTTP layer and brings a Preact view layer. A page with no islands ships zero client JavaScript. Adding an island never grows a page that doesn't use it.

📖 Full documentation: chevalier.souk.dev

// app/routes/index.tsx  →  GET /
import Counter from "../islands/counter.tsx";

export default function Home() {
  return (
    <main>
      <h1>Chevalier</h1>
      <Counter start={3} /> {/* the only JS this page ships */}
    </main>
  );
}

Features

  • 🗂️ File-based routing. routes/index.tsx/, blog/[slug].tsx/blog/:slug, docs/[...rest].tsx catch-all. Familiar conventions, no config.
  • 🏝️ Per-page islands. Each page ships only the JS for the islands it actually rendered. No islands, no <script>. An island is declared by path, never a wrapper in your code.
  • Split hot-reload. Islands hot-update in place with state preserved (Preact Fast Refresh). Route and layout edits force a full reload.
  • 🔥 Hono all the way down. The HTTP layer stays Hono. Any route file can export const app to serve any method, as a Hono sub-app.
  • 🎨 Tailwind v4. Scaffolds with Tailwind wired for dev and production — utility classes work in pages and islands out of the box.
  • 🦕 Deno-native. JSR package, Vite dev server, no package.json.

Getting started

Scaffold a fresh app in one command:

deno run -Ar jsr:@chevalier/init my-app
cd my-app
deno install
deno task dev

Open the printed URL. You get a working app — a page, an island, a static page, a form, and a /api handler. Edit the island and it hot-updates in place, keeping its state; edit a route or _layout.tsx and the page does a full reload.

The scaffolded app comes with these tasks:

deno task dev       # vite dev server
deno task build     # client + SSR build
deno task preview   # preview the build

Already have a project? Add the core package and import defineApp:

deno add jsr:@chevalier/core

Just want to look around? Run the bundled example:

cd examples/basic && deno install && deno task dev

Documentation

Full docs live at chevalier.souk.dev:

Prefer to read code? examples/basic is a complete working app.

Alternatives

Chevalier is inspired by these. Reach for them if they fit better.

  • HonoX. The closest shape. File routing and islands on Hono, with its own view layer instead of Preact.
  • Fresh. The Deno-native standard. Islands, file routing, and zero client JS by default, rendered with Preact.

Stability

Chevalier is pre-1.0; the API can change between releases. Every release is recorded in the changelog, which also states the stability policy and the path from 0.0.x toward 0.1 and 1.0. Pin an exact version and read the entry before upgrading.

About

A small, file-routed Deno meta-framework that ships islands, not bundles.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages