Skip to content
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

feat(adapters): support hono v4 #778

Merged
merged 1 commit into from
Jun 24, 2024
Merged

feat(adapters): support hono v4 #778

merged 1 commit into from
Jun 24, 2024

Conversation

nihalgonsalves
Copy link
Contributor

@nihalgonsalves nihalgonsalves commented Jun 24, 2024

Support Hono V4. Since the adapters are not versioned separately, I tried to make a minimally-breaking change - it requires no changes unless you use Cloudflare Workers, which has a breaking change in Hono v41.

This makes the types in the HonoAdapter slightly unsound. A proper long-term fix would be to change the API to accept handler: ({ root, rewriteRequestPath }) => MiddlewareHandler (where MiddlewareHandler is the return type of serveStatic).

Consumers could then construct serveStatic themselves, including requirements such as the manifest. That would, of course, require every consumer to update their HonoAdapter constructor, so maybe something to reserve for a major release.

Closes #721 (supersedes)

Footnotes

  1. https://github.com/honojs/hono/blob/main/docs/MIGRATION.md#servestatic-in-cloudflare-workers-adapter-requires-manifest

@felixmosh felixmosh merged commit 549364a into felixmosh:master Jun 24, 2024
4 checks passed
@felixmosh
Copy link
Owner

Thank you for this PR 🙏🏽

@dalechyn
Copy link

thanks king, right about time i started looking into it

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