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
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
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.
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.
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
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.
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.
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
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
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!
@@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!
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
Next month another Super Fast Framework and yet, the main app are running on the good and old Spring, Express and Django...I love the educational content though
Dude your videos are unwatchable... slow down. If you want people able to watch it, do NOT assume everyone can run same speed as the fastest runner in video :)
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
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
There will always be endless new stacks. Even when a new one if faster does not mean you have to alway change. It is vary hard to hit bottlenecks unless you 100,000s of people a second almost ever second.
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
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
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
If you have a frontend in react then the frontend developer can simply make an empty page and backend developer can send some custom jsx webpage as a response, to be displayed in that empty frontend page. This could be very useful for authentication purpose
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?
Why is everybody suddenly using bun? I am glad I didn't get on the deno train now that bun is the next cool thing. I will probably also be happy not having jumped on the bun train once its hype goes down and to just having stuck to npm which is the most proven.
JS developers change frameworks more often than they take a bath.
yeah this is getting rediculous lol
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?
@@TolyaBogomolov i see humor is lost to js devs
Why complain most of this stuff is free and you get to use something that you like.
@@TolyaBogomolov I'm not sure. Back in the caveman days they would still take a shower at least once a week, so I just can't imagine.
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
Bro will you make a full stack application using Bun, so that we can learn something from your experience
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
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
Thumbs up if you don't even understand what he's saying.
😂
Are you dumb ?
I understand what he's saying
Gotta practice more with fullstack projects
dude get recommended wrong videos
Your content is really amazing, i would love to see a vite and hono full fledged tutorial.
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
Yo, can't wait for Hono+Vite+React setup tutorial!
I've tried a couple of time to make it works but failed! Can't wait to see the video!
Man just ditch React and Client frameworks once and for all. You have JSX on the server with these. What else do you need?
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.
beth stack but hono
@@jarnathan-snow
@alaskandonut yoooo, thx bud
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.
Luckily hono supports node too
@@WillDelishtrue
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
Today bun is good tomorrow there is something better and we all abandon bun😢
It would be great to see the performance part in comparison with express, fastify on node to understand the capabilities of this modern framework
Google is your friend:
"Node.js vs Deno vs Bun: Express hello world server benchmarking"
the use of context reminds me of how Golang Web Frameworks like Gin and Echo work. Pretty nice!
Same here! I was looking for this comment
Amazing! We’re waiting for a full Tutorial ;-)
Have you tried Elysia? The DX is really amazing
it is not. Have you tried nesting guards?
@@jarnathan-snowyh that's a chore but I prefer beforehandle function
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.
yep
It’s pretty straight forward though, anyone with react and express knowledge will pick this up in an hour.
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.
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
@@juststudying1019 you're complaining like you are making these solutions smh
Hello sam, how about ElysiaJs?
I wish Bun had Windows and Nextjs support ... hopefully soon
Just quit using Windows and start using Linux, you'll thank me later.
Hey sam please make a comparison between Hono and ElysiaJS
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
We will be done with mentel fog
Htmx
Yes, but why would you ever excuse using JS as a server in 2024? after all we have learned that js sucks for servers already, right?
Sure, but the same can’t be said for typescript…
Tutorial for hono/vite if possible. Idk if you already did it but thanks ahead of timeif you are thinking about it.
error: Cannot find module "react/jsx-dev-runtime" from "/Users/sam/Documents/server/src/app.tsx"
Hono seems cool, but after Sveltekit I can’t see me using another tool for api
As informative this video was, it was also quite fun, because hovno (read almost like hono) means shit in Czech.
More bun and Hono please! Maybe build full rest api with swagger, mongo and some sort of autorization it is be nice
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.
Subscribed for the hono+vite magic that you'll drop
You just stopped using express now?? You should've stopped using express when Fastify came out
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!
Did you ever test elysia i'm looking for something performant and reliable
You are going so fast... is hard to follow... but none the less... very valuable content. thanks
In YT you have a great option to slow down the playback speed of a video and also an advanced button called "pause".🤷🏿♀️🤷🏿♀️🤷🏿♀️
@@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!
Could you make a video integrating tRPC with hono?
It's kinda mix of express.js and golang. But anyway looks so cool and clean
I stopped using JS on the server because Go exists
Why do you prefer Go? Just because it's faster? What about the developer experience?
@@dominicbruhwiler3042 dev experience ? lol. just learn something else that isn't js and your "dev experience" will sky rocket 200000%
What are your thoughts on Hono vs. Elysia? What do you prefer about Hono?
Guys stop. Express is great. What are you going to do now? Re-invent html?
Hah, I'm doing the same! With drizzle orm and vitest it's perfect stack for me.
can you also make a video on elysiajs and bun
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
Thanks now I understand why Hono is better that ElisiaJS too 🎉
Next month another Super Fast Framework and yet, the main app are running on the good and old Spring, Express and Django...I love the educational content though
Oh no.. Express is still here Ava Node.js hasn’t been replaced. Wrong again guys.
Dude your videos are unwatchable... slow down. If you want people able to watch it, do NOT assume everyone can run same speed as the fastest runner in video :)
Are you able to run a successful docker build with Bun?
I've been bashing my head for the past 6 versions
I don’t think Express will miss you 😂
You could’ve used NestJ, but hey it’s your choice.
You had me at “Because Bun” it’s always about the bun
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
do you have a video about exposing an ML (AI) model thourgh a JS/TS API?
waiting to watch a vite and hono full fledged tutorial
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
What's it with these mustached programming mofo's popping up everywhere.
i use vanilla js for routing 😂😂
believe it or not it work perfectly without all dos funcy library 😂
Do you live in the US? Your english accent is a little yankish
Great, as always. ✌️
So what problem is this fixing? Express too slow? Too slow for what? For who? Respect to what ?
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
Nice intro! Well done.
HTMX, HTMX, HTMX
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
I’ve used Prisma with hono and bun. No problem.
@@elephant_888 can you share the setup docs?
try out drizzle.team
How hono vs Elysia?
This looks great for use with HTMX with built in JSX
you may want to switch rust/axum it also looks like express but much faster and lightweight than ever, also supports multithreading with tokio
True, but we're in node/js land right now 🥲
make the tut
"Express became outdated and slow" LOL LOL
So this is next month’s greatest thing.
Looking forward to March’s greatest thing and everybody hates February’s 🙄
I stopped using JS cuz Go
The only based comment here
There will always be endless new stacks. Even when a new one if faster does not mean you have to alway change. It is vary hard to hit bottlenecks unless you 100,000s of people a second almost ever second.
Nah... Express can't die :)
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
Data though params (GET variables) works ok.
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
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
Could you compare Hono and tRPC? It appears they both have similar capabilities. Thanks!
Have they solved Bun not working with SSH-ed25519? I couldn't use Bun due to my SSH dependencies not working with it.
Being able to serve HTML using JSX instead of EJS or other template language is so good!!!
Same here. Bun + Hono is such a nice combo. Easy to work with, and holy f-- it’s performant.
Where can this be deployed?
How about ElisiaJS ? Some insights ?
Its developed by one person. Just like express.js
Is Bun.serve() necessary? when already using bun run --hot src/index.ts??
Pardon my incompetence, but why would you want to send jsx as a response?
If you have a frontend in react then the frontend developer can simply make an empty page and backend developer can send some custom jsx webpage as a response, to be displayed in that empty frontend page. This could be very useful for authentication purpose
Yeah, let`s call my managers and say to then that they need to change all their products to Bun and Hono hahahahaha
express.js is like jQuery. It will never die
Looove hono + bun combo. Also sprinkle some htmx and its pretty magical
Don’t forget drizzle
awesome
im always wanting to try bun , but i don't know if its stable for production yet or not
Hey Sam, how can we connect to a database while calling APIs
Damn, Hono looks incredible!
how to make something like nodemon with hono + node
why hono, not bun-native elysia?
Elysia is the best one I have ever found
With qwik can be good solution for full stack, how about SSR, IRS kinda things like NextJS. Thanks for tutorial, keep it up 🎉
Have you tried ElysiaJS?
There’s a Safari bug that prevents Bun web servers from successfully sending binary downloads like images and files to that web browser. 😢
idea about having context argument instead of req, res is actually convenient
Which cli and cli font are you using? I'm so obsessed with the fonts, ain't I?
Please more of hono.js
🙂
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?
Nope use deno …
I'm interested in hono + react app and how the live together and interact
bun update command not update version numbers in package.json in my local, do you know how to fix it?
Bun is great, but it doesn't work with Windows yet. :(
Hi Sam,
have you built a production app with bun? if yes how has been your experience?
It’s been awesome, only great things to say about using bun. I’ve been deploying to fly.io.
@@SamMeechWard Wow! will definitely try it. Thanks
Definites on what a production app is - if you mean an app with thousands of live users, then Bun isn't stable for that.
@@mdmathewdc Please share your experience.
We have few public API running with bun, it is just great.
Why is everybody suddenly using bun? I am glad I didn't get on the deno train now that bun is the next cool thing. I will probably also be happy not having jumped on the bun train once its hype goes down and to just having stuck to npm which is the most proven.
that is soo good dud, i see yesterday.
Make the tutorial with Vite and Hono
ok you've sold me!
next project will be with hono (bun i already use :D)
This is great! Is there support to integrate Bun into a AWS lambda runtime and Hono into an AWS lambda proxy?