skip to content
Video cover art for Bun with Anthony Campolo
Video

Bun with Anthony Campolo

Anthony Campolo explores Bun, a new JS/TS runtime, and demos creating and deploying a basic Bun server using Railway and Docker.

Open .md

Episode Description

Anthony Campolo explores Bun, the new JavaScript runtime built on Zig, and demonstrates how to deploy a Bun server and Next.js app using Railway.

Episode Summary

Anthony Campolo kicks off his first solo stream by tackling Bun, the fast JavaScript runtime created by Jared Sumner and now backed by a new company called Oven. He sets the stage by explaining what a JavaScript runtime is and how Bun fits alongside Node, Deno, and Cloudflare Workers, arguing that competition among back-end JavaScript tools is healthy in the same way front-end frameworks have flourished. Anthony notes that Bun is built on the Zig programming language, which likely accounts for its speed advantages, and discusses how Bun's documentation, while comprehensive as a reference, lacks a clear getting-started guide for newcomers. The practical heart of the stream focuses on deploying Bun: using Austin Crim's existing repo, Anthony walks through cloning a simple Bun server project with a Dockerfile and getting it live on Railway in just three commands. He then demonstrates generating a Next.js app using Bun's create command and running it locally, while noting the open question of how to deploy Bun-based apps on platforms like Vercel. The stream wraps up with discussion of Oven's likely monetization through a hosting platform similar to Deno Deploy, and Anthony encourages viewers to write blog posts about Bun given the scarcity of existing tutorials.

Chapters

00:00:25 - Introduction and What Is Bun

Anthony Campolo opens his first solo stream and explains the session's goal: exploring Bun, a new JavaScript runtime he has been scrambling to understand. He greets viewers in chat and shares that he had to reach out across his network to find anyone with hands-on Bun experience, setting the tone for an experimental and community-driven exploration.

He introduces Bun as a project created by Jared Sumner, now forming the basis of a company called Oven. Anthony explains that Bun is a fast, all-in-one JavaScript runtime and contextualizes it by describing what a JavaScript runtime actually does, noting that Node, Deno, and Cloudflare Workers are all alternatives in this space. He emphasizes that his instinct with any new tool is to figure out deployment first.

00:05:38 - The JavaScript Runtime Landscape and Competition

Anthony broadens the discussion to the state of JavaScript runtimes and frameworks, drawing a parallel between the explosion of front-end tools like React, Vue, Svelte, Solid, and Qwik and the emerging competition on the back end. He argues that this kind of competition is healthy for the ecosystem and keeps innovation moving forward, comparing it to the progression beyond jQuery.

He identifies Cloudflare Workers as arguably the first real alternative to Node on the back end, noting its proprietary runtime, and references a podcast conversation about why Netlify chose Deno over Cloudflare Workers for edge functions. The conversation turns to Bun's underlying technology — specifically that it uses JavaScriptCore rather than V8 and is built with Zig, a systems programming language positioned as an alternative to C++ and Rust, which likely explains Bun's speed characteristics.

00:12:54 - Technical Writing, Community Discussion, and Bun's Documentation

Anthony discusses Node compatibility, explaining how Deno initially avoided NPM compatibility but was eventually pushed by the community to support Node modules. He then shares his approach to technical writing, describing his "first look" blog series where he creates end-to-end tutorials that go beyond official documentation to include full deployment steps, making projects accessible even to beginners.

The chat engages in a lively discussion comparing Bun and Deno's maturity levels, with Anthony cautioning that it is unfair to compare Bun — essentially a solo project roughly a year old — against tools that have had years of development and community support. He also discusses the Zig ecosystem's cold start problem and the challenge any new tool faces in building a package ecosystem from scratch.

00:17:31 - Deploying Bun on Railway with Docker

Anthony shifts to the hands-on portion, starting with Austin Crim's repository that demonstrates deploying a Bun server on Railway. He walks through the project structure, which includes a simple server.ts file using Bun's serve function and a Dockerfile that copies the project files and runs the server. After cloning the repo and confirming it works locally, he runs the three Railway CLI commands — init, link, and up — to deploy the project.

Within about 30 seconds, the Bun server is live on a generated Railway URL, demonstrating how straightforward Docker-based deployment can be. A brief tangent occurs when a viewer suggests another platform called Hop, which turns out to involve a Rickroll demonstration of the platform's redirect capabilities, providing some comic relief before Anthony moves on to the next topic.

00:33:39 - Generating a Next.js App with Bun

Anthony demonstrates how to generate a Next.js application using Bun's create command, showing that the resulting project structure looks familiar to anyone who has worked with Next.js before, complete with standard pages and TypeScript files. Running the app locally with bun dev works smoothly, and Anthony praises this as a strong onboarding experience.

However, he raises the key question of how to deploy a Bun-powered Next.js app on platforms like Vercel, noting that while Docker-based platforms work, there is no clear path for Vercel deployment yet. He speculates about Oven's monetization strategy, discussing the likelihood that they will build their own hosting platform similar to Deno Deploy, which could explain the lack of third-party deployment tutorials.

00:39:09 - Wrap-Up and Upcoming Guests

Anthony shares links to three key repositories for getting started with Bun and encourages viewers to write their own blog posts given the scarcity of written material about the tool. He emphasizes that more tutorials covering different projects, use cases, and deployment platforms are needed and would likely gain significant traction in the community right now.

He previews upcoming stream guests, including Travis discussing Bedrock Layout — a CSS library for repeatable layout patterns in React and Solid applications — as well as sessions on end-to-end type safety and Analog. Anthony briefly showcases the Bedrock Layout website before thanking everyone for attending and confirming that the stream will run weekly on Mondays at 1 PM Eastern.

Transcript

00:00:25 - Anthony Campolo

Hello everyone. My name is Anthony Campolo, and I am live. Welcome to the first solo stream of AJC and the Web Devs. This will be a fun one.

We're going to be looking at Bun. This new, not very well-trodden path of a tool that we're going to be doing some very experimental stuff with. It's funny, the last two hours I've been scrambling around my network to be like, hey, has anyone done anything with Bun? Do you have any idea how Bun works? Thankfully, a couple people did.

So let's show some messages here. We got Niki T, Niki T from Jersey Canada here with us. Good to be here. We got Niki, another Niki here, Niki Meuleman. And then we got Meyers.

All right. What's up, everybody? Thanks so much for being here. I was kind of trying out Bun right before this and seeing what it can do and how to use it.

[00:01:28] And for me, when I approach new tools, and I think this is maybe my Redwood bias coming through the whole universal deployment machine, the first question I ask is, how do I deploy this thing? That's just kind of where my mind goes. It was not particularly thought out.

I think as Bun was being created, it was more so as a development tool. And now that it is being put forward as this replacement to Node and Deno, people are like, okay, well, if it's Node or Deno, then I need to put it on a server and run it because that's what those things do. So I kind of was asking around, and Austin Crim saved my bacon. He already had a whole repo that worked and was just like, run this thing on Railway and it's just good to go, and bam. And that's exactly what happened. So I'm going to be showing today how to do this with Railway.

[00:02:20] Partly just because Austin already figured that out and gave me a repo to do it, that doesn't necessarily mean it's the easiest way to do it. It's just the first one that I think people figured out.

And then there's another one called North Flank. So there's this tool called North Flank that I'd never even heard of. They wrote the first blog post kind of explaining how to do this. So I thought that was pretty interesting, and I was not quite able to get it going, partly because I never used the service before. And I also think they had a couple implied steps in the tutorial, which were things I skipped over and were, in retrospect, very obvious.

So I think I might figure that one out and do it on another stream, along with things like Fly. But today we're just going to look at Railway.

[00:03:13] So we got Luke here with us as well. Hello. Hello. Let me get my thing all set up so I can start screen sharing and showing stuff. This was kind of thrown together at the last minute, so I have a lot of things I need to get going on my screen right now.

All right. That's all good. How's everyone doing out there in chat world? And then, one thing I still need to do: get the Twitch chat up. Great. Great. Sorry. Tweet. Thought it was a good way to spend the afternoon. Happy to hear that. That's the plan.

Let's set some foundation here for people who have never even heard of Bun. Because when it comes to cool new dev tools, you never know. So this was created by Jared Sumner. He is a nerd of the highest nerd caliber. He basically said, I want to just build this thing.

[00:04:35] It's an incredibly large, complex project that he has kind of gone at totally solo and is now building a company around, as you can see here, introducing Bun. So this is Bun. And then there's also Oven. And this happened within the last couple of weeks.

There's a company being built around Bun itself. There was a tweet that went out about the U.S. commitment and time that would be involved in working for this company. That led to a lot of debate on Twitter. Not really going to talk about that, because it's kind of outside the scope of this. But Oven itself is going to be a company around the tool Bun.

So Bun, as you can see here, is a fast all-in-one JavaScript runtime. And this kind of will lead you to ask naturally, what is a JavaScript runtime? A JavaScript runtime is a thing that runs JavaScript code, and in this case, TypeScript code, because that's kind of seen as table stakes with any of these things.

[00:05:38] These days, Node is known as one of the more well-known JavaScript runtimes, along with Deno now, which was put forward as a replacement to Node. Oh my God, Claire is here. Hello, Claire. That's awesome. Claire, Redwood team member.

So for me, this is something I was talking about when someone who hangs out in the Lunch Dev server had put forward this kind of topic and said, hey, you should do a Bun episode because I was asking him what he wanted to see. And I think it's an interesting thing for the back end JavaScript, because when we look at the front end of JavaScript, we have React, we have Vue, we have Svelte. Not only that, now we have Solid and Qwik and Marko. And it's just this huge explosion of tools. And even though React is the clear front runner, you have, that's the one right there. Discord forward slash dev.

[00:06:37] And when you have the front end in all these different tools, even though React is a clear front runner, you have a situation where there's good alternatives for different use cases and for different preferences and for just different R&D even. And I think that's good. I think competition is healthy. I think especially in the open source world, the ability to just take influence from other projects, even straight up copy other projects, and build something slightly different and slightly better, that's a good thing.

I think it keeps people from just building a thing. And then, imagine if we were just all still using jQuery today. Not that jQuery was bad at the time, but we've been able to kind of go beyond it. And that's a good thing. That's healthy for the web. So I think we're in a situation now where the back end is starting to see some of the same competition, where Node has been the thing to use in the back end forever.

[00:07:29] And the first kind of chink in this armor, I think, was not Bun or Deno. Actually, it was Cloudflare Workers, because Cloudflare Workers was able to present an alternative.

How quickly can Bun accidentally remove all your files at root? That's a good question. I would imagine extremely quickly, but I don't know if that is a pro or a con.

So Cloudflare Workers was an alternative to Node, actually, because Cloudflare Workers uses V8 much like Node does. But it does not just run Node. It's a completely separate runtime that was proprietary to Cloudflare Workers. This is something that actually came up on a new episode of FSH jam that we just put out with Matt Bellman. He was talking about why they chose Deno instead of Cloudflare Workers for Netlify edge functions is because Cloudflare Workers do not have an open source runtime. It's actually proprietary, although this is changing in the future. They're actually working on open sourcing it. Hello to Excel in the chat.

[00:08:38] Excel is the creator of create T3 app, which is the coolest new full stack app anyone has built since Redwood. Thank you for being here.

Okay, I was talking about Cloudflare Workers. So Cloudflare Workers was kind of an alternative runtime to Node. Then you also had Deno, which is an alternative runtime to Node. Now you have Bun. So Bun is a way to run JavaScript code. So that's a very long, rambly way of explaining Bun that hopefully makes sense to people.

I'd be curious for people who are hanging out in the chat, like what do you know about Bun? What is your take on Bun right now? What are you hoping to see from Bun? Anything like that I'd be curious to hear. It seems like people in the chat actually know what Bun is to a certain extent. So throw out some thoughts, throw out some opinions. And then I'm going to start getting our project going here very soon. But first I want to check out some tweets.

[00:09:44] I haven't touched it yet, but I've been a fly on the wall for the last several months. Yeah, I think that's probably going to be the case for a lot of people when it comes to these new tools. It's easy to become aware of it and to know it exists, but to actually sit down and try and use it is a whole separate process.

And this is something that I've kind of staked out as a thing I like to do, specifically that I have this whole blog series of first look at blank. Maybe look at, as I was saying, create T3 app. That was the last one I did and has a pretty good response, as you can see. But if you look at a first look at blank, I've got 18 of these blog posts. First look at hard hat, ethers, Astro, Oak, Nuxt, Pulumi, GraphQL, Helix, Fargate, Serverless Cloud, Keystone, Slinkity, Fly, GitHub actions, post, GraphQL on and on. And once you actually get into the habit of trying these things out, you can get a better sense of actually what they do and kind of cut through the hype and the buzzwords and all that.

[00:10:51] Yeah, I've been blogging for a while. Blogging is kind of my thing. From what I've seen briefly, it's faster dev experience. I haven't looked at the speed gains for actual apps yet. This is Nicky.

I'm trying to remember why he went with JavaScriptCore to V8. Is JavaScriptCore faster under the hood than V8? I have to imagine that's the case. This is one of those things where sometimes you just introduce a new tool where the speed is like an order of magnitude faster. This is why Esbuild blew everyone's minds and V8 took over Webpack so fast, because it was a whole different language. It was written in Go. So once you write something in a different language, you have completely different speed characteristics.

So even though people talk about Node being a JavaScript runtime, Node is actually written in C++, and Deno is written in Rust. So these things are not written in JavaScript. There are different programming languages that are running JavaScript code.

[00:11:52] This is actually important to mention. I did not realize Bun is built on Zig. Zig is a programming language that is meant to be an alternative to things like C++ and Rust. So I think the speed gains, if I was to guess, probably have a lot to do with Zig more than anything else.

Let's go back to the chat here. Is there anything different syntax-wise from Node? As far as I can tell, it should not be a different syntax. It's going to have a different project setup. It has differences in terms of what your package.json is doing and what other stuff like that is doing. That's the biggest difference I've noticed so far, but it seemed like it was mentioned. Just run JavaScript the way JavaScript works.

I guess the question I would be curious about is the compatibility with things like NPM versus non-NPM, because that's the big question Deno was trying to deal with: heavy Node.js compat. Although Deno is doing this now too.

[00:12:54] Yeah, exactly. With Deno, they were trying not to be compatible with NPM, I think on purpose because they want a clean slate. But at a certain point, people are like, I'm not going to use this thing until you let me use my 10,000 Node modules. And so they kind of forced their hand. And now Deno is working on working with all your Node modules that you love so very, very much.

I'd love to hear about how you refined your technical writing. I did it a lot over and over again. With the first look series, I would just pick a tool and I'd try and create an end-to-end tutorial experience that I felt like was better than whatever they were offering in their own doc.

So I'd look at their getting started guide. I would go through it, I would find all the missing steps that I felt like were implied knowledge that weren't necessarily explicitly stated. I would then write my own blog post that I was like twice as long.

And I would also make it, as I was saying, deploy the actual things. A lot of blog posts or a lot of getting started tutorials will be like, here's how you get the standard computer, here's how you run your computer. But to me, that's like, okay, what do I do with that? If I don't have it on the internet, I don't have a thing.

So I would create an end-to-end tutorial that would both start from blank, either generating a project or just creating a blank directory and creating files, and then walking that process through to actually deploying the thing, with the goal being that even someone who may not even know how to code could follow along and be like, okay, I'm going to run these commands. I'm going to put this code in these files. And then at the end, I'm going to have a thing, almost to make it like you can't mess it up. That's really my goal with these tutorials. So I did that with like 30 projects.

[00:14:38] And then that's kind of how I refined my technical writing. Nextel is saying, I think Bun is quite fast in some places, but Deno is still better in a lot of stuff. I think it's unfair to compare Bun right now to Deno because it doesn't even have 1.8.

Yeah, and this is the thing. When Bun came out, people immediately start comparing it to Node and Deno. But Deno, I mean Node's been around for ten years. Node's in 2009. Deno has been around now for four years, and Bun is just one guy who's been working on it and is like garage, not literally, but it's like Tony Stark built this in a cave kind of thing. And so it's just this guy who's been working on this thing for like a year, and good for him. But you just can't compare. It's completely different scales of things. So I think it's kind of unfair to put Bun up against Node and Deno at this stage because it's not there yet.

[00:15:32] And it's like, the docs aren't there yet, that's for sure. And this is something that I was going to get into with the Twitter stuff.

If folks want to know more about Deno, I chat with one of the core teams. Thank you for this. This is iamdeveloper.com. Great content from Nikki T. We got Saban over here saving the world.

And then I'm curious about Zig, still learning Rust for Zig. I heard it's like C without the bad parts. Yeah, exactly. That's kind of what I've heard as well. You want a systems programming language that can get deep into the guts of stuff without having to deal with all the pointers and things like that. I don't know anything about Zig, so there may be pointers. I have no idea. This is beyond my pay grade. So, cool. Let's start looking at just kind of what I was doing to get this running originally.

[00:16:27] This is the one: Zig lacks ecosystem packages, and there's a cold start problem with every single programming language, every single framework, every single runtime, all of them. You are going to have this problem of once you build a thing you need, then a hundred, a thousand, 10,000 more people to build more things because that's what you're competing with. They believe in making everything from scratch. Yeah, that's what Go did though. And Go got to having an ecosystem because they build everything from scratch. And people liked the way they built it from scratch. So it ended up working out.

So it's not impossible. You just need a company with maybe $500 billion to back you. You want to get into systems programming. Rust is the best language to do it right now. Yeah, that's probably what I would guess too.

Okay, so I was tweeting out at everyone I know who runs deployment platforms to see who knew how to do this. So I tweeted Kurt from Fly.io, Jake and Anurag from Render. None of them responded, but we got a couple good answers anyway.

[00:17:31] Austin Crim, good friend from Prisma, already had a repo here showing how to do it on Railway. And then hello from Trost in the chat. Cool.

So this is Austin Crim's repo. We'll be looking at this today. Then this is my running application that I was able to get going. And Peter Cooper, I don't know if many people here know Peter Cooper. He runs the Cooper Press newsletters. Very cool dude. He got it running on Fly and went through this North Flank tutorial, which I was checking out.

Oh, they do have a Git repo. Oh, this is what I missed. This is what I needed. Okay, sweet. All right, next time, this is what I'll be doing.

Primer, CSS, color rancher. Yeah, I wish. Do not come to this stream to learn about CSS. There are better people to teach you CSS out there for sure.

[00:18:43] And then this was the actual running Fly application Peter Cooper got going.

But let's go back now. And, pale goldenrod, you'll love in the... I have no idea what you're talking about right now, Nicky.

Okay, so I had created just a blank repo here. All my projects are always agency web dev. Dash, the name of the thing, agency web dev bun. And then I've got a README here where I kind of spelled out some steps for people. And there's a couple blog posts already about Bun. I already mentioned the North Flank one, and then there's a LogRocket one. Whoops.

And then there's this one from Dev Genius. What is this one? Yeah, this one I have not even read yet. But with each of these, you're going to get at least some sort of step-by-step. This one's not that particularly useful, but it's better than nothing. So if you go to the GitHub and I kind of gave Jared a little bit of guff about this on Twitter.

[00:20:09] The README is extremely long. There's not a short README. That is not the problem. The problem is that this is a huge reference guide. This is not docs.

So like having actual docs requires step-by-step, and it requires a getting started step with step-by-step instructions saying here's how you get a project going. Here's how you do something with it. This is basically explaining all of Bun from beginning to end, in whatever order he felt fit to explain it, which is nice. That is all here, but I would have to read through this entire thing and then reverse engineer a tutorial from it, which is partly what I'm doing here.

So this is not great. This is not a great way to get into someone's tool. I highly encourage whoever Jared hires first to write better docs because these docs are not great. I'm sorry.

Okay, so this will be the first way you would install. Curl command: you hit the install script and then you install it. Then you do this and then you do that.

So now once you've done that, and you can find those on the Bun website, if you're trying to follow along at home, open the README and go and sort it out.

[00:21:17] So if you run the help command, you're going to see all this. I'm zooming out so you can kind of see the whole thing. And then if we zoom in, it looks like these things on the bottom are important.

Yeah. So Nextel. So what I'm going to start by doing is I'm going to create just a plain index.js file that's going to be like a Bun server. And we're going to run that with a Docker container on Railway. And once we do that, then I'm going to show how you would actually generate a React app or a Next app with Bun.

So this is all of the Bun commands. We got things like dev, init, create. I didn't try out the init command. I should try that next time. So there's a lot of good stuff here.

[00:22:18] This tool is very built out. It's just like I said, there's not really a good entry point. Like how do you start with this thing? Because the docs are just this huge brain dump of stuff.

But what I was able to do: there's a Bun package for making servers. Interesting. If you have a link for that, please drop it. Got. Trash dev in the house? Yeah, there's a global, like the Deno global. Yeah, that sounds about right.

Let me pull up Austin's repo again, because this is what I was kind of following along with. So if we check this out, we're going to have a server.ts file. So this is our whole server right here. It's just going to run dot serve. And then it's going to do a fetch request. And then it's going to give a response that has a little bit of HTML here. So that's the header with a content type. So that's all pretty cool. That's pretty comprehensible.

[00:23:21] And then if we look at his Dockerfile here, all it's doing is copying this Docker image, whatever this is, copying over all of the files, and then just running Bun server.ts.

So the first thing I'm going to do, and to make this as simple as possible, is I'm just going to clone this repo down. I think I might already have it there. Let me do this. Okay, that's good.

Okay, so we're going to clone this repo and then open it up. And then I think, let's see if we can just run server and see what happens. So this will open it up now on localhost 3000. And there we go. So there's our Hello Bun.

Let's do this and that and let's try changing this. And it looks like we're going to restart the server to see the change over here. This is a fast, minimalist framework, for good reference. Wow, okay. So there's already frameworks being built around.

[00:25:08] I did not see that coming. Let me see. When was this created? So this was created July 9th. I always like going to the very first commit on things.

How many dumpling references? Does anyone here watch Bo Burnham? Whenever I hear dumplings, I just think of there's this song in the Bo Burnham alternative takes for Inside, where he has this argument with his girlfriend about dumplings and how she takes one of his dumplings. They order dumplings and he's like, you owe me a dumpling or dumpling equivalent.

So this is... Oh, okay, it's Koa with Bun. Get it? Because it's Boa. So if anyone knows of Oak, Oak is a play on Koa. And then Node or Deno is a play on Node. So this is an HTTP server middleware framework for Bun that is inspired by Koa. That makes a lot of sense.

If anyone here wants to check out Semantics, building an API with Deno and Oak, this block of code right here is almost line for line what we built on that stream.

[00:26:36] Thank you for that link. This is really, really interesting. I had no idea about this.

Okay, great. So now that we got this thing, we've got a Dockerfile. We've got a server.ts, and then we've got this bun.b. I have no idea what this is. I don't have the slightest clue. I should look at the Bun docs right now to figure out what this actually is. Lock file does not load; it just converts. Okay, so this is Bun's version of a lock file.

Hello to dev in the chat. Dev is the meme lord extraordinaire over in Theo server. He wants to create a meme. It was a Will Smith slapping Chris Rock meme with a remix slapping Solid. If you know the context, you know the context. It was three times more impressions than the most impressions I've ever gotten on a tweet. I almost felt bad tweeting it out because he deserves all of that good tweet love.

[00:27:47] Okay, so this is now basically ready to go onto Railway. That's what I'm going to remember you for. You'll be remembered for far better one day, I'm sure. The bedrock one was good.

And so he also had one where he's comparing Bedrock to Redwood. That's a bit of a diversion. Well, let's look at Railway right now. I know some people in the chat here probably already know Railway. But it is a way to run servers and databases and a way to do that in a very easy way.

And it has the ability to basically take a Dockerfile and a project with a Dockerfile and just figure it out. So I had some instructions in my last README. Let me pull that back up again. So I had... here we go.

So you start with railway init. And then that's going to initialize a project for you. So we're going to select contract. Something new is to have Railway hit me with any suggestions. This is only going to take like 30 seconds to get going.

[00:29:07] So after this, we can do anything. We give it the name AJC Web Dev Bun, and after that it's already got that going. All right, put a pin on that. Hop.io here.

Then run railway link and select. You see here we got my T3 t31 running as well. And then we're going to do railway up. And this will actually put it up onto the clouds. And then railway open to go to it. It will then detect that you have a web server. Let's do that.

All right. This is meant to say cool, not the word the mod thinks it is. You are fine. And then we're going to say generate a domain. All right. This is a good call on the bot. That's correct. And then now we actually have this thing running here. It will take a second to actually get running. It's going to have to actually spin up the Docker container. It should pretty much work. So there it is. That's all we had to do.

[00:30:21] We had to run railway init, railway link, and then railway up. And then your entire project with a Dockerfile is now running on this URL. That's pretty great.

All right. Now we got Hop. Hop is the cloud platform for real-time. So XL, how much is this company paying you to advertise for them? Not much, kid. They should be paying you though, because I have not heard of this. And there's so many deployment platforms in the world I know of, probably eight or nine. Yeah. Fly.io. Yeah. Render us a referral link. That's funny.

Okay, so let's try this out. Let's see what happens. So I'm going to go ahead and connect. Oh no. Can't do that. All right. So I'm going to try and set this up with my email, so I'm going to hop off for just a second. Don't want to do anything dumb there. Also, thanks so much to everyone hanging out in the chat right now. This is super fun.

[00:31:34] So let me put my email here.com. And then that will give me an invite code. My invite code over here. Okay. Hmm. Nothing yet. It's in private beta. Okay. So I mean, I can't use it. Oh, wait. Here we go.

Okay. That link goes to a Rickroll next. I can't tell if you're messing with me right now or not. What is happening? Your link goes to... okay. So is this like a meme deployment platform or is this actually a real thing?

Let me go back to share my screen. Okay. So this is a Rickroll. They recently had a hackathon. Okay. It is real. It's a real thing. But can I use it? Let's kick it back here a few steps.

Okay, so we got it running on Railway. That's pretty cool. Oh, you're using the Hop app as a redirect to Rickroll as a way to demonstrate the tool. I understand.

[00:33:39] Okay, I understand now. Clever. Very clever.

Let's see how to generate a Next app with this thing now because, you know, it's great to have a running Node server, but I think most of us these days are probably just spinning up things like React and Next and all that. So let's get this going again. Fresh project.

All right. So we're doing Bun create next. And we create a project called AJC Web Dev Dash bun. Next, let's now take a look at it here and here. Now, if you've ever seen a Next app before, you will see some familiar things like pages, underscore, app, dot TSX and index dot TSX.

So then run it. You do bun dev, open up localhost 3000 and there's your Next app. So that is a very nice onboarding experience. It's a very good way to get set up. I think that if they can add those couple extra steps of actually putting this Next app onto something like Vercel, we have a really cool workflow here.

[00:35:00] But as far as I can tell, I have no idea how I would run this thing on Vercel unless I was somehow able to run the actual thing there. Yeah, see, I don't even know. I can imagine running this on anything that runs a Dockerfile, but I would have no idea how to get this to work with Vercel.

So that would be kind of the next question in my mind is, how do you run Next.js with Bun on Vercel? I'm sure the Vercel people are working on it, but at this point I would not know how to do that.

So let's try editing some of this and see what happens. So let's go here. Let's just delete that and change this to hello from AJC and Web Devs. All right, cool.

But I was also working on deployment platform, right? I'm curious about that. Let me see if that was mentioned in the original post about it. Because as far as I know, yeah, the deployment is nowhere in this.

[00:36:16] So as far as I know, they created a company with no stated plan of monetization. Now, that does not mean that they do not have plans for monetization. I think that they're probably leaving it vague right now because they have a couple different things they're going to try, and they're going to see what's going to succeed. And I think that's smart because you can never know ahead of time with something like this.

When you build a company around an open source tool, there's ways to monetize it. There's a couple different models we've seen over the last two decades in terms of building a deployment platform, offering services that extend it. Look at Please Meet Oven. Point is, they offer hosting. Okay. That's why. Offer hosting, okay. So there you go. They're going to offer hosting and grow. Okay. So they are doing a hosting platform, it sounds like. Okay, good for them. We'll see how that pans out. It's a bold move, Cotton. We'll see how it goes.

[00:37:20] I mean, I think if they can offer a nice DH, why not? There's plenty of good solutions for hosting the front end. There's plenty of good solutions for hosting static websites. There's not as many good solutions for just hosting Node apps unless you're running them in a Dockerfile, as we've shown with things like Railway and Render.

Yeah, exactly. Yeah, they'll make their own Deno Deploy is kind of the idea. So if you know Deno Deploy, Deno Deploy is a deployment platform based around Deno itself. And actually I really like Deno Deploy. I think Deno Deploy is pretty sweet.

So if Oven can offer something similar for Bun and they just make it work, and this is maybe why there's not good tutorials for deploying it in other places, because they don't want people to deploy it in other places. They want people to deploy it on Oven in X amount of months. So we'll see what happens with that. There's a lot of interesting things going on here.

[00:38:21] There's a lot of interesting stuff going on with Bun. This is about all of the things I wanted to show in terms of tutorials and whatnot.

Let me get this thing on a Git repo so people can see it because we already shared Austin Crim's a while ago. So if you want to get this thing onto Railway or something like that, this will be the way to do it. If you want to get a Next.js project going, I'm going to get mine up onto a Git repo real quick. Let's see, where's my README at? Yeah, there we go.

00:39:09 - Anthony Campolo

Any other questions about Bun before I start closing it out here?

00:39:20 - Anthony Campolo split?

With Next.js.

00:39:27 - Anthony Campolo

And then here's this frame and wants to check this out and play around with this. And then there was a Norfolk one. The other one. So these three repos are probably three of the best places to get started right now with Bun. And there's not a ton of written material for walking through things, but hopefully the stream gave some idea of what you can do with Bun and how to use it.

As always, my name is Anthony and I am found at AJC Web Dev on the Twitters. I actually have a recent Twitter refresh for people who haven't seen it yet with this cool little Hero Patterns background that Ben Myers got me set up with.

Yes, Nextel. You should absolutely write a Bun blog post. I will likely have one maybe in a week or two. I think that with any of this stuff, I was only able to find maybe like three or four blog posts that have been written about it. And there really needs to be more.

[00:40:32] Ideally, there should be multiple blog posts for different projects and different use cases and different deployment platforms. And there's always going to be a need for more docs and especially up to date docs. So if you want to write something about it, I think that would get a lot of traction right now.

Thank you to Nikki T. He'll be on the stream on October 24th. We already have a very full schedule of guests coming up. We're going to have Travis with Mayer talking about Bedrock Layout. We have Saban talking about end-to-end type safety. We're going to have Brandon Roberts talking about Analog. We're going to have... no, I'm talking about something Web3 related.

And yeah. So thank you everyone who came to hang out. I think I'm going to cut it a little short today, because I think I showed all the stuff I wanted to show.

So bedrock layout next. So this is a layout CSS library. We did a podcast not too long ago about it, but if you want to just check out the actual website itself, it's for repeatable layout patterns.

[00:41:41] So things like columns and grids, and the stack is actually the one he always references. It's a kind of good hello world example. Let's take a look at this.

So you have how you stack things on top of each other. So things like that. Oh, thank God it's not the templates. Not the templates CSS framework plus component library that implements said CSS framework.

Yeah, exactly. So it's a way to just take repeatable, common layout patterns and make those easy to use in things like a React application or even a Solid application. I know he has gone heavy into Solid recently, but Travis will be on to talk more about this in a couple of weeks. So keep an eye on my Twitter to learn more about that.

And yeah, thank you so much, everyone, for coming out and for hanging out. This was a lot of fun. And this will be pretty much every week.

[00:42:52] There you go. Yep. This will be pretty much every week Monday at this time. It's 1:00 pm Eastern time or 10 a.m., I think, Pacific time. So, yeah. And this will close out for us today. Hope to see you next time.

On this pageJump to section