autobun
v0.2.2
Published
Back when web development was simple, applications were fast and straightforward. Autobun brings back that efficiency while leveraging modern tools and approaches.
Readme
Autobun
Back when web development was simple, applications were fast and straightforward. Autobun brings back that efficiency while leveraging modern tools and approaches.
Write code that just works. No overengineering, no unnecessary complexity. Just fast, reliable web applications built the right way.
Similar to early Next.js versions, but focused on simplicity, performance, and no magic. That's why the codebase is small and anyone can understand how it works.
Powered by Bun, Typescript and Preact
Performance
Benchmarks on a minimal Hello World application:
Build time
Next.js : ███████████████████████████████████████████████████...█ 17s
Autobun : █ 0.11sDev start time
Next.js : ███████████ 1.1s
Autobun : █ InstantBundle Size (HTML + JS, gzip)
Next.js : ████████████████ 133 KB
Autobun : █ 8.6 KBRPS
Next.js (Static, App Router) : █████ 5k
Next.js (Static, Pages Router) : ██████ 6k
Next.js (Dynamic, Pages Router) : ██ 1.7k
Autobun (Dynamic) : ███████████████████████ 24kDependencies install time
bun add next : ██████████████████ 210s
bun add autobun : █ 12sGetting Started
Install Bun
First, make sure you have the latest version of Bun:
curl -fsSL https://bun.sh/install | bash
# or update existing installation
bun upgradeCreate Project
bun create autobun-app my-app
cd my-app
bun installFor manual project setup without using the scaffolding tool, see Manual Setup.
Examples
Check out examples/ directory, especially examples/sample-app for reference implementations.
Server-side Props
Unlike Next.js, getServerSideProps lives in separate files like pages/page-name.props.ts for clear separation between server and client code without any tricks. See GET_SERVER_SIDE_PROPS.md for details.
Start development server
bun autobun devBuild
bun autobun buildStart production server
bun autobun startFAQ
Why Bun? Can I use Node.js instead?
No, you can't use Node.js. Bun is fast and comes with modern APIs out of the box that don't require pulling in tons of dependencies or writing a lot of boilerplate code.
Why Preact instead of React?
Preact performs 10x faster, which reduces server load and/or allows for higher RPS. Also, React adds 100 KB to the bundle (gzipped), which increases the Hello World page size by 12x.
Where's client-side routing? How do you live without SPA?
SPAs are overrated. Created to improve user experience, they've turned into huge unwieldy spaceships with bloated bundles. Modern SPAs often don't speed anything up, they just make life harder for both users and developers. Autobun's goal is to be a tool for building simple and efficient websites, so there's no client-side rendering out of the box.
Why no React Server Components (RSC)?
RSC is an interesting idea that allows developers to pay less attention to architecture design. But Autobun is about efficiency and straightforwardness. You prepare data for a page, you send it to rendering. That's it. No magic, no complex abstractions, no blur between server and client boundaries. When you need server logic or data, you work with it on the server in one place. Clear separation leads to better performance and easier debugging.
