-
-
Notifications
You must be signed in to change notification settings - Fork 926
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reasons we use Mithril #1026
Comments
A tiny, elegant API surface frees you to think about solutions to your problems instead of trying to frame them in the language of the framework. |
My original critique of the site from gitter:
|
We chose Mithril because we were looking for a framework with two main features first: to be able to perform very fast on rendering and to be versatile and small (in size, API and learning curve). Mithril is great at both, and much more. |
no fucking magic |
Unopinionated |
Batman's utility belt - Everything you need at arms length, but you barely even notice it. |
Everything is vanilla functional JavaScript. Refactoring becomes easy and enjoyable. |
Great documentation and simple API. |
Apart of reasons above (simple + small + fast), also JS views (no need for template compilation) is huge for me. |
Clean and Simple. |
A lot of LOTR refs, also. |
Great when using and building npm modules. |
spacejack @spacejack 14:24 @JAForbes "A Javascript Framework for forging Brilliant Applications" Concept image for the website: |
I can do something in Mithril without needing 20 dependencies in my package.json. A LOTR style reference / logo would work. Just look at the popularity of Browserify. Perhaps Mithril can be the mithril magic wand complement to Browserify's wizard's hat. |
The one that rules them all: fast, functional and fun javascript |
Me:
* Well...Angular 2 is definitely an improvement in this front, but it's still not where it should be. |
Thank you everyone for contributing. I'm suprised how singular the comments have been. Many of you are extolling the virtues of it just being Javascript/not some opinionated framework DSL. And a related sentiment: the lack of build tool or complex setup. There is clearly a lot of frustration within this community with framework and build tool burnout. And mithriljs solves that problem with a tiny api surface that is not prescriptive. There is also clearly a similar frustration in the programming community at large. We probably all have witnessed opinions on the recent left-pad situation with npm, and Java programmers writing about how hard it is to get a simple app running these days. No matter how you see these events, there is clearly demand for exactly what mithril achieves. I belive the key is to position it as a utility/library that replaces the need for a framework.
Mithril is in a different category to larger frameworks, but just because it is a "micro framework" that doesn't mean you are settling for a less complete solution. I think we should avoid the word framework entirely, because it leads to playing a game Mithril won't win. We should also make it clear large production codebases use Mithril instead of a larger framework, and that the world didn't end. It'd be great to feature RuneAudio, lichess, Guild Wars, Flarum etc on the home page to assuage any fears that mithril is only suited for hobby projects. So please keep it coming! :) |
I really like Bondifrench's description. The big frameworks seem decidedly "not fun". Mithril was very enjoyable to discover. Several times I wrote a bit of code thinking "That couldn't be it? What else do I have to hook up?" and boom it worked. By the way, I was kind of joking when I suggested sword & sorcery imagery. I mean, I'd be all for 70s van art style, but I could see how it might not be the right way to go. :) |
Yeah, I agree. Fun is maybe more important than any other factor. If we don't enjoy working with a tool we will write poor quality code / be depressed / give up. |
I think a lot of potential Mithril users would want to know "does it scale?". Angular and others may have its purpose somewhere, or maybe people are victim to the hype machine? If we can convince more people to get off the hype wagon and contribute to Mithril and help build a bigger ecosystem of packages, that would be great. |
I can get closer to MVC as it should be than with any other framework. Focus can be on your actual objects, when you skip viewmodels, that is. ;) |
@EirikBirkeland just curious, in what areas should/could Mithril scale? |
So, an argument would be that you can preserve a proper separation of concerns, which is currently not the case for some popular frameworks. @ciscoheat What I had in mind is whether it's suitable for so-called "large" projects, e.g. a dev team of 5+ developers and a lot of code, like 100k+ lines, many iterations and shifting requirements along the way. |
@EirikBirkeland yes, where "proper" is not always separated, whereas the popular frameworks usually enforce a total M,V,C separation, and V is not even considered an object. Mithril keeps that open. I see what you mean, I think it really is suitable for large projects (I explain why in the MVC article), the problem could be to make those large teams feeling comfortable with a small, clever tool like Mithril, instead of the sense of "security" from larger frameworks. A security that will eventually bite back, in my experience, because the focus will be on the structure, not the architecture. Not wanting to start some raging debate here, but Drupal is a good example. A huge structure, hundreds of hours required to become proficient, but then you can do almost anything. But you can do that in less time with much simpler tools however, and then you will have more freedom, which is a double-edged sword of course. I think it's ultimately about trusting yourself, not a structure forcing you to think in a certain way. Maybe the scope got larger than your question, but I'd use a framework with ideas like this for sure. :) |
@JAForbes I like your metaphoric comparison that Mithril (like its fictional namesake) is "Light, Flexible, Strong". I agree many people will not understand that Tolkien reference, so it should be made explicit. @ciscoheat is insightful to say: "But you can do that in less time with much simpler tools however, and then you will have more freedom, which is a double-edged sword of course. I think it's ultimately about trusting yourself, not a structure forcing you to think in a certain way." I like Mithril because it does not get in the way. Mithril makes it possible to leverage JavaScript/TypeScript to the full power of the language. I agree Mithril is "fun" in that sense. Ultimately, a software developer in the web space needs to learn about the DOM, CSS, and JavaScript as well as some notions of good design. It is probably better to commit to learning all that up front (or as you go) using Mithril than to spend a lot of time learning a big framework which locks you in to its way of doing things and then may be passed by eventually. Even if one moves on from Mithril for some reason someday (given so much vdom innovation), the lessons learned using Mithril will be applicable to any web project. So, an investment in using Mithril is an investment in yourself as a web software developer -- not an investment in promoting somebody else's big all-encompassing complex framework. Mithril itself is also easy to learn (aside from needing to know about DOM, CSS, and the basics of good design). If you write your code well (a big "if" in some situations), a Mithril application is probably easier to maintain for some new developer given the short learning curve of Mithril than if the web application was written in a big framework. This is because, with so many frameworks out there, it is likely the next developer will not know the specific framework you chose, and so they will have a big learning ahead of them to learn the framework before they can understand what the application code does or how to change it. If there was only one framework that might not be an issue, but there are several ones out there and new ones are constantly being written, making the odds low of a match between any random new developer and any chosen huge framework. I also like working with the HyperScript API (which is "m" in Mithril and "h" in other libraries like Maquette or virtual-dom). Especially when using Mithril with TypeScript, I like that an IDE or the TypeScript compiler can flag errors that would not be obvious if much of the code was pushed into a separate HTML template. As someone coming to web development from many years working in languages like Java, Delphi, C++, and Python, I like that Mithril with HyperScript supports writing web UIs in a programming language -- not a markup language like HTML or XML where coding is an afterthought. And I say that having been on a team at IBM Research years ago helping implement and refine XML standards. :-) I feel working with HTML-based templates is a holdover from the first days of the web compared to HyperScript. The days when a "designer" could modify HTML files used as templates to make significant changes to how an application works are fading away. We still need good designers, but I feel we should accept that designers will need to learn the HyperScript API (and a bit of programming to do that) if designers want to do more than just modify CSS files and provide wireframes and style guideline documents. I don't feel the lack of designers' programming abilities should be a limiting factor forcing programmers to spend a lot of time programming in what are essentially not programming languages (HTML templates like in many frameworks or XML templates like React's JSX). That said, I'm developing in Angular2 right now to help out with a pre-existing project where I had no involvement in the technology choice. And I feel the Angular2 work takes longer and is more complex to understand and maintain than if I could be writing it in Mithril. Angular2 wants you to do everything the Angular2 way given its "change detection" (using "dirty checking" and enhancements), making it hard to integrate code written in other approaches into an Angular2 app (like code that generates reports from assembling HTML snippets). Angular2 does have some good points of course. But compared to Mithril, Angular2 feels mostly obsolete even though it is still in beta and has huge numbers of people working on it at Google and elsewhere. I miss Mithril. :-( |
@pdfernhout I deeply agree with everything you've just said. It's gratifying to hear you talk about the Hyperscript idiom as a sea-change in writing structured views vis-a-vis XML derivatives from a position of design investment in the latter — and in particular your assertion that it isn't unreasonable to conceive of 'designers' using it — since a large part of the sales strategy for monolithic web app frameworks rests on the assertion that it is inordinate to suggest that these designers are wedded to opening and closing tags with angle brackets: something I find disingenuous, condescending and fundamentally regressive in the scope of aspiration it sets for web design and development. Not wanting to take this tangent too far, but I think it's worth noting what the sales pitch for monolithic web frameworks gives people:
As much as I find all of the above fundamentally distasteful — as an ambitious craftsman, a teacher, and a consulting developer for hire in a thriving web economy — there's no denying the appeal of these things based on economic and political concerns that are often ingrained on a subliminal level. For what it's worth, I really enjoy working with Mithril and conversing with and assisting people working with Mithril because so much of the above disappears — people will occasionally be drawn to Mithril and feel an urge to ask for help in bending Mithril towards these cultural trappings ("can I get this with classes?" and "why isn't the technical solution to the problem we just solved a simple API call?" are returning favourites) — but it's fundamentally easier to reason about people's tangible problems when dealing with Mithril precisely because it doesn't advertise itself on the basis of addressing issues rooted in political / cultural tangents. As such, I must admit to being ironically grateful that Mithril doesn't advertise itself as a competitor to these frameworks — which is not to say I think we should desist from finding more elegant ways of representing the library :) |
Semi-related re: getting some sweet look for it. These fonts make it look SO GOOD. Hobbiton Brushhand (freeware license)Elven Common Speak (freeware license) |
Having worked with Angular/Backbone/React, Mithril had me because:
|
Agreed, 'it just works'. It is a framework though, but it's so unopinionated and small that it feels like a library. |
|
@tinchoz49 It really seems like teams want specialized developers and this is a growing trend I see. I know developer's don't like it, but sadly facebook and google are pushing this trend. It's not the only reason, but I love how mithril's development is purely open source, not a corporate PR stunt or a race towards revolutionary. To add to the discussion, mithril brings the pro's of both ember and react. We can jot out projects quickly which are also maintainable and fast with mithril. |
I ultimately chose to use it because the syntax is so much better than React's messy JSX. Fast, light, straightforward are all awesome bonuses. |
One of the biggest benefits at first was the documentation. It is fantastic because it not only explains how Mithril can be used, but how applications can be structured well with Mithril. I've also found that code written with Mithril tends to be very elegant and concise. Before using Mithril I was very much into React. One of the things with React that bothered me was that there was so much bloat you'd need in order to have just a basic functioning app. Besides React itself, you'd need a way to manage state, you'd need a way to make ajax requests, you'd need React-Router, and likely another module to glue that together with the state (something like react-router-redux). And then the community would encourage also using Immutable js, and some flux implementation, and the list would go on. With almost zero application code, you could already have a 1MB application. Mithril, while smaller/lighter/faster than React, came with almost everything I needed for a fairly complex application. With Mithril, I have more application code than library code, fewer dependencies, and a lot less to glue together. Not dealing with classes and not being forced to transpile just for a quick prototype were other perks. Performance improvements were icing on the cake. |
I'd like to add that the gitter chat has been extremely responsive and active in helping out with any issues I have faced. Mithril allows developers to focus on solving their problem domain in a way that makes sense to them. |
I dabbled with Backbone, Angular 1.x, Ember, React and regularly looked into the documentation of other libraries and frameworks anytime a new version came out. What initially drew me to Mithril was the promise to be a small library that gives you structure and eases the burden of thinking about DOM updates. Back then I built my fair share of web components/widgets with ES3 and jQuery. Mithril not only lifted the burden of thinking about side effects (DOM updates) but also gave me a very tiny bit of (MVC) structure. But this tiny bit just nailed it. Let me explain what I mean:
No matter what I built with it, be it SPAs or just some widgets for static HTML sites, it has always been a pleasure, because debugging my own code and that of my colleagues is way easier without many different framework abstraction layers sprinkled in between. Since I spend more time reading, understanding, testing and debugging code than writing it I really appreciate Mithril unintrusive structure. jQuery is the swiss army knife for DOM interactions. Easy to learn and use for enrichment of static HTML pages. If you need something outside of its API, just add it on top or build a plugin. |
Its simple, flexible and powerful ;) |
I have used Mithril for a number of different projects, ranging from small proofs-of-concept to large platforms with a wide array of functionality and requirements for desktop, mobile etc. I love Mithril for being so well-thought through and lightweight. It contains just the basic features needed to create a fully-fledged web app (components, routes, models etc.). It's such a pleasure to work with. |
|
Lightweight is king on mobile web apps. |
I think I got a pretty good sample of testimonials, so I'm gonna close this. Thanks everyone! |
no dependencies, robustness, simplicity |
more approachable As a newbie and having fiddled about with Angular, Vue etc I found Mithril much more approachable and less intimidating. Setup was quick and easy. I'm often put off by all the tools you need just to get started with js dev. Grunt, Gulp, Bower, Brunch, Browserify, Webpack etc etc. Christ, all I want to do is build a simple web app. Gandalf help me! How did we end up here? If I ever look at someone else's js project I find it ten times more difficult to work out what it's doing than C# projects I look at. Why did anyone think it help anyone to make things exponentially more complicated? I am grateful that I'm not the only one that wants a simple life. And yeah.. sorry.. I am getting emotional. |
I'm just going to leave this forever open... |
why do not someone make some tutorial on youtube? it helps a lot a new developer to know it ;) |
Here my 2 cents, from the mithril's gitter chat I discovered thanks to the guy behind rayfeed (https://rayfeed.com/). We are in a chat together and he told us that he was using this. So I looked it.. and find it really interesting. At my work we use React, I am happy with it but honestly is very verbose (especially with redux) and IMHO once you learn the basic concept behind it that React has brought to mainstream, you became "magically" a better web dev, and you are ready to move out and learn how to use these concepts using the native DOM APIs and other libs/framework that are more minimal. I am trying to start a side project, and decided to move away from React, for these reasons:
Sorry for my poor english! |
From a beginner mindset... after I heard about Web Frameworks and I wanted to learn one of them... I started seeing things like "React has a steep learning curve and Vue.js has the lowest learning curve", I also saw things like 1kB frameworks and the what-not... but the only things I really cared about was EASY TO LEARN & PERFORMANCE/BENCHMARKS... After trying out Vue, which took me over 5 days... I knew I wasn't perhaps understanding what lowest/low learning curve meant in Vue's case. That was no where near easy, maybe easy but took must to grasp, too much load, too many APIs, too many subsystems. When I learned Mithril (I did that several months before trying Vue.js btw), I finished it in under 100 minutes and built a production-facing app with it: so simple, so easy, such little mental/cognitive load, so little to learn. I recently tried that 1KB framework named HyperApp and that's a serious lie, they've just partitioned the codebase, an example is their I think the BEST selling point for Mithril is: The first phrase will pull a lot of beginners especially from Google Search for the search query "easiest javascript framework" (I can't remember how many times I've done that though and in all it brings up nothing meaningful, so I think its a great pitch)... The above pitch is 99% possible for any web framework beginner who is already fluent in JavaScript. |
"Light as a feather, but as hard as dragon scales." |
I think the best thing is what it doesn't have. No transpiler, no command line tool, no scaffolding. Just 8kb, a small API, and everything you need for the front end of an SPA. |
Just wanted to say that Mithril is one of the best software I've had the pleasure to work with in my entire 20y+ dev career working both in backend and frontend. Some points that standout to me: ✅ truly small: No gotchas like needing to add extra 50kb of libs to do basic things like routing and requests. I've either worked with or written Proof of Concepts in Angular, React and Vue before. Angular felt overengineered, often got in the way and node_modules from a simple Hello World reduced my hope in humanity a bit. React and Vue required unreasonable amounts of glue lib to do basic things, the end result was that their node_modules didn't looked much better either and it required extra discipline to keep code maintainable with helper libs being used all the time. As someone who's on the far spectrum of code minimalism and pragmatism, frontend development was frustrating for years until recently when I had the chance to use Mithril in a new project at work. It's been nothing but success so far. Team is ahead of schedule, frontend code is simple, small and maintainable. Suddenly even interns can grok frontend code with little trouble and the faster Save-Refresh-View loop helps too. Most importantly, we're able to accommodate unplanned requirements easily because the code is simpler yet still fully componentized. Thank you Mithril team and contributors. |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Hey everyone!
It would be very helpful if everyone could say 1 or 2 words that summarise why they use Mithril instead of another MVC library.
If anyone and everyone involved in Mithril could just say in 1 word why they use mithril instead of another library. Hopefully we could aggregate and come up with a clear message to help with a redesign of the site. We are all here for a reason, the task is to make our reasons concise and precise.
The text was updated successfully, but these errors were encountered: