Skip to content

Philosophy

Kiln follows four principles. Every feature should trace back to one of them.

1. The filesystem is the router

A page exists because a file exists. You never register a route in code. Running kiln routes prints the same table the runtime uses, so the URL structure of an app can be read from its folders.

2. The filename chooses the rendering mode

Rendering is a per-page decision, so it lives next to the page:

  • about.server.tsx sends HTML and no JavaScript.
  • index.tsx renders on the server and hydrates in the browser.
  • dashboard.client.tsx renders only in the browser.

No central config decides this. A page's behavior is visible in its name.

3. Server code stays on the server

The build refuses to bundle .server modules into the browser. Loaders run on the server, and their results are serialized into the page. Importing server code into a client module fails the build with a message, instead of shipping a secret.

4. Use the web platform

Handlers take a standard Request and return a Response. The same handler runs on Bun, Node, and edge runtimes. Kiln adds structure but does not define its own request or response types.

What Kiln is not

  • It is not a bundler. Vite does the bundling, and Kiln configures it.
  • It is not opinionated about data. Loaders are plain functions.
  • It does not hide React. Components are normal React components.