How edgeofinnerspace/vi-_-iv works
Project type and purpose
• “viv” is a client-side JavaScript library (an open-source front-end framework) for building web UIs directly in the browser without templating or a virtual DOM. It provides a minimal core (src/viv.js) plus a small helper (src/webscript.js) to parse HTML-ish constructs in JS.
File structure
• Top-level files: configuration (eslintrc.js, .gitignore), package.json, README.md
• src/: the core modules
• viv.js – the reactive-update engine and API surface
• webscript.js – an optional parser that turns JS-embedded HTML into real DOM nodes
• documentation/: a self-contained demo embedding viv in a browser page
• examples/: consumer apps showing viv usage (html2webscript, tictactoe)
• No backend or build pipeline—pure browser library
Key insights from the README
• Goals: zero dependencies, no compiler, no virtual DOM, no new syntax, fine-grained control, high performance
• Usage pattern: developer writes plain JS functions that return DOM nodes; viv tracks dependencies and calls DOM methods directly
a. User Application Code (Examples or downstream apps)
b. viv Core Module (src/viv.js)
c. Webscript Parser Module (src/webscript.js) – optional
d. Browser Runtime / DOM APIs
e. Documentation & Examples (static assets; not part of runtime)
Relationships and data flows
• App Code imports viv core (and webscript if needed)
→ viv exports functions to define reactive “views” and manage state
→ At runtime, viv schedules updates and calls DOM API methods (createElement, setAttribute, appendChild, removeChild)
→ If using webscript: code strings or template-style JS expressions are handed to webscript.parse() → returns DOM nodes
• viv maintains dependency graphs internally and invokes only the minimal updates
• There is no server interaction in the core library; any backend calls would be in user code
Architectural patterns & design principles
• Reactive Programming / Data-Driven Updates (no global re-render, only diff/patch)
• Modular ES6 structure: two small modules (core + parser)
• Zero-dependency philosophy: relies only on Browser DOM APIs
• Extensibility points: user can add custom update hooks or lifecycle events via viv API
Technologies & frameworks
• JavaScript ES6 modules
• Browser DOM API
• No build toolchain—author distributes via npm and raw script tags
• Examples leverage CodeMirror, Prism, Terser only as demo dependencies, not for viv’s core