A technical guide and conceptual "Rosetta Stone" for React developers exploring Strvct.
React and Strvct both keep user interfaces synchronized with application state, but they start from opposite design philosophies:
useState, useReducer, Redux, Zustand), and write custom render functions. You are responsible for integrating state management, form components, ORMs, REST/GraphQL APIs, routing, internationalization, and accessibility.SvStorableNode classes) with annotated property slots. The framework automatically derives the user interface, manages local IndexedDB persistence and cloud sync, generates Miller column navigation, and provides an AI tool surface without hand-authored UI code.// ContactForm.jsx - Hand-authored UI component
function ContactForm({ contactId, onSave }) {
const [name, setName] = useState("");
const [email, setEmail] = useState("");
const [errors, setErrors] = useState({});
useEffect(() => {
// Fetch from API or local store
api.getContact(contactId).then(data => {
setName(data.name);
setEmail(data.email);
});
}, [contactId]);
const handleSubmit = async (e) => {
e.preventDefault();
if (!email.includes("@")) {
setErrors({ email: "Invalid email address" });
return;
}
await api.updateContact(contactId, { name, email });
onSave();
};
return (
<form onSubmit={handleSubmit} className="contact-form">
<label>Name:
<input value={name} onChange={e => setName(e.target.value)} />
</label>
<label>Email:
<input value={email} onChange={e => setEmail(e.target.value)} />
{errors.email && <span className="error">{errors.email}</span>}
</label>
<button type="submit">Save Changes</button>
</form>
);
}Summary: Requires manually coding state hooks, form inputs, validation error handlers, API serializers, and submit listeners.
// Contact.js - Annotated domain model
(class Contact extends SvStorableNode {
initPrototypeSlots () {
{
const slot = this.newSlot("name", "");
slot.setSlotType("String");
slot.setShouldStoreSlot(true); // Persist to IndexedDB
slot.setSyncsToView(true); // Live UI update
slot.setCanEditInspection(true); // Editable field
}
{
const slot = this.newSlot("email", "");
slot.setSlotType("String");
slot.setShouldStoreSlot(true);
slot.setSyncsToView(true);
slot.setCanEditInspection(true);
}
}
initPrototype () {
this.setTitle("Contact");
this.setShouldStore(true);
}
}.initThisClass());Summary: Declares properties and metadata once. Strvct automatically derives editable UI input fields, handles IndexedDB persistence, emits change notifications, generates Miller column navigation tiles, and exposes an AI tool specification.
| React Concept | Strvct Equivalent | Architectural Difference |
|---|---|---|
Component (JSX) | SvNodeView (Auto-generated or custom subclass) | React components render JSX trees. Strvct views are derived lazily at runtime from SvNode slot metadata. |
State (useState) | Slot getters/setters (this.name(), this.setName(v)) | React state lives in components. Strvct state lives in model slots (setSyncsToView(true)). |
| Context / Redux Store | SvNotificationCenter & SvModel Object Graph | React uses context or external stores for global state. Strvct uses a single local object graph with notification observers. |
Effects (useEffect) | Notification Observations (SvNotificationCenter) | React runs effect hooks after render passes. Strvct observes model events via weak notifications. |
| React Router / Next.js | Miller Column Navigation (SvStackView, SvNavView) | React maps URLs to components manually. Strvct derives navigation paths directly from parent-child object relationships. |
| ORM / REST API Sync | SvPersistentObjectPool (IndexedDB + Cloud) | React requires custom API calls (Axios/TanStack Query). Strvct commits dirty nodes automatically at the end of each event loop. |
| Virtual DOM Reconciliation | Per-Slot Notification Sync (SvSyncScheduler) | React diffs full virtual DOM trees. Strvct updates individual DOM elements directly via coalesced slot change passes. |
| Bundlers (Vite / Webpack) | Content-Addressable Memory (CAM) System | React bundles code into chunks. Strvct caches individual source files in IndexedDB by SHA-256 hash. |
| TypeScript / Prop Types | Slot Type Declarations (slot.setSlotType("String")) | React uses compile-time type checking. Strvct enforces runtime type checking on setters and AI JSON patches. |
SvNotificationCenter. SvSyncScheduler coalesces multiple updates within the event loop, notifying observing views to pull updated values directly.| Dimension | React Ecosystem | Strvct Framework |
|---|---|---|
| Primary Artifact | Authored Component Trees (JSX) | Annotated Domain Models (SvNode) |
| UI Derivation | Manual per screen | 100% Derived automatically |
| Persistence Strategy | Custom integration (REST, GraphQL, Firebase) | Built-in local IndexedDB pools + Cloud Sync |
| Offline Support | Complex PWA / Service Worker setup | Native local-first (offline by default) |
| AI Agent Interop | Custom per-screen tool definitions | Native constant-size tool surface (schema-fetch / apply-patch) |
| Headless Testing | Requires jsdom / Puppeteer | Native Node.js execution (zero DOM dependencies) |
| Internationalization | Manual string wrapping & translation files | Intercepted centrally at tile primitive boundary |
| Module Ecosystem | Full npm ecosystem & Vite / Webpack | Vendored libraries & Content-Addressable Memory (CAM) |