Lädt...


🔧 Why we chose Bun


Nachrichtenbereich: 🔧 Programmierung
🔗 Quelle: dev.to

At AlertPix we allow streamers to receive donations from their audience via Pix Instant Payment and show an alert on the live stream.

I was eyecatching Bun for a long time. And while developing the initial version of the platform the excitement to use it when it was more stable was really high.
And when 1.0 reached, I knew it, our real time system should be written in Bun.

No common js or esmodules madness

Our API is in node. And God, how I suffered to import nanoid in an esmodule project. I had to vendor it, since using a previous version was not ideal.
With bun, we can no longer worry about that. Just import what you need and done.

import fs from "node:fs"
const path = require("node:path")

TypeScript ou of the box

We all know that TS is just a linter, so we need it as the project grows right?
That feeling when the auto complete works, hits different.
But the struggle to setup TypeScript in nodejs is a pain.

Well, with Bun, its no longer an issue anymore. It just works.

Fast startup times

Oh boy, while developing AlertPix, I was relying solely on using cloud environments since my laptop was in repair.
I can count how many hours I wasted waiting node to sync the changes (I'm talking about you Next, you are slow even on high end machines) in these cloud enviroments. When switched to Bun, everything felt fast.

Buildless deployment

Our realtime service needs to be deployed as fast as possible.
It means that, the time to identify a bug in production, fix the issue, commit and run de CI deployment should be small.
And we know that, even cached, deployments are slow because of the build step. The bigger the project, the more time it takes.

Since bun runs TypeScript without a build step.
In summary, our container pulls Bun, install the packages, copies the needed files and runs the code with Bun:

FROM oven/bun

WORKDIR /app

COPY package.json .
COPY bun.lockb .

RUN bun install --production

COPY src src
COPY tsconfig.json .

ENV NODE_ENV production
CMD ["bun", "src/index.ts"]

EXPOSE 3000

Pub Sub is easier

Our real time system is a pub sub on top of websockets.
And it is so easy to do, that we already covered it in this post

AlertPix

...

🔧 Why we chose Bun


📈 45.73 Punkte
🔧 Programmierung

🎥 Why Moure chose a .dev domain name


📈 25.87 Punkte
🎥 Videos

🔧 Why We Chose PostgreSQL for Our No-Code Platform: A Deep Dive into Database Decisions


📈 25.87 Punkte
🔧 Programmierung

🎥 Why Creator chose a .app domain name


📈 25.87 Punkte
🎥 Videos

🔧 Why I Chose Node.js for My Side Project (Even Though .NET C# Is Still My Day Job)


📈 25.87 Punkte
🔧 Programmierung

🎥 Why DanaScript chose a .dev domain name


📈 25.87 Punkte
🎥 Videos

🔧 Why OpenAI chose Remix?


📈 25.87 Punkte
🔧 Programmierung

📰 I bought a Mac Studio: Here are the specs I chose and why


📈 25.87 Punkte
📰 IT Nachrichten

🔧 From Real Estate to Ruby - Why I Chose Ruby on Rails


📈 25.87 Punkte
🔧 Programmierung

📰 Did your TV streaming bill just go up again? Here's why I chose YouTube TV


📈 25.87 Punkte
📰 IT Nachrichten

🔧 Type ✔ Vs Interface ❌: Why you should chose type over interface in typescript.


📈 25.87 Punkte
🔧 Programmierung

📰 Why I chose YouTube TV over the other live TV streaming services


📈 25.87 Punkte
📰 IT Nachrichten

🔧 Why I chose Clojure/Script for building Vade Studio


📈 25.87 Punkte
🔧 Programmierung

🔧 Why I Chose React Over Angular


📈 25.87 Punkte
🔧 Programmierung

📰 Why I finally ditched the cable company and chose YouTube TV


📈 25.87 Punkte
📰 IT Nachrichten

🔧 Why I Chose Supabase as BaaS for My Projects


📈 25.87 Punkte
🔧 Programmierung

🎥 Why Netlify chose a .app domain name


📈 25.87 Punkte
🎥 Videos

🔧 Why I chose Supabase as BaaS for my projects


📈 25.87 Punkte
🔧 Programmierung

🎥 Why Clerk chose a .dev domain name


📈 25.87 Punkte
🎥 Videos

🔧 Why I chose Svelte over React?


📈 25.87 Punkte
🔧 Programmierung

📰 Agent vs Agentless Monitoring: Why We Chose Agentless | UpGuard


📈 25.87 Punkte
📰 IT Security Nachrichten

🔧 Why I Chose Vite.js for My React Projects


📈 25.87 Punkte
🔧 Programmierung

🎥 Why deepwatch Chose Splunk to Secure Customer Networks - Patrick Orzechowski - BSW #202


📈 25.87 Punkte
🎥 IT Security Video

🔧 Why I Chose React to Start My Full-Stack Journey


📈 25.87 Punkte
🔧 Programmierung

🎥 Why deepwatch Chose Splunk to Secure Customer Networks - Patrick Orzechowski - BSW #202


📈 25.87 Punkte
🎥 IT Security Video

🎥 Why Doodle chose Jira Product Discovery ahead of other roadmapping tools | Atlassian


📈 25.87 Punkte
🎥 Video | Youtube

📰 Agent vs Agentless Monitoring: Why We Chose Agentless


📈 25.87 Punkte
📰 IT Security Nachrichten

🔧 Why I Chose Not To Continue Interviewing With A Certain Popular Tech Podcast


📈 25.87 Punkte
🔧 Programmierung

🐧 Owner Explains Why He Chose Tata Nexon XM Over XUV300, Brezza, And Venue


📈 25.87 Punkte
🐧 Linux Tipps

🎥 Why Kedasha chose a .dev domain name


📈 25.87 Punkte
🎥 Videos

🔧 Why We Chose NGINX + HashiStack Over Kubernetes for Our Service Discovery Needs


📈 25.87 Punkte
🔧 Programmierung

🔧 Why we chose C over Rust


📈 25.87 Punkte
🔧 Programmierung

📰 Why Polish LOT Airlines Chose SUSE To Bolster Its Linux Infrastructure


📈 25.87 Punkte
🐧 Unix Server

🐧 How I chose the right screenshot tool for my Linux


📈 20.57 Punkte
🐧 Linux Tipps

matomo