Commit Graph
56 Commits
Author SHA1 Message Date
ad8ec0fa42 docs: fix markdown docs (#3459)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 19:10:48 +00:00
Bartek IwańczukandClaude Opus 4.6 103427f9da docs: comprehensive documentation audit, fixes, and website improvements (#3712)
## Summary

Full documentation audit and fixes for Fresh 2.x docs. Addresses every
issue identified in the [audit
report](https://gist.github.com/bartlomieju/91ddb08c23552f642d2073c0e9a36102).

### Critical fixes
- Remove 4 TODO placeholders (app.md, plugins/index.md)
- Fix 4 broken code examples (layouts syntax error, routing missing ctx,
csrf wrong import, getting-started unused prop)
- Fix 3 copy-pasted frontmatter descriptions (context, env-vars, app)
- Fix CSRF page describing CORS instead of CSRF

### New pages (8)
- **Architecture** — request lifecycle diagram, server-first rendering,
islands architecture
- **Data Fetching** — handlers, page(), type-safe data passing, async
components, PageProps reference
- **Signals** — useSignal, computed, props, shared state, serialization
- **Serialization** — supported types, what can't be serialized,
circular refs, pitfalls
- **API Routes** — handler-only routes, method-specific, catch-all,
programmatic
- **Common Patterns** — protected routes, redirects, cookies,
WebSockets, streaming, content negotiation, subdomain routing, proxying,
lazy-loading islands
- **API Reference** — all exports from fresh, fresh/runtime, fresh/dev
- **OpenTelemetry** — what's instrumented, enabling tracing, Deno Deploy

### Expanded pages (6)
- **Routing** — matching priority, HTTP methods, HEAD fallback,
file-based handlers
- **Vite plugin** — HMR, plugin composition, internals, debugging
- **Deno Deploy** — build config, env vars, custom domains,
troubleshooting
- **deno compile** — cross-compilation, limitations
- **Error handling** — expanded HttpError with message param, import
paths
- **Plugins index** — plugin authoring guidance, built-in plugin list

### Structural improvements
- Update all 3 index pages (concepts, advanced, examples) with links to
every sub-page
- Cross-link the two Layouts pages (file-based vs programmatic)
- Resolve contradictory build commands (remove legacy dev.ts references)
- Add "next steps" to Getting Started
- Explain `(_islands)` and `(_components)` directories in file routing
- Document `basePath`, `assetSrcSet()`, `IS_BROWSER`, route `css` option
- Add PR guidelines to Contributing page
- Add Deno version requirements to Introduction

### Docs fixes from issue triage
- **Docker deployment** — add missing `deno install --allow-scripts`
step, remove stale `deno cache`, fix CMD (#3500)
- **Deployment index** — add install step before build (#3500)
- **Static files** — add tip about root-relative URLs (#3482), add image
optimization section with vite-imagetools, CDN services, best practices
(#671)
- **main.ts vs main.tsx** — fix examples showing JSX in main.ts, add tip
about serverEntry config (#3476)
- **Head component** — clarify dedup precedence: last-rendered wins
(#2749)
- **Islands** — add custom elements / web components section (#2741)
- **Sharing state** — rewrite cart example to avoid shared module-level
signals (#2437, #1877)
- **Common patterns** — add subdomain routing (#603), proxying requests
(#361), lazy-loading islands (#565)

### Website fixes
- **Canary redirects** — catch-all `/docs/canary/...` → `/docs/...`
redirect (#3375)
- **Recipe partials** — redirect direct access to recipe routes to
homepage (#2559)
- **Homepage** — add progressive complexity code examples to Simple
section (#2755)

### Image reference fixes
- Rename `getting-started-3-cotuntdown.png` →
`getting-started-3-countdown.png`
- Fix 1.x partials image path

### Grammar/typos
- 11 corrections across 12 files

### CI
- Add `docs/check_images_test.ts` — verifies all markdown image
references resolve to existing files in `www/static/`

Closes #3514
Closes #3476
Closes #3591
Closes #2876
Closes #2075
Closes #1612
Closes #1535
Closes #527
Closes #3059
Closes #3695
Closes #3548
Closes #3500
Closes #3482
Closes #3375
Closes #2749
Closes #2741
Closes #2559
Closes #2437
Closes #671
Closes #361

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 18:22:33 +00:00
Bartek IwańczukandClaude Opus 4.6 2c94a1da2e ci: add link checker to CI (#3707)
## 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>
2026-03-27 13:49:17 +00:00
88bef6c2ef docs: add example for session management (#3594)
Resolves: #1216

---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 19:49:01 +01:00
Freddy Alvarado R a1000cbb59 docs: Update daisyUI installation instructions and file path (#3592)
The directory where the stylesheet is located is updated.
2025-11-20 09:50:35 +01:00
Roy Revelt 45bb094bd6 docs: fix two typos (#3577)
fixes two tiny erros in the docs
2025-10-29 17:59:23 +01:00
Bruno Bernardino fa6f4f4bef docs: fix wrong variable name in migration guide (#3496)
You have `export const handlers = ` when it needs to be `export const
handler = `.

I'm unsure if there's any build process I need to run for this.
2025-09-26 11:03:42 +02:00
fry69 f82bd7e63d docs: add deno.json update section to migration guide (#3471)
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).
2025-09-20 13:17:11 +02:00
Mau Scheff 18961995d5 docs: Revise migration guide with new help sections (#3455)
Revise migration guide with new help sections
2025-09-16 13:24:39 +02:00
Zhi 7999d500f8 docs: fix missing files on "sharing state with islands" page (#3377)
close #3376
2025-09-12 17:16:30 +02:00
Marvin Hagemeister e06f03ac67 fix: add missing compile entry (#3410)
Fixes https://github.com/denoland/fresh/issues/3409
2025-09-12 13:08:49 +02:00
Marvin Hagemeister 79d8cfc3ed docs: make 2.x the default version (#3369) 2025-09-09 14:36:51 +02:00
Christian Svensson a2de5154ec fix(docs): improve and increase consistency for code blocks (#3163)
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"
/>
2025-08-01 09:07:42 +02:00
Christian Svensson c9b43ea32b feat(docs): add file/language type icons to code blocks (#3162)
I originally wanted to make it clearer the distinction between "files"
and e.g. `` ```tsx foo.tsx `` compared to `` ```sh Terminal `` or ``
```txt Project structure``. I originally started just trying to add a 📝
icon or something. But instead I ended showing file types of all
markdown languages.

I took the file type icons for the SVG's from
https://github.com/vscode-icons/vscode-icons, which has a MIT license.

I think the icons make it a even more clear what the language of the
code snippet is.

I have a follow-up PR for improving code block titles and making
examples more consistent in #3163.


## Comparisons

<details>

<summary><strong>Open &mdash; Before | After</strong></summary>


### TS + Shell icons - Hover tooltips and alt text

<img width="1504" height="639" alt="image"
src="https://github.com/user-attachments/assets/636838a3-f38c-4048-a536-52c1cdd6b6d4"
/>


### TS + Shell icons 2

<img width="1511" height="761" alt="image"
src="https://github.com/user-attachments/assets/2ad6d25c-3995-433a-ad93-162830ca55a1"
/>

### Shell + Dockerfile icons

<img width="1500" height="780" alt="image"
src="https://github.com/user-attachments/assets/88010749-d0d2-4498-9eb2-9bd971e48365"
/>

### Nested blocks + Git icon

<img width="1513" height="634" alt="image"
src="https://github.com/user-attachments/assets/400c27f8-d0b4-40bd-801d-611e1e8a8e36"
/>

</details>
2025-07-31 23:48:00 +02:00
bb23643779 feat: support tailwindcss v4 (#3054)
update /www and tailwind-plugin to support tailwind v4.

Thanks to the merge of #3034, the work of integrating and advancing
#2903 is promoted.

related #3034 
related #2903 

close #3056
close #2819

--patch-1 
based on review,

1. del compiler and make it more clean and simple,
2.  fix init tailwind part,
3. fix test tailwind part

--patch-2

1. fix the docs 
2. fix the docs of plugin and version

--patch-3
1. Addressed various maintenance tasks (chores)
2. Updated the Tailwind CSS plugin to align with this release. Generated
a fresh project using the updated init configuration and
3. deployed it via Deno Deploy EA. Deployment is functioning correctly.

--patch-4
Move postcss imports to Tailwind section in init script

--patch-5
Refactored Tailwind plugin type definitions by copying PluginOptions
properties from @tailwindcss/postcss and adding Fresh-specific exclude
option, while exporting types from package entrypoint for better
accessibility.

Test Project: https://fresh.fresh-press.deno.net/
Test Project Repository:
https://github.com/SisyphusZheng/fresh-tailwindv4
Test Plugin: https://jsr.io/@freshpress/fresh-plugin-tailwind@1.0.0

---------

Co-authored-by: 李嘉图·M·路 <146103794+Ricardo-M-Zheng@users.noreply.github.com>
Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
Co-authored-by: Marvin Hagemeister <marvin@deno.com>
2025-07-21 16:13:34 +02:00
zhizhengand李嘉图·M·路 8d3b8c53c6 docs: Update Fresh canary usage instructions in docs (#3067)
Revise documentation to clarify how to use the latest Fresh 2 canary,
specific commits, and forks via deno.json. Add instructions for creating
new projects using JSR and local sources, and update references to
current package versions. Include links to the Fresh v2 blog and
migration guide for further reading.

close #3058

---------

Co-authored-by: 李嘉图·M·路 <146103794+Ricardo-M-Zheng@users.noreply.github.com>
2025-06-30 12:27:53 +02:00
Sviatoslav M. 1321cda916 docs: update rendering-markdown.md (#2800)
When using deno add @deno/gfm outputs the following:
```
error: @deno/gfm is missing a prefix. Did you mean `deno add jsr:@deno/gfm`?
```
Then when jsr is specified:
```
deno add jsr:@deno/gfm
Add jsr:@deno/gfm@0.10.0
```

deno --version: 2.1.4
2025-05-19 13:20:10 +02:00
Asher Gomez 8ea3dbeac5 refactor(www): use useSignal() instead of useState() (#2894) 2025-05-12 23:28:46 +02:00
Luca Casonato 03847e9a33 2.0.0-alpha.26 2024-12-10 16:05:22 +01:00
Marvin HagemeisterandLuca Casonato de8f1b0c59 feat: update for Deno 2 (#2655)
Co-authored-by: Luca Casonato <hello@lcas.dev>
2024-09-30 18:30:30 +02:00
João Victor LopesandMarvin Hagemeister 7e4a22f7af feat(docs): dynamic css use tailwind (#2646)
close #2626

---------

Co-authored-by: Marvin Hagemeister <marvin@deno.com>
2024-09-09 09:10:40 +02:00
Max Rashes 239de3d08a docs: update markdown tutorial to use JSR (#2565)
Small cleanup of how we recommend importing the gfm package (moved to
jsr, old post still works but could be confusing to new users)
2024-07-02 20:29:12 +00:00
Tsukasa Ueno febbc52727 doc: fix the link to sever configuration (#2526)
I found a dead link on the "Writing tests" page.
2024-06-23 17:43:03 +02:00
Marvin Hagemeister e4981d30ad www: rework docs layout (#2429)
- Re-enable partials
- clean up layout a bit
2024-05-21 17:38:32 +02:00
Sebastian Nomme 586706e24f docs: Update documentation for active link with Tailwind (#2417)
**Proposed change:**
- Document styling for aria-current attribute separately for Tailwind
and Twind.

**Disclaimer:**
I am new to open-source contributions and are unfamiliar with the
process for submitting a pull request. I have found some more areas of
improvement in the Fresh documentation. Should this PR not be
up-to-standards on how to contribute, please guide me in the right
direction. I have a few more suggestions on issues I found while
developing a new Fresh app.

Any guidance would be helpful, either reach out to me on GitHub, Discord
(bastianplsfix) or X (bastianplsfix).

Best,
Sebastian 🦕
2024-05-02 20:45:31 +02:00
Zisulin MorbrotandAsher Gomez c9ec6bb153 docs: add a PKCE authentication with Supabase example (#2302)
Closes #1217

Adds an example on how to implement the PKCE authentication flow with
Supabase.

I included a link to a repo of mine holding the code to a fully fleshed
out example app as a more comprehensive point of reference, hope that is
ok. In fact, I was thinking of deploying that app on Deno Deploy and add
it to the Showcase section, lmk if that would be a good idea.

---------

Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
2024-03-27 15:39:01 +01:00
narumincho 407e4379df doc: Rename _req used to req (#2349)
Where other documents use req, they use the name req instead of _req


https://github.com/denoland/fresh/blob/b7281792a0a5b2674f659514b1e58116fabd6460/docs/latest/concepts/middleware.md?plain=1#L153
2024-03-21 09:32:59 +00:00
Casey Ydenberg 30a25dd2f3 Docs: Add page about setting raw HTML content (#2189) (#2295)
Closes #2189
2024-03-18 19:11:34 +01:00
Marvin Hagemeister a2be1abc6b chore: update Preact to 10.19.6 (#2331) 2024-02-22 10:46:41 +01:00
Reed von Redwitz 82c75f85e9 fix: update dependency recommendations (#2320)
closes https://github.com/denoland/fresh/issues/2319

The issue is because `imports.ts` wasn't changed before releasing. I
thought I would go through and bump some other versions as well. This
handles everything except the esbuild stuff and `tests/`.
2024-02-19 10:33:04 +01:00
Reed von Redwitz 3f28cc8977 chore: upgrade tailwind to 3.4.1 (#2287) 2024-01-29 14:10:28 +01:00
Marvin Hagemeister 8c4385043c Revert "refactor: use --env CLI arg" (#2212)
Reverts denoland/fresh#2204

The `--env` flag cannot be used by default because it fails when no
`.env` file is present. Therefore this PR accidentally introduced a
breaking change.
2024-01-04 11:53:15 +01:00
Asher Gomez 99eb5435bb refactor: use --env CLI arg (#2204)
This change replaces the use of the Standard Library's `dotenv.load()`
with the native `--env` CLI flag.

The benefits include:
* One less dependency
* More obvious consumption of the `.env` file in the CLI output
2023-12-29 10:47:15 +01:00
Ian James a8a43ff0d4 docs: fix typo in active links introduction (#2192)
Fixes an "<a>" in the active link markdown from being interpreted as an
actual link, rather than part of the text.

Before:


![](https://github.com/denoland/fresh/assets/1732331/fa5665f8-deed-439f-b6de-4589b494edd7)

Before with rogue anchor element in hover state:


![](https://github.com/denoland/fresh/assets/1732331/e6b286d6-e76a-4def-8446-ec0f8752967a)


After:

![](https://github.com/denoland/fresh/assets/1732331/1f441b30-871e-4076-837e-1cf5e64a82b0)
2023-12-22 12:54:16 +00:00
Marvin Hagemeister 74481007f3 docs: Move aot step in tailwind guide to start (#2176) 2023-12-15 16:42:42 +01:00
Marvin Hagemeister 993f1020b6 docs: add note for aria + data with Tailwind CSS (#2137)
Fixes https://github.com/denoland/fresh/issues/2123
2023-12-04 12:31:52 +01:00
迷渡andMarvin Hagemeister 87d1f2356a chore: Use satisfies instead of as (#2136)
Co-authored-by: Marvin Hagemeister <marvin@deno.com>
2023-12-04 11:38:52 +01:00
Christos Hrousis f3578f863f docs: Remove references to deprecated types (#2125)
As per the [1.6
release](https://deno.com/blog/fresh-1.6#simplified-typings), and
commentary by @csvn
[here](https://github.com/denoland/fresh/issues/2108#issuecomment-1836625789),
this PR aims to replace the references to deprecated typing in the
documentation.

Please see inline commentary for parts I'm unclear on.
2023-12-02 11:14:37 +00:00
Marvin Hagemeister dace008611 chore: release 1.6.0 (#2113) 2023-12-01 16:20:40 +01:00
Guilherme MiyakeandMarvin Hagemeister 1501699988 docs/examples: Client side components and libraries (#2089)
Co-authored-by: Marvin Hagemeister <marvin@deno.com>
2023-11-30 14:22:11 +01:00
Reed von Redwitz 6a90fdbf1b docs: switch to aria-current in active links page (#2019) 2023-11-28 17:32:48 +01:00
Reed von Redwitz 687d41d6d5 docs: update active link page to clarify twindv1 plugin usage (#2004) 2023-11-06 14:08:53 +01:00
Reed von Redwitz d655386617 docs: update writing tests page to discuss options (#1994) 2023-11-03 16:53:36 +01:00
Reed von Redwitz 4042d47346 docs: update using twindv1 page (#1982) 2023-10-30 18:01:27 +01:00
Reed von Redwitz 781247b180 chore: explicitly version rts in deps.ts (#1684) 2023-10-30 17:59:22 +01:00
Reed von Redwitz 533139afbf docs: update init the server to account for build step (#1988) 2023-10-30 17:58:02 +01:00
Marvin Hagemeister 73aaf84fad chore: Remove deno_kv_auth plugin (#1910) 2023-10-11 15:14:14 +02:00
Marvin Hagemeister fe2c95cc25 chore: release 1.5.0 (#1899) 2023-10-10 18:08:44 +02:00
Asher Gomez 88985fe933 chore: update Deno KV OAuth plugin and docs (#1826)
These changes aim to improve the clarity and understandability of the
Deno KV OAuth plugin. It also updates to use the latest version of the
module.
2023-09-28 08:05:53 +00:00
Michael Herzner b6eb518092 feat: add first party Deno KV OAuth plugin (#1774) 2023-09-18 17:10:50 +00:00