Bosejs is a next-generation web framework that combines the flexibility of Astro's Islands Architecture with the "Zero-Hydration" performance of Qwik's Resumability.
It is designed to be "All-Powerful"—minimizing JavaScript to near zero while providing a seamless, type-safe developer experience.
While Astro introduced "Islands," Bosejs introduces "Resumable Islands." Instead of the browser re-running (hydrating) your component to attach event listeners, Bosejs serializes the event listeners and state directly into HTML. The browser "resumes" execution instantly on the first interaction.
Bosejs uses a custom Babel-based compiler that "shreds" your code. Every interaction wrapped in $( ) is automatically extracted into its own lazy-loadable chunk. You write standard code; we handle the complex code-splitting.
Built-in error boundaries catch failures during the "Resumption" phase. If a specific interaction fails, Bosejs swaps in a fallback UI without crashing the rest of the page.
Call server-side functions (DB queries, API calls) directly from your client components with automatic RPC—Bose handles the entire network layer for you.
Bosejs is published as a monorepo. As a user you only install two packages — the rest are internal dependencies pulled in automatically.
| Package | Install? | Role |
|---|---|---|
@bosejs/core |
✅ Yes | Vite plugin — file-based routing, SSR, dev server |
@bosejs/state |
✅ Yes | Fine-grained reactive signals (useSignal) |
@bosejs/compiler |
🔧 Auto | Babel plugin — extracts $() closures into lazy chunks |
@bosejs/runtime |
🔧 Auto | Tiny (<2KB) browser loader — resumes event handlers |
When you install @bosejs/core, npm automatically installs @bosejs/compiler and @bosejs/runtime as transitive dependencies. You never need to touch them directly.
@bosejs/state is listed separately because you import from it directly in your page files (import { useSignal } from '@bosejs/state'), so it needs to be an explicit dependency in your project.
packages/
core/ ← @bosejs/core (Vite plugin)
compiler/ ← @bosejs/compiler (Babel plugin, auto-installed)
runtime/ ← @bosejs/runtime (Browser loader, auto-installed)
state/ ← @bosejs/state (Signals)
create-bose/ ← create-bose (Project scaffold CLI)
playground/ ← local dev sandbox
npx create-bose my-cool-app
cd my-cool-app
npm install
npm run devThen open http://localhost:5173.
If you want to add Bosejs to an existing Vite project:
npm install @bosejs/core @bosejs/stateAdd the plugin to your vite.config.js:
import { defineConfig } from "vite";
import bosePlugin from "@bosejs/core";
export default defineConfig({
plugins: [bosePlugin()],
});Signals are the nervous system of Bose. They allow state to be shared across independent islands without full re-renders.
import { useSignal } from "@bosejs/state";
export default function Counter() {
// 1. Define a signal (shared globally if ID is provided)
const count = useSignal(0, "count");
// 2. Logic is automatically extracted
const increment = $(() => {
count.value++;
});
return `
<div>
<p>Count is: <span bose:bind="count">0</span></p>
<button bose:on:click="${increment.chunk}">Add</button>
</div>
`;
}Call server-side code without writing fetch or defining API routes.
export default function AdminPanel() {
// This function ONLY runs on the server — never shipped to the browser
const deleteUser = server$(async (id) => {
const db = await connect();
return await db.users.delete(id);
});
const handleClick = $(async () => {
const result = await deleteUser(123);
console.log(result.status);
});
return `
<button bose:on:click="${handleClick.chunk}">
Delete User
</button>
`;
}Bose automatically maps files in src/pages to URLs.
src/pages/index.md->/src/pages/about.js->/aboutsrc/pages/product/[id].js->/product/123(Dynamic parameters available viaparams)
Keep styles scoped to your island with zero runtime overhead.
export default function StyledButton() {
const styles = css$(`
.btn { background: blue; color: white; }
`);
return `<button class="${styles.btn}">Styled Island</button>`;
}Bose treats .md files as components. You can use frontmatter for metadata and embed interactive $( ) islands directly in your prose.
- Resumable Runtime (Loader)
- Closure Extraction Compiler
- Prop Serialization (State Capture)
- Vite Integration
- Server Actions (Auto-RPC)
- Fine-Grained Signals
- File-based Routing
- Markdown Support
- Scoped CSS-in-JS
- Production Edge Deployment (Bun/Cloudflare)
MIT
Built with ❤️ to redefine web performance.