deno-frontend

작성자: denoland

Fresh 프레임워크 작업, Fresh에서 라우트나 핸들러 생성, Preact로 웹 UI 구축, Deno에서 Tailwind CSS 추가 시 사용합니다. Fresh 2.x를 다룹니다…

npx skills add https://github.com/denoland/skills --skill deno-frontend

Frontend development with Deno

Two paths. Pick by what the project already uses.

Regular npm frameworks — the usual choice

Deno runs the normal frontend ecosystem: React, Vue, Svelte, Solid, Vite, Astro, Next.js, Nuxt, SvelteKit, Remix, SolidStart. Nothing needs to be ported, and there is no Deno-specific way to write them.

deno create vite my-app     # or astro, next, nuxt, svelte…
cd my-app
deno install
deno task dev

deno create is npm create. deno install reads package.json. deno task <script> runs package.json scripts. That is the whole difference.

Follow the framework's own documentation for everything else — routing, components, data loading, and config are the framework's concern, not Deno's. Don't invent Deno-flavoured variants of their APIs, and don't reach for Fresh patterns in a React or Svelte project.

The only things worth knowing:

  • Some frameworks need "nodeModulesDir": "auto" in deno.json; Next.js does.
  • Permissions apply to the dev server too — framework tasks generally want -A.
  • Deploying: see the deno-deploy skill, which lists per-framework build commands and presets.

Fresh — Deno's own framework

Fresh suits a new Deno-first project that wants server rendering with minimal client JavaScript. It uses island architecture: pages render on the server, and only components in islands/ ship JavaScript.

deno run -Ar jsr:@fresh/init
cd my-project
deno task dev                # http://localhost:5173

A Fresh project is Vite-based: vite.config.ts for the build, main.ts for the server, file-based routes in routes/, islands in islands/, server-only components in components/. Preact supplies the component model, with signals for state.

// islands/Counter.tsx — interactive, ships JS
import { useSignal } from "@preact/signals";

export default function Counter() {
  const count = useSignal(0);
  return <button onClick={() => count.value++}>Count: {count.value}</button>;
}

Three rules carry most of the weight:

  1. Islands ship JavaScript — keep them small, leave everything else in components/.
  2. Island props must be serializable. Functions cannot be passed.
  3. Handlers take a single (ctx) parameter.

Load references/FRESH.md for routes, handlers, define helpers, middleware, islands, signals, and Tailwind.

Use Fresh 2.x, imported from "fresh". For an existing 1.x project, or one pinned to a 2.0.0-alpha.* release, see references/FRESH_MIGRATION.md.

Further reading

  • https://fresh.deno.dev/docs — Fresh documentation
  • references/FRESH.md — Fresh 2.x patterns in depth
  • references/FRESH_MIGRATION.md — Fresh 1.x and alpha migration

denoland의 다른 스킬

deno
denoland
Deno 프로젝트에서 코드를 작성, 실행, 구성, 검토 또는 디버깅할 때나 새 프로젝트를 생성할 때 사용합니다. deno…를 사용한 의존성 관리를 포함합니다.
deno-deploy
denoland
Use when deploying Deno apps to production, asking about Deno Deploy, or working with `deno deploy` CLI commands. Covers deployment workflows, environment…
deno-expert
denoland
전문가 수준의 Deno 지식으로 코드 리뷰, 디버깅, 모범 사례 적용을 지원합니다. Deno 코드를 검토하거나 고급 Deno 질문에 답변할 때 사용하세요.
deno-guidance
denoland
Deno 프로젝트를 시작하거나, 패키지를 선택하거나, deno.json을 구성하거나, CLI 명령어를 실행할 때 사용합니다. 최신 Deno 애플리케이션을 구축하기 위한 기본 지식을 제공합니다.
deno-project-templates
denoland
새로운 Deno 프로젝트를 스캐폴딩할 때 사용합니다. Fresh 웹 앱, CLI 도구, 라이브러리, API 서버를 위한 템플릿을 최신 모범 사례와 함께 제공합니다.
deno-sandbox
denoland
신뢰할 수 없는 사용자 코드, AI 생성 코드를 실행하거나 격리된 코드 실행 환경이 필요할 때 사용합니다. @deno/sandbox SDK를 다룹니다.
migrate-to-deno
denoland
Node.js, npm, Yarn, pnpm 또는 Bun 프로젝트를 Deno로 마이그레이션하거나, 기존 JavaScript 또는 TypeScript 코드베이스에서 Deno를 점진적으로 도입할 때 사용합니다.…
fmt
denoland
저장소의 모든 코드를 포맷합니다. PR을 열거나 변경 사항을 커밋하기 전에 실행하세요.