Introduction to Eronom
Welcome to the official Eronom Framework documentation. Eronom is a next-generation full-stack web framework designed for extreme performance, minimal memory footprints, and intuitive signal-based reactivity.
Traditional web frameworks re-render component trees using virtual DOM reconciliation. Eronom compiles .erm components down to direct fine-grained signal subscriptions that update precise DOM elements instantaneously.
Quick Start (60 Seconds)
Initialize a new Eronom application using the CLI system binary:
eronom init my-app
# Move to project directory
cd my-app
# Start the Rust-powered HMR dev server
eronom dev .
Open your browser to http://localhost:4000. Any file edit in app/pages/ will trigger instant HMR updates!
Project Architecture & Structure
Eronom projects adhere to a clean, transparent directory structure:
├── app/
│ ├── components/ # Reusable .erm component files
│ │ ├── Header.erm
│ │ └── Footer.erm
│ ├── layouts/ # Root HTML layout wrappers
│ │ └── layout.erm
│ └── pages/ # File-system page routes
│ └── index.erm # Served at /
├── server/
│ └── api/
│ └── routes.er # Server HTTP endpoints
└── eronom.toml # Eronom configuration file
Reactive Signals (useState)
State management in Eronom is powered by fine-grained signals initialized with useState().
// Initialize a reactive state signal
let count = useState(0);
// Computed signal that automatically tracks dependencies
let double = useState(() => count * 2);
</script>
<div>
<button onClick={() => count++}>
Count is {count} (Double: {double})
</button>
</div>
Live Interactive Docs Sandbox
Control Flow (if / for Directives)
Eronom supports clean native template directives for conditional rendering and looping without complex map syntax:
let items = useState(["Apple", "Banana", "Cherry"]);
let isLoggedIn = useState(true);
</script>
if isLoggedIn {
<h3>Welcome back!</h3>
for item, i in items {
<p>Item {i + 1}: {item}</p>
}
} else {
<p>Please log in to continue.</p>
}
Context API & State Sharing
Share signals seamlessly across child components without prop drilling:
export let activeTheme = useState('dark');
// Import signal inside child Header component
import { activeTheme } from "@pages/index.erm";