Тёмный

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

Sam Meech-Ward
Подписаться 84 тыс.
Просмотров 101 тыс.
50% 1

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

Наука

Опубликовано:

 

1 июн 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 230   
@romank1ng528
@romank1ng528 4 месяца назад
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 5 месяцев назад
Your content is really amazing, i would love to see a vite and hono full fledged tutorial.
@ayushgogna9732
@ayushgogna9732 5 месяцев назад
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
@faahkoo
@faahkoo 5 месяцев назад
looks so cool! I'm gonna try it out for sure, thanks for the info!
@thequang9234
@thequang9234 4 месяца назад
amazing demonstration Sam!
@Marujah07
@Marujah07 5 месяцев назад
Amazing! We’re waiting for a full Tutorial ;-)
@hugodsa89
@hugodsa89 3 месяца назад
Dude, super well paced and explained, mint.
@davidhombe2313
@davidhombe2313 2 месяца назад
Gratefull, I'll waiting for your tutorial using Hono🤩
@ainulyaqin1958
@ainulyaqin1958 Месяц назад
that absolutely look great!, would be nice to see hono - monorepo tutorial :D
@zunnoorainrafi5985
@zunnoorainrafi5985 5 месяцев назад
Bro will you make a full stack application using Bun, so that we can learn something from your experience
@dinckelman
@dinckelman 4 месяца назад
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_ 4 месяца назад
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
@mikebradbury3997
@mikebradbury3997 4 месяца назад
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!
@fullstack_journey
@fullstack_journey 4 месяца назад
Subscribed for the hono+vite magic that you'll drop
@ArielBenichou
@ArielBenichou 4 дня назад
ok you've sold me! next project will be with hono (bun i already use :D)
@koteelok2014
@koteelok2014 5 месяцев назад
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.
@aldrickdev
@aldrickdev 5 месяцев назад
the use of context reminds me of how Golang Web Frameworks like Gin and Echo work. Pretty nice!
@gusparr28
@gusparr28 4 месяца назад
Same here! I was looking for this comment
@jjrise
@jjrise 3 месяца назад
we need more Hono videos! this was great!
@exapsy
@exapsy 4 месяца назад
amazing, seems like something's great is growing out of bun. im excited to see where it will go.
@easywest1
@easywest1 5 месяцев назад
Hono is awesome! Would love seeing more content on hono
@ivv3393
@ivv3393 3 месяца назад
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 3 месяца назад
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 Месяц назад
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
@lukor-tech
@lukor-tech 4 месяца назад
The client/server type safety is a nice feature!
@CSkyGameGen
@CSkyGameGen 3 месяца назад
Yes we would love a tutorial on vite and hono please 🙏
@raident29
@raident29 4 месяца назад
JS developers change frameworks more often than they take a bath.
@rmnkot
@rmnkot 4 месяца назад
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 4 месяца назад
Google is your friend: "Node.js vs Deno vs Bun: Express hello world server benchmarking"
@harryzachariou1
@harryzachariou1 4 месяца назад
This is great! Is there support to integrate Bun into a AWS lambda runtime and Hono into an AWS lambda proxy?
@misterlinuxfriendly947
@misterlinuxfriendly947 4 месяца назад
Nice intro! Well done.
@Fullflexno
@Fullflexno 4 месяца назад
Super Cool video! Subbed!
@tinypell3ts
@tinypell3ts 3 месяца назад
Great video! I would love to see a Hono, Vite, React tutorial.
@lastink444
@lastink444 Месяц назад
Would be nice to see more vids on this topic
@cyrilgeorge7818
@cyrilgeorge7818 5 месяцев назад
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.
@2xxxtrem
@2xxxtrem 5 месяцев назад
What are your thoughts on Hono vs. Elysia? What do you prefer about Hono?
@DoudouCircus
@DoudouCircus 3 месяца назад
That is very cool I usually use python for backend development but I am excited to try hono and bun
@7doors847
@7doors847 5 месяцев назад
Great, as always. ✌️
@haroonalbar2725
@haroonalbar2725 4 месяца назад
awesome content . subbed :)
@brunoacev
@brunoacev 5 месяцев назад
that is soo good dud, i see yesterday.
@ChrisJaydenBeats
@ChrisJaydenBeats 3 месяца назад
Hono is beautiful. Been using it so much.
@VictorMongi
@VictorMongi 5 месяцев назад
Hello sam, how about ElysiaJs?
@flipperiflop
@flipperiflop 5 месяцев назад
Damn, Hono looks incredible!
@kodekorp2064
@kodekorp2064 5 месяцев назад
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 4 месяца назад
​@@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
@crimsonautumnsun
@crimsonautumnsun 4 месяца назад
Is it sending a Server Sent Event stream with the stream.write stuff?
@pedapudiraviteja7388
@pedapudiraviteja7388 Месяц назад
Which cli and cli font are you using? I'm so obsessed with the fonts, ain't I?
@WillDelish
@WillDelish 5 месяцев назад
Looove hono + bun combo. Also sprinkle some htmx and its pretty magical
@SamMeechWard
@SamMeechWard 5 месяцев назад
Don’t forget drizzle
@Hut-181
@Hut-181 Месяц назад
What about the server folder you created at the start, Sam? 😁
@DaxSudo
@DaxSudo 4 месяца назад
yea i tried this ~ 12 - 18 months ago but couldnt stick w it for larger stuff glad the ecosystem has improved w it
@damianjanus1990
@damianjanus1990 4 месяца назад
More bun and Hono please! Maybe build full rest api with swagger, mongo and some sort of autorization it is be nice
@brtk7
@brtk7 3 месяца назад
Could you compare Hono and tRPC? It appears they both have similar capabilities. Thanks!
@jaymartinez311
@jaymartinez311 Месяц назад
Tutorial for hono/vite if possible. Idk if you already did it but thanks ahead of timeif you are thinking about it.
@anasaitzouinet9699
@anasaitzouinet9699 21 день назад
im always wanting to try bun , but i don't know if its stable for production yet or not
@zlatkoiliev8927
@zlatkoiliev8927 4 месяца назад
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
@blkgames1447
@blkgames1447 4 месяца назад
What about elysia? Can you also review that project?
@christianangelomsulit3759
@christianangelomsulit3759 2 месяца назад
Is Bun.serve() necessary? when already using bun run --hot src/index.ts??
@NattaWang
@NattaWang 4 месяца назад
bun update command not update version numbers in package.json in my local, do you know how to fix it?
@darkoplax7688
@darkoplax7688 5 месяцев назад
I wish Bun had Windows and Nextjs support ... hopefully soon
@debadipti
@debadipti 5 месяцев назад
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 5 месяцев назад
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 5 месяцев назад
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
@zenithdevgroup
@zenithdevgroup 4 месяца назад
Have they solved Bun not working with SSH-ed25519? I couldn't use Bun due to my SSH dependencies not working with it.
@aprilm2941
@aprilm2941 5 месяцев назад
You had me at “Because Bun” it’s always about the bun
@natainditama
@natainditama 5 месяцев назад
How about koa js. It's like similar with hono right ?
@Bookingtr
@Bookingtr 4 месяца назад
With qwik can be good solution for full stack, how about SSR, IRS kinda things like NextJS. Thanks for tutorial, keep it up 🎉
@sujjee
@sujjee 5 месяцев назад
Hey sam please make a comparison between Hono and ElysiaJS
@BunnyMolester
@BunnyMolester Месяц назад
Hey Sam, how can we connect to a database while calling APIs
@zb2747
@zb2747 3 месяца назад
Being able to serve HTML using JSX instead of EJS or other template language is so good!!!
@mnchabel8402
@mnchabel8402 3 месяца назад
Wow, this is nice I love hono
@gryg666
@gryg666 5 месяцев назад
Hah, I'm doing the same! With drizzle orm and vitest it's perfect stack for me.
@maguiskader7771
@maguiskader7771 5 месяцев назад
Outstanding 😊
@kurniamassidik5798
@kurniamassidik5798 12 дней назад
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
@uchennaofoma4624
@uchennaofoma4624 4 месяца назад
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)
@ChristianEscalante
@ChristianEscalante 4 месяца назад
I would like to see this working with vite, it sounds interesting.
@saadowain3511
@saadowain3511 4 месяца назад
Yes please make tutorial with react and hono
@gadgetboyplaysmc
@gadgetboyplaysmc 4 месяца назад
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
@patrick_kabwe
@patrick_kabwe 5 месяцев назад
Hi Sam, have you built a production app with bun? if yes how has been your experience?
@SamMeechWard
@SamMeechWard 5 месяцев назад
It’s been awesome, only great things to say about using bun. I’ve been deploying to fly.io.
@patrick_kabwe
@patrick_kabwe 5 месяцев назад
@@SamMeechWard Wow! will definitely try it. Thanks
@mdmathewdc
@mdmathewdc 5 месяцев назад
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 5 месяцев назад
@@mdmathewdc Please share your experience.
@blender_wiki
@blender_wiki 4 месяца назад
We have few public API running with bun, it is just great.
@JohnMcclaned
@JohnMcclaned 5 месяцев назад
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 3 месяца назад
Nope use deno …
@TechnologicNick
@TechnologicNick 5 месяцев назад
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!
@austinmudd6372
@austinmudd6372 5 месяцев назад
Could you make a video integrating tRPC with hono?
@ajinkyax
@ajinkyax 27 дней назад
Thanks now I understand why Hono is better that ElisiaJS too 🎉
@elephant_888
@elephant_888 5 месяцев назад
There’s a Safari bug that prevents Bun web servers from successfully sending binary downloads like images and files to that web browser. 😢
@kasper369
@kasper369 2 месяца назад
do you think hono is production read?
@sam3k
@sam3k 4 месяца назад
Would love to see the version with client side
@swikarsharma3118
@swikarsharma3118 4 месяца назад
never tried hono but tried elysia i was a pleasant experience
@shouryansharma
@shouryansharma 10 дней назад
error: Cannot find module "react/jsx-dev-runtime" from "/Users/sam/Documents/server/src/app.tsx"
@kumarvishalben
@kumarvishalben 5 месяцев назад
This is DOPE
@danvilela
@danvilela 2 месяца назад
Hono seems cool, but after Sveltekit I can’t see me using another tool for api
@crimsonautumnsun
@crimsonautumnsun 4 месяца назад
How does it compare to Elysia?
@bipinsingh9318
@bipinsingh9318 5 месяцев назад
Great content
@Erandros
@Erandros 4 месяца назад
Do you get any memory leaks?
@ayushgogna9732
@ayushgogna9732 5 месяцев назад
can you also make a video on elysiajs and bun
@mehedihasanridoy1086
@mehedihasanridoy1086 5 месяцев назад
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 5 месяцев назад
I’ve used Prisma with hono and bun. No problem.
@mehedihasanridoy1086
@mehedihasanridoy1086 5 месяцев назад
@@elephant_888 can you share the setup docs?
@SamMeechWard
@SamMeechWard 5 месяцев назад
try out drizzle.team
@vickylance
@vickylance 4 месяца назад
what about security like helmet plugin?
@ronaldtejada8846
@ronaldtejada8846 Месяц назад
I'm interested in hono + react app and how the live together and interact
@ArielBenichou
@ArielBenichou 4 дня назад
do you have a video about exposing an ML (AI) model thourgh a JS/TS API?
@makisetakashi
@makisetakashi 5 месяцев назад
how to handle concurrency or multithread using Hono ?
@limpep
@limpep 5 месяцев назад
how does this compare to fastify?
@yoskokleng3658
@yoskokleng3658 4 месяца назад
laravel with vue js using inertia js is stll awesome
@danlazer741
@danlazer741 2 месяца назад
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 2 месяца назад
And the fact I get 0 users lol
@ReyLamurin
@ReyLamurin 5 месяцев назад
Hono!! Another Javascript framework!!
@trejohnson7677
@trejohnson7677 4 месяца назад
Waku synergizes well af
@DamirSecki
@DamirSecki 5 месяцев назад
You are going so fast... is hard to follow... but none the less... very valuable content. thanks
@blender_wiki
@blender_wiki 4 месяца назад
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 4 месяца назад
@@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!
@cartermckay1509
@cartermckay1509 3 месяца назад
Thanks!
@1apostoli
@1apostoli 3 месяца назад
Someone lmk what extension is showing errors right from inline
@carlosricardoziegler2650
@carlosricardoziegler2650 5 месяцев назад
How about ElisiaJS ? Some insights ?
@shiningview
@shiningview 3 месяца назад
Its developed by one person. Just like express.js
@nathanschmidt1988
@nathanschmidt1988 26 дней назад
What clipboard manager to copy paste is he using?
@SamMeechWard
@SamMeechWard 25 дней назад
alfred
@domw2391
@domw2391 4 месяца назад
How hono vs Elysia?
Далее
Заметили?
00:11
Просмотров 2,4 млн
She’s Giving Birth in Class…?
00:21
Просмотров 6 млн
Go vs Rust vs Bun vs Node | Prime Reacts
18:07
Просмотров 158 тыс.
Cool Tools I’ve Been Using Lately
23:11
Просмотров 96 тыс.
Why I'm Using Express Instead of NextJS
5:23
Просмотров 97 тыс.
Should You use Bun in 2024?
6:43
Просмотров 1 тыс.
Using docker in unusual ways
12:58
Просмотров 387 тыс.
DO NOT USE BUN (bun install is good dough)
17:54
Просмотров 138 тыс.
Bun is disrupting JavaScript land
4:30
Просмотров 966 тыс.
DiagramGPT - Honest Review of Eraser AI
8:22
Просмотров 96 тыс.
Huawei который почти как iPhone
0:53
Просмотров 581 тыс.
AMD больше не конкурент для Intel
0:57
SAMSUNG S23 ULTRA🔥
0:47
Просмотров 146 тыс.