- Update HelloBar to announce Fresh 2.3 with feature callouts
(WebSockets, View Transitions, Temporal API)
- Rework hero section: new headline ("The framework so simple, you
already know it"), descriptive subtitle, moved CTA to left
- Remove old Simple section, add "Take a tour of Fresh" heading before
showcase
- Add new showcase sections: View Transitions, API Routes/Handlers,
WebSockets, `<Head>` element, OpenTelemetry
- Fix broken Deco showcase image (missing `/showcase/` directory)
- Fix syntax highlighting in Simple section (was using raw `<pre>`
instead of Prism)
- Update RenderingSection to use Temporal API instead of Date API
- Fix cursor styles on Forms and Partials interactive demos
- Move WebSocket docs from Examples to Advanced in TOC
- Densify all showcase sections: smaller headings, code blocks, icons,
demo boxes, arrows, and tighter spacing
---------
Co-authored-by: Josh Collinsworth <joshuajcollinsworth@gmail.com>
## Summary
- **`ctx.upgrade()`** on the `Context` class with two overloads:
- **Bare mode**: `ctx.upgrade()` or `ctx.upgrade(options)` returns `{
socket, response }` for manual event wiring
- **Managed mode**: `ctx.upgrade(handlers)` accepts `{ open, message,
close, error }` and returns the upgrade `Response` directly
- **`app.ws(path, handlers, options?)`** shorthand that registers a GET
route with automatic WebSocket upgrade (managed mode only)
- Both support `idleTimeout` and `protocol` options forwarded to
`Deno.upgradeWebSocket()`
- Throws `HttpError(400)` on non-WebSocket requests
- Case-insensitive `Upgrade` header check per RFC 6455 §4.2.1
- Exports `WebSocketHandlers` and `WebSocketUpgradeOptions` types from
`fresh`
- Full documentation page with examples for managed mode, bare mode,
broadcast chat, and client-side usage
## Summary
- Extends the `_freshIndicator` loading signal to form submissions, not
just anchor clicks
- Checks the submitter element first, falling back to the form element
- Wraps the fetch in try/finally to ensure the indicator resets on
success or failure
- Adds 3 browser tests: indicator on button, indicator on form, and
submitter-over-form precedence
Closes#3504
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
## Summary
- Adds `trustProxy` option to `FreshConfig` (default: `false`)
- When enabled, the handler reads `X-Forwarded-Proto` and
`X-Forwarded-Host` headers and rewrites `ctx.url` so it reflects the
actual client-facing URL
- Useful for apps running behind nginx, Caddy, or other reverse proxies
where `ctx.url` would otherwise return `http://` instead of `https://`
Closes#2660
## Usage
```ts
const app = new App({ trustProxy: true });
```
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
## Summary
- `staticDir` now accepts `string | string[]` in both the **Vite
plugin** (`FreshViteConfig`) and the **Builder API** (`BuildOptions`)
- When multiple directories are specified, they are searched in order
and the first match wins
- **Vite plugin**: first dir maps to Vite's native `publicDir`; extra
dirs are served manually in the dev server and walked during production
builds
- **Builder API**: both `MemoryBuildCache` (dev) and `DiskBuildCache`
(prod) iterate over all directories
- Updated tailwind v3 plugin to use `config.root` instead of
`path.dirname(config.staticDir)`
- Docs updated: `static-files.md`, `vite.md`, `builder.md`
Closes#3105
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
## Summary
- `matchesUrl()` now considers query parameters — links with query
params that don't match the current URL get `Ancestor` instead of
`Current` status
- Links with a user-set `aria-current` attribute are left untouched
(both server and client side), fixing daisyUI tab components and similar
use cases
- Client-side `updateLinks()` passes search params and respects user-set
attributes
Closes#3474
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
## Summary
- The inline HTML/CSS flow diagram in `docs/concepts/architecture` was
broken — marked's smartypants text transforms corrupted the `<style>`
block, stripping all styling
- Replaced with a standalone SVG
(`www/static/docs/architecture-flow-v2.svg`) using theme-neutral
mid-gray colors that are readable on both light and dark backgrounds
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
## Summary
- Reverts all references from `deno create @fresh/init` back to `deno
run -Ar jsr:@fresh/init` across docs, READMEs, homepage, and CLI help
text
- Removes the deprecation warning in `packages/init/src/mod.ts` that
told users to switch to `deno create`
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
## Summary
- Integrates the [View Transitions
API](https://developer.mozilla.org/en-US/docs/Web/API/View_Transition_API)
into Fresh's existing partials system
- Opt-in via `f-view-transition` attribute, progressive enhancement
(falls back gracefully)
- Wraps all navigation types (link clicks, popstate, form submissions)
in `document.startViewTransition()`
## Usage
```html
<body f-client-nav f-view-transition>
<!-- your app -->
</body>
```
Customize animations with standard CSS:
```css
::view-transition-old(root) {
animation: fade-out 0.2s ease-in;
}
::view-transition-new(root) {
animation: fade-in 0.2s ease-out;
}
```
Per-element transitions work via `view-transition-name`:
```css
.sidebar { view-transition-name: sidebar; }
```
## Design decisions
- **Opt-in** — only activates when `f-view-transition` attribute is
present, can be disabled with `f-view-transition="false"`
- **Progressive** — falls back to regular partial updates when the
browser doesn't support the View Transitions API
- **Minimal** — 35 lines of implementation, integrates into existing
partials infrastructure rather than building a parallel navigation
system
Closes https://github.com/denoland/fresh/issues/3458
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
## Summary
- Auto-inject `nonce` attribute onto inline `<script>` and `<style>`
tags during server rendering
- Add `useNonce` option to the CSP middleware that replaces
`'unsafe-inline'` with per-request `'nonce-{value}'` directives
- Expose render nonce via `X-Fresh-Nonce` response header (internal,
stripped by CSP middleware)
## Usage
```ts
app.use(csp({ useNonce: true }));
```
This locks down the CSP policy so only Fresh-rendered inline
scripts/styles are allowed. Each request gets a unique nonce.
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
## Summary
- Adds a `console.warn` during SSR when a `<Partial>` uses
`mode="append"` or `mode="prepend"` without a `key` prop
- Without a key, Preact cannot correctly reconcile prepended/appended
children, leading to subtle rendering bugs
- No warning for `mode="replace"` (default) since keys aren't required
there
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
## Summary
- Rewrite `tools/check_links.ts` to be more robust (inspired by
denoland/docs' `better_link_checker.ts`)
- Add `deno task check:links` to `deno.json`
- Wire it into CI as a new step (Ubuntu + v2.x only, after `build-www`)
- Add missing `docs/latest/examples/index.md` to fix broken
`/docs/examples` link
- Crawl up to 10 pages concurrently for faster link checking
## What the link checker does
1. Builds the www site with Vite
2. Launches a production server
3. Crawls all internal links starting from the root (10 pages
concurrently)
4. Reports broken links (4xx/5xx) with referrer info
5. Detects empty `href` attributes
6. Prints a summary at the end instead of throwing on first failure
Improvements over the old `check_links.ts`:
- Doesn't throw on first 404 — collects all failures and reports at the
end
- Detects empty hrefs
- Skips non-HTML content, fragment-only links, external links, and
common static file extensions
- Shows referrer for each broken link so you know where to fix it
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds a Contributing section to the Fresh documentation covering:
- Repository structure and package layout
- Getting started (clone, `deno task ok`)
- Development workflow (docs site, vite demo, `links` for external
projects)
- Testing (commands, conventions, known local issues)
Single page at `docs/latest/contributing/index.md`.
---------
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This adds a short clarification how imported assets vs. static files get
handled now with Vite to the existing documentation for static files.
---------
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sets up `@/` as the default path alias in newly generated Fresh
projects, following the official Deno documentation guidelines. This
allows developers to use `@/` for absolute imports from the project root
instead of relative paths. This is especially convenient to remove
import that require deeply traversing up the directory tree.
The `@/` alias is now included in the imports section of deno.json for
all new projects, enabling cleaner import statements like:
```
import { Button } from "@/components/Button.tsx";
```
Fixes#3485
This adds a short blurb how to install the VS Code extension to the
troubleshooting guide.
Possible concerns:
- maybe redundant as there are already official VS Code Deno docs
- could be shortened to just refer to the main docs or completely
removed
fix#3470
This adds a short blurb about `deno.json` focusing on imports.
Background: Without `npm:vite` and `jsr:@fresh/plugin-vite` installed it
can lead to confusing errors like this one:
```shell
$ deno task dev
vite: command not found
```
Which might lead to users install Vite globally, which is not needed
(and will not fix this problem).
This fixes the testing page in the docs for real this time.
Every test is hand checked now. Thanks to a certain button, which
appeared recently.
Optionally I can also split this page up in separate pages:
- Middlewars
- AppWrappers and Layouts
- Routing and Handlers
- SSR and Islands
Addresses the issue mentioned in
https://github.com/denoland/fresh/pull/3163#discussion_r2246708003.
The issue was that the `raw` markdown was being used for e.g. `## My
title`, thus the slug became `-my-title` instead of `my-title`. Slugs
were working correctly for `codespan` in headers, e.g. ``## `someCode`
``.
I decided to hard error if unexpected heading syntax is used over
sluggifying unexpected content (can become super weird otherwise, e.g.
`## <button ...>My heading</button>`). I can revert to fallbacking to
`raw` if preferred, but perhaps with at least trimming leading `-` just
in case.
Follow-up from #3162.
This PR does various tweaks, mostly related to code blocks.
- Adds missing titles to code blocks, and updates titles to be more
consistent
- Adds filenames to most ` ```tsx` blocks with e.g. `main.ts`, `dev.ts`
or a suitable example (e.g. `routes/greeting.tsx`) based on the code
- Adds filenames to ` ```diff` blocks if there's a relevant file, to
make the icon e.g. TS over Diff icon
- Code blocks with Fresh code (e.g. interfaces) uses ` ```tsx fresh 🍋`
- Changes most ` ```sh` blocks with example terminal commands to ` ```sh
Terminal`
- Updates ` ```txt Project Structure` or ` ```diff Project Structure`
blocks to be more consistent
- Changes `sh` or `txt` to `txt-files` which improves highlighting and
makes icon consistent
- Renames `<project dir>` to `<project root>` to match builder `root`
option terminology
- Adds `<project root>` root folder to most/all overview folder
overviews
- Makes the structure blocks more consistently displayed
- Tried to make some "bare" examples more complete
## Comparison
Here's a small curated set of before/after changes.
### Deployment
- `deno` highlighted in terminal commands
- `.gitignore` syntax highlighting works without using `sh` as language
<img width="1641" height="1009" alt="image"
src="https://github.com/user-attachments/assets/170cf833-1f6a-4b0d-8d2d-a081bc28a967"
/>
### File routing
Updated icon, comments same as before, but root and hierarchy have new
colors (`operator`/`function`).
<img width="1647" height="588" alt="image"
src="https://github.com/user-attachments/assets/f28db51b-4bee-45e4-be1c-e137a6d3ae3d"
/>