I Stopped Using Express.js: Because Bun and Hono 🔥

Ғылым және технология

Express has been around for almost as long as node has existed. It’s an awesome framework, it’s how I learned to make web servers in node and how i’ve been teaching people to make web servers for the past 8 years.
But it’s time to move on, because the alternatives are just so much better. It’s mind blowing how much the web has changed recently.
Chapters:
0:00​ Hono
0:42 Bun Server
1:52 Routing
3:33 Streaming
4:18 Middleware
4:50 JSX
6:32 Testing
8:21 Validation
Help support me make more videos: ko-fi.com/meechward
🔗
My Website: www.sammeechward.com
Instagram: / meech_ward
TikTok: / meech.s.ward
X: / meech_ward
Threads: www.threads.net/@meech_ward
Github: github.com/orgs/meech-ward

Пікірлер: 238

  • @romank1ng528
    @romank1ng5285 ай бұрын

    Amazing video! I don’t know if it’s just me but: being able to write your server logic in Typescript without extra tooling, the fact you can write JSX, just amazing, my only concern with these new and better technologies is compatibility with existing libraries and packages, maybe you could do a video addressing that

  • @raident29
    @raident294 ай бұрын

    JS developers change frameworks more often than they take a bath.

  • @jotaroisdarius1918

    @jotaroisdarius1918

    3 күн бұрын

    yeah this is getting rediculous lol

  • @ayushgogna9732
    @ayushgogna97325 ай бұрын

    i wanted to use hono for a time now but bun and hono combined looks crazy fun. I think the next project will be with bun and hono

  • @thequang9234
    @thequang92345 ай бұрын

    amazing demonstration Sam!

  • @Marujah07
    @Marujah075 ай бұрын

    Amazing! We’re waiting for a full Tutorial ;-)

  • @AjayYoutube-rz2so
    @AjayYoutube-rz2so6 ай бұрын

    Your content is really amazing, i would love to see a vite and hono full fledged tutorial.

  • @faahkoo
    @faahkoo5 ай бұрын

    looks so cool! I'm gonna try it out for sure, thanks for the info!

  • @hugodsa89
    @hugodsa894 ай бұрын

    Dude, super well paced and explained, mint.

  • @davidhombe2313
    @davidhombe23133 ай бұрын

    Gratefull, I'll waiting for your tutorial using Hono🤩

  • @ivv3393
    @ivv33934 ай бұрын

    The problem with this new tech is that the industry doesn't implement it. They stick with the OG tech. So spending time learning something like that could be wasting of time sadly.

  • @wobsoriano

    @wobsoriano

    4 ай бұрын

    yep

  • @tobeythepancake

    @tobeythepancake

    2 ай бұрын

    It’s pretty straight forward though, anyone with react and express knowledge will pick this up in an hour.

  • @Sammysapphira

    @Sammysapphira

    2 ай бұрын

    It doesn't take any time to learn this if you already know express. That was the point of bun, to supercede node, express, npm, but actually fast since it runs on zig.

  • @juststudying1019

    @juststudying1019

    Ай бұрын

    JS developers are sick to be honest they always run for new things without any need, searching for the perfect library or runtime or framework and they never find one or will. I am a js developer but the community is just too much, and I am not against developing more libraries that are better, but not hundred of solutions for the same problem and most of them are the same

  • @aldrickdev
    @aldrickdev5 ай бұрын

    the use of context reminds me of how Golang Web Frameworks like Gin and Echo work. Pretty nice!

  • @gusparr28

    @gusparr28

    5 ай бұрын

    Same here! I was looking for this comment

  • @fullstack_journey
    @fullstack_journey5 ай бұрын

    Subscribed for the hono+vite magic that you'll drop

  • @exapsy
    @exapsy5 ай бұрын

    amazing, seems like something's great is growing out of bun. im excited to see where it will go.

  • @mikebradbury3997
    @mikebradbury39975 ай бұрын

    Great video Sam, curious as to which keyboard you're using (i'm trying to find a silent one you can't hear over a microphone), thanks!

  • @ainulyaqin1958
    @ainulyaqin19582 ай бұрын

    that absolutely look great!, would be nice to see hono - monorepo tutorial :D

  • @koteelok2014
    @koteelok20145 ай бұрын

    Yo, can't wait for Hono+Vite+React setup tutorial!

  • @armandsalle8447

    @armandsalle8447

    5 ай бұрын

    I've tried a couple of time to make it works but failed! Can't wait to see the video!

  • @jarnathan-snow

    @jarnathan-snow

    4 ай бұрын

    Man just ditch React and Client frameworks once and for all. You have JSX on the server with these. What else do you need?

  • @voidmind

    @voidmind

    4 ай бұрын

    I'd love to see that too. Where I work, we use Next.js (page router) for a big web app and the DX is terrible. The dev server crashed at least one a day and take close to 2GB of memory. All I care about in Next if getServerSideProps(), so if I could use something lightweight to replace it, that would be awesome.

  • @ustav_o

    @ustav_o

    Ай бұрын

    beth stack but hono ​@@jarnathan-snow

  • @alaskandonut

    @alaskandonut

    Ай бұрын

    It’s here he just posted it. It was more of a walkthrough but so far has been very enjoyable.

  • @jjrise
    @jjrise4 ай бұрын

    we need more Hono videos! this was great!

  • @ArielBenichou
    @ArielBenichou27 күн бұрын

    ok you've sold me! next project will be with hono (bun i already use :D)

  • @7doors847
    @7doors8476 ай бұрын

    Great, as always. ✌️

  • @zunnoorainrafi5985
    @zunnoorainrafi59856 ай бұрын

    Bro will you make a full stack application using Bun, so that we can learn something from your experience

  • @dinckelman

    @dinckelman

    5 ай бұрын

    The way you can learn from this experience is if YOU make a full-stack app using Bun. His knowledge isn’t magically transferred into your head

  • @Agent_Six_

    @Agent_Six_

    5 ай бұрын

    Is it that you're not sure how full-stack works? Here. OPEN THE TERMINAL AND RUN > mkdir HotelTrivago > cd HotelTrivago > bun init > bun install express cors CREATE FILE CALLED "server.js" IN THE "HotelTrivago" FOLDER THEN BUILD AN API THAT SPITS OUT SOME TEXT USING THE BELOW CODE START CODE BLOCK const express = require('express'); const cors = require('cors'); const app = express(); app.use(cors()); app.get('/', (req, res) => { res.send("Trivago"); }); app.listen(3000, () => { console.log('listening on port 3000'); }); END CODE BLOCK BACK TO THE TERMINAL AND START UP THIS BAD BOY > bun server.js OPEN BROWSER AND GO TO 'localhost:3000/' AND BEHOLD, OUR SERVER/API HAS RESPONDED WITH THE WORD "Trivago" NOW WRITE A CLIENT APP THAT USES THIS API ENDPOINT CREATE AN "index.html" FILE ANYWHERE, OPEN WITH A TEXT EDITOR AND INSERT THIS MARKUP START MARKUP BLOCK async function clickityclickity() { let response = await fetch('localhost:3000'); let data = await response.text(); document.querySelector('p').innerHTML = data; } Hotel? Click Me END MARKUP BLOCK NOW OPEN "index.html" WITH A BROWSER CLICK THE BUTTON AND BEHOLD THE "Hotel?" TURNS INTO A "Trivago" FULL STACK, BABY

  • @easywest1
    @easywest15 ай бұрын

    Hono is awesome! Would love seeing more content on hono

  • @lukor-tech
    @lukor-tech5 ай бұрын

    The client/server type safety is a nice feature!

  • @misterlinuxfriendly947
    @misterlinuxfriendly9475 ай бұрын

    Nice intro! Well done.

  • @brunoacev
    @brunoacev6 ай бұрын

    that is soo good dud, i see yesterday.

  • @harryzachariou1
    @harryzachariou14 ай бұрын

    This is great! Is there support to integrate Bun into a AWS lambda runtime and Hono into an AWS lambda proxy?

  • @rmnkot
    @rmnkot5 ай бұрын

    It would be great to see the performance part in comparison with express, fastify on node to understand the capabilities of this modern framework

  • @blender_wiki

    @blender_wiki

    5 ай бұрын

    Google is your friend: "Node.js vs Deno vs Bun: Express hello world server benchmarking"

  • @2xxxtrem
    @2xxxtrem5 ай бұрын

    What are your thoughts on Hono vs. Elysia? What do you prefer about Hono?

  • @Fullflexno
    @Fullflexno5 ай бұрын

    Super Cool video! Subbed!

  • @CSkyGameGen
    @CSkyGameGen4 ай бұрын

    Yes we would love a tutorial on vite and hono please 🙏

  • @DoudouCircus
    @DoudouCircus4 ай бұрын

    That is very cool I usually use python for backend development but I am excited to try hono and bun

  • @tinypell3ts
    @tinypell3ts4 ай бұрын

    Great video! I would love to see a Hono, Vite, React tutorial.

  • @lastink444
    @lastink4442 ай бұрын

    Would be nice to see more vids on this topic

  • @pedapudiraviteja7388
    @pedapudiraviteja73882 ай бұрын

    Which cli and cli font are you using? I'm so obsessed with the fonts, ain't I?

  • @maguiskader7771
    @maguiskader77715 ай бұрын

    Outstanding 😊

  • @haroonalbar2725
    @haroonalbar27255 ай бұрын

    awesome content . subbed :)

  • @DaxSudo
    @DaxSudo5 ай бұрын

    yea i tried this ~ 12 - 18 months ago but couldnt stick w it for larger stuff glad the ecosystem has improved w it

  • @cyrilgeorge7818
    @cyrilgeorge78185 ай бұрын

    You know what I have an old express project, I will try migrating it to bun + hono . Want to see what are the gotchas in this combo.

  • @kodekorp2064
    @kodekorp20645 ай бұрын

    While bun is great, Bun is still reliant on one primary developer. I love bun and will continue to use it for smaller projects or side projects, but until it becomes reliable longevity wise, I prefer to stay with the standard tech for now for business focused work.

  • @WillDelish

    @WillDelish

    5 ай бұрын

    Luckily hono supports node too

  • @uchennaofoma4624

    @uchennaofoma4624

    5 ай бұрын

    ​@@WillDelishtrue

  • @juststudying1019

    @juststudying1019

    Ай бұрын

    JS developers are sick to be honest they always run for new things without any need, searching for the perfect library or runtime or framework and they never find one or will. I am a js developer but the community is just too much, and I am not against developing more libraries that are better, but not hundred of solutions for the same problem and most of them are the same

  • @aprilm2941
    @aprilm29416 ай бұрын

    You had me at “Because Bun” it’s always about the bun

  • @flipperiflop
    @flipperiflop5 ай бұрын

    Damn, Hono looks incredible!

  • @WillDelish
    @WillDelish5 ай бұрын

    Looove hono + bun combo. Also sprinkle some htmx and its pretty magical

  • @SamMeechWard

    @SamMeechWard

    5 ай бұрын

    Don’t forget drizzle

  • @damianjanus1990
    @damianjanus19905 ай бұрын

    More bun and Hono please! Maybe build full rest api with swagger, mongo and some sort of autorization it is be nice

  • @Hut-181
    @Hut-1812 ай бұрын

    What about the server folder you created at the start, Sam? 😁

  • @ChrisJaydenBeats
    @ChrisJaydenBeats3 ай бұрын

    Hono is beautiful. Been using it so much.

  • @brtk7
    @brtk74 ай бұрын

    Could you compare Hono and tRPC? It appears they both have similar capabilities. Thanks!

  • @VictorMongi
    @VictorMongi5 ай бұрын

    Hello sam, how about ElysiaJs?

  • @anasaitzouinet9699
    @anasaitzouinet9699Ай бұрын

    im always wanting to try bun , but i don't know if its stable for production yet or not

  • @jaymartinez311
    @jaymartinez3112 ай бұрын

    Tutorial for hono/vite if possible. Idk if you already did it but thanks ahead of timeif you are thinking about it.

  • @zlatkoiliev8927
    @zlatkoiliev89275 ай бұрын

    I am absolutely blown away! 😮 This is so much better than Node and Express! If they come up with a framework like Nest or Adonis with bun and hono, it will absolutely dominate the backend world!

  • @blkgames1447

    @blkgames1447

    4 ай бұрын

    Did you ever test elysia i'm looking for something performant and reliable

  • @crimsonautumnsun
    @crimsonautumnsun4 ай бұрын

    Is it sending a Server Sent Event stream with the stream.write stuff?

  • @kumarvishalben
    @kumarvishalben5 ай бұрын

    This is DOPE

  • @bipinsingh9318
    @bipinsingh93186 ай бұрын

    Great content

  • @darkoplax7688
    @darkoplax76886 ай бұрын

    I wish Bun had Windows and Nextjs support ... hopefully soon

  • @sujjee
    @sujjee5 ай бұрын

    Hey sam please make a comparison between Hono and ElysiaJS

  • @TechnologicNick
    @TechnologicNick5 ай бұрын

    I just had to rewrite a small webapp because Flask doesn't handle SSE nicely, and Bun + Hono works so much better. Thanks a lot for showing this setup!

  • @gryg666
    @gryg6665 ай бұрын

    Hah, I'm doing the same! With drizzle orm and vitest it's perfect stack for me.

  • @christianangelomsulit3759
    @christianangelomsulit37593 ай бұрын

    Is Bun.serve() necessary? when already using bun run --hot src/index.ts??

  • @blkgames1447
    @blkgames14474 ай бұрын

    What about elysia? Can you also review that project?

  • @Erandros
    @Erandros5 ай бұрын

    Do you get any memory leaks?

  • @natainditama
    @natainditama5 ай бұрын

    How about koa js. It's like similar with hono right ?

  • @kasper369
    @kasper3693 ай бұрын

    do you think hono is production read?

  • @uchennaofoma4624
    @uchennaofoma46245 ай бұрын

    One of the issues i still have with the validator is that your validator has to return strings (if you try a number itll just throw a ts error)

  • @kurniamassidik5798
    @kurniamassidik5798Ай бұрын

    since i only new about express js, could be more risk to implement this to my project, but i will try my best to use it from my next project

  • @nutrimindnutricion2474
    @nutrimindnutricion247414 күн бұрын

    Please more of hono.js 🙂

  • @BunnyMolester
    @BunnyMolester2 ай бұрын

    Hey Sam, how can we connect to a database while calling APIs

  • @cartermckay1509
    @cartermckay15094 ай бұрын

    Thanks!

  • @Bookingtr
    @Bookingtr5 ай бұрын

    With qwik can be good solution for full stack, how about SSR, IRS kinda things like NextJS. Thanks for tutorial, keep it up 🎉

  • @ayushgogna9732
    @ayushgogna97325 ай бұрын

    can you also make a video on elysiajs and bun

  • @danvilela
    @danvilela2 ай бұрын

    Hono seems cool, but after Sveltekit I can’t see me using another tool for api

  • @ChristianEscalante
    @ChristianEscalante5 ай бұрын

    I would like to see this working with vite, it sounds interesting.

  • @zb2747
    @zb27473 ай бұрын

    Being able to serve HTML using JSX instead of EJS or other template language is so good!!!

  • @swikarsharma3118
    @swikarsharma31185 ай бұрын

    never tried hono but tried elysia i was a pleasant experience

  • @NigelNindo
    @NigelNindo17 күн бұрын

    This looks great for use with HTMX with built in JSX

  • @mnchabel8402
    @mnchabel84024 ай бұрын

    Wow, this is nice I love hono

  • @saadowain3511
    @saadowain35115 ай бұрын

    Yes please make tutorial with react and hono

  • @NattaWang
    @NattaWang5 ай бұрын

    bun update command not update version numbers in package.json in my local, do you know how to fix it?

  • @gadgetboyplaysmc
    @gadgetboyplaysmc5 ай бұрын

    Have you tried Elysia? The DX is really amazing

  • @jarnathan-snow

    @jarnathan-snow

    4 ай бұрын

    it is not. Have you tried nesting guards?

  • @killerdroid99

    @killerdroid99

    4 ай бұрын

    ​@@jarnathan-snowyh that's a chore but I prefer beforehandle function

  • @sam3k
    @sam3k5 ай бұрын

    Would love to see the version with client side

  • @crimsonautumnsun
    @crimsonautumnsun4 ай бұрын

    How does it compare to Elysia?

  • @ajinkyax
    @ajinkyaxАй бұрын

    Thanks now I understand why Hono is better that ElisiaJS too 🎉

  • @debadipti
    @debadipti6 ай бұрын

    Hey Sam! Great video as always! I am curious how this works with bigger projects where I have JSX templates and layouts just like Next, but without all the hassle, it just renders HTML. I would appreciate if you could make a longer video on that.

  • @SamMeechWard

    @SamMeechWard

    6 ай бұрын

    It’s not opinionated like next, so you would just have to create your own layout components. You could make it work however you want but you wouldn’t get default caching behaviour or default 404 or error pages.

  • @debadipti

    @debadipti

    6 ай бұрын

    I don't think 404 pages or error pages are that much difficult to handle. But I can't say the same about caching. Caching seems very hard. If you could make a video on caching different parts of your website i.e mixing database caching, CDN caching and all that good stuff, that would be really good. @@SamMeechWard

  • @ronaldtejada8846
    @ronaldtejada88462 ай бұрын

    I'm interested in hono + react app and how the live together and interact

  • @makisetakashi
    @makisetakashi5 ай бұрын

    how to handle concurrency or multithread using Hono ?

  • @zenithdevgroup
    @zenithdevgroup5 ай бұрын

    Have they solved Bun not working with SSH-ed25519? I couldn't use Bun due to my SSH dependencies not working with it.

  • @limpep
    @limpep5 ай бұрын

    how does this compare to fastify?

  • @vickylance
    @vickylance5 ай бұрын

    what about security like helmet plugin?

  • @ArielBenichou
    @ArielBenichou27 күн бұрын

    do you have a video about exposing an ML (AI) model thourgh a JS/TS API?

  • @austinmudd6372
    @austinmudd63725 ай бұрын

    Could you make a video integrating tRPC with hono?

  • @JohnMcclaned
    @JohnMcclaned5 ай бұрын

    How do you feel about there only being basically 1 contributor to bun? Do you still recommend bun for production even though it doesn't pass the bus test?

  • @perc-ai

    @perc-ai

    4 ай бұрын

    Nope use deno …

  • @1apostoli
    @1apostoli4 ай бұрын

    Someone lmk what extension is showing errors right from inline

  • @trejohnson7677
    @trejohnson76775 ай бұрын

    Waku synergizes well af

  • @yoskokleng3658
    @yoskokleng36585 ай бұрын

    laravel with vue js using inertia js is stll awesome

  • @domw2391
    @domw23915 ай бұрын

    How hono vs Elysia?

  • @returnZeroo
    @returnZeroo5 ай бұрын

    waiting to watch a vite and hono full fledged tutorial

  • @shouryansharma
    @shouryansharmaАй бұрын

    error: Cannot find module "react/jsx-dev-runtime" from "/Users/sam/Documents/server/src/app.tsx"

  • @MattChinander
    @MattChinander3 ай бұрын

    Where can this be deployed?

  • @cholasimmons
    @cholasimmonsКүн бұрын

    Are you able to run a successful docker build with Bun? I've been bashing my head for the past 6 versions

  • @danlazer741
    @danlazer7413 ай бұрын

    I do trpc with zod and I don't get why I should use hono or bun unless there's a trpc hono adapter

  • @danlazer741

    @danlazer741

    3 ай бұрын

    And the fact I get 0 users lol

  • @ajdinpipo08
    @ajdinpipo085 ай бұрын

    It's kinda mix of express.js and golang. But anyway looks so cool and clean

  • @chhinsras
    @chhinsras3 ай бұрын

    how to make something like nodemon with hono + node

Келесі