Live data from Hacker News

Alternative lightweight UI library to modern day frameworks

mithril.js.org

41–50 of 73 posts

Re: Alternative lightweight UI library to modern day frameworks

#41

I used to use mithril for almost every new project I'd start, but I've switched over to using React w/ Hooks for just about everything for two main reasons: - toolchain support is a lot less finicky and better supported (you can use parcel and it "just works") - should I need to bring in a obnoxious third party library, it's far more likely to exist in a react world than mithril If you're just building something smal…

I dunno, I see a lot of react codebases at my day job, and my experience is that libraries are all over the place. The really popular libs are often framework agnostic (e.g. lodash, date-fns, etc), but there's also a long tail of questionable quality libs: some react packages only work with webpack, some use unusual idioms (e.g. having to reference a node_modules path for some css, which doesn't fly with yarn 2), some are unmaintained, etc.

I've also seen cases where people were not aware that high quality vanilla libs exist, e.g. react-dnd vs dragula

There are a lot more wrapper libs for react, that is definitely true, but FWIW, I've come to despise them. Often you end up running into governance/versioning issues (e.g. one moving part releases a new version but you're stuck with the old one because a wrapper author doesn't have time to fix the breaking change, or are MIA, etc), or there are missing/broken pass-through options or whatever...

Re: Alternative lightweight UI library to modern day frameworks

#42

I’d like to use a simple front end library that doesn’t use a vdom, doesn’t require a special state system, doesn’t require special compilation, is performant, and largely gets out of my way. I currently use Preact and am pretty happy with it, even though it doesn’t check most of those boxes. Is there something that does? Anyway, Mithril looks nice. I’ve kicked the tires a few times, but comments like the ones here i…

The “special compilation” step is what annoys me as well. Modern JavaScript is powerful enough and almost universally supported enough to no longer need this. I’m looking forward to the day when we don’t have to use transpiled languages and preprocessrs for basic things.

Re: Alternative lightweight UI library to modern day frameworks

#43
Just in case someone interested.

Mithril works as it is in Sciter.JS

Yet this:

    JSX = m;   // let's  use Mithril as a driver of JSX expressions
enables built-in and native Sciter's JSX extension to work with Mithril:

See demo: https://github.com/c-smile/sciter-js-sdk/blob/main/samples/m...

Sciter.JS uses QuickJS with JSX parsing extension added : https://github.com/c-smile/quickjspp/blob/master/quickjs-jsx... . It is significantly easier and effective to add JSX as part of native JS parser rather than to have monstrous JS-parser-in-JS infrastructure of Babel.

Re: Alternative lightweight UI library to modern day frameworks

#44
post #25

From the Framework comparison page: "Guild Wars 2 uses Mithril (yes, inside the game!)" I would love to hear more about that! Anyone know where I can find more information?

I read an interview by Pat Cavit (the former UI lead at ArenaNet) where he briefly speaks about it here: https://carlmungazi.github.io/sourcecodeadventures/posts/pat...

Re: Alternative lightweight UI library to modern day frameworks

#45

Does Mithril include state management? I see it’s being compared to Vue + VueX but I didn’t see other mentions of state management on the linked page.

I've only just learned about Mithril streams: https://mithril.js.org/stream.html#combining-streams

No experience of using them, but they look cool for managing state.

Re: Alternative lightweight UI library to modern day frameworks

#46

Does Mithril include state management? I see it’s being compared to Vue + VueX but I didn’t see other mentions of state management on the linked page.

I wrote a brief blog post[1] about vanilla state management in Mithril. Since Mithril triggers redraws on event handler calls, as another user said, you can just use POJOs very easily.

[1] [link redacted]

Re: Alternative lightweight UI library to modern day frameworks

#47

Right now Next.js might be the hottest front end framework but I'm looking for something simpler to build SPA's. I'm not interested in SSR or SSG at all. Mithril.js looks very promising as it provides you with everything you might need to build a simple web app out of the box. The only other frameworks that do that is Angular and Ember, but they're both declining in popularity especially Ember. On the other hand Reac…

I've become a big fan of light weight mostly native web components.

I use lit-html for rendering.

Then I sprinkle in components as I need from things like ionic or shoelace.style

Re: Alternative lightweight UI library to modern day frameworks

#48
I like to chime in every time I see a thread about Mithril. I learned modern SPA development with Mithril and in many ways still prefer it over React or Svelte.

It's definitely starting to show its age as many of the main contributors have moved on and new libs are being created everyday. However the chat [1] is still very active and there are always great discussions going on there that are often not even specifically about Mithril. One of the best dev communities I've found, honestly.

One major benefit of Mithril for me is the lack of need for polyfills while still including a router, XHR utils, and simple state management, AND being compatible with IE11 out of the box, which is invaluable for many government contracts I work on where I don't want to introduce any potentially complicated build tools to an already complex codebase.

[1] https://gitter.im/mithriljs/mithril.js

Re: Alternative lightweight UI library to modern day frameworks

#49

Does Mithril include state management? I see it’s being compared to Vue + VueX but I didn’t see other mentions of state management on the linked page.

It’s left up to you. POJOs work just fine in Mithril, but you can use any of the existing libraries (Redux, Mobx, etc) too if you want.

So then it’s probably more fair to compare it to Vue without VueX included, no?

Re: Alternative lightweight UI library to modern day frameworks

#50
post #46

Does Mithril include state management? I see it’s being compared to Vue + VueX but I didn’t see other mentions of state management on the linked page.

I wrote a brief blog post[1] about vanilla state management in Mithril. Since Mithril triggers redraws on event handler calls, as another user said, you can just use POJOs very easily. [1] [link redacted]

You have a very nice-looking blog.
Post reply on HN