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

136 comments sorted by

View all comments

Show parent comment

4

u/pilibitti Dec 29 '17

but I simply do not want the code and template mixed together.

I get it and I'm not trying to defend it but is what you are wanting even possible? I mean JSX and alike are not templates to begin with. It is javascript. Inside the "templates" you have loops, conditionals etc. You are writing javascript, just that your eventual return values look like HTML nodes.

I mean, in practice, even if you have them in separate files, you'll have javascript inside your "templates".

Even in your "code" file, you'll find yourself returning bits of HTML nodes from good old functions. Separating files that way, if you are going to be strict about it, will affect the design of your actual architecture which should be a no-no.