You couldn't describe what was going on in an equivalent functional construction of a react version unless you first head off on a diatribe about signals/hooks/state-management-disaster-du-jour, the choice of use of which would have implications to both the event handlers in some way - though they likely couldn't be in-place here, they'd have to be passed down from parent context in a giant dance of inversion of control. At runtime the outcome would likely get parsed twice (once for shadow, once for insertion) if not more times under certain compositions. Here the jquery is almost incidental, and could be quickly replaced by something else - for example want to swap out htmx here, well, just add the markers to the DOM, delete the jquery lines and you're done. You'd probably need to spend at least an hour figuring out if you could fit something independent and platform-native into your react code base, hell I've seen people burn weeks on it.
IMHO, Vue is superior for both maintainability and readability than React. Especially because CSS, JS anda HTML are largely in separate blocks of the same file.
Not that I'm confident Flutter is worth the trade-offs.
It's not.
React CSS modules feel so unwieldy compared to Vue SFC's inline `scoped` CSS.
Vue's approach to templating using `v-for` and `v-if` means that you won't end up with a big block of logic mixed in with the template (you can still do it, but Vue's nature steers you away from it).
And the difference between duplicated and mirrored is ...
Mirrored means when you update state, your changes are reflected in the DOM, automagically.
Duplicated means when you change state, you also have to make the changes to the DOM, yourself.
It appears that Puter handles templating with a pattern like:
let h = ``
h += `<div>${exampleContent}</div>`
h += `<div>${moreExampleContent}</div>`
$(targetEl).append(h)
And handles events in the traditional way: $(targetEl).on('click', function () { /* do stuff */ });
Searching for “React” or “jQuery” in this thread, there are several other conversations with thoughtful comments about pros and cons. One curious tidbit that I learned is that Visual Studio Code doesn’t use a framework either and, like Puter, updates the DOM directly.This might seem like a small issue on the surface but as your application grows, this either becomes a big problem or you have reinvented React, Vue, or something similar, but without the extensive testing and developer/community availability. Which is essentially what VSCode does for example, using some sort of MVP* pattern.
I did web not just before React but before jQuery and MooTools. So it is funny you ask I should explore outside "React cargo cult".
It is not an official framework per se, but it is a framework nonetheless, except without comprehensive documentation and developer availability or much commercial value in investing your time to learn it.
The main point is that if you're arguing against React or any framework "because abstraction bad", you will end up with them anyways, enjoy:
https://github.com/microsoft/vscode/blob/release/1.87/src/vs...
https://github.com/microsoft/vscode/blob/release/1.87/src/vs...
https://github.com/microsoft/vscode/blob/release/1.87/src/vs...
The creators of vscode also explicitly state they don't use UI frameworks. https://www.youtube.com/watch?v=gnKzJRr-rd0
Unless we are calling all libraries and packages as frameworks...
It is because you didn't look deep enough, VSCode for all intent and purposes has a "framework" that it is built on top of.
What is a frameworks anyways?
"Frameworks model a specific domain or an important aspect thereof. They represent the domain as an abstract design, consisting of abstract classes (or interfaces). The abstract design is more than a set of classes, because it defines how instances of the classes are allowed to collaborate with each other at runtime. Effectively, it acts as a skeleton, or a scaffolding, that determines how framework objects relate to each other."
If it walks like a duck, and quacks like a duck, it probably also Reacts like a duck.
> the rendering and organization logic would be mine.
This is cute and nice for a weekend project. But if you want to build commercially viable products or even a GA open-source software, "Mine" is of no value.
Good documentation, extensive testing, developer availability, on the other hand are far more important.