Ask HN: Ever Use Front End Framework Mithril.js?
I know React is the hot thing right now for components, but Mithril looks better and really attractive to me. I just don't want to waste my time if there's fundamental problems with it.
I know React is the hot thing right now for components, but Mithril looks better and really attractive to me. I just don't want to waste my time if there's fundamental problems with it.
I had a bit of trouble convincing it to redraw when I though it should, and ended up throwing in way more m.redraw()'s than I probably should have, but it works, it's responsive, it's fast (if you couldn't tell that already from it's benchmarks), and it's fun (for me at least).
*Note: I haven't bothered looking into React yet, so I have no real comparison between the two. But Mithril suits my style of development, and that's good enough for me.
P.S. The templates look really nice in CoffeeScript too, for what it's worth.
React is clean but heavy. It can solve every problem for you well except one. That one is mobile web-apps. (It's really heavy for low-bandwidth applications.) React won't make you much of a better developer itself, but all the things that it comes with are really good to learn like:
- Redux - ES6/7 with Babel - Webpack (which I prefer) or Browserify for packaging - Using ESLint to get in the habit of writing readable and consistent code.
Mithril is nimble and light but more difficult to use well. Learning Mithril will make you a better developer because of how it encourages smart use of Javascript. This is easier to see for yourself (read the blog entries) than quantify in a list like I've done with React.
I also just found out that Mithril has a growing material design library. Check out polythene.js.org
React is a safer bet in that it's far more widely used and battle tested by large sites and just about any problem you'd want to solve using React has been solved by others before. Finding solutions to any React problem you want to solve is just a Google search away whereas fewer people have really pushed Mithril's limits and solved every conceivable problem.
Mithril seems faster, more logically designed, and is more fun to use. The killer thing about Mithril is that the documentation and guides are so amazingly good and focused with lots of examples and simple explanations.
As with thuddle's comment, I also had to explicitly call redraw a few more times than what felt necessary to get things working on occasion, but I think that might be more due to my own inexperience with Mithril rather than a bug in the framework.
For personal projects, I'd definitely lean towards Mithril just to enjoy life more. If it was anything where my job was at stake and I had to minimize the risk of not successfully completing the project, React would still probably be the safest bet even if the solution wouldn't be as fun to create or as fast.