It's over three years ago. At that time, Hono was built with WebStandard API and it was only for Cloudflare workers. So, we couldn't really say it's multiple runtime yet. I'll talk about how Hono supports multiple runtimes.
We released version 2 of Hono on June 16th, 2022. Version 2, Hono started to support Dno and BAN. We didn't say Hono supports Dno and BAN before version 2, but it was easy to support them because both Dno and BAN use WebStandard APIs.
To support Dno, we need to do two things. In Dno, to import module, we had to add an extension like .ts or .ds, the module name. And second, Dno imports modules using URLs. So, we made a Hono package that can be downloaded from Dno.runx. Supporting BAN was very easy. After BAN was made public, someone created this issue and is there any plan for BAN.js support? But we don't have to do anything. Hono just works on BAN without any changes.
Here is something interesting. The same code can run on Cloudflare and BAN. This example is just a hello world application and you can learn it. Language dev commands for Cloudflare workers and BAN command for BAN. So, the completely same for hello world application started as Cloudflare workers and BAN. So, we can say Hono is a multi-runtime framework.
Becoming multi-runtime had some great benefits. When Hono started supporting multi-runtime, more people began to use it. This meant we got more feedback, issues and use cases. By addressing this, we improved Hono's quality. So, learning Hono on multi-runtime has led to very good results for us. Next, I explain the Node.js adapter. After supporting DNO and BAN in version 2, our next big challenge was making Hono work on Node.js. Because many people use Node.js, so if it succeeds, Hono would reach much larger users. But Hono application can't run on Node.js as it is. Node.js has web standard APIs like fetch and request response URL and et cetera.
Comments