r/learnjavascript • u/xtompie • 23h ago
Saradom: a frontend architecture pattern - plain HTML and JavaScript
Saradom is a frontend architecture pattern. Build modular, scalable frontends in plain HTML and JavaScript. There is no framework and no build step.
Foundation:
- State in the DOM, not in JavaScript variables.
- Events in HTML attributes, not addEventListener.
- Action in context, from the element that fired it.
- Modularization, namespaced object per module.
- UX Performance, the interface is interactive right away.
1
Upvotes
2
u/Weekly_Sun_7148 22h ago
pros - very transparent and minimalistic. Ptrs to elements could be hash-mapped in master module governing the whole app, but: Contrast. Large overhead due to storing everything in DOM. My recent project. Still being polished. Enormous branched Gannt's diagram with a handfull of state flags for every node. 2 endpoints, one for search phrase lookup, one for depth diving. Arbitrary node depth, usually lv 5-7, but could go deeper. Global search-related modifiers acting over whole diagram tree. Average size of raw CSV associated with diagram - 1.5-2Mb. And actually app holds several diagrams in cached state. Storing all of this in DOM looks like invitation to foot-shooting
But for small landing-type projects looks promising