As I strive to refine my stack, one consideration becomes increasingly important - Simplicity.
I want my main tool - the UI library - to do just ...
For further actions, you may consider blocking this person and/or reporting abuse
Hy Numbut
What do you think of this, a not styled tiny counter :
You can test it here : DevToTinyCounter
Regards
Hi :)
I like the self-encapsulation of your components. In the second (styled) example, you could move the style inside the Counter function.
What I don't like is that in order to write html hierarchies, you have to declare
selectBase
andunselectBase
each time you enter / exit a DOM node. Your code formatting will be ruined if you run a basic linter.Instead, I would allow a third parameter to the function
div
(and any other HTML Element) that would receive it's children, and it would look like:But that's just my opinion - you should do whatever you like.
Can you send me your github / npm so I can play with it? I couldn't find it.
Also, did you look at hyperapp? It looks close to DML in its concept.
Have a good day :)
Hy Numbut,
Thank you your advises.
In fact, I am not the creator of DML
Here is the official link : DML
Github : DMLGit
Enjoy :-)
Regards
Thanks :)
Hyperapp is nice.
But DML has this very nice thing to refence directly the newly created element.
Read the official site, to see what does that permit.
Regards
Yep, that's actually a neat feature of the
selectBase
code style.Why does everyone want to be framed?
And forget Vanilla JavaScript is the most powerful Framework.
jsfiddle.net/WebComponents/5q4hk3gL/
It's the most powerful in terms of being lower-level. I like your example, it's simple and it's elegant with vanillajs. But what about when you wanna update some other stuff that's not the button you just clicked? Do you really wanna write
querySelector
s all day long? And what about lists? Constructing and replacing the HTML as a string is extremely slow, so to match Yoffee's performance you will have to keep references to DOM Nodes that you'd like to update at some point. What about multiple UI elements that depend on a single property? What about a UI element that is dependent on multiple properties?All is possible with vanilla JS, but your code would be much longer and much less self explanatory, I'm afraid.
Use Github Copilot to write code for you
Reminds me a lot of lit-element (I like that framework)
Thanks :)
You're spot-on, lit was my inspiration to make yoffee, along with lighterhtml!
You have good taste 🙂