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

Поділитися
Вставка
  • Опубліковано 17 лис 2024

КОМЕНТАРІ • 274

  • @romank1ng528
    @romank1ng528 10 місяців тому +63

    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

  • @AjayYoutube-rz2so
    @AjayYoutube-rz2so 10 місяців тому +55

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

  • @ayushgogna9732
    @ayushgogna9732 10 місяців тому +22

    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

  • @raident29
    @raident29 9 місяців тому +41

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

    • @jotaroisdarius1918
      @jotaroisdarius1918 4 місяці тому +1

      yeah this is getting rediculous lol

    • @TolyaBogomolov
      @TolyaBogomolov 4 місяці тому +3

      Express.JS is 14 years old. So, this is a little bit concerning. How can a human being survive without showering for 14 years straight?

    • @raident29
      @raident29 4 місяці тому +3

      @@TolyaBogomolov i see humor is lost to js devs

    • @malcolmn.5222
      @malcolmn.5222 4 місяці тому

      Why complain most of this stuff is free and you get to use something that you like.

  • @aldrickdev
    @aldrickdev 10 місяців тому +9

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

    • @gusparr28
      @gusparr28 10 місяців тому +2

      Same here! I was looking for this comment

  • @koteelok2014
    @koteelok2014 10 місяців тому +41

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

    • @armandsalle8447
      @armandsalle8447 10 місяців тому

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

    • @jarnathan-snow
      @jarnathan-snow 9 місяців тому +7

      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 9 місяців тому

      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 6 місяців тому

      beth stack but hono
      ​@@jarnathan-snow

    • @koteelok2014
      @koteelok2014 6 місяців тому

      @alaskandonut yoooo, thx bud

  • @zunnoorainrafi5985
    @zunnoorainrafi5985 10 місяців тому +55

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

    • @dinckelman
      @dinckelman 10 місяців тому +9

      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_ 10 місяців тому

      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

  • @Marujah07
    @Marujah07 10 місяців тому +8

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

  • @kodekorp2064
    @kodekorp2064 10 місяців тому +18

    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 10 місяців тому +5

      Luckily hono supports node too

    • @uchennaofoma4624
      @uchennaofoma4624 10 місяців тому

      ​@@WillDelishtrue

    • @juststudying1019
      @juststudying1019 6 місяців тому +1

      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

    • @pmrebel2733
      @pmrebel2733 2 місяці тому +1

      Today bun is good tomorrow there is something better and we all abandon bun😢

    • @SirusStarTV
      @SirusStarTV 26 днів тому

      ​@@juststudying1019 i want programming/computer things to not change for years, to not be deprecated. For programs/games to work on any future computers. For things to be reproducable on any computers.

  • @rmnkot
    @rmnkot 10 місяців тому +7

    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 9 місяців тому

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

  • @zlatkoiliev8927
    @zlatkoiliev8927 9 місяців тому +2

    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 9 місяців тому

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

  • @npx_riff_lift-g
    @npx_riff_lift-g 4 місяці тому

    Same here. Bun + Hono is such a nice combo. Easy to work with, and holy f-- it’s performant.

  • @ainulyaqin1958
    @ainulyaqin1958 7 місяців тому

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

  • @fullstack_journey
    @fullstack_journey 10 місяців тому +2

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

  • @ArielBenichou
    @ArielBenichou 5 місяців тому

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

  • @ivv3393
    @ivv3393 9 місяців тому +9

    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 9 місяців тому +1

      yep

    • @tobeythepancake
      @tobeythepancake 7 місяців тому +7

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

    • @Sammysapphira
      @Sammysapphira 7 місяців тому +1

      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 6 місяців тому +2

      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

    • @malcolmn.5222
      @malcolmn.5222 Місяць тому

      ​@@juststudying1019 you're complaining like you are making these solutions smh

  • @exapsy
    @exapsy 10 місяців тому

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

  • @cyrilgeorge7818
    @cyrilgeorge7818 10 місяців тому +2

    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.

  • @darkoplax7688
    @darkoplax7688 10 місяців тому +5

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

    • @fabrice9848
      @fabrice9848 2 місяці тому

      Just quit using Windows and start using Linux, you'll thank me later.

  • @xzex2609
    @xzex2609 2 дні тому

    wow this is awesome , specially the ability to write jsx ( I don't hate ejs but i wish that if it was jsx ) in the template engine. I hope to see more on this matter especially from you that obviously are very good at explaining . thanks bro

  • @WillDelish
    @WillDelish 10 місяців тому +1

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

  • @gadgetboyplaysmc
    @gadgetboyplaysmc 10 місяців тому +6

    Have you tried Elysia? The DX is really amazing

    • @jarnathan-snow
      @jarnathan-snow 9 місяців тому

      it is not. Have you tried nesting guards?

    • @killerdroid99
      @killerdroid99 9 місяців тому

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

  • @franka1154
    @franka1154 25 днів тому

    Sam- It seems that since this video was posted, Hono has changed a bit, requiring its "helpers" -- which include: stream(), streamText() and streamSSE() -- to now be imported (i.e.: import { stream, streamText, streamSSE } from 'hono/streaming') for your streaming example @T=3:35 to work. Otherwise, well done!! Thanks.

  • @jjrise
    @jjrise 9 місяців тому

    we need more Hono videos! this was great!

  • @chiqui1234ok
    @chiqui1234ok 3 місяці тому

    Thanks for showing the basic for a fresh start. Cheers!

  • @davidhombe2313
    @davidhombe2313 8 місяців тому

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

  • @danvilela
    @danvilela 7 місяців тому +1

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

  • @VictorMongi
    @VictorMongi 10 місяців тому +4

    Hello sam, how about ElysiaJs?

  • @hugodsa89
    @hugodsa89 9 місяців тому

    Dude, super well paced and explained, mint.

  • @thequang9234
    @thequang9234 9 місяців тому

    amazing demonstration Sam!

  • @jaymartinez311
    @jaymartinez311 7 місяців тому +1

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

  • @CSkyGameGen
    @CSkyGameGen 9 місяців тому

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

  • @tinypell3ts
    @tinypell3ts 9 місяців тому

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

  • @zb2747
    @zb2747 8 місяців тому

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

  • @flipperiflop
    @flipperiflop 10 місяців тому +1

    Damn, Hono looks incredible!

  • @lukor-tech
    @lukor-tech 10 місяців тому

    The client/server type safety is a nice feature!

  • @DoudouCircus
    @DoudouCircus 9 місяців тому

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

  • @aprilm2941
    @aprilm2941 10 місяців тому +2

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

  • @TechnologicNick
    @TechnologicNick 10 місяців тому +1

    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!

  • @Gadrawingz
    @Gadrawingz 2 місяці тому

    The future of us!

  • @damianjanus1990
    @damianjanus1990 10 місяців тому

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

  • @faahkoo
    @faahkoo 10 місяців тому

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

  • @easywest1
    @easywest1 10 місяців тому

    Hono is awesome! Would love seeing more content on hono

  • @ChrisJaydenBeats
    @ChrisJaydenBeats 8 місяців тому

    Hono is beautiful. Been using it so much.

  • @sujjee
    @sujjee 10 місяців тому +2

    Hey sam please make a comparison between Hono and ElysiaJS

  • @shouryansharma
    @shouryansharma 5 місяців тому

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

  • @brunoacev
    @brunoacev 10 місяців тому +1

    that is soo good dud, i see yesterday.

  • @DaxSudo
    @DaxSudo 10 місяців тому

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

  • @whodoneitx2x
    @whodoneitx2x 10 місяців тому +3

    Could you make a video integrating tRPC with hono?

  • @DamirSecki
    @DamirSecki 10 місяців тому +3

    You are going so fast... is hard to follow... but none the less... very valuable content. thanks

    • @blender_wiki
      @blender_wiki 9 місяців тому

      In YT you have a great option to slow down the playback speed of a video and also an advanced button called "pause".🤷🏿‍♀️🤷🏿‍♀️🤷🏿‍♀️

    • @DamirSecki
      @DamirSecki 9 місяців тому +1

      @@blender_wiki will this magic button also give all the context that I need? Is not the speed of the video that is fast... but the flow... but thanks for such a lovely condesending and mansplaining comment! We def. need more of these!

    • @mrcheeseguyman
      @mrcheeseguyman Місяць тому

      @@DamirSeckiyou need to watch some beginner videos first. If you are a developer this speed is fine

    • @DamirSecki
      @DamirSecki Місяць тому

      @@mrcheeseguyman I probably need to, yes....been dev only for 30 years....

    • @mrcheeseguyman
      @mrcheeseguyman Місяць тому

      @@DamirSeckiI don’t understand why you can’t follow his speed. I have been a developer for only 4 years and I have zero trouble following along

  • @misterlinuxfriendly947
    @misterlinuxfriendly947 10 місяців тому

    Nice intro! Well done.

  • @rohantunikipat6843
    @rohantunikipat6843 2 місяці тому

    Such a amazing tutorial

  • @ajinkyax
    @ajinkyax 6 місяців тому

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

  • @lastink444
    @lastink444 7 місяців тому

    Would be nice to see more vids on this topic

  • @kamalkamals
    @kamalkamals 2 місяці тому +1

    hono still has a loooot of issues like websocket implement and graphql like yoga with enable ws ...etc, so i cannot recommend hono for now

  • @pedapudiraviteja7388
    @pedapudiraviteja7388 7 місяців тому

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

  • @JohnMcclaned
    @JohnMcclaned 10 місяців тому +8

    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 9 місяців тому +2

      Nope use deno …

  • @Hut-181
    @Hut-181 7 місяців тому

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

  • @7doors847
    @7doors847 10 місяців тому +1

    Great, as always. ✌️

  • @harryzachariou1
    @harryzachariou1 9 місяців тому

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

  • @NigelNindo
    @NigelNindo 5 місяців тому

    This looks great for use with HTMX with built in JSX

  • @Badis-n2u
    @Badis-n2u 10 місяців тому +4

    I started to think that web dev is getting more broken with time,
    First, it was html css Javascript & php
    Then react angular express angular react vite mysql
    Today react express mongodb express nextjs nestjs bo fo ko do so & nono
    One year from now they will be +infinity

    • @Badis-n2u
      @Badis-n2u 10 місяців тому

      We will be done with mentel fog

    • @hba6018
      @hba6018 10 місяців тому

      Htmx

  • @Fullflexno
    @Fullflexno 9 місяців тому

    Super Cool video! Subbed!

  • @TianYuanEX
    @TianYuanEX 2 місяці тому

    Can hono be used in non serverless environments? Because if it can't how would you implement socket connections or anything that needs a longer connection

  • @StarsOfMinecrafttr
    @StarsOfMinecrafttr 10 місяців тому +2

    you may want to switch rust/axum it also looks like express but much faster and lightweight than ever, also supports multithreading with tokio

    • @uchennaofoma4624
      @uchennaofoma4624 10 місяців тому

      True, but we're in node/js land right now 🥲

  • @patrick_kabwe
    @patrick_kabwe 10 місяців тому +2

    Hi Sam,
    have you built a production app with bun? if yes how has been your experience?

    • @SamMeechWard
      @SamMeechWard  10 місяців тому +2

      It’s been awesome, only great things to say about using bun. I’ve been deploying to fly.io.

    • @patrick_kabwe
      @patrick_kabwe 10 місяців тому

      @@SamMeechWard Wow! will definitely try it. Thanks

    • @mdmathewdc
      @mdmathewdc 10 місяців тому +2

      Definites on what a production app is - if you mean an app with thousands of live users, then Bun isn't stable for that.

    • @patrick_kabwe
      @patrick_kabwe 10 місяців тому

      @@mdmathewdc Please share your experience.

    • @blender_wiki
      @blender_wiki 9 місяців тому +1

      We have few public API running with bun, it is just great.

  • @oleksiistri8429
    @oleksiistri8429 10 місяців тому

    idea about having context argument instead of req, res is actually convenient

  • @Bookingtr
    @Bookingtr 10 місяців тому

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

  • @brtk7
    @brtk7 9 місяців тому

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

  • @debadipti
    @debadipti 10 місяців тому +3

    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  10 місяців тому +3

      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 10 місяців тому +2

      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

  • @gryg666
    @gryg666 10 місяців тому +1

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

  • @BunnyMolester
    @BunnyMolester 7 місяців тому

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

  • @blkgames1447
    @blkgames1447 9 місяців тому

    What about elysia? Can you also review that project?

  • @cholasimmons
    @cholasimmons 4 місяці тому

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

  • @juststudying1019
    @juststudying1019 6 місяців тому

    Great video Sam, thanks.
    BUT
    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

  • @elephant_888
    @elephant_888 10 місяців тому

    There’s a Safari bug that prevents Bun web servers from successfully sending binary downloads like images and files to that web browser. 😢

  • @uchennaofoma4624
    @uchennaofoma4624 10 місяців тому

    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)

  • @Malcolm777-i
    @Malcolm777-i 8 місяців тому

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

  • @mehedihasanridoy1086
    @mehedihasanridoy1086 10 місяців тому +1

    What about database operations? I used it around 10 month ago. Only problem in that time i found is that db operation. I need to use totally raw operation. Express has mongoose ODM but i Don't find similar that

    • @elephant_888
      @elephant_888 10 місяців тому

      I’ve used Prisma with hono and bun. No problem.

    • @mehedihasanridoy1086
      @mehedihasanridoy1086 10 місяців тому

      @@elephant_888 can you share the setup docs?

    • @SamMeechWard
      @SamMeechWard  10 місяців тому

      try out drizzle.team

  • @anasaitzouinet9699
    @anasaitzouinet9699 6 місяців тому

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

  • @domw2391
    @domw2391 10 місяців тому +1

    How hono vs Elysia?

  • @zenithdevgroup
    @zenithdevgroup 10 місяців тому

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

  • @returnZeroo
    @returnZeroo 10 місяців тому +1

    waiting to watch a vite and hono full fledged tutorial

  • @kurniamassidik5798
    @kurniamassidik5798 6 місяців тому

    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

  • @NattaWang
    @NattaWang 10 місяців тому

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

  • @nutrimindnutricion2474
    @nutrimindnutricion2474 5 місяців тому

    Please more of hono.js
    🙂

  • @kumarvishalben
    @kumarvishalben 10 місяців тому +1

    This is DOPE

  • @vickylance
    @vickylance 9 місяців тому

    what about security like helmet plugin?

  • @swikarsharma3118
    @swikarsharma3118 10 місяців тому

    never tried hono but tried elysia i was a pleasant experience

  • @ajdinpipo08
    @ajdinpipo08 10 місяців тому +1

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

  • @ArielBenichou
    @ArielBenichou 5 місяців тому

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

  • @ayushgogna9732
    @ayushgogna9732 10 місяців тому +1

    can you also make a video on elysiajs and bun

  • @LeoWasHere1
    @LeoWasHere1 3 місяці тому

    can jsx work with htmx this way?

  • @MattChinander
    @MattChinander 8 місяців тому

    Where can this be deployed?

  • @crimsonautumnsun
    @crimsonautumnsun 9 місяців тому

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

  • @zuzukouzina-original
    @zuzukouzina-original 10 місяців тому

    I don’t think Express will miss you 😂
    You could’ve used NestJ, but hey it’s your choice.

  • @makisetakashi
    @makisetakashi 10 місяців тому

    how to handle concurrency or multithread using Hono ?

  • @ashimov1970
    @ashimov1970 8 місяців тому

    why hono, not bun-native elysia?

  • @seoky6
    @seoky6 3 місяці тому

    Have you tried ElysiaJS?

  • @crimsonautumnsun
    @crimsonautumnsun 9 місяців тому

    How does it compare to Elysia?