Closed passy closed 9 years ago
It was fun to try to fix these tests to finally play with and get a feeling for Elm https://github.com/luigy/elm-todomvc/commit/c85fcf42a4421d4e69869bb556ff27abe9cf80dd
@luigy That's looking great! :)
@evancz Any chance this could get pulled in?
@luigy, is it okay for me to merge these into my branch? My stuff is all BSD3 and I try to be very careful about this.
So the last remaining thing is local storage? I vaguely recall that not being needed, but I guess I was confused. Once we hear back from @luigy, I'll bring that over from the master branch. At that point, it'll probably be all set.
@evancz it needs to be cleaned up, though:
visibility
is duplicated. ChangeVisibility
action can be removed or the router
could "send" the actionrouter
sends the hash formatted for taskList
case-expression, but it doesn't check wether it is valid "visibility". Maybe the True
case could be relaxed or this logic be handled in the routerSince, "TodoMVC" is usually used as an example to follow I wasn't sure how to go about code style or naming in Elm so I was hoping someone familiar with it to critique :smile:
If you would like to tell me how to proceed I can submit a PR or feel free to merge with the proper changes :)
@evancz Yup, localStorage is still needed. We have an experimental (and thus optional) API, but localStorage is mandatory in terms of the spec at this point.
Okay, I think all of the things mentioned here should be covered now. @luigy, I just left the URL parsing stuff in JS for now, though I could imagine a pattern match that only does stuff on valid strings.
29 passing (1m)
Fantastic! \o/
There are some stylistic changed we have to make to match the TodoMVC repo. It's up to you whether we want to do this in this repo or whenever we're syncing the versions. It's only about white spaces and tabs. What do you think?
What are the rules of that change? Tabs are not permitted in Elm, and though it's possible to do things "all 4 space indent" it would not look very typical.
Tabs are not permitted in Elm
Okay, that makes things easier. :) Other than that the only thing we enforce through JSCS/JSHint is a space after function, ie. function () { …
. Otherwise it should be perfectly compatible.
Do you mean in the snippet of JS in index.html? I'm happy to make those changes on this repo.
@evancz Yup, that's what I mean. Would you like to submit the PR afterwards?
I'm not sure exactly what is needed right now. Would you mind doing a PR for the JS changes? I'm not sure if function foo ()
also needs a space, and I think it's probably easier to just do it than explain to me exactly what needs to happen.
I'm not sure what the protocol is for doing PRs to the todomvc repo, so if I can just get cc'd on it, that'd be ideal.
Is that okay?
@evancz Sounds good. I think I still have a pending one, I can just update that one and cc you on it. :)
The discussion is now in https://github.com/tastejs/todomvc/pull/1041
I think the first confusingly titled "should allow me to add todo items" failure refers to the localStorage persistence.
Saving on blur is implemented slightly differently. You're currently reverting the edit on blur and escape is ignored. I tried to change it like this, but I must be missing something because the behavior is not what I expected. I think because escape also blurs the entry, it's not as easy as I thought:
The "back button" means that the routing should be observed and using back/forwards should change the All/Active/Completed filter in the app.