Configs2026年5月27日·1 分钟阅读

Fresh — Full-Stack Web Framework for Deno

A next-generation web framework built for Deno with just-in-time rendering, island-based hydration, and zero build step. Pages are server-rendered by default with no client JS shipped unless opted in.

Agent 就绪

Agent 可直接安装

这个资产可安装;Agent 先选择当前运行时、检查安装计划,再运行匹配命令。

Native · 98/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
Deno Fresh Overview
直接安装命令
npx -y tokrepo@latest install c04c98ff-59e8-11f1-9bc6-00163e2b0d79 --target codex

先 dry-run 确认安装计划,再运行此命令。

Introduction

Fresh is a full-stack web framework designed for Deno. It sends zero JavaScript to the client by default, using server-side rendering for all pages. Interactive components are loaded selectively through an islands architecture, resulting in fast page loads without a build step.

What Fresh Does

  • Renders pages on the server with no client-side JS by default
  • Supports islands architecture for selective client-side hydration
  • Uses file-system routing (routes/ directory maps to URL paths)
  • Provides built-in middleware, error pages, and API route handlers
  • Runs on Deno Deploy for edge deployment or any Deno-compatible host

Architecture Overview

Fresh uses Preact as its rendering engine and compiles island components on demand using esbuild. Routes are defined as files in the routes/ directory, where each file exports a handler and/or a component. Static assets are served from a static/ directory. There is no build step during development; TypeScript and JSX are handled natively by Deno.

Self-Hosting & Configuration

  • Requires Deno runtime (v1.35+ or Deno 2)
  • Configure via fresh.config.ts for plugins and middleware
  • Deploy to Deno Deploy with deployctl deploy
  • Self-host on any server with deno run -A main.ts
  • Add Tailwind CSS via the official plugin in the project scaffold

Key Features

  • Zero-config TypeScript and JSX support through Deno
  • No build step required for development or production
  • Islands architecture sends JS only for interactive components
  • File-system routing with support for dynamic and catch-all routes
  • First-class integration with Deno Deploy for edge hosting

Comparison with Similar Tools

  • Next.js — React-based with Node.js; Fresh uses Preact on Deno with no build step
  • Astro — content-focused with multi-framework islands; Fresh is Preact-only on Deno
  • Remix — relies on React and Node; Fresh is lighter with Deno-native tooling
  • SvelteKit — uses Svelte compiler; Fresh skips the build step entirely
  • Hono — minimal HTTP framework; Fresh is full-stack with routing and rendering

FAQ

Q: Do I need Node.js to use Fresh? A: No. Fresh runs entirely on Deno and does not use npm or Node.js.

Q: Can I use npm packages with Fresh? A: Yes. Deno supports npm specifiers (npm:package-name), so most npm packages work.

Q: What is an island in Fresh? A: An island is a Preact component placed in the islands/ directory that gets hydrated on the client. Everything else remains server-rendered HTML.

Q: Is Fresh production-ready? A: Fresh is used in production by Deno and other companies. It follows semantic versioning with stable releases.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产