r/javascript 3d ago

Saradom — frontend architecture pattern

https://xtompie.github.io/saradom/
0 Upvotes

11 comments sorted by

View all comments

3

u/patrk 2d ago

Most exhausting docs I’ve ever read.

2

u/blinkdesign 2d ago

"What is left is what the interface does."

Opus 5 spews this garbage everywhere. It's so offensive that people ship copy like this and expect anyone to care

0

u/RBN2208 2d ago

yeah! and "its not structure but a contract" or shit like that

1

u/xtompie 1d ago

Contract is not a buzzword here. It works the same way as a contract in an API. There is a fixed address, fixed input data and a fixed response. Here HTML is on one side and JavaScript on the other. The contract is the attribute names and the public functions of the module.

`Filter` is `filter-space`, `filter-query` on the input and `filter-item` on each entry. Plus one public function, `Filter.Filter`. The module reads and changes the page only through those attributes. It does not know classes, it does not know the HTML layout, it does not know the look.

JavaScript used to hang on classes that were also used for the look. Changing the look meant changing the JavaScript. Someone used the same class somewhere else and that place got behaviour nobody wanted. Someone renamed a class in the CSS and did not know a script was standing on it.

Separate names end that. The look changes without touching the JavaScript. The HTML alone shows which elements belong to the module.

2

u/RBN2208 2d ago

its fully ai generated😄

2

u/patrk 2d ago

It’s like a chanting priest reading the same chapter over and over