Update Readme.md

This commit is contained in:
Natxo
2026-03-28 20:21:42 +01:00
committed by GitHub
parent 002c37c632
commit aef353a983

View File

@@ -1,41 +1,37 @@
# `SigPro` # `SigPro` ⚛️
### **The Atomic Reactivity Engine for the Modern Web.** ### **The Atomic Reactivity Engine for the Modern Web.**
[](https://opensource.org/licenses/MIT) **SigPro** is an ultra-lightweight rendering engine designed for extreme performance. By eliminating the Virtual DOM and heavy compilers, it achieves **surgical reactivity** in less than 2KB.
[](https://www.google.com/search?q=https://github.com/natxocc/sigpro)
[](https://www.google.com/search?q=https://github.com/natxocc/sigpro)
**SigPro** is an ultra-lightweight reactive rendering engine that redefines efficiency. No Virtual DOM, no heavy compilers, and zero dependencies. Just **surgical reactivity** packed into less than 2KB. [**Explore the Docs →**](https://www.google.com/search?q=https://natxocc.github.io/sigpro/) | [**View on GitHub**](https://www.google.com/search?q=https://github.com/natxocc/sigpro)
[**Explore the Docs →**](https://www.google.com/search?q=https://natxocc.github.io/sigpro/)
----- -----
## The SigPro Manifesto ## Why SigPro?
SigPro isn't just another framework; its a precision tool. While other frameworks try to guess what changed by comparing trees (Diffing), SigPro **already knows**. While other frameworks "guess" what changed by comparing massive DOM trees (Diffing), **SigPro already knows**.
* ** Atomic Reactivity:** Powered by a *Signal-based* architecture, SigPro binds state directly to DOM nodes. When a value changes, only that specific node reacts. * 🎯 **Atomic Precision:** Powered by a *Signal-based* architecture. State is bound directly to DOM nodes—when a value changes, **only that specific node updates**.
* ** Zero Overhead:** Forget hydration bottlenecks and 100KB bundles. SigPro is pure, optimized JavaScript tailored for the browser's engine. * 🚀 **Zero-Hydration Bottlenecks:** No 100KB bundles or complex build steps. SigPro is pure, optimized JavaScript tailored for the browser's native engine.
* ** Next-Gen DX:** Say goodbye to endless imports. SigPro injects smart helpers like `Div()`, `Button()`, and `Span()` directly into your environment for a clean, functional syntax. * 💎 **Premium DX (Developer Experience):** Forget boilerplate imports. SigPro injects a functional, elegant syntax (`Div()`, `Button()`, `Span()`) directly into your workflow.
* ** Batteries Included:** Hash-based Routing, native `localStorage` persistence, and automatic lifecycle management (cleanups) come standard. * 📦 **Fully Loaded:** Built-in Hash Routing, native `localStorage` persistence, and automatic lifecycle management (cleanups) out of the box.
* 🌳 **Tree-Shakable:** Optimized for modern bundlers. Import only what you use, or load the full engine for rapid prototyping.
----- -----
## A Glimpse of the Code ## Elegance in Action
Elegance stems from simplicity. Here is how you create a reactive, persistent component: Create reactive, persistent components with a syntax that feels like Vanilla JS, but works like magic:
```javascript ```javascript
// main.js
const Counter = () => { const Counter = () => {
// Persistent Signal: automatically restores state after reload // One-line persistence: state survives page reloads automatically
const count = $(0, "user-counter-pref"); const count = $(0, "user-counter-pref");
return Div({ class: "card-container" }, [ return Div({ class: "card" }, [
H1(`Count: ${count()}`), H1(`Count: ${count()}`),
P("Click below to trigger an atomic update."), P("Atomic updates. Zero re-renders of the parent tree."),
Button({ Button({
onclick: () => count(c => c + 1), onclick: () => count(c => c + 1),
class: "btn-primary" class: "btn-primary"
@@ -48,36 +44,34 @@ $mount(Counter, "#app");
----- -----
## Performance Breakdown ## Performance Without Compromise
| Metric | **SigPro** | React / Vue | Svelte | | Feature | **SigPro** | React / Vue | Svelte |
| :--- | :--- | :--- | :--- | | :--- | :--- | :--- | :--- |
| **Weight (Gzipped)** | **\< 1.8KB** | \~30KB - 50KB | \~2KB (Runtime) | | **Payload (Gzipped)** | **\< 1.8KB** | \~30KB - 50KB | \~2KB (Runtime) |
| **Strategy** | **Atomic Signals** | Virtual DOM Diffing | Compiler Dirty Bits | | **State Logic** | **Atomic Signals** | Virtual DOM Diffing | Compiler Dirty Bits |
| **Update Mechanism** | **Direct Node Access** | Branch Re-rendering | Block Update | | **Update Speed** | **Direct Node Access** | Component Re-render | Block Reconciliation |
| **Persistence** | **Native ($)** | Manual / Plugins | Manual | | **Native Persistence** | **Included ($)** | Requires Plugins | Manual |
| **Learning Curve** | **Flat (Vanilla JS)** | Medium / High | Medium | | **Dependencies** | **Zero** | Many | Build Toolchain |
----- -----
## Recommended Architecture ## Scalable Architecture
SigPro scales beautifully with modern project structures: SigPro scales from micro-widgets to full enterprise dashboards:
```text ```text
app/ src/
├── 📂 components/ # UI Atoms (Button.js, Input.js) ├── 📂 components/ # UI Atoms (Button.js, Grid.js)
├── 📂 pages/ # Main Views (Home.js, Dashboard.js) ├── 📂 views/ # Main Pages (Home.js, Auth.js)
├── 📂 store/ # Shared Global Signals ├── 📂 store/ # Shared Global Signals
├── 📄 App.js # Layout, Router & Navigation ├── 📄 router.js # Route Definitions
└── 📄 index.js # Entry Point & Mounting └── 📄 main.js # App Entry & Mounting
``` ```
----- -----
## Quick Install ## Quick Start
Install via your preferred package manager:
```bash ```bash
npm install sigpro npm install sigpro
@@ -87,4 +81,5 @@ npm install sigpro
## License ## License
MIT © 2026 **SigPro Team**. Engineered for speed, designed for clarity. MIT © 2026 **SigPro Team**.
*Engineered for speed, designed for clarity, built for the modern web.*