4 ms·
One of the comments the other day was "You have reinvented Hyperscript". In case you didn't see it, they meant this [0] and also this [1]. I don't mean this a
by genezeta 2y ago
One of the comments the other day was "You have reinvented Hyperscript".
In case you didn't see it, they meant this [0] and also this [1].
I don't mean this as a critique or dismissal of your idea, but I think it's fair to prefer Hyperscript since it's well tested code and has a couple of additional features (like event handler support) without being much larger than your own code. Also, I think Hyperscript is more correct in the way they build the elements.
[0] https://github.com/hyperhype/hyperscript https://github.com/hyperhype/hyperscript
[1] https://github.com/ohanhi/hyperscript-helpers https://github.com/ohanhi/hyperscript-helpers
- atum47 2y agoI haven't. I tried googling Hyperscript and other stuff came up. Seeing it now I'm glad I end up having the ideia of registering each tag as a function, I think it reads better. (Editing) I'm now seeing your second link, it is quite similar to what I've created. Haven't looked at the source code yet. > I think it's fair to prefer Hyperscript It is.
- atum47 2y agoOk, now that I've looked at both sources, I asked ChatGPT to drawn a comparison between the projects. https://chatgpt.com/share/d38144b6-d088-4887-a2d2-50b931c6af65 https://chatgpt.com/share/d38144b6-d088-4887-a2d2-50b931c6af... One thing it got wrong is that TinyJS can handle events, you can just pass a onclick property via props and it will work `div({onclick: () => alert(1)}, 'click me')`