12 points · by demetriusnunes · 10y ago · 18 comments
But recently I found out about Mithril.js and it seems to me that is technically superior than most of it competitors (in terms of performance, ease of use and size), and yet, pratically nobody is talking about it.
Is this just a marketing issue or am I missing some crucial point here?
I think perception plays a big role. There are fairly large and high traffic apps[1] built w/ Mithril, but when someone is taking a risk to learn a new thing (and there's a lot of that in js), of course something used by google or facebook feels "safer" to learn than something used by mashape, guild wars 2 or lichess. I've seen the "might no longer be supported later" fear being mentioned more than a few times, even though the reality is that it's not really a solo project anymore - it has almost a hundred contributors - and has a fairly sizeable ecosystem[2][3]. There are even Mithril jobs[4] out there.
Another somewhat ironic issue is that Mithril's main appeal is its lack of ceremony. It doesn't ask you to drink the revolutionary koolaid of "bi-directional data binding" or "immutable unidirectional data flow" or whatever other fanciness you can explain to others to make yourself look good. It's just a tool to get stuff done. And even though that's an important metric, it's not exactly newsworthy.
re: ES6: to clarify, you can use ES6 w/ Mithril. The issue in question has to do w/ trying to shoehorn ES6 classes to be components (which are normally plain objects in Mithril). Things like arrow functions actually make things cleaner in places where you'd otherwise use a .bind for example.
[1] https://github.com/lhorie/mithril.js/wiki/Who-Uses-Mithril
[2] https://github.com/lhorie/mithril.js/wiki/Community-Projects
Now that I've worked in react, angular, and mithril I really do think it's the best of the three.
Though I haven't used mithril since I learned about webpack's hot module replacement so I'm not sure if they work well together (but its amazing with react).
Mithril is incredibly lightweight and quick to learn. The utils you've written with respect to rest integration are so quick to pick up and use...
I'm actually thinking about pulling mithril into a react project just for the request side of things.
Anyways, mithril is in my opinion so far, the best of the three.
Both options are costly and that's maybe one of the reasons.
React was just as easy as Mithril. And for big projects, React brings in a better structure and performance. React ecosystem is full of amazing people, there is always something new that i want to learn. Flux, Redux, Relay, RN, the list just goes on.
There is very little in mithril that is "opinionated" so you can be up and running very quickly.
It has a few very key built-in methods that make working with apis easier but they're based on (or possibly exactly) taken from the versions you know. As an example m.request uses a format nearly identical to node's request module.
Compare to angular where you MUST use dependency injection, you must use their templating, must use their XYZ internals. Very heavy to pick up and build correctly. Very slow whan you get to scale.
Compare to react where you've got to use JSX, which means adding transpilers, maybe some sort of gulp-watch, should probably use flux, do things in their opinionated way.
Once you "get it" they each have their pros and cons.
My preference so far is mithril but I am in the middle of giving my react project a fair chance so that opinion may change by the time I go live.