Skip to content

chore: migrate docsearch and imagescript to npm/jsr imports#3731

Closed
bartlomieju wants to merge 55 commits into
mainfrom
chore/migrate-docsearch-imagescript-imports
Closed

chore: migrate docsearch and imagescript to npm/jsr imports#3731
bartlomieju wants to merge 55 commits into
mainfrom
chore/migrate-docsearch-imagescript-imports

Conversation

@bartlomieju

Copy link
Copy Markdown
Contributor

Summary

  • docsearch: Replaced esm.sh URL (https://esm.sh/@docsearch/js@3.5.2?target=es2020) 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 (it lacks "type": "module"), hiding the callable default export.
  • imagescript: Replaced deno.land/x URL (https://deno.land/x/imagescript@1.3.0/mod.ts) 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.

Test plan

  • deno task ok passes (fmt, lint, types, 506 tests)

🤖 Generated with Claude Code

bartlomieju and others added 30 commits March 27, 2026 19:59
Fill in documentation for `.route()`, `.onError()` route, and `.notFound()`
route examples in concepts/app.md. Replace TODO in plugins/index.md with a
list of built-in plugins.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Fix syntax error in concepts/layouts.md (missing parens around arrow fn params)
- Add missing `ctx` parameter in concepts/routing.md blog handler
- Fix wrong import `app` -> `App` in plugins/csrf.md
- Remove unused `target` prop from Countdown example in getting-started

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- concepts/app.md: was "Add a global app wrapper..." (from app-wrapper page)
- concepts/context.md: was "Plugins can add..." (from plugins page)
- advanced/environment-variables.md: was "Error pages can be used..." (from error-handling page)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The CSRF plugin page had copy-pasted text describing CORS behavior
("which origins...is permitted to load resources from"). Replaced with
an accurate description of CSRF protection mechanics.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- "it's subfolders" -> "its subfolders" (middleware.md)
- "other's like" -> "others like" (define.md)
- "than this is likely" -> "then this is likely" (troubleshooting.md)
- "as well has collect" -> "as well as collect" (deno-deploy.md)
- "the the correct" -> "the correct" (cloudflare-workers.md)
- "host name number" -> "host name" (deno-compile.md)
- "While this generally desired" -> "While this is generally desired" (rendering-raw-html.md)
- "If can't update" -> "If you can't update" (builder.md)
- Missing closing quotes in code comments (context.md, app.md)
- Image filename typo "cotuntdown" -> "countdown" (getting-started)
- "_layout_.tsx" -> "_layout.tsx" (layouts.md)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The advanced section index was a single sentence with no links to its
sub-pages. Added a complete list of all advanced topics with brief
descriptions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The routing page was ~100 words with only basic examples (one broken).
Now covers route matching priority (static-first, then registration
order), HTTP method handlers, HEAD fallback behavior, and file-based
route handler patterns.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…nals

The Vite page was ~100 words showing only the config options. Now explains
what the plugin does (JSX, aliasing, HMR, code splitting), how to add
other Vite plugins alongside Fresh, how HMR works, and debugging tips.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signals are a core reactivity feature with zero dedicated documentation.
New page covers: creating signals with useSignal, computed signals,
passing signals as island props, shared state via module-level signals,
and serialization behavior.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Handler-only routes (JSON APIs) are a very common pattern with no
documentation. New page covers: basic JSON responses, method-specific
handlers with 405 fallback, catch-all handlers, and programmatic routes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There are two layout docs (file-based in concepts/, programmatic in
advanced/) with no cross-references. Added a note at the top of each
page pointing to the other with a clear distinction.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The deployment index listed both 'deno task build' and the legacy
'deno run -A dev.ts build'. The latter was removed by the Fresh 2
migration (dev.ts is replaced by vite.config.ts). Now shows only
the current command with a note linking to the migration guide.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Deno Deploy page was 4 numbered steps (~70 words). Now covers build step
configuration, environment variables, custom domains, and troubleshooting.

deno compile page was ~80 words. Now covers cross-compilation, the
--include flag, and known limitations.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Fresh 1.x had a dedicated data fetching page that was dropped in 2.x.
New page covers: handler-to-component data flow with page(), type-safe
data passing with define.handlers/define.page, async page components,
middleware state, response customization, and a PageProps reference table.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Documents what types can be passed as island props, what cannot be
serialized (functions, class instances, symbols), circular reference
handling, signal serialization mechanics, and common pitfalls like
large props and accidental non-serializable values.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Collects frequently-needed patterns in one place: protected routes,
URL redirects, content negotiation, cookies, query parameters, response
headers, streaming, WebSockets, and timing middleware.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Fresh 1.x had a dedicated architecture page that was dropped in 2.x.
New page includes an ASCII request flow diagram covering static files,
middleware chain, routing, handlers, layouts, page rendering, and island
hydration. Also explains server-first rendering, islands architecture,
middleware onion pattern, layout inheritance, and build/deploy flow.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- islands.md: fix "route/index.tsx" typo -> "routes/index.tsx"
- middleware.md: add missing csp() to included middlewares list, fix
  trailingSlash -> trailingSlashes
- layouts.md: fix line 88 using define.layout() for a page example ->
  define.page()
- migration-guide.md: add missing ctx parameter in ctx.render() example
- markdown.md: remove unused CONTENT variable, fix step numbering (3 not 4)
- builder.md: fix inconsistent tailwind() args (remove extra app param)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Was missing Architecture, Data Fetching, Signals, Static Files, and
File Routing links. Now lists every concept sub-page with descriptions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The getting started page ended abruptly after the Countdown example
with no guidance on where to go next. Added links to routing, data
fetching, islands, middleware, and architecture.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
These directories were shown in the project structure tree but never
explained. Added a section describing what each does and why the
parentheses matter.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- static-files.md: add assetSrcSet() usage example
- error-handling.md: expand HttpError docs with message param, import
  path, and browser availability
- app.md: add Configuration section documenting basePath option
- islands.md: clarify IS_BROWSER import and behavior

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Manual reference covering all exports from fresh, fresh/runtime, and
fresh/dev entry points. Each export includes its kind (class, function,
component, constant, type) and links to the relevant docs page.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- examples/index.md: add API Routes and Common Patterns to listing,
  match order to TOC
- migration-guide.md: fix awkward phrasing "automatically update like"

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The introduction had no mention of what Deno version is needed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The audit noted there was no explanation of how to create custom plugins.
Added a "Creating reusable plugins" section showing how to export a
middleware function as a reusable plugin.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Fresh has built-in OTel instrumentation listed as a feature in the
introduction but with no dedicated documentation. New page covers what's
instrumented, how to enable tracing with Deno's built-in OTel support,
and the Deno Deploy integration.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The audit noted the contributing page could use PR submission guidelines.
Added a section covering deno task ok, focused PRs, test expectations,
and code style.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The RouteConfig css option for loading per-route CSS files was
undocumented. Added an example alongside the existing routeOverride
section.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
bartlomieju and others added 25 commits March 28, 2026 08:50
- Rename getting-started-3-cotuntdown.png -> getting-started-3-countdown.png
  to match the markdown reference fixed in an earlier commit
- Fix 1.x partials.md referencing /docs/1.x/fresh-partial-docs.png when
  the file is at /docs/fresh-partial-docs.png

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Walks all markdown files in docs/ and verifies that every image
reference (![alt](path)) points to an existing file in www/static/.
Skips external URLs. Fails with a list of all broken references.

Run: deno test -A docs/check_images_test.ts

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Addresses #3695 — documents how to register multiple layouts for
different paths and how to use skipInheritedLayouts to override
inherited layouts for specific routes.

Closes #3695

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Explain that .listen() conflicts with deno serve / Vite dev server
and document how to customize the port in the default setup.

Closes #3548

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add missing `deno install --allow-scripts` step before build
- Remove incorrect `deno cache` step (not needed with Vite build output)
- Add `deno` prefix to `serve` command in CMD
- Add install step to deployment index page

Ref #3500

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Ref #3482

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Fix examples that showed JSX in main.ts (not valid without config)
- Add tip explaining how to enable main.tsx with serverEntry config

Closes #3476

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replaces hardcoded canary redirects with a single catch-all since
canary docs have been merged into latest.

Closes #3375

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Shows three steps on the homepage: one-file server, adding JSX,
and adding an island — demonstrating Fresh's progressive complexity.

Ref #2755

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Explains that the last-rendered <Head> element wins, so route
components override defaults set in _app.tsx.

Closes #2749

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Shows how to register and use custom elements and third-party
web component libraries inside Fresh islands.

Closes #2741

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When recipe partial routes are accessed directly (not as a partial
request), redirect to /#partials instead of serving raw HTML fragments.

Closes #2559

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Module-level signals are shared across all server requests, causing
state leaks between users. Rewrote the cart example to create signals
per-render and pass them as props, with a warning about the pitfall.

Closes #2437

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Covers build-time optimization with vite-imagetools, CDN image
services, and best practices for responsive images.

Closes #671

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Subdomain routing via middleware + URLPattern (ref #603)
- Proxying requests to upstream servers (closes #361)
- Lazy-loading island content with Preact lazy() + Suspense (ref #565)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ctx.render() requires a vnode argument; use page() to delegate
rendering to the default page export instead.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…hecker

- Add layouts page to concepts section in TOC (file existed but wasn't registered)
- Exclude GitHub edit URLs from link checker to avoid 429 rate limiting

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1. Fix handlers → handler (singular) in app.route() example
2. Fix app.onError() missing path argument
3. Fix css shown inside RouteConfig → top-level export
4. Fix variable shadowing (page shadows page() import)
5. Fix ctx.redirect() in page component → move to handler
6-8. Add missing HttpError and define imports in examples
9. Add config and info to PageProps reference table
10. Add RouteData, Lazy, MaybeLazy, ResolvedBuildConfig to API reference
11. Clarify layout nesting order in architecture docs
12. Add note explaining useSignal in server-rendered route for signals

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Fix app.onError() missing path arg in error-handling.md
- Add missing HttpError import in error-handling.md
- Add missing define imports in WebSocket, subdomain, timing examples
- Standardize on `handler` (singular) for all export names
- Convert all untyped middleware to define.middleware()

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace legacy URL-based imports with proper registry imports:
- docsearch: esm.sh URL → npm:@docsearch/js
- imagescript: deno.land/x URL → jsr:@matmen/imagescript

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant