Hi AJ, nice video! Subscribed! One question, at 1:40 you state that it's easy to split a mono-lambda into single-functions. How would that work with Hono, especially if you want to use API Gateway but still want to have the full Hono routing in place when running locally?
@@DirkLuijk hey, thanks!! If you're all in on Hono you'd basically copy that code out to another Hono-powered function. The framework overhead is so low you'd likely not notice it vs vanilla JS
Had the same thought, but the other bog advantage of staying away from provider-specific integrations is that there is only 1 framework to adapt to, which makes it easier to drop in any open-source utilities. As long as it works with Hono (or Web API standards).
Thanks for diving in on this, I actually worked at a company that had thousands of lambdas using Serverless framework... Total mess, not to mention serverless framework is slow in general. I've been thinking about that setup and hono definitely has the right ideas. The bundle size was massive, they all used I also give massive props to the creator for using zod, which has become my goto in TS, it's simply fantastic.
Thanks! Yeah Hono has really hit something special here, I think it's doing a lot of the things we initially sought to do on the Serverless Framework which fell off after focus shifts revenue challenges.
Hey good question! It's because the size of your bundle directly impacts your cold start latency for serverless functions! I gave a whole talk on this at AWS re:Invent: ua-cam.com/video/2EDNcPvR45w/v-deo.html
Less code (assuming it's still doing similar work) will generally run faster than more code as it can take better advantage of CPU cache etc, "Locality of Reference" is a term to search further on the subject. JS is an interpreted language so less code to interpret also means faster startup times which is especially important on hosting platforms like "lambda" that can scale to zero
"context is everywhere now"... Nah, this is some folks reinventing the Apache request/response model. I've seen it go through that reinvention cycle in frameworks at least 2 times over my career, looks like this'll be a 3rd or 4th.
I have been deciding between encore and hono and looks like I'm going hono even though I find encore's take on services impressive but deployment would be expensive. 😅 Thanks for sharing that article and talking through it.
Should be good to mount your existing h3 app by importing hono from ''hono/quick", using its app.mount method, and then using the handle function from the hono aws-lambda package. They should both be wintercg compliant. I've been meaning to try it but veered off in another direction before I could experiment.
I run it without issues on lambda, I bundle with esbuild (to mjs) and deploy no prob. just use the aws adapter. I actually like to have an 'app.ts' and then 'node.ts' and 'lambda.ts' entry points (with esbuild config to match and build each bundle to dist/lambda and dist/node). Its a great setup.
it has 0 dependencys... well, it has, it just so happens that the TS compiler bundles them, and you'll always have dev dependencies while you are developing it, so they don't need to be in the dependencies list.....
Hono is exactly what I've been looking for. Radically simple and doesn't get in my way. Zero dependencies is a cherry on top.
nice! I've been using hono for our public facing api for about a year now - it's fantastic
Yeah it's awesome!
hono is fire 🔥
Hi AJ, nice video! Subscribed! One question, at 1:40 you state that it's easy to split a mono-lambda into single-functions. How would that work with Hono, especially if you want to use API Gateway but still want to have the full Hono routing in place when running locally?
@@DirkLuijk hey, thanks!! If you're all in on Hono you'd basically copy that code out to another Hono-powered function. The framework overhead is so low you'd likely not notice it vs vanilla JS
Hono has been alot of fun tbh
How many times in your project's lifetime do you move hosting providers?
@@Karan-zz8eh almost always at least once, from Lambda to Fargate. Rarely between cloud providers (though it does happen)
Had the same thought, but the other bog advantage of staying away from provider-specific integrations is that there is only 1 framework to adapt to, which makes it easier to drop in any open-source utilities. As long as it works with Hono (or Web API standards).
Thanks for diving in on this, I actually worked at a company that had thousands of lambdas using Serverless framework... Total mess, not to mention serverless framework is slow in general.
I've been thinking about that setup and hono definitely has the right ideas. The bundle size was massive, they all used
I also give massive props to the creator for using zod, which has become my goto in TS, it's simply fantastic.
Thanks! Yeah Hono has really hit something special here, I think it's doing a lot of the things we initially sought to do on the Serverless Framework which fell off after focus shifts revenue challenges.
Hi, a newbie here, why the size of the bundle of server side framework is important ?
Hey good question! It's because the size of your bundle directly impacts your cold start latency for serverless functions! I gave a whole talk on this at AWS re:Invent: ua-cam.com/video/2EDNcPvR45w/v-deo.html
Less code (assuming it's still doing similar work) will generally run faster than more code as it can take better advantage of CPU cache etc, "Locality of Reference" is a term to search further on the subject. JS is an interpreted language so less code to interpret also means faster startup times which is especially important on hosting platforms like "lambda" that can scale to zero
"context is everywhere now"... Nah, this is some folks reinventing the Apache request/response model. I've seen it go through that reinvention cycle in frameworks at least 2 times over my career, looks like this'll be a 3rd or 4th.
I'm trying to integrate Inertiajs into Honojs, please any assistance would be appreciated
I have been deciding between encore and hono and looks like I'm going hono even though I find encore's take on services impressive but deployment would be expensive. 😅
Thanks for sharing that article and talking through it.
Sure thing, glad you enjoyed it!
As a user of h3 I might check this Hono out for the AWS Lambda compatibility. Based on the demos, the Hono code reads like h3 too which is nice.
Should be good to mount your existing h3 app by importing hono from ''hono/quick", using its app.mount method, and then using the handle function from the hono aws-lambda package. They should both be wintercg compliant.
I've been meaning to try it but veered off in another direction before I could experiment.
I run it without issues on lambda, I bundle with esbuild (to mjs) and deploy no prob. just use the aws adapter. I actually like to have an 'app.ts' and then 'node.ts' and 'lambda.ts' entry points (with esbuild config to match and build each bundle to dist/lambda and dist/node). Its a great setup.
@@furycorp I also did a similar thing with Bun (somehow), can also vouch for the different entry point setup. Very convenient to do.
it has 0 dependencys... well, it has, it just so happens that the TS compiler bundles them, and you'll always have dev dependencies while you are developing it, so they don't need to be in the dependencies list.....
Great vid, subbed!
@@maddada thanks!
Hey AJ, do you do career mentoring?
Hey! not really, but I'm happy to answer any specific questions. You can DM me on twitter
last time I looked into it, the OpenAPi generation was not as good as Fastify Swagger plugin
Did you check their zodOpenAPI plugin?
Which one is the easiest ? i don't care the fastest
Zero dependencies 🙂
Fun fact : I visited the official site of Hono, searching for documentation ... On this site, it seems that the links are dead ....
Hono is trash
@@witness1013 what's missing?
Dependency injection is missing
@@moonwhisperer4804 not sure why your framework needs that? Just pass your dependencies as an arg?
@@astuyveyou can live without it for smaller projects. but it becomes a mess for much larger projects.
@@moonwhisperer4804skill issue