Skip to content

docs: annotate handlers with (c: CtxCore), the scriptc-compilable form - #90

Merged
devin-ai-integration[bot] merged 1 commit into
mainfrom
devin/1792395988-docs-ctxcore
Oct 19, 2026
Merged

devin-ai-integration[bot] merged 1 commit into
mainfrom
devin/1792395988-docs-ctxcore

Conversation

@espetro

@espetro espetro commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes sigilco/cutils#29 — the @chttp/auth README quickstart (and every other doc snippet using the same handler idiom) failed under scriptc: an unannotated async (c) => gets c: any (SC0001/SC2009), and (c: Ctx) hits SC2009 because Ctx<P> is a generic interface. The working annotation is the runtime class Handler is typed on: (c: CtxCore).

Changes:

  • packages/auth/README.md: quickstart handlers now async (c: CtxCore) with import { CtxCore } from "@chttp/router" shown.
  • Same idiom swept across the docs site and package READMEs: README.md, packages/router/README.md, packages/stream/README.md, docs/{index,quickstart,middleware,deploy,html,multipart,routing,static,streaming,unplugin}.md.
  • docs/middleware.md: import type { Ctx } → CtxCore and all (c: Ctx) annotations updated (this exact form is the second failure in the issue).

Verified: a consumer file containing the fixed quickstart compiles 100% static under scriptc coverage (both import { CtxCore } and import type { CtxCore }); the old unannotated and (c: Ctx) forms reproduce the issue's errors. pnpm docs:build still passes.

Not touched: examples/** sources use the same idioms but are real code with their own gates — worth a separate sweep if wanted.

Link to Devin session: https://app.devin.ai/sessions/876dac2af1e84877b45fb044d31c514b
Open in Devin Desktop: https://app.devin.ai/desktop/session/876dac2af1e84877b45fb044d31c514b?variant=devin
Requested by: @espetro

scriptc refuses unannotated handler params ('any') and the Ctx<P>
generic interface (SC2009); CtxCore is the runtime class Handler is
typed on. Fixes the @chttp/auth README quickstart (cutils#29) and the
same handler idiom across the docs site and package READMEs.
@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying chttpjs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 24edeb9
Status: ✅  Deploy successful!
Preview URL: https://92bcca3a.chttpjs.pages.dev
Branch Preview URL: https://devin-1792395988-docs-ctxcor.chttpjs.pages.dev

View logs

@devin-ai-integration
devin-ai-integration Bot merged commit b510d58 into main Oct 19, 2026
3 checks passed
@devin-ai-integration
devin-ai-integration Bot deleted the devin/1792395988-docs-ctxcore branch October 19, 2026 07:50
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.

docs(auth): README quickstart handler fails under scriptc, needs (c: CtxCore)

1 participant