-
Notifications
You must be signed in to change notification settings - Fork 10
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
Library status #1
Comments
Thanks :) So the master branch is "stable" but has some flaws that I've been trying to address, primarily having to do with large-scale performance. If you want to build a project with it that is going to be huge and supported for all of time, I'd say go for it. Its a simple pattern and you can change it however you want to fit your needs.a In the
So there's a bunch of stuff I want to explore still. I welcome any input or help on this if youre interested. I've committed myself not to build any more side-project apps until I've come up with a frontend architecture that doesnt suck, so I'm going to keep working on this once my job calms down a little bit. The last thing I'll want to do is analyse the performance characteristics of the entire app. Thats something that is rarely done in a rigorous fashion and since this app is entirely composed of pure functions it should be possible. And in that regard, the only concern I have left with this entire approach is the complexity associated with comparing partially applied functions because the comparison will depend on the depth of the component hierarchy.... This is just speculation at this point though. We'll see :) |
My biggest concern is making sure that the API is simple to consume, and project structure is easy to follow and implement. It seems like mego has a good start, just need to simplify some things in that regard. Maybe a sample project using mego would be useful as well that can evolve as the branch does. For services, it would also be nice to be able to plug in external services easily. Anyway, I'll take a look at mego and see if there's anything I can contribute to moving this along. |
Thats going to be a while -- I havent figured out all the schema crawling stuff yet..
Thats the plan! Just like the way master works.
Sounds good 👍 |
@eliperelman after some recent insights I've created a new branch that I think is going to work: https://github.com/ccorcos/elmish/blob/inverted/v11/main.js Rather than map over dispatch and passing the subcomponent state on (like we did before), we pass the global dispatch and state and let the component narrow down on the state that it wants. This makes it much easier on the developer. We do this by "lifting" components. Then the component keeps track of a lens for reading and mutating the global state, and maps over the actions to nest them appropriately. This also make the publish/subscribe implementation pretty easy :) I'm working on building services now but I want to do it the lazily so its performant (just like React). I've been working on this tree / lazyReduce concept here: https://github.com/ccorcos/elmish/blob/inverted/v12/tree.js I think its going to work quite well. And so long as we lift any subcomponents, the services can crawl the entire component tree. There are only two things that are still up in the air conceptually.
I also think we could support all Redux middleware is we fake out the store api which would be really cool. Although I find that most redux middleware breaks purity :/ Anyways, let me know what you think, if you're still interested in this. |
@eliperelman this is going to be the workhorse of pretty much ever service: https://github.com/ccorcos/lazy-tree |
@ccorcos sorry I haven't responded, been a little busy lately. I'm taking a look now. |
I haven't dove into v11 elmish code yet, but just a quick question, in return { count: state.count + 1 } Are you re-creating the state, returning an object to be merged with state, or something else? |
In other words, can you evolve the state from |
h('button.dec', {onClick: dispatch('dec')}, '-') So, this // reduced for brevity
const dispatch = (action) => () => redux.dispatch(action); I've always liked doing it that way, but naming it With JSX: <button className="dec" onClick={dispatches('dec')}>-</button> |
I like where this is going. I'm a JS developer, so it's nice to be able to write with the elm-like patterns but in JS. The pain point I noticed at first glance in the tutorials when If |
I have a much better way :) I'll show you when I'm back at my computer
|
Cool, show me in person! When's the next meetup you're going to? |
No immediate plans. But I'm down for something. this is what it looks like: https://github.com/ccorcos/elmish/blob/inverted/v16/main.js#L122-L135 |
Need some tutorial comments. x} |
I've been reading over the tutorials and I really like the concept and its surface. I'm curious to know about the ability of using elmish as a library, as the repo seems to be in a state of instability. I looked through the branches and it seems that the mego branch has been going through some recent change.
Do you know what it would take in order to make this project user-ready?
The text was updated successfully, but these errors were encountered: