fix(deps): update dependency hono to v4 #654
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
3.12.12
->4.0.1
Release Notes
honojs/hono (hono)
v4.0.1
Compare Source
What's Changed
Full Changelog: honojs/hono@v4.0.0...v4.0.1
v4.0.0
Compare Source
Hono v4.0.0 is out! This major update includes some breaking changes and the addition of three major features.
So Hono is going to full-stack. Let's take a look at the three features.
1. Static Site Generation
We introduce SSG Helper. With it you can generate static pages of your Hono applications.
To use this, create a separate file
build.ts
from the application and call thetoSSG()
function in it.There are adapters for Bun and Deno, so you can write shorter for Bun, for example.
And, just run it.
Then HTML is generated.
$ ls static about.html index.html
You can easily deploy this page to Cloudflare Pages, etc.
$ wrangler pages deploy static
With Vite
We have created a plugin
@hono/vite-ssg
for Vite. By using this, you will be able to develop and build a static sites with just thevite
command.The configuration is the following:
If you want to develope, just run the command:
If you want to build, just run the command:
In combination with the deployment mentioned above to Cloudflare Pages, you can develop, SSG build, and deploy non-stop. And each of them is extremely fast (the video is 2x faster).
2. Client Components
hono/jsx
was originally designed to run server-side as an alternative to template engines such as Mustache. Server-side JSX is an interesting experiment, creating a new stack to combine with HTMX and Alpine.js. But that's not all.Now,
hono/jsx
runs on the client as well. We call ithono/jsx/dom
or Client Components.The exact same code as React runs with Hono's JSX.
The Hooks listed below are also implemented and you can create Client Components just like in React.
startViewTransition
familyIn addition, the original APIs,
startViewTransition
family make the View Transition API easy to use.You can easily create the animation.
Ultra-small
The
hono/jsx/dom
is fast and ultra-small. It has a smaller JSX runtime dedicated to the DOM in addition to the common server and client ones. Just specifyhono/jsx/dom
instead ofhono/jsx
intsconfig.json
.The above counter example is 2.8KB with Brotli compression.
In comparison, React is 47.3 KB for the same thing.
3. File-based Routing
Last is File-based Routing. This is not included in the hono package, but is provided in a separate package.
It is named HonoX.
HonoX
HonoX has the following features.
You can try it now. One of create-hono's starter templates named "x-base" uses HonoX.
For detailed usage, please see the following HonoX repository.
https://github.com/honojs/honox
The core is still tiny
The addition of this feature has no impact on the core. "Hello World" in hono/tiny is still small, only 12KB minified.
Other new features
'*'
forapp.use()
- https://github.com/honojs/hono/pull/1753app.on
supports multiple paths - https://github.com/honojs/hono/pull/1923c.json()
- https://github.com/honojs/hono/pull/2021mimes
option for serve-static - https://github.com/honojs/hono/pull/2094Breaking Changes
There are several breaking changes. Please see the Migration Guide below.
https://github.com/honojs/hono/blob/main/docs/MIGRATION.md
Thanks
Thanks to all contributors. Great job on all the hard work!
All Updates
app.on
supports multiple paths by @yusukebe in https://github.com/honojs/hono/pull/1923import
by @yusukebe in https://github.com/honojs/hono/pull/1969node:path
by @nakasyou in https://github.com/honojs/hono/pull/1965deprecated
fromFactory
andcreateHandlers
by @yusukebe in https://github.com/honojs/hono/pull/1979manifest
required by @yusukebe in https://github.com/honojs/hono/pull/1984.tsx
by @yusukebe in https://github.com/honojs/hono/pull/1994c.get()
inference by @yusukebe in https://github.com/honojs/hono/pull/1995ssgParams
middleware by @nakasyou in https://github.com/honojs/hono/pull/1960isDynamicRoute
andssgParams
matter by @yusukebe in https://github.com/honojs/hono/pull/2006useTransition()
handling more simple by @usualoma in https://github.com/honojs/hono/pull/2003test:deno
by @yusukebe in https://github.com/honojs/hono/pull/2014deno.lock
by @yusukebe in https://github.com/honojs/hono/pull/2015return c.json()
by @yusukebe in https://github.com/honojs/hono/pull/2021ssgParams
flexibility by @sor4chi in https://github.com/honojs/hono/pull/2024BlankSchema
orBlankInput
by @yusukebe in https://github.com/honojs/hono/pull/2040useViewTransition()
hook andviewTransition()
helper by @usualoma in https://github.com/honojs/hono/pull/2053Installing dependencies
by @yusukebe in https://github.com/honojs/hono/pull/2113mimes
option for serve-static by @ryuapp in https://github.com/honojs/hono/pull/2094disableSSG
andonlySSG
by @yusukebe in https://github.com/honojs/hono/pull/2104c.var
type by @Kyiro in https://github.com/honojs/hono/pull/2121hono/html
by @javascripter in https://github.com/honojs/hono/pull/2143helper.ts
by @yusukebe in https://github.com/honojs/hono/pull/2150MergeSchemePath
infers param types correctly by @yusukebe in https://github.com/honojs/hono/pull/2152MergeSchemaPath
infer inputs not only params by @yusukebe in https://github.com/honojs/hono/pull/2154getExtension()
fast by @ryuapp in https://github.com/honojs/hono/pull/2168New Contributors
Full Changelog: honojs/hono@v3.12.10...v4.0.0
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate. View repository job log here.