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

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

КОМЕНТАРІ • 277

  • @romank1ng528
    @romank1ng528 11 місяців тому +66

    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
    @raident29 11 місяців тому +55

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

    • @jotaroisdarius1918
      @jotaroisdarius1918 6 місяців тому +2

      yeah this is getting rediculous lol

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

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

      @@TolyaBogomolov i see humor is lost to js devs

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

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

  • @ayushgogna9732
    @ayushgogna9732 Рік тому +23

    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

  • @AjayYoutube-rz2so
    @AjayYoutube-rz2so Рік тому +56

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

  • @zunnoorainrafi5985
    @zunnoorainrafi5985 Рік тому +55

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

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

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

      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

  • @aldrickdev
    @aldrickdev Рік тому +9

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

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

      Same here! I was looking for this comment

  • @koteelok2014
    @koteelok2014 Рік тому +41

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

    • @armandsalle8447
      @armandsalle8447 Рік тому

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

    • @jarnathan-snow
      @jarnathan-snow 11 місяців тому +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 11 місяців тому

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

      beth stack but hono
      ​@@jarnathan-snow

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

      @alaskandonut yoooo, thx bud

  • @Marujah07
    @Marujah07 Рік тому +8

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

  • @rmnkot
    @rmnkot 11 місяців тому +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 11 місяців тому

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

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

    amazing demonstration Sam!

  • @cyrilgeorge7818
    @cyrilgeorge7818 Рік тому +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.

  • @kodekorp2064
    @kodekorp2064 Рік тому +19

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

      ​@@WillDelishtrue

    • @juststudying1019
      @juststudying1019 8 місяців тому +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 4 місяці тому +1

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

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

      ​@@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.

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

    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.

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

    Have you tried Elysia? The DX is really amazing

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

      it is not. Have you tried nesting guards?

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

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

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

    I always use a library called "nock" for writing tests for HTTP requests so i can mock external http requests in the "network" level. would be nice to see if that works out of the box or if there are some other library that can do that. would be wicked.

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

    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

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

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

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

    Dude, super well paced and explained, mint.

  • @VictorMongi
    @VictorMongi Рік тому +5

    Hello sam, how about ElysiaJs?

  • @cartermckay1509
    @cartermckay1509 11 місяців тому

    Thanks!

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  • @sujjee
    @sujjee Рік тому +2

    Hey sam please make a comparison between Hono and ElysiaJS

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

    we need more Hono videos! this was great!

  • @faahkoo
    @faahkoo Рік тому

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

  • @kamalkamals
    @kamalkamals 3 місяці тому +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

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

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

  • @whodoneitx2x
    @whodoneitx2x Рік тому +3

    Could you make a video integrating tRPC with hono?

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

    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)

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

    Such a amazing tutorial

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

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

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

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

  • @elephant_888
    @elephant_888 Рік тому

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

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

    Someone lmk what extension is showing errors right from inline

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

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

  • @ayushgogna9732
    @ayushgogna9732 Рік тому +1

    can you also make a video on elysiajs and bun

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

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

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

    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

  • @FuzailShaikh
    @FuzailShaikh 6 днів тому

    I’ve been using fastify already, do you know some use cases where hono would be preferable compared to fastify?

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

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

  • @WillDelish
    @WillDelish Рік тому +1

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

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

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

  • @aprilm2941
    @aprilm2941 Рік тому +2

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

  • @JohnMcclaned
    @JohnMcclaned Рік тому +9

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

      Nope use deno …

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

    The client/server type safety is a nice feature!

  • @mehedihasanridoy1086
    @mehedihasanridoy1086 Рік тому +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

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

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

  • @easywest1
    @easywest1 Рік тому

    Hono is awesome! Would love seeing more content on hono

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

    Would be nice to see more vids on this topic

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

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

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

    What about elysia? Can you also review that project?

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

    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

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

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

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

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

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

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

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

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

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

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

  • @patrick_kabwe
    @patrick_kabwe Рік тому +2

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

    • @SamMeechWard
      @SamMeechWard  Рік тому +2

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

    • @patrick_kabwe
      @patrick_kabwe Рік тому

      @@SamMeechWard Wow! will definitely try it. Thanks

    • @mdmathewdc
      @mdmathewdc Рік тому +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 Рік тому

      @@mdmathewdc Please share your experience.

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

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

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

    Nice intro! Well done.

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

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

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

    Hono is beautiful. Been using it so much.

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

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

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

    Super Cool video! Subbed!

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

    why hono, not bun-native elysia?

  • @brunoacev
    @brunoacev Рік тому +1

    that is soo good dud, i see yesterday.

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

    The future of us!

  • @ChristianEscalante
    @ChristianEscalante 11 місяців тому

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

  • @flipperiflop
    @flipperiflop Рік тому +1

    Damn, Hono looks incredible!

  • @darkoplax7688
    @darkoplax7688 Рік тому +5

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

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

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

  • @makisetakashi
    @makisetakashi Рік тому

    how to handle concurrency or multithread using Hono ?

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

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

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

    what about security like helmet plugin?

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

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

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

    This looks great for use with HTMX with built in JSX

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

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

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

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

  • @7doors847
    @7doors847 Рік тому +1

    Great, as always. ✌️

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

    Hi again, I'm testing Bun and I already setted up half of JWT. But right now I want to make my register and login routes. Finded out c.req.query('user') and c.req.query('password') didn't retrieve anything. I'm sending those two variables through Postman in form-urlencoded (as always). Anybody finds the solution? In Node + Express was app.use(express.json()) in the main javascript file, but here I don't know if I need some method like this, or maybe I'm doing something wrong...
    Thanks

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

      Data though params (GET variables) works ok.

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

      Ok, I get body/post/form-urlencode variables thanks to:
      await c.req.parseBody()
      or:
      await c.req.formData()
      That's weird AF, anyone has another way to get form data? This way I showed you, looks sketchy. I never needed a Promise to get form data in NodeJs+Express lol

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

      in "Validation" section they didn't mention (and even the data model seems different) we need to get body/form data in the way I showed you. :O Damn, something it's looking bad haha

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

    how to make something like nodemon with hono + node

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

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

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

    never tried hono but tried elysia i was a pleasant experience

  • @natainditama
    @natainditama Рік тому

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

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

    can jsx work with htmx this way?

  • @carlosricardoziegler2650
    @carlosricardoziegler2650 Рік тому +1

    How about ElisiaJS ? Some insights ?

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

      Its developed by one person. Just like express.js

  • @haroonalbar2725
    @haroonalbar2725 11 місяців тому

    awesome content . subbed :)

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

    How hono vs Elysia?

  • @TechnologicNick
    @TechnologicNick Рік тому +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!

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

    do you think hono is production read?

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

    How does it compare to Elysia?

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

    Please more of hono.js
    🙂

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

    Where can this be deployed?

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

    Have you tried ElysiaJS?

  • @zlatkoiliev8927
    @zlatkoiliev8927 11 місяців тому +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 11 місяців тому

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

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

    Make a video on how to deploy it