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의 다른 스킬

fmt
denoland
저장소의 모든 코드를 포맷하세요. PR을 열거나 변경 사항을 커밋하기 전에 실행하세요.
official
issue-triage
denoland
Deno GitHub 이슈를 트리아지하세요 — 버그를 재현하고, 분류하고, 라벨을 지정하고, 결과를 댓글로 남깁니다. 이슈를 트리아지하라는 요청을 받거나 이슈 번호/URL이 주어졌을 때 사용하세요…
official
lint-all
denoland
모든 코드 린트 (Rust + JS/TS). Rust 코드가 변경되었을 때 PR을 열기 전에 사용하세요.
official
lint-js
denoland
JS/TS 코드만 린트하세요. JavaScript 또는 TypeScript 파일만 변경된 경우( Rust 없음) PR을 열기 전에 사용하세요.
official
node-compat
denoland
Node.js 호환성 테스트를 실행하고, 실패를 진단한 다음 구현을 수정하거나 테스트를 건너뛰거나 무시하세요. 노드 호환 테스트 작업을 요청받았을 때 사용하세요.
official
deno
denoland
Deno 프로젝트에서 코드를 작성, 실행, 구성, 검토 또는 디버깅할 때나 새 프로젝트를 생성할 때 사용합니다. deno…를 사용한 의존성 관리를 포함합니다.
official
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…
official
deno-expert
denoland
전문가 수준의 Deno 지식으로 코드 리뷰, 디버깅, 모범 사례 적용을 지원합니다. Deno 코드를 검토하거나 고급 Deno 질문에 답변할 때 사용하세요.
official