Skip to content

Feat/hook#626

Merged
ynwd merged 3 commits intomainfrom
feat/hook
Mar 8, 2026
Merged

Feat/hook#626
ynwd merged 3 commits intomainfrom
feat/hook

Conversation

@ynwd
Copy link
Copy Markdown
Member

@ynwd ynwd commented Mar 8, 2026

No description provided.

ynwd added 3 commits March 8, 2026 22:01
- app.hook('onRequest', handler) runs before routing and middleware
- app.hook('onResponse', handler) runs after response is constructed
- Both hooks share a single ctx per request (same object as middleware)
- State set in onRequest is accessible in middleware, route handler, and onResponse
- Auto-detects async hooks to avoid unnecessary Promise allocation on sync paths
- 100% branch and line coverage across all files
- All benchmark scenarios remain above 92% of native Deno.serve with hooks active
# Conflicts:
#	modules/app.ts
@ynwd ynwd self-assigned this Mar 8, 2026
@ynwd ynwd merged commit f4e231b into main Mar 8, 2026
1 check passed
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