Live data from Hacker News

Mithril.js – A modern client-side Javascript framework

mithril.js.org

41–50 of 83 posts

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

#42
I credit mithril and it’s fantastic community of knowledgeable devs with really changing my learning style at the outset of my dev career. Essentially from learning by reading, and becoming overwhelmed (as is often reported in the js world), to learning by doing and using technology. I’m sure this happens to many other people through different routes but I personally experienced it through this community. Seeing people so actively discuss things with new users and the amount of other general interesting discussion that happens in the mithril Gitter channel makes it one of my favourite places on the web. There is a strong desire for simplicity and a strong anti bloat sentiment from the devs over there. I like it a lot. I’m referring to you, Pygy, Leo, tivac, barney, porsager, jaforbes and foxdonut. I have built and deployed a few mithril apps in production early in my career and I’m glad I had the chance. I wonder now how new js devs starting with frameworks like vue can learn to work with the language rather than than the framework when every part of it is wrapped up in a reactivity system. I would worry that a lot of vue devs would come to mithril and not understand why the string literals they are passing down to components are not being set in the parent.

Anyway that’s enough. Cheers to mithril and it’s great devs, if you like mithril check out bss and Wright from porsager and meiosis from Foxdonut.

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

#43
post #30
post #24

Earlier quoted context omitted.

Mithil maintainer here. Guilty as charged. That page hasn't been updated since the v1.0 release, we've been focusing on code improvements. V2 is around the corner (mostly bug fixes, some of which required subtle breaking changes (i.e. things that most users won't run into but it would not have been honest to make it a minor semver bump). We'll revisit the home page before the release.

Do you accept PRs for website and documentation? Thanks!

Yes, they do. But parts are already in process of being updated, so be sure to check other branches!

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

#44

Why include XHR in a view framework?

You can use mithril.js without m.request, but then you have to dispatch redraw events when you finished handling the request[^1]. It also provides a promise API for web requests in old browsers, i.e. without fetch(). If I choose not to use m.request, I would have to find another XMLHttpRequest wrapper and bind it to Mithril.

[^1]: https://mithril.js.org/autoredraw.html#after-mrequest

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

#45
The main problem with steering away from templates is that designers who know HTML are immediately alienated from the code base. Same thing with CSS as objects instead of using real CSS.

When working with libs that use HTML templates such as Vue, it's still possible for designers to be integrated in the development process. But with HyperScript, JSX, or Mithril, anyone contributing to the codebase has to know JavaScript.

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

#47
post #21

This follows Reacts style of 'functions instead of templates'. I don't think it's a good idea. I think React will be the Java of our time. It caters to engineers who want everything to be well defined and typed. And to large corporations which don't care about heavy build processes. Looking at what happened to Java: It's still used a lot. But not by new and exciting companies or indie developers. I think we will see…

You might be right, but I think you underestimate how lightweight React felt compared to all the alternatives when it was first released.

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

#48
I love Mithril. I would encourage every React/Vue developer to try it for a small project. Not to convince them to switch (I use all 3), but because I think using tools designed by smart people with a minimal mindset is valuable. Also I really like the hyperscript approach. It just fits my brain.

Last I checked, Mithril hyperscript couldn't handle SVG, which is a non-starter for dataviz work. Anyone know if that's still the case?

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

#49

Earlier quoted context omitted.

Setting up Webpack manually is a pain, but honestly if one uses create-react-app, everything is done for you and you just start coding your app: you have transpiling of ES6 (at least, I don't know about ES7), you can install and include other packages, etc. etc.

True. If you're creating an app that will be used in production then of course you need to use npm, webpack and other tools. But if you're new to a framework and just want to experiment then being able to create an html file with a couple of script tags and writing code removes many barriers to entry. React, Vue and many others already offer this, I thought it was worth mentioning that Mithril does this too.

I don't know. Creating the HTML file, finding a CDN, and adding script tags take more than:

npx create-react-app MyApp

There is nothing to install, and you have a complete playground to experiment.

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

#50
post #48

I love Mithril. I would encourage every React/Vue developer to try it for a small project. Not to convince them to switch (I use all 3), but because I think using tools designed by smart people with a minimal mindset is valuable. Also I really like the hyperscript approach. It just fits my brain. Last I checked, Mithril hyperscript couldn't handle SVG, which is a non-starter for dataviz work. Anyone know if that's st…

Yeah, hyperscript really doesn't get the attention it deserves.

SVG works fine with Mithril now, and has for a while. Here's a quick sample: https://flems.io/#0=N4IgZglgNgpgziAXAbVAOwIYFsZJAOgAsAXLKEAG...

Post reply on HN