I'm surprised this kind of data doesn't come up more. Load times and parsing times is something I've been harping on about for ages[1] but these days it feels like no one cares.
My biggest draws to Mithril are the performance and how leightweight it is. I find myself not having to require any other libraries (other than Mithril) and my webpack config ends up being dead simple for most apps I end up writing. It comes with XHR and routing out of the box (no need for extra libraries). My typical app size, with static assets included, weigh in around 200k. I build a lot of "proof of concept" apps, visualizations and internal tools at work.
One of the biggest downsizes to Mithril is the lack of stackoverflow posts. Mithril's documentation is pretty decent, but sometimes I hit a wall. It'd be nice to bounce a question off somebody else using it. On the plus side, I've learned more about Mithril's internals.
This page really sold me on Mithril for my use cases: https://mithril.js.org/framework-comparison.html
I guess it depends.
Compared to React, Hyperdom:
As for Mithril, there is a great write up that goes into a detailed comparison on their website, but one thing stood out for me personally - and it's true for both frameworks - it's pragmatic. There is just not much to it. There is just not much to building SPAs as React might make you think.
On the other hand, React has a massive community and a whole lot of complimentary projects that solve all sorts of problems - I am thinking of styled components for instance - and so perhaps, from that point of view, React is rather pragmatic.
Was this a learning project for you? Is this basically just a rehash of Mithril.js, because that's what it looks like? Mithril aside, you can already do this with React SSR, or EJS, or any of the multitudes of other templating engines
Personally I prefer Mithril for projects of any size, but it's especially well-suited to small projects. It doesn't require any build tooling, you don't need to learn a custom template language, doesn't require fancy redux libraries to wire up redraws. It does include http request and router libs all in a single 8k gzipped script. It also comes with a tiny, optional streams library to help work with async data.
I like Mithril personally. Virtual DOM with auto-redraw, routing, an HTTP wrapper, Promise polyfill, and an optional stream (observables) library. No build tooling required. All in 9K gzipped. Works for anything as simple as widget in a server-rendered page to a full blown SPA.
Building complex forms like this is indeed one of the first historic use cases for front-end frameworks. Don't go with full-blown React / Angulat, try Mithril or some other light lib.
If that's not your cup of tea, and the scenarios all follow the same pattern, you might also use code -> configuration trick, writing the logic in a json along the lines of { option1: ['panel1', 'panel2'] }
. However, in my experience the assumptions of such models are soon broken, leaving you wrapping it with duct tape until your nose bleeds.
React. It's much more marketable these days, and I would argue has a far better fundamental design.
That said, I feel it is my duty to always mention Mithril in these conversations. It still has a smallish user base, but it is fast, easy to learn, and has (in my opinion) an even better design than React.
Did you check the Layout section in this tutorial https://mithril.js.org/simple-application.html?
> I also feel working around that changing the url doesn't 'reload' the page on screen is a bit 'hacky' and is perhaps open to a maintenance nightmare.
I don't understand this. Did you mean changing screens/pages without full-page reload is hacky?
Another way to get helps is heading to https://gitter.im/mithriljs/mithril.js. The community there is very friendly and helpful.
I mainly do small projects as well, but find frameworks nice because they make the code simpler and make it clearer what it's supposed to do, as well as reducing bugs caused by my DOM-updating code. Try Mithril, it's one of the simpler frameworks and has great documentation.
For what it's worth, React isn't the only game in town when it comes to JavaScript frameworks: there's a ton of popular ones.
If your use case requires faster performance than React, I'd say to look at something like Mithril and other JS frameworks out there.
https://mithril.js.org/framework-comparison.html
(This info may or may not be a bit out of date, so do your research)
I use https://github.com/vrimar/construct-ui and https://mithril.js.org/ with TypeScript for frontend part of application written with Golang. construct-ui enables me to think about UI as programmable construct from variety of UI components available, and all that above available mithril.js Mithril.js acts like swiss-army-kinda-lib so really low requirements to go outside, making it fewer dependencies down the road. That said, my target is administrative UI with lot of time-series data which may not be your target.
EDIT: Golang part of application is done with https://github.com/gin-gonic/gin
Reading about mithril.js shouldn't take much time along with gin-gonic code examples. Really easy to create your API endpoints and consume them with your components made from construct-ui objects.
Long time favourite (web development): https://mithril.js.org
Easiest, smallest and most extendable framework I have found and use.
About:
>which elements and qualities do you favour when comparing the frameworks?
If a framework does not immediately click in your head, like "I would have done it exactly the same way", in bigger projects your cognitive load will become overwhelming and hinder you from being fast and reliable.
Beside that, I found that "simplicity" is a good guideline to find something you will like.
It has around ~12k github stars now, and is used by some high profile brands like lichess (second largest chess site in the world) and guild wars (in the marketplace). It raised a few thousand dollars on opencollective.
I believe something like this JSFiddle should do the trick, at least it did during my light testing. The trick I've used is to add a hidden input for repeat
when user selects one-off payment.
The code should work and cover most, if not all, cases but massaging markup in form to satisfy the shape of payload we send to API feels quite hackish — at this point it's more like a mini-app than a simple form, and jQuery isn't an ideal tool for these type of things.
I'd guess using something like Mithril could simplify this code, but it does come at costs: it's an additional API to learn for a developer who might need to change the form and another library to host (or trust in CDN to serve it reliably). Still, if you wish, I can show an implementation of this form in Mithril.
These days I usually work on just backend stuff, but when I do front-end stuff I use Mithril if I have a choice, sometimes via TypeScript. Our standard at work for end user stuff though is React.
Mithril is nice as far as JS libraries go, but I still hate JS itself. TypeScript is meh. Actually, JS itself isn't the worst thing ever, but NPM, Babel, and all that stuff that causes me to burn with anger.
Its a custom stack done by me. Its a mix up of JAMStack and SPA (JS Hydration etc.).
The "base" itself is mithril.js (https://mithril.js.org) which in itself is very extendable.
Main target was Onsite Search Performance and Time To First Byte (TTFB). The old website took 15 sec and more on high time with A LOT of monthly server costs. With this system, the server costs where cut down to 1/12.
> I'm talking about development overhead. The amount of work to get a modern framework integrated into an existing (or legacy) application is not trivial. Part of the overhead is learning to 'write for the framework', instead of just writing plain javascript that can run everywhere without webpack.
there are frameworks which agree with you about that, too.
one by yours, truly: https://github.com/domvm/domvm
another by /u/lhorie: https://mithril.js.org/
and probably quite a few others.
Mithril is dope! Everyone should at least give it a shot, I think you'll be pleasantly surprised. Maybe this tidbit will interest you -- there is no mithril-router
project, it's baked in (in contrast to vue-router
and react-router
:).
I think they are being a bit silly, and mostly just don't understand React or modern front end development.
That said, I am a big fan of Mithril.js. Similar design philosophy as React, but with a nice lightweight API that is easy to learn and a bit closer to the metal than React is. Also, you can use it without any transpiling.
This article is a bit weird. It condemns RealWorld Demo and then proceeds to praise a synthetic benchmark where paint time is the largest component of the measurement. Is the point that solidjs has marginally better numbers than some alternatives? That it doesn't matter and React is good enough? That the whole benchmarking exercise is pointless since the vast majority of perf impact comes from application space? I can't really tell what the message is.
For what it's worth, I consistently call out "vdom in 2kb" libs that are incomplete/incorrect when they pop up around here. And I consistently repeat that you can build apps with any half decent framework
As an author of a framework that is mindful of bundle sizes and KISS mentality, I still think that there isn't enough obsession with bundle sizes among the majority of web devs, let alone more advanced perf topics such as TTFB, TTI, DX-vs-UX, etc.
One can go pretty deep into "unpopular" territory by looking no further than what Google has to say about JS frameworks (TL;DR: they have a pretty unflattering opinion of both SPAs and SSR frameworks like Next.js), but they do have some good points about looking at performance holistically. I say their opinions are "unpopular" because these days web devs are fully into the SPA koolaid and treat even basic perf considerations (like bundle size) as secondary concerns, if they even care at all. But it would be great if more people cared more about the end product of the craft of web development, rather than focusing on what shiny toys that make life easier.
The frontend is primarily a combination of Mithril.js and the Bulma CSS library. Mithril is essentially a much lighter JS framework than many of the alternatives and it doesn't take you too far away from writing normal JS which is something I quite like.
I dunno if you know how this is put together but this looks like a client side view using Mithril, not the actual form processing code that sits on the server.
It's a bit odd, there's nothing in the code that specifies this is secure connect, it's looks like a regular contact form. There's nothing that jumps out to suggest it's encrypting before sending although to be fair, it could be elsewhere, I don't know the js framework and I'm looking at what I can find through basic github searches on the repo.
If I had to hazard a guess, I'd suggest this code connects to a service, downloads a web page containing more code and executes/renders/displays it in a browser window/webview. The code it potentially downloads and displays I have no idea about. There's nothing I can immediately see to suggest that this is the actual complete code for the feature, but there could be more to this.
Is anyone else in a better position to make sense of this?
Hands down my favorite library. It is an MVC with everything you need and nothing you don’t. It’s fast. The API is lightweight and easy to pick up. Every time I get to build a site with Mithril.js is a treat.
> Code is a liability, not an asset. It's like tar.
Bro, does that mean the next step for webdev is no-code??
> I deemed it was critical to have invoice line items be drag-and-drop sortable, so I employed Mithril just for the invoice editing UI.
<unjerk>
Can't jerk. Most dumbass UI/UX jobs you see require minimal shit; like either no JabbaShit or shit like Mithril or Svelte or if you jerk off to React, Preact (lol "closer to the metal") </unjerk>
Here I am, in somewhat of a middle area. Things that can be static pages, should be static pages. Things that are interactive, like "web apps" or things that need more complex UI behavior, I've also been adding Mithril to the mix. It really is a refreshingly simple lightweight library. I much prefer throwing a Mithril component together than coming up with CSS checkbox insanity.
Hi,
I'd like to do a web application. I was looking into something simple like mithril.js. Do you have any suggestions?
Can php handle websockets or do I need to use node?
Thats weird definetly and not what i see. You have a a few buttons missing, or aperently only the graphics for those, as You still have a link to click at the white box that shows as a button for me.
Im currently at work and on mobile and as such i cant provide a pcture for what i see now. Ill see if i can provide You with what it looks like to me when im home tough.
In the mean time i can only suggest You to try it again with a different browser such as the Standard browsers that come with Windows like Internet Explorrer or Edge, and ArenaNet therevor strives to suport, i suppose.
It could be that the Browser Youre using does not Support the Mithril framework, judging by the mention of mithril in the error You get.
Edit: Nevermind my late Answer. I was tricked by my phone showing only a single comments Tread... /face~~palm~~ paw