Skip to content

fix(hono): Allow passing env and fix type issues#19825

Merged
s1gr1d merged 4 commits intodevelopfrom
sig/hono-cloudflare-fixes
Mar 17, 2026
Merged

fix(hono): Allow passing env and fix type issues#19825
s1gr1d merged 4 commits intodevelopfrom
sig/hono-cloudflare-fixes

Conversation

@s1gr1d
Copy link
Member

@s1gr1d s1gr1d commented Mar 16, 2026

Fixes some things in the Hono cloudflare export:

  • allows passing a callback which inlcudes the env
  • fix type errors when using the middleware
  • re-export everything from @sentry/cloudflare

Closes #19826 (added automatically)

@github-actions
Copy link
Contributor

github-actions bot commented Mar 16, 2026

size-limit report 📦

⚠️ Warning: Base artifact is not the latest one, because the latest workflow run is not done yet. This may lead to incorrect results. Try to re-run all tests to get up to date results.

Path Size % Change Change
@sentry/browser 25.64 kB - -
@sentry/browser - with treeshaking flags 24.14 kB - -
@sentry/browser (incl. Tracing) 42.62 kB - -
@sentry/browser (incl. Tracing, Profiling) 47.28 kB - -
@sentry/browser (incl. Tracing, Replay) 81.42 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 71 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 86.12 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 98.37 kB - -
@sentry/browser (incl. Feedback) 42.45 kB - -
@sentry/browser (incl. sendFeedback) 30.31 kB - -
@sentry/browser (incl. FeedbackAsync) 35.36 kB - -
@sentry/browser (incl. Metrics) 26.92 kB - -
@sentry/browser (incl. Logs) 27.07 kB - -
@sentry/browser (incl. Metrics & Logs) 27.74 kB - -
@sentry/react 27.39 kB - -
@sentry/react (incl. Tracing) 44.95 kB - -
@sentry/vue 30.08 kB - -
@sentry/vue (incl. Tracing) 44.48 kB - -
@sentry/svelte 25.66 kB - -
CDN Bundle 28.28 kB +0.04% +11 B 🔺
CDN Bundle (incl. Tracing) 43.51 kB +0.03% +10 B 🔺
CDN Bundle (incl. Logs, Metrics) 29.14 kB +0.05% +12 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) 44.36 kB +0.03% +11 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) 68.21 kB +0.02% +12 B 🔺
CDN Bundle (incl. Tracing, Replay) 80.33 kB +0.02% +13 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 81.23 kB +0.02% +13 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 85.87 kB +0.02% +12 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 86.77 kB +0.02% +12 B 🔺
CDN Bundle - uncompressed 82.62 kB +0.08% +59 B 🔺
CDN Bundle (incl. Tracing) - uncompressed 128.56 kB +0.05% +59 B 🔺
CDN Bundle (incl. Logs, Metrics) - uncompressed 85.49 kB +0.07% +59 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 131.43 kB +0.05% +59 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 209.12 kB +0.03% +59 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed 245.41 kB +0.03% +59 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 248.26 kB +0.03% +59 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 258.32 kB +0.03% +59 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 261.17 kB +0.03% +59 B 🔺
@sentry/nextjs (client) 47.37 kB - -
@sentry/sveltekit (client) 43.07 kB - -
@sentry/node-core 56.34 kB +0.02% +10 B 🔺
@sentry/node 173.16 kB -0.02% -21 B 🔽
@sentry/node - without tracing 96.35 kB +0.01% +5 B 🔺
@sentry/aws-serverless 113.34 kB +0.01% +7 B 🔺

View base workflow run

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

* wrapped in a Sentry span. Supports both forms: `app.use(...handlers)` and `app.use(path, ...handlers)`.
*/
export function patchAppUse(app: Hono): void {
export function patchAppUse<E extends Env>(app: Hono<E>): void {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

l: If E is never used maybe it'd be better to use the following (haven't tested it though)? It reminds me a bit of #18302

Suggested change
export function patchAppUse<E extends Env>(app: Hono<E>): void {
export function patchAppUse<H extends Hono>(app: H): void {

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would give me a massive type error :/

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok then nevermind :D

@s1gr1d s1gr1d enabled auto-merge (squash) March 17, 2026 08:35
@s1gr1d s1gr1d merged commit 9f779f5 into develop Mar 17, 2026
176 checks passed
@s1gr1d s1gr1d deleted the sig/hono-cloudflare-fixes branch March 17, 2026 08:54
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.

fix(hono): Allow passing env and fix type issues

2 participants