News for hackers. Stuff that matters.
Re:Show HN: My new JavaScript MVC framework by jpmonette on Tuesday March 18, 2014 @11:11PM (#7426599)
There's a sample TodoMVC posted here - https://github.com/jpmonette/todomvc-mithril. If you have any idea to improve, feel free to send a pull request!
Re:Show HN: My new JavaScript MVC framework by lhorie on Wednesday March 19, 2014 @11:19AM (#7429200)
Looks roughly how I'd expect. Personally I don't find it unreadable, except for the 8-spaces-in-a-tab thing (which is not really relevant anyhow). Anyways, few things I see:

- I'm not sure why you're doing `return m("#todo-app"), [...]` on line 15 of the view, it looks like a typo

- I would probably have written a keyboard utility function similar to m.withAttr to keep the e.keyCode stuff out of the controller and remove the anonymous function in the view

- I generally prefer inline ternary syntax instead of a if statement at the top for the "clear" button.

- the pluralize snippet can also be pulled out into a utility method

- I also tend to favor this syntax: m("input#new-todo[placeholder='What needs to be done?']") if the value of the attribute is static (line 18)

Re:Show HN: My new JavaScript MVC framework by thefreeman on Wednesday March 19, 2014 @01:30AM (#7426986)
https://github.com/jpmonette/todomvc-mithril/blob/master/js/...

Looks pretty painful, but I do think adapting JSX could be a pretty painless solution so I don't look at it as a deal breaker. I am still yet to find a javascript templating solution that I don't have at least 1 or 2 issues with.

Re:Show HN: My new JavaScript MVC framework by insin on Wednesday March 19, 2014 @07:39AM (#7427937)
Here's a JSXified version which assumes the existence of an "mshim" object which adapts tag calls and arguments to what m() expects:

https://gist.github.com/insin/9639918

Re:Show HN: My new JavaScript MVC framework by ulisesrmzroche on Wednesday March 19, 2014 @10:21AM (#7428764)
Honestly, that looks worse than I thought it would. Are you guys familiar with the whole, programs are for humans to read it, and incidentally for computers to execute?