fresh

Fresh

Specific best practices and architectural patterns when working with Fresh.

Details

Language / Topic
denoDeno
Category
framework

Rules

balanced
- In Deno projects: Use `_middleware.ts` to manage auth checks cleanly and safely pass data down to routes via `ctx.state`.
- Confine interactive client-side logic exclusively to React/Preact components placed strictly inside the `islands/` directory.
- In Deno projects: Fetch data server-side entirely in route handlers (`export const handler`) and pass it down as props via `ctx.render(data)`.
- Leverage Deno KV natively for highly performant, globally distributed server state and lightweight persistence.