Hacker News new | past | comments | ask | show | jobs | submit login

(Mithril author here)

Usually, what I hear from folks is that you come out of using Mithril with more transferable knowledge than something like React.

One example that comes to mind was when someone realized you could implement an incredibly simple atomic CSS composition framework by basically doing this:

    /* some atomic CSS */
    .primary-color-700 {color:blue;}
    .pad-700 {padding:1em;}

    /* a bog standard CSS selector string */
    const MyWidget = '.primary-color-700.pad-700';

    /* a Mithril element */
    m(MyWidget) // <MyWidget /> in JSX
So you can get a fairly aggressive CSS optimization scheme for basically free, and you can iteratively improve the quality of your atomic CSS as you learn more about plain CSS / semantic taxonomy practices. And meanwhile, you're still just writing bog standard CSS and Mithril templates. There's no compile-time shenanigans to dedupe styles, no extra library runtime, and CSS is actually CSS so if you server-render you stay on the browser's streaming rendering happy path instead of waiting blocked on scripts.

Now compare with what one would do with most frameworks: one would pick some CSS-in-JS library, get things done and over with, but probably learn nothing interesting in the process and have little idea of what sort of code is actually getting shipped to customers.




This is really useful. Thank you.




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: