Hacker News new | past | comments | ask | show | jobs | submit login
Ask HN: Ever Use Front End Framework Mithril.js?
7 points by hanniabu on Nov 30, 2015 | hide | past | favorite | 5 comments
I am looking for a front end b frame work to pick up and looking at Mithril. Just from reading some of the docs it looks good on the surface but I haven't actually used it in anything so there could be pitfalls I am unaware of. I am curious if anybody has experience with it and what your thoughts are.

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've used it before. Not for anything "production worthy", but the tool I built is seeing at least monthly use at my company, seems relatively stable (hasn't broken yet), and was way easier (for me at least) to write than the same app when I originally wrote it in Angular.

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.


Thanks for sharing your experience. When I was reading up on it I found out there's been a few updates that fix problems such as not having to redraw as much. You can also write your components in html using the new m.trust('<html>')


Learn both. I have and here's what you'll learn:

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.


You share the same thoughts as I hado which is nice to have that confirmation.

I also just found out that Mithril has a growing material design library. Check out polythene.js.org


I am not an expert in either Mithril.js or React, but have used both.

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.




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: