Live data from Hacker News

Mithril.js – A modern client-side Javascript framework

mithril.js.org

11–20 of 83 posts

Re: Mithril.js – A modern client-side Javascript framework

#12
Mithril is probably my favorite widget framework. I will still use React for larger applications because of the breadth of third-party modules. That said, Mithril and Preact start to make me question React. I'm sure a React developer would say that 10k LOC and 70MB worth of repository is completely necessary for the functioning of React, but part of me thinks there are too many cooks and only one pot. React is elegant, but I don't think its abstractions are simple enough.

Re: Mithril.js – A modern client-side Javascript framework

#13
Looks interesting, but I found the fact that they say

| Be wary of aggressive performance claims, as benchmarks used by some of these projects are known to be out-of-date and flawed (in the sense that they can be - and are - exploited)

on a page full of aggressive performance claims[0] slightly ironic

[0]https://mithril.js.org/framework-comparison.html

Re: Mithril.js – A modern client-side Javascript framework

#14
post #13

Looks interesting, but I found the fact that they say | Be wary of aggressive performance claims, as benchmarks used by some of these projects are known to be out-of-date and flawed (in the sense that they can be - and are - exploited) on a page full of aggressive performance claims[0] slightly ironic [0] https://mithril.js.org/framework-comparison.html

I think what they are trying to say is that try everything yourself and see and don't just blindly believe in benchmarks.

And also mentioned on the same page is this :

In the spirit of demonstrating typical performance characteristics, the benchmarks presented in this comparison page are implemented in an apples-to-apples, naive, idiomatic way (i.e. the way you would normally write 99% of your code) and do not employ tricks or advanced optimizations to make one or other framework look artificially better. You are encouraged to contribute a PR if you feel any DbMonster implementation here could be written more idiomatically.

Re: Mithril.js – A modern client-side Javascript framework

#15
post #8

A lighter-weight and largely API-compatible replacement for React: Preact. https://preactjs.com/

Sure. If you still want to be React-like, that is! But React, Preact are still view libraries right? Mithril is a (reasonably) complete framework. It's sufficiently similar to React that if you know React, you can get productive in Mithril very fast. I guess mithril is for people who want a full framework with no fluff that gets out of the way.

> But React, Preact are still view libraries right?

No, they're component-oriented. View suggests you're doing MVC or similar. You don't need an M & C with React -- you will likely need to add react-router, but react + react-router (or preact + preact-router) is all the 'framework' you need for most apps.

Re: Mithril.js – A modern client-side Javascript framework

#17
post #4

Nowadays I'd recommend HyperApp over mithril.js.

I'm asking why you prefer hyperapp because Mithril has router and xhr capability built-in, and hyperapp doesn't seem to have those features. But hyperapp is really tiny though. :-)

Because HyperApp also has state management built in.

Re: Mithril.js – A modern client-side Javascript framework

#18
post #15

Earlier quoted context omitted.

Sure. If you still want to be React-like, that is! But React, Preact are still view libraries right? Mithril is a (reasonably) complete framework. It's sufficiently similar to React that if you know React, you can get productive in Mithril very fast. I guess mithril is for people who want a full framework with no fluff that gets out of the way.

> But React, Preact are still view libraries right? No, they're component-oriented. View suggests you're doing MVC or similar. You don't need an M & C with React -- you will likely need to add react-router, but react + react-router (or preact + preact-router) is all the 'framework' you need for most apps.

Ok. For that matter, Mithril is also component-oriented and router is included.

And what I meant by react being a view library is that react by itself only handles the UI part and you need to get additional libraries to handle stuff like routing and talking with the server. This stuff is provided by mithril itself.

Re: Mithril.js – A modern client-side Javascript framework

#19
post #13

Looks interesting, but I found the fact that they say | Be wary of aggressive performance claims, as benchmarks used by some of these projects are known to be out-of-date and flawed (in the sense that they can be - and are - exploited) on a page full of aggressive performance claims[0] slightly ironic [0] https://mithril.js.org/framework-comparison.html

I remember that this page even had wrong claims on it years ago.

Re: Mithril.js – A modern client-side Javascript framework

#20
post #4

Nowadays I'd recommend HyperApp over mithril.js.

I'm asking why you prefer hyperapp because Mithril has router and xhr capability built-in, and hyperapp doesn't seem to have those features. But hyperapp is really tiny though. :-)

There are addons for routing and HTTP requests for hyperapp, and they add trivial amounts to the bundle size.

The reason to use hyperapp IMO is it is far closer to the actual Elm-style FRP model, and as such includes functional state management out of the box, in a far less awkward and boilerplate heavy way than Redux provides.

Post reply on HN