News for hackers. Stuff that matters.
Re:Riot – A React-like, 2.5K user interface library by tipiirai on Friday January 23, 2015 @05:47AM (#8934226)
Mithril "HTML" syntax is not for my taste:

return m("html", [

    m("body", [

        m("input"),

        m("button", "Add"),

        m("table", [

            m("tr", [

                m("td", [

                    m("input[type=checkbox]")

                ]),

                m("td", "task description"),

            ])

        ])

    ])
]);
Re:Riot – A React-like, 2.5K user interface library by insin on Friday January 23, 2015 @07:18AM (#8934483)
I did a quick tweak of React's JSX transpiler to output mithril-compatible code [1], as the above was the sort of syntax I was using JSX to get away from!

    return <html>
      <body>
        <input>
        <button>Add</button>
        <table>
          <tbody>
            <tr>
              <td><input type="checkbox"/></td>
              <td>task description</td>
            </tr>
          </tbody>
        </table>
      </body>
    </html>
[1] https://github.com/insin/msx/
Re:Riot – A React-like, 2.5K user interface library by tipiirai on Friday January 23, 2015 @08:31AM (#8934701)
Definitely more readable than Mithril
Re:Riot – A React-like, 2.5K user interface library by rapind on Friday January 23, 2015 @11:02PM (#8938771)
I think it starts to look like HAML / Slim / Jade once you use CoffeeScript. Understandably not for everyone, but I quite like it, and it doesn't mess with your syntax highlighting like JSX does.

  m "body",
    m "input"
    m "button", "Add"
    m "table",
      m "tr",
        m "td",
          m "input[type=checkbox]"
        m "td", "task description"
Re:Riot – A React-like, 2.5K user interface library by dopamean on Friday January 23, 2015 @06:41AM (#8934376)
Agreed, it's not the best. Maybe you can help come up with something more palatable?
Re:Riot – A React-like, 2.5K user interface library by istoica on Friday January 23, 2015 @10:15AM (#8935200)
yes man, this abstraction is horror, I hope mithril adheres to something else for declarative tasks a the one above