fresh

Fresh

Specific best practices and architectural patterns when working with Fresh.

Details

Language / Topic
typescriptTypeScript
Category
framework

Rules

balanced

Fresh (Deno)

- Use islands architecture — components are server-rendered by default, only `islands/` components ship JavaScript to the client. Use handlers for server-side data loading (`ctx.render(data)`). Keep islands small and independent.

Fresh (Deno)

- Use islands architecture — components are server-rendered by default, only `islands/` components ship JavaScript to the client. Use handlers for server-side data loading (`ctx.render(data)`). Keep islands small and independent.
- Define route handlers with `GET`, `POST` etc. exports for API endpoints in route files. Use `<Head>` component for SEO meta tags. Use Preact signals (`@preact/signals`) for reactive state in islands. Serve static files from the `static/` directory. Use `fresh.config.ts` for plugins and middleware configuration.