Skip to content

chore(dev-deps): upgrade to hono v4 #1092

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 31, 2025

Conversation

BarryThePenguin
Copy link
Contributor

@BarryThePenguin BarryThePenguin commented Mar 30, 2025

Updates the monorepo to use the root package.json to install hono. This ensures a single version is installed, in this case v4.x

I've been able to take what I've learned in other PRs and apply that here 🎉

Copy link

changeset-bot bot commented Mar 30, 2025

⚠️ No Changeset found

Latest commit: ab769cd

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@codecov-commenter
Copy link

codecov-commenter commented Mar 30, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.52%. Comparing base (b70735c) to head (ab769cd).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1092      +/-   ##
==========================================
+ Coverage   79.48%   79.52%   +0.04%     
==========================================
  Files          77       77              
  Lines        2276     2276              
  Branches      574      574              
==========================================
+ Hits         1809     1810       +1     
+ Misses        391      390       -1     
  Partials       76       76              
Flag Coverage Δ
ajv-validator 0.74% <0.00%> (ø)
arktype-validator 0.57% <0.00%> (+<0.01%) ⬆️
auth-js 2.98% <0.00%> (ø)
casbin 1.44% <0.00%> (ø)
class-validator 0.83% <0.00%> (ø)
clerk-auth 0.92% <0.00%> (-0.07%) ⬇️
cloudflare-access 2.72% <0.00%> (ø)
conform-validator 1.09% <0.00%> (ø)
effect-validator 0.39% <0.00%> (ø)
esbuild-transpiler 0.96% <0.00%> (ø)
event-emitter 2.50% <0.00%> (-0.18%) ⬇️
firebase-auth 2.46% <0.00%> (ø)
graphql-server 4.13% <0.00%> (-0.29%) ⬇️
hello 0.17% <0.00%> (ø)
medley-router 0.43% <0.00%> (ø)
node-ws 2.28% <0.00%> (-0.16%) ⬇️
oauth-providers 26.31% <0.00%> (ø)
oidc-auth 9.97% <0.00%> (ø)
otel 0.87% <0.00%> (ø)
prometheus 1.58% <0.00%> (-0.12%) ⬇️
react-renderer 1.36% <0.00%> (ø)
sentry 0.74% <0.00%> (ø)
standard-validator 1.40% <0.00%> (ø)
swagger-editor 0.61% <0.00%> (ø)
swagger-ui 1.66% <0.00%> (ø)
trpc-server 0.52% <100.00%> (ø)
tsyringe 0.26% <0.00%> (ø)
typebox-validator 1.36% <0.00%> (ø)
typia-validator 1.88% <0.00%> (ø)
valibot-validator 0.48% <0.00%> (-0.04%) ⬇️
zod-openapi 5.18% <0.00%> (ø)
zod-validator 0.57% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@@ -44,7 +44,7 @@ export const trpcServer = ({
return Reflect.get(t, p, t)
},
}),
}).then((res) => c.body(res.body, res))
}).then((res) => c.newResponse(res.body, res))
Copy link
Contributor Author

@BarryThePenguin BarryThePenguin Mar 30, 2025

Choose a reason for hiding this comment

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

The types for c.body don't allow the combination of..

(data: Data | null, init?: ResponseOrInit): Response;

..but c.newResponse does, both end up calling #newResponse anyway!

https://github.com/honojs/hono/blob/0bb821a4a10053f82a6afac09a1243fd2da62ad4/src/context.ts#L730-L738

https://github.com/honojs/hono/blob/0bb821a4a10053f82a6afac09a1243fd2da62ad4/src/context.ts#L707

Unsure if this needs a changeset 🤔

Copy link
Member

Choose a reason for hiding this comment

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

Both c.body and c.newResponse are okay, but c.body is better since c.newResponse is not often used as a public API. So how about adding @ts-expected-error like this (I think it's not a big problem adding @ts-expect-error or @ts-ignore internal implementation)?

 // @ts-expect-error c.body accepts both ReadableStream and null but is not typed well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great! Done 👍🏻

Copy link
Member

@yusukebe yusukebe left a comment

Choose a reason for hiding this comment

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

LGTM!

@yusukebe
Copy link
Member

@BarryThePenguin

Perfect! Let's go with this. Thank you!

@yusukebe yusukebe merged commit b18f243 into honojs:main Mar 31, 2025
35 checks passed
@BarryThePenguin BarryThePenguin deleted the chore/upgrade-hono-4 branch March 31, 2025 09:22
@BarryThePenguin BarryThePenguin mentioned this pull request Mar 31, 2025
TimBarley pushed a commit to TimBarley/honojs-middleware that referenced this pull request Apr 9, 2025
* chore(dev-deps): upgrade to hono v4

* chore(zod-openapi): build workspace dependencies

* chore(trpc-server): ignore null body type
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.

3 participants