4 ms·
This certainly is an interesting idea. It seems to me though that all of your application logic is jammed into a single file at the presentation layer. This mig
by bobbywilson0 16y ago
This certainly is an interesting idea. It seems to me though that all of your application logic is jammed into a single file at the presentation layer. This might suffice for very small apps, and that's fine if it is your goal. I can't imagine that you just define all of your logic in one file.
How would you go about reusing code?
Could you potentially separate out logic from your template?
I would also like to see how this could be done more unobtrusively. It would also be good to show what the output html looks like after it is compiled to html.
- marcuswestin 16y agoAbsolutely! You can declare something akin to a function, which takes arguments and emits HTML. Imagine e.g. let taskTemplate = template(task) { <div class="task"> <span class="title">task.title</span> </div> } for (task in tasks) { taskTemplate(task) } I'm not decided on syntax yet. You can definitely separate out logic from template this way. Fun outputs javascript, not HTML - the javascript then builds the DOM.
- giantfuzzypanda 16y agoSo if someone has javascript disabled what happens?
- m0th87 16y agoBut it still outputs something that is only consumable by web browsers. It seems to me like the potential productivity gains you'd get out of Fun would only be for tightly coupled systems where you're not worried about exposing an API, and all clients use web browsers.