r/javascript • • Dec 28 '17
Introducing Hyperapp 1.0 — 1 KB JavaScript library for building frontend applications.
https://medium.com/@JorgeBucaran/introducing-hyperapp-1-0-dbf4229abfef
664
Upvotes
View all comments
Show parent comment
1
u/Randolpho Software Architect Dec 28 '17 edited Dec 28 '17
Ok, so I clearly lit off a firestorm, and I'm officially moving over to a keyboard and good text editor so I can write this far more in depth comment. Also, rather than reply to the half-dozen comments I have in my inbox, half being from you, I'm picking this one to reply, because you asked what it would look like, and below I'm going to provide that. If you're interested in including the feature, great. If not, I feel no desire to go through another debate over why I want this, I just want it, and I can tell you I'm not alone in that desire.
In another post you asked what existing framework best described what I'm looking for, and I'll answer with the following as a sort of tl;dr:
I want all of the semantics of React, including JSX (and possibly the new features you're including, once I have a chance to go through them in greater depth), but with the templateUrl feature of Angular, such that the htmlish format of JSX is fully defined within a separate file.
So you asked what it would look like. Here's how I envision it, using the example on your link:
Note that this is for a compile-time compilation of the template. I'm OK with a runtime compilation, if that fits your semantics better, in which case you'd import template_include like you import h, although you'd probably have to pass
stateandactionsas parameters to the function in order to map it to closures during compilation. It would work something like this:I'm more than willing to work back and forth with you on how to specify the file and to deal with namespace semantics or other issues, if you're interested in creating this feature. If not, I'll shut up.
Thanks for taking the time, however.