-
-
Notifications
You must be signed in to change notification settings - Fork 923
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
Making Mithril more component-driven and less component-oriented #2278
Comments
@MithrilJS/collaborators Could I get some feedback on this? I won't likely be able to respond to any of it today, but I'll be able to tomorrow. |
Some great proposals. Thanks @isiahmeadows. The |
Yes, definitely, view functions for mount/route would be appreciated. It sounds like they would no longer accept components which is, I think, bit unfortinate for really simple stuff. Would it be easier to use m.render with routing? I'm not 100% sold on adding |
I like the proposals, and this statement really resonates with me:
The async component might not need to be in core, but I think having more upfront/semi official pre made components for mithril would be great thing. Even if it was a sub repo, or part of the mithril org. |
BTW, I'm going to close this + its sub-bugs, and I'll file a single RFC-style issue once I have a branch set up on my local fork with a recast, better-structured proposal. I need to have this better locked down and organized first, and spreading it out across 5 issues just isn't cutting it. It's also easier to explain if it's all a bunch of Markdown files I can link to and within. |
If you want to follow developments in the meantime (before I get to filing the issues), follow this branch. |
Edit: before I get to filing the issue (singular). |
Updates
m.async
from this bugThis evolved out of a long discussion between @pygy, @barneycarroll, and I on Gitter.
So I've got this concept of how Mithril could evolve, at a high level, and I feel it could really leverage components and
m
better and be less of a kingdom of nouns. This would all aim for better usability and consistency first, but incidental perf wins could also arise out of this. This is a general synthesis of what all this is and how it'd fit together.There are three general types of changes I'm suggesting here:
m
#2279m.mount
to use a view function rather than a component: Simplify mounting to just be sugar overm.render
#2280m.route
to be a set of dynamic components that invoke view functions: Make the router use components, but only accept view functions #2281I plan to first kick this off in my own fork in a dedicated branch, so I can work on nailing exacts down. It'll also let me independently experiment on how it should be modularized.
If this gets accepted, it'd be a semver-major breaking change with non-trivial migration. It won't be as bad as v0.2 to v1, but it certainly won't be as simple as v1 to v2.
If you're curious what this looks like from 10,000 feet away, here's a rough (and probably broken) TypeScript definition file.
In this comment, I wrote this paragraph. This is a great summary for why I'm pursuing this.
The text was updated successfully, but these errors were encountered: