Commit Graph
1722 Commits
Author SHA1 Message Date
669f62a32a fix: prevent 404 for routes consisting solely of an optional parameter (#2798)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 21:27:18 +02:00
Bartek Iwańczuk be813e0dfd ci: add perf prefix to PR title checker (#3739) 2026-03-29 21:25:40 +02:00
a79b155e79 fix: make <Head> work in client (#3252)
Closes #3310

---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 21:21:39 +02:00
Sato Takayuki 19d3589b9b fix: apply basePath correctly in dev mode for root index (#3219)
## Summary
- Fixed an issue where basePath was not correctly applied in dev mode
for the root index route
- The dev server now uses root path "/" while preserving the configured
basePath for the main app
2026-03-29 21:17:17 +02:00
Bartek IwańczukandClaude Opus 4.6 ee9d1d04e7 fix: apply layout to index route with programmatic routing (#3725)
Closes #3553

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 21:14:34 +02:00
Bartek IwańczukandClaude Opus 4.6 9e7adc084b fix: middleware not matching routes with optional parameters in fs routing (#3726)
Closes #3545

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 21:11:55 +02:00
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 dd1ecf3b16 fix: don't intercept forms without explicit f-partial inside f-client-nav (#3722)
Fixes #3473

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 19:07:54 +00:00
Bartek IwańczukandClaude Opus 4.6 caeebd88a5 fix: trailing slash mismatch causes 404 for static routes (#3721)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 21:06:18 +02:00
Bartek IwańczukandClaude Opus 4.6 e6b25a084c fix: add @types/babel__core to vite project template (#3723)
Closes #3605

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 19:04:07 +00:00
Bartek IwańczukandClaude Opus 4.6 075dfb73b2 feat: inject traceparent meta tag when OpenTelemetry is active (#3729)
Closes #2830

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 18:51:12 +00:00
Bartek IwańczukandClaude Opus 4.6 92e07f03b3 fix: resolve server entry filename from bundle chunks (#3719)
Closes #3655

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 20:45:32 +02:00
420a8cfb8e docs: fix misleading main.tsx filenames (#3477)
Closes #3476

---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 18:38:14 +00:00
Bartek IwańczukandClaude Opus 4.6 be467d3cdb fix: warn when Partial with append/prepend mode is missing key prop (#3738)
## 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>
2026-03-29 20:33:14 +02: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 059183b230 fix: improve error message for missing exports in file routes (#3718)
Closes #3652

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 20:18:07 +02:00
Bartek IwańczukandClaude Opus 4.6 4e0331b5c9 fix: preserve partial search param through redirects (#3715)
## Summary
- Fixes #2610 — "Partial + redirect breaks islands"
- When a partial request (`?fresh-partial=true`) hits a server-side
redirect via `ctx.redirect()`, the `fresh-partial` search param is now
preserved in the redirect `Location` header
- Previously the param was lost, so the redirect target rendered as a
full page instead of a partial response, breaking island hydration

The fix is in `ctx.redirect()` in `packages/fresh/src/context.ts` — when
`this.isPartial` is true, the partial param is appended to the redirect
location (handling existing query params and hash fragments correctly).

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 13:23:54 +02:00
0015710909 feat: allow passing Temporal objects to islands (#3701)
## Summary

- Add serialization/deserialization for all 8 Temporal types in the
jsonify module (used for island props): Instant, ZonedDateTime,
PlainDate, PlainTime, PlainDateTime, PlainYearMonth, PlainMonthDay,
Duration
- Stringify side guards with `typeof Temporal !== "undefined"` to avoid
ReferenceError when Temporal is unavailable
- Uses `.toString()` for serialization and `Type.from()` for
deserialization

Co-authored-by: Nano Miratus <nanomiratus@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 10:23:38 +02:00
Bartek IwańczukandClaude Opus 4.6 b790c804ee feat: support deno create for project initialization (#3706)
## Summary
- Add a `./create` export to `@fresh/init` so users can scaffold
projects with `deno create @fresh/init` (Deno 2.7+)
- The old `deno run -Ar jsr:@fresh/init` continues to work but now shows
a deprecation warning

**New way (Deno 2.7+):**
```sh
deno create @fresh/init
```

**Old way (still works, with warning):**
```sh
deno run -Ar jsr:@fresh/init
```

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 15:38:31 +00:00
Bartek Iwańczuk 214975d90d chore: inline ga4 module and remove raw GitHub import (#3733)
## Summary
- Inlined the `$ga4` module (from
`https://raw.githubusercontent.com/denoland/ga4/main/mod.ts`) into
`www/utils/ga4.ts`
- Replaced old `deno.land/std` URL imports with `@std/http`
(`getCookies`, `STATUS_TEXT`)
- Inlined the trivial `snakeCase` helper (was from `deno.land/x/case`)
- Removed `$ga4` import map entry from `deno.json`

The ga4 package was never published to jsr or npm, so inlining was the
cleanest way to eliminate the last raw URL-based dependency.
2026-03-28 12:05:13 +00:00
Bartek IwańczukandClaude Opus 4.6 220368aa15 chore: migrate docsearch and imagescript to npm/jsr imports (#3732)
## Summary
- **docsearch**: Replaced `esm.sh` URL with `npm:@docsearch/js@^3.5.2`.
Added a type cast workaround in `SearchButton.tsx` since Deno's type
checker treats this npm package as CJS (missing `"type": "module"`).
- **imagescript**: Replaced `deno.land/x` URL with
`jsr:@matmen/imagescript@^1.3.0`. Clean swap, no code changes needed.

These were legacy URL-based imports from before Deno had native `npm:`
and `jsr:` support.

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 11:44:37 +00:00
Bartek Iwańczuk 25e6357e1a chore: release 2.2.2 (#3717) 2026-03-28 10:01:28 +01:00
Bartek Iwańczuk 3b61ede394 ci: update PR title checker (#3713) 2026-03-28 08:55:24 +01: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
Bartek IwańczukandClaude Opus 4.6 7aea4942d7 chore: add pr title validation to ci (#3702)
## Summary
- Adds a `pr-title` CI job that validates PR titles start with `feat:`,
`fix:`, `test:`, `chore:`, or `showcase:` and are all lowercase
- Updates `.github/CONTRIBUTING.md` with the title format rules and a
link to the full contributing docs

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 09:11:51 +01:00
Bartek IwańczukandClaude Opus 4.6 bc13417448 ci: use canary Deno version for JSR publishing (#3710)
Mostly to quickly get updates and fixes like
https://github.com/denoland/deno/pull/32127

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 22:24:50 +01:00
Bartek IwańczukandClaude Opus 4.6 8a2b659339 fix: vendor check_docs to avoid raw GitHub URL rate limits (#3704)
## Summary
- The CI `check:docs` task imports from
`raw.githubusercontent.com/denoland/std/.../_tools/check_docs.ts` which
intermittently fails with **429 Too Many Requests**, breaking CI on
unrelated PRs
- Vendor the script locally as `tools/check_docs_lib.ts` (from
`denoland/std`'s `_tools/check_docs.ts` + inlined `resolve` from
`_tools/utils.ts`) to eliminate the external dependency
- Both `@deno/doc` and `@std/collections` were already in the import
map, so no new dependencies

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 11:05:20 +01:00
Bartek IwańczukandClaude Opus 4.6 93356c80c4 chore: remove showcase page (#3703)
## Summary
- Remove the Showcase page route, data, component, and all 175 showcase
images
- Remove "Showcase" from the navigation bar
- Keep the fresh-badge SVGs (still linked from external READMEs)

Also closed 12 open showcase PRs: #2691, #2861, #2846, #2720, #2282,
#2667, #2585, #1842, #2784, #1697, #2260, #2841.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 11:05:05 +01:00
Hong Minhee (洪 民憙)andBartek Iwańczuk b11d1d98f2 fix: handle invalid date objects in jsonify stringify (#2851)
## Summary
- Handles the case when `Date.toISOString()` throws for invalid dates by
catching the error and serializing as `"Invalid Date"`
- Round-trips correctly: `new Date("Invalid Date")` serializes to
`["Date","Invalid Date"]` and deserializes back to an invalid `Date`
object
- Adds test case and snapshot for invalid `Date`

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2026-03-26 08:31:27 +00:00
j0siandBartek Iwańczuk 61eb5f625a Adding a small demo to showcase (#2970)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2026-03-26 08:27:10 +00:00
3822b4a21b test: add fresh_version_check test (#3029)
add a test file to auto check the fresh_version, based on deno.json
--version.

Close #3024 

---------

Co-authored-by: 李嘉图·M·路 <146103794+Ricardo-M-Zheng@users.noreply.github.com>
Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2026-03-26 08:20:01 +00:00
2fce869971 docs: update project setup commands in READMEs (#3334)
## Summary
- Update init command in `README.md` from `deno run -A -r
https://fresh.deno.dev` to `deno run -Ar jsr:@fresh/init` to match Fresh
2.x
- Fix `www/README.md` to use `deno task dev` (Vite dev server) instead
of `deno task start` (production server) for development workflow

---------

Co-authored-by: Marvin Hagemeister <marvinhagemeister50@gmail.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2026-03-26 08:14:22 +00:00
Marvin HagemeisterandBartek Iwańczuk 882b7829fd feat: expose HttpError for clients (#3080)
This PR exposes the `HttpError` class for clients. 

To do that I needed to make the error message optional to avoid bloating
up the bundle with lots of status strings.

Fixes https://github.com/denoland/fresh/issues/2995

---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2026-03-26 09:10:21 +01:00
0fff2b04da chore: minor code cleanups (#3103)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 09:01:34 +01:00
9509b087ff docs: add contributing section (#3384)
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>
2026-03-26 07:39:20 +00:00
Wesley FrancesconandBartek Iwańczuk 1accb21b6e add boxdgrid project to showcase (#3236)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2026-03-25 19:01:39 +00:00
022835cce6 perf: make updater faster by streaming instead of reading into memory (#3630)
Fix system crash (OOM) caused by updater spending time in folders like
docs/

- Skip hidden and vendor directories (node_modules, vendor, docs, etc.)
to avoid OOM
- free ASTs immediately
- ts-morph dependency bumped to ^27.0.2

Closes https://github.com/denoland/fresh/issues/3483

---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 20:01:01 +01:00
c863097779 fix: handle paths with whitespaces in staticFiles (#3659)
Fix #3657

Static files with special characters in their names (spaces, `#`,
unicode, etc.) fail to load due to path encoding issues.

## Root cause

`prepareStaticFile()` uses `new URL(pathname, base)` to normalize paths,
but `new URL` doesn't properly encode characters that are already
percent-encoded in the filesystem path. For example, a file literally
named `test %20encodeUri` becomes `test%20%20encodeUri` (the space and
literal `%20` are indistinguishable), instead of the correct
`test%20%2520encodeUri`.

---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 20:00:48 +01:00
Brian SimoniandBartek Iwańczuk 4b4e495194 Add weewoo.study to the showcase (#3212)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2026-03-25 18:55:54 +00:00
Bartek IwańczukandClaude Opus 4.6 1a266ac987 chore: add AGENTS.md (#3699)
## Summary
- Add `AGENTS.md` with guidelines for AI-assisted development on this
repo
- Documents git workflow (use `gh pr checkout`, run `deno fmt`, avoid
lockfile noise)
- Documents dev practices (`deno task ok`, stale remote specifier
hashes)

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 18:55:29 +00:00
8bf05a0127 docs: add clarification for assets/static (#3525)
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>
2026-03-25 19:54:04 +01: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
421e3394a2 fix(vite): use manifest entry filename for server entry import (#3595)
## Summary
When `rollupOptions.output.entryFileNames` is customized in vite config
(e.g. `[hash].mjs`), the generated `server.js` was hardcoding
`server-entry.mjs` as the import path, causing the server to fail to
start.

This fix reads the actual entry filename from the Vite manifest and uses
it in the generated `server.js` import, falling back to
`server-entry.mjs` when no custom naming is configured.

---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 18:47:02 +00:00
cdc14a0c6e Do not assign named exports into existing default export (#3494)
Fixes: https://github.com/denoland/fresh/issues/3492

---------

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:40:46 +01:00
Emil KrebsandBartek Iwańczuk 9c06f4aa8c Showcase: Add VailNote (#3248)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2026-03-25 18:15:30 +00:00
Charlie Garrison 979d0294fa Added Beyond Better to showcase (#3547) 2026-03-25 19:08:31 +01:00
Octo8080XandBartek Iwańczuk bac59c672b Add showcase Deno Sandbox API Test Game (#3640)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2026-03-25 18:07:58 +00:00
3530d212f2 Update Code of Conduct link in Footer component (#3679)
Current site has broken code of conduct link

Co-authored-by: Drew Hoffer <55151884+drewhoffer@users.noreply.github.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2026-03-25 18:04:05 +00:00
Gracjan ZiemiańskiandBartek Iwańczuk 770233d956 Add new showcase entry for TKD-Dzwirzyno (#3660)
I added taekwon-do club website made in Fresh - club name is
TKD-Dzwirzyno

---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2026-03-25 18:00:09 +00:00
Douglas MouraandBartek Iwańczuk 76a9ca7d1e fix: typo in Subscribe page handler reference (#3669)
This PR removes an extra `s` on the type definition of the handler for
the page.

---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2026-03-25 17:59:21 +00:00