No video

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

  Рет қаралды 115,823

Sam Meech-Ward

Sam Meech-Ward

Күн бұрын

Пікірлер: 255
@romank1ng528
@romank1ng528 7 ай бұрын
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 8 ай бұрын
Your content is really amazing, i would love to see a vite and hono full fledged tutorial.
@ayushgogna9732
@ayushgogna9732 8 ай бұрын
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
@aldrickdev
@aldrickdev 8 ай бұрын
the use of context reminds me of how Golang Web Frameworks like Gin and Echo work. Pretty nice!
@gusparr28
@gusparr28 7 ай бұрын
Same here! I was looking for this comment
@koteelok2014
@koteelok2014 8 ай бұрын
Yo, can't wait for Hono+Vite+React setup tutorial!
@armandsalle8447
@armandsalle8447 8 ай бұрын
I've tried a couple of time to make it works but failed! Can't wait to see the video!
@jarnathan-snow
@jarnathan-snow 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 6 ай бұрын
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 4 ай бұрын
beth stack but hono ​@@jarnathan-snow
@alaskandonut
@alaskandonut 3 ай бұрын
It’s here he just posted it. It was more of a walkthrough but so far has been very enjoyable.
@zunnoorainrafi5985
@zunnoorainrafi5985 8 ай бұрын
Bro will you make a full stack application using Bun, so that we can learn something from your experience
@dinckelman
@dinckelman 7 ай бұрын
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_ 7 ай бұрын
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 8 ай бұрын
Amazing! We’re waiting for a full Tutorial ;-)
@rmnkot
@rmnkot 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 7 ай бұрын
Google is your friend: "Node.js vs Deno vs Bun: Express hello world server benchmarking"
@kodekorp2064
@kodekorp2064 8 ай бұрын
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 8 ай бұрын
Luckily hono supports node too
@uchennaofoma4624
@uchennaofoma4624 7 ай бұрын
​@@WillDelishtrue
@juststudying1019
@juststudying1019 3 ай бұрын
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 күн бұрын
Today bun is good tomorrow there is something better and we all abandon bun😢
@2xxxtrem
@2xxxtrem 8 ай бұрын
What are your thoughts on Hono vs. Elysia? What do you prefer about Hono?
@raident29
@raident29 7 ай бұрын
JS developers change frameworks more often than they take a bath.
@jotaroisdarius1918
@jotaroisdarius1918 2 ай бұрын
yeah this is getting rediculous lol
@TolyaBogomolov
@TolyaBogomolov Ай бұрын
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 Ай бұрын
@@TolyaBogomolov i see humor is lost to js devs
@malcolmn.5222
@malcolmn.5222 Ай бұрын
Why complain most of this stuff is free and you get to use something that you like.
@ivv3393
@ivv3393 6 ай бұрын
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 6 ай бұрын
yep
@tobeythepancake
@tobeythepancake 5 ай бұрын
It’s pretty straight forward though, anyone with react and express knowledge will pick this up in an hour.
@Sammysapphira
@Sammysapphira 4 ай бұрын
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 3 ай бұрын
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
@npx_riff_lift-g
@npx_riff_lift-g Ай бұрын
Same here. Bun + Hono is such a nice combo. Easy to work with, and holy f-- it’s performant.
@gadgetboyplaysmc
@gadgetboyplaysmc 7 ай бұрын
Have you tried Elysia? The DX is really amazing
@jarnathan-snow
@jarnathan-snow 7 ай бұрын
it is not. Have you tried nesting guards?
@killerdroid99
@killerdroid99 7 ай бұрын
​@@jarnathan-snowyh that's a chore but I prefer beforehandle function
@zlatkoiliev8927
@zlatkoiliev8927 7 ай бұрын
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 7 ай бұрын
Did you ever test elysia i'm looking for something performant and reliable
@fullstack_journey
@fullstack_journey 7 ай бұрын
Subscribed for the hono+vite magic that you'll drop
@chiqui1234ok
@chiqui1234ok 27 күн бұрын
Thanks for showing the basic for a fresh start. Cheers!
@ArielBenichou
@ArielBenichou 3 ай бұрын
ok you've sold me! next project will be with hono (bun i already use :D)
@thequang9234
@thequang9234 7 ай бұрын
amazing demonstration Sam!
@jaymartinez311
@jaymartinez311 4 ай бұрын
Tutorial for hono/vite if possible. Idk if you already did it but thanks ahead of timeif you are thinking about it.
@faahkoo
@faahkoo 8 ай бұрын
looks so cool! I'm gonna try it out for sure, thanks for the info!
@ainulyaqin1958
@ainulyaqin1958 4 ай бұрын
that absolutely look great!, would be nice to see hono - monorepo tutorial :D
@darkoplax7688
@darkoplax7688 8 ай бұрын
I wish Bun had Windows and Nextjs support ... hopefully soon
@VictorMongi
@VictorMongi 8 ай бұрын
Hello sam, how about ElysiaJs?
@hugodsa89
@hugodsa89 6 ай бұрын
Dude, super well paced and explained, mint.
@exapsy
@exapsy 7 ай бұрын
amazing, seems like something's great is growing out of bun. im excited to see where it will go.
@davidhombe2313
@davidhombe2313 5 ай бұрын
Gratefull, I'll waiting for your tutorial using Hono🤩
@aprilm2941
@aprilm2941 8 ай бұрын
You had me at “Because Bun” it’s always about the bun
@WillDelish
@WillDelish 8 ай бұрын
Looove hono + bun combo. Also sprinkle some htmx and its pretty magical
@SamMeechWard
@SamMeechWard 8 ай бұрын
Don’t forget drizzle
@cyrilgeorge7818
@cyrilgeorge7818 8 ай бұрын
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.
@danvilela
@danvilela 5 ай бұрын
Hono seems cool, but after Sveltekit I can’t see me using another tool for api
@sujjee
@sujjee 8 ай бұрын
Hey sam please make a comparison between Hono and ElysiaJS
@jjrise
@jjrise 6 ай бұрын
we need more Hono videos! this was great!
@DoudouCircus
@DoudouCircus 6 ай бұрын
That is very cool I usually use python for backend development but I am excited to try hono and bun
@ajinkyax
@ajinkyax 3 ай бұрын
Thanks now I understand why Hono is better that ElisiaJS too 🎉
@DamirSecki
@DamirSecki 8 ай бұрын
You are going so fast... is hard to follow... but none the less... very valuable content. thanks
@blender_wiki
@blender_wiki 7 ай бұрын
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 7 ай бұрын
@@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!
@CSkyGameGen
@CSkyGameGen 6 ай бұрын
Yes we would love a tutorial on vite and hono please 🙏
@flipperiflop
@flipperiflop 8 ай бұрын
Damn, Hono looks incredible!
@tinypell3ts
@tinypell3ts 6 ай бұрын
Great video! I would love to see a Hono, Vite, React tutorial.
@JohnMcclaned
@JohnMcclaned 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 6 ай бұрын
Nope use deno …
@NigelNindo
@NigelNindo 2 ай бұрын
This looks great for use with HTMX with built in JSX
@user-wr7ou8ih5s
@user-wr7ou8ih5s 8 ай бұрын
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
@user-wr7ou8ih5s
@user-wr7ou8ih5s 8 ай бұрын
We will be done with mentel fog
@hba6018
@hba6018 7 ай бұрын
Htmx
@zb2747
@zb2747 6 ай бұрын
Being able to serve HTML using JSX instead of EJS or other template language is so good!!!
@brunoacev
@brunoacev 8 ай бұрын
that is soo good dud, i see yesterday.
@pedapudiraviteja7388
@pedapudiraviteja7388 4 ай бұрын
Which cli and cli font are you using? I'm so obsessed with the fonts, ain't I?
@DaxSudo
@DaxSudo 7 ай бұрын
yea i tried this ~ 12 - 18 months ago but couldnt stick w it for larger stuff glad the ecosystem has improved w it
@easywest1
@easywest1 8 ай бұрын
Hono is awesome! Would love seeing more content on hono
@kurniamassidik5798
@kurniamassidik5798 3 ай бұрын
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
@whodoneitx2x
@whodoneitx2x 8 ай бұрын
Could you make a video integrating tRPC with hono?
@gryg666
@gryg666 8 ай бұрын
Hah, I'm doing the same! With drizzle orm and vitest it's perfect stack for me.
@7doors847
@7doors847 8 ай бұрын
Great, as always. ✌️
@shouryansharma
@shouryansharma 3 ай бұрын
error: Cannot find module "react/jsx-dev-runtime" from "/Users/sam/Documents/server/src/app.tsx"
@ChrisJaydenBeats
@ChrisJaydenBeats 6 ай бұрын
Hono is beautiful. Been using it so much.
@harryzachariou1
@harryzachariou1 7 ай бұрын
This is great! Is there support to integrate Bun into a AWS lambda runtime and Hono into an AWS lambda proxy?
@lukor-tech
@lukor-tech 7 ай бұрын
The client/server type safety is a nice feature!
@cholasimmons
@cholasimmons 2 ай бұрын
Are you able to run a successful docker build with Bun? I've been bashing my head for the past 6 versions
@lastink444
@lastink444 4 ай бұрын
Would be nice to see more vids on this topic
@damianjanus1990
@damianjanus1990 7 ай бұрын
More bun and Hono please! Maybe build full rest api with swagger, mongo and some sort of autorization it is be nice
@Fullflexno
@Fullflexno 7 ай бұрын
Super Cool video! Subbed!
@mehedihasanridoy1086
@mehedihasanridoy1086 8 ай бұрын
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 8 ай бұрын
I’ve used Prisma with hono and bun. No problem.
@mehedihasanridoy1086
@mehedihasanridoy1086 8 ай бұрын
@@elephant_888 can you share the setup docs?
@SamMeechWard
@SamMeechWard 8 ай бұрын
try out drizzle.team
@nutrimindnutricion2474
@nutrimindnutricion2474 2 ай бұрын
Please more of hono.js 🙂
@misterlinuxfriendly947
@misterlinuxfriendly947 7 ай бұрын
Nice intro! Well done.
@ayushgogna9732
@ayushgogna9732 8 ай бұрын
can you also make a video on elysiajs and bun
@brtk7
@brtk7 6 ай бұрын
Could you compare Hono and tRPC? It appears they both have similar capabilities. Thanks!
@ArielBenichou
@ArielBenichou 3 ай бұрын
do you have a video about exposing an ML (AI) model thourgh a JS/TS API?
@patrick_kabwe
@patrick_kabwe 8 ай бұрын
Hi Sam, have you built a production app with bun? if yes how has been your experience?
@SamMeechWard
@SamMeechWard 8 ай бұрын
It’s been awesome, only great things to say about using bun. I’ve been deploying to fly.io.
@patrick_kabwe
@patrick_kabwe 8 ай бұрын
@@SamMeechWard Wow! will definitely try it. Thanks
@mdmathewdc
@mdmathewdc 8 ай бұрын
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 8 ай бұрын
@@mdmathewdc Please share your experience.
@blender_wiki
@blender_wiki 7 ай бұрын
We have few public API running with bun, it is just great.
@TechnologicNick
@TechnologicNick 8 ай бұрын
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!
@Bookingtr
@Bookingtr 7 ай бұрын
With qwik can be good solution for full stack, how about SSR, IRS kinda things like NextJS. Thanks for tutorial, keep it up 🎉
@uchennaofoma4624
@uchennaofoma4624 7 ай бұрын
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)
@domw2391
@domw2391 7 ай бұрын
How hono vs Elysia?
@juststudying1019
@juststudying1019 3 ай бұрын
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
@Hut-181
@Hut-181 4 ай бұрын
What about the server folder you created at the start, Sam? 😁
@StarsOfMinecrafttr
@StarsOfMinecrafttr 8 ай бұрын
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 7 ай бұрын
True, but we're in node/js land right now 🥲
@debadipti
@debadipti 8 ай бұрын
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 8 ай бұрын
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 8 ай бұрын
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
@christianangelomsulit3759
@christianangelomsulit3759 5 ай бұрын
Is Bun.serve() necessary? when already using bun run --hot src/index.ts??
@anasaitzouinet9699
@anasaitzouinet9699 3 ай бұрын
im always wanting to try bun , but i don't know if its stable for production yet or not
@BunnyMolester
@BunnyMolester 4 ай бұрын
Hey Sam, how can we connect to a database while calling APIs
@zuzukouzina-original
@zuzukouzina-original 7 ай бұрын
I don’t think Express will miss you 😂 You could’ve used NestJ, but hey it’s your choice.
@danlazer741
@danlazer741 5 ай бұрын
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 5 ай бұрын
And the fact I get 0 users lol
@elephant_888
@elephant_888 8 ай бұрын
There’s a Safari bug that prevents Bun web servers from successfully sending binary downloads like images and files to that web browser. 😢
@haroonalbar2725
@haroonalbar2725 7 ай бұрын
awesome content . subbed :)
@carlosricardoziegler2650
@carlosricardoziegler2650 8 ай бұрын
How about ElisiaJS ? Some insights ?
@shiningview
@shiningview 6 ай бұрын
Its developed by one person. Just like express.js
@returnZeroo
@returnZeroo 8 ай бұрын
waiting to watch a vite and hono full fledged tutorial
@kumarvishalben
@kumarvishalben 8 ай бұрын
This is DOPE
@blkgames1447
@blkgames1447 7 ай бұрын
What about elysia? Can you also review that project?
@zenithdevgroup
@zenithdevgroup 7 ай бұрын
Have they solved Bun not working with SSH-ed25519? I couldn't use Bun due to my SSH dependencies not working with it.
@seoky6
@seoky6 23 күн бұрын
Have you tried ElysiaJS?
@chiqui1234ok
@chiqui1234ok 24 күн бұрын
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 24 күн бұрын
Data though params (GET variables) works ok.
@chiqui1234ok
@chiqui1234ok 24 күн бұрын
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 24 күн бұрын
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
@ajdinpipo08
@ajdinpipo08 8 ай бұрын
It's kinda mix of express.js and golang. But anyway looks so cool and clean
@ronaldtejada8846
@ronaldtejada8846 4 ай бұрын
I'm interested in hono + react app and how the live together and interact
@ChristianEscalante
@ChristianEscalante 7 ай бұрын
I would like to see this working with vite, it sounds interesting.
@swikarsharma3118
@swikarsharma3118 7 ай бұрын
never tried hono but tried elysia i was a pleasant experience
@nathanschmidt1988
@nathanschmidt1988 3 ай бұрын
What clipboard manager to copy paste is he using?
@SamMeechWard
@SamMeechWard 3 ай бұрын
alfred
@LeoWasHere1
@LeoWasHere1 18 күн бұрын
can jsx work with htmx this way?
@oleksiistri8429
@oleksiistri8429 7 ай бұрын
idea about having context argument instead of req, res is actually convenient
@ashimov1970
@ashimov1970 5 ай бұрын
why hono, not bun-native elysia?
@makisetakashi
@makisetakashi 7 ай бұрын
how to handle concurrency or multithread using Hono ?
@chhinsras
@chhinsras 5 ай бұрын
how to make something like nodemon with hono + node
@crimsonautumnsun
@crimsonautumnsun 7 ай бұрын
Is it sending a Server Sent Event stream with the stream.write stuff?
@mnchabel8402
@mnchabel8402 6 ай бұрын
Wow, this is nice I love hono
Go vs Rust vs Bun vs Node | Prime Reacts
18:07
ThePrimeTime
Рет қаралды 168 М.
Чёрная ДЫРА 🕳️ | WICSUR #shorts
00:49
Бискас
Рет қаралды 6 МЛН
The CUTEST flower girl on YouTube (2019-2024)
00:10
Hungry FAM
Рет қаралды 7 МЛН
هذه الحلوى قد تقتلني 😱🍬
00:22
Cool Tool SHORTS Arabic
Рет қаралды 61 МЛН
Bash? Nah, I Have Bun.
12:38
Theo - t3․gg
Рет қаралды 72 М.
A Better Way to Write APIs?
12:00
Josh tried coding
Рет қаралды 93 М.
Bun 1.0 Release | Prime Reacts
17:36
ThePrimeTime
Рет қаралды 203 М.
Every Developer Needs a Raspberry Pi
27:27
Sam Meech-Ward
Рет қаралды 447 М.
DO NOT USE BUN (bun install is good dough)
17:54
strager
Рет қаралды 142 М.
Why Signals Are Better Than React Hooks
16:30
Web Dev Simplified
Рет қаралды 472 М.
Bun is disrupting JavaScript land
4:30
Fireship
Рет қаралды 979 М.
Turns out REST APIs weren't the answer (and that's OK!)
10:38
Dylan Beattie
Рет қаралды 152 М.
The cloud is over-engineered and overpriced (no music)
14:39
Tom Delalande
Рет қаралды 564 М.
Чёрная ДЫРА 🕳️ | WICSUR #shorts
00:49
Бискас
Рет қаралды 6 МЛН