Live data from Hacker News

Release of Mithril 1.0

mithril.js.org

1–10 of 31 posts

Re: Release of Mithril 1.0

#3
Does Mithril implement something akin to Redux? Otherwise, I'd argue that those graphs related to size aren't quite correct.

Also, fetch isn't required for either React or Vue.js, could certainly just use the built XHR API to get down even further.

Re: Release of Mithril 1.0

#4

Does Mithril implement something akin to Redux? Otherwise, I'd argue that those graphs related to size aren't quite correct. Also, fetch isn't required for either React or Vue.js, could certainly just use the built XHR API to get down even further.

> Does Mithril implement something akin to Redux

Depends on what you mean by "akin". The core of Redux is just a few lines of code with a set of very opinionated conventions surrounding it, plus a bunch of utilities that people may or may not use. Angular's services serve a similar purpose to redux, but the approach is quite different. Mithril's idiomatic approach is similar to Redux in the sense that it's largely convention-based, but it doesn't actually require any specialized code. We could talk about non-idiomatic options, but from my observations, Redux is the most popular state management convention/library set for React and vuex is to Vue what Redux is to React.

In any case, were talking about a 2kb difference, so it's not like it makes that much of a difference.

Fetch is not required by any library, but a) realistically nobody uses the XHR API directly and b) projects typically do require XHR capabilities. If we're going to be removing things, note that Mithril and Angular are modular and can also be trimmed down if the comparison criteria involves removing things like XHR. Also, if "using the built-in XHR API" means re-inventing basic things like querystring parsing, then a library starts to look a lot more appealing again, and at that point, we're back to the point that Mithril's XHR utilities are smaller than most others that have comparable feature sets (e.g. Axios, superagent).

Re: Release of Mithril 1.0

#5
I used Mithril for a prototype app a couple years ago, and it was one of those projects that is awesome to get into: the documentation is short but complete, and you can basically learn it and produce a usable app in an afternoon.

One of the things I really liked is there's really no sense of 'magic': as I was learning it, it just clicked and I could basically picture how the framework had been implemented. So many times when I'm learning another framework/library it gets to the point where I just think "Whatever, I don't understand why I have to do this particular boilerplate and though it seems dumb to me, I'll just do it because that's the way it works".

Ultimately we ended up building with Vue (team decision, and I don't remember the precise reasons now) which is similar in many ways, but I did really enjoy Mithril. With 1.0 out I'm going to have to find an excuse to give it a shot again.

----

The changelog [1] is a great example of why the Mithril docs are so great. Each entry shows a code example of old and new usage.

[1] http://mithril.js.org/change-log.html

Re: Release of Mithril 1.0

#6
post #4

Does Mithril implement something akin to Redux? Otherwise, I'd argue that those graphs related to size aren't quite correct. Also, fetch isn't required for either React or Vue.js, could certainly just use the built XHR API to get down even further.

> Does Mithril implement something akin to Redux Depends on what you mean by "akin". The core of Redux is just a few lines of code with a set of very opinionated conventions surrounding it, plus a bunch of utilities that people may or may not use. Angular's services serve a similar purpose to redux, but the approach is quite different. Mithril's idiomatic approach is similar to Redux in the sense that it's largely co…

I'm not expecting there to be a huge difference, but it looks silly to include non-standard features for both React and Vue.

As for performance, do you have a setup that we could see that shows how those are generated? Just genuinely curious.

Re: Release of Mithril 1.0

#7
post #5

I used Mithril for a prototype app a couple years ago, and it was one of those projects that is awesome to get into: the documentation is short but complete, and you can basically learn it and produce a usable app in an afternoon. One of the things I really liked is there's really no sense of 'magic': as I was learning it, it just clicked and I could basically picture how the framework had been implemented. So many t…

I've enjoyed Mithril for a while now, and you will be pleasantly surprised with the rewrite (i.e., the 1.0 version). It's different in quite a few ways and does away with the confusing controller concept for one thing.

But best of all might be lhorie's wisdom (and of course the contributors) that you can consume from the documentation.

Re: Release of Mithril 1.0

#8

Does Mithril implement something akin to Redux? Otherwise, I'd argue that those graphs related to size aren't quite correct. Also, fetch isn't required for either React or Vue.js, could certainly just use the built XHR API to get down even further.

Complete sidenote: Here is an example with something Redux-like done with Mithril:

https://github.com/lhorie/mithril.js/blob/next/examples/todo...

Re: Release of Mithril 1.0

#9
post #4

Earlier quoted context omitted.

> Does Mithril implement something akin to Redux Depends on what you mean by "akin". The core of Redux is just a few lines of code with a set of very opinionated conventions surrounding it, plus a bunch of utilities that people may or may not use. Angular's services serve a similar purpose to redux, but the approach is quite different. Mithril's idiomatic approach is similar to Redux in the sense that it's largely co…

I'm not expecting there to be a huge difference, but it looks silly to include non-standard features for both React and Vue. As for performance, do you have a setup that we could see that shows how those are generated? Just genuinely curious.

Well, maybe we just disagree on this point, but I think it makes more sense to compare apples to apples. To frame in a different way, given that Mithril isn't solely a view library, would you say it makes more sense to compare against a typical Backbone setup including dependencies like jQuery, or just compare against Marionette alone?

The performance numbers are explained in more detailed in the frameworks comparison page (they're dbmonster average render times). There are links to each implementation (they are all naive, using production-mode versions).

Re: Release of Mithril 1.0

#10

Does Mithril implement something akin to Redux? Otherwise, I'd argue that those graphs related to size aren't quite correct. Also, fetch isn't required for either React or Vue.js, could certainly just use the built XHR API to get down even further.

> Also, fetch isn't required for either React or Vue.js, could certainly just use the built XHR API to get down even further.

While true, Mithril does have an XHR interface built in, while Vue doesn't and I don't think React does, so it's a fair comparison to include those in the bundle.

Post reply on HN