-
-
Notifications
You must be signed in to change notification settings - Fork 110
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
DRAFT: Web Applications part 1 concept #723
base: main
Are you sure you want to change the base?
Conversation
Hum, I’ve never used it, but I wonder what you can get with elm-program-test https://github.com/avh4/elm-program-test |
That is an option as well. It would require us to update the docker image for the test runner, but we can definitely do that. I don't think we need it for this exercise though, we can test virtually everything already. THe only thing we can't test is that the correct update function gets passed to Browser.sandbox, but we do know that it has the correct type signature, and we do test the update function itself, so you would have to write some very weird code for it to be a problem. |
This is nice, and you are testing all that needs to be tested, although I would also give elm-program-test a shot, maybe we can get even better tests (and they would also be more realistic). However, I'm still unsure whether that concept really works. The point of the Browser module is to make web pages, but here you will never see it, that seems like a shame. Maybe it's still good to learn about the Elm architecture in theory, but... yeah, I'm not sure. |
I've never used elm-program-test, and Matthieu hasn't either, not sure if you have? But I do test my update and view functions routinely, and sometimes my init functions if they are complicated. So I think the testing that is done here is basically the same as what I normally do, so it feels quite realistic to me. It is true that you would never see the code running in the online editor, but we could promote Ellie, and people could copy and paste it in to there to see it running. We could also give people instructions to make it work locally on peoples computer (delete Browser.elm and install the Browser package). Another option is to use the actual Browser module, instead of using a fake. This would mean that if you were solving the exercise on your own computer, you could run it and see a web page. It feels like it might open up a security hole though, but I could investigate if people think this is worth pursuing. |
We could maybe try and have different files (Browser.elm) for the online version and the download version (no Browser.elm). I imagine this would require a chanage to exercism, but I could put something on the forum |
I expect that to be complicated to maintain. I've thought about this some more and you know what? I think that it's worth a shot, especially since you are interested in working on this. Let's do it, and if we get negative feedback, we'll regroup :) No need for elm-program-test for now, that's not required for this exercise. Just a note though: let's keep the required knowledge about HTML to a strict mininum (by providing pre-made views easy to adapt). I knew close to nothing about HTML/JS/CSS when I picked up Elm, Elm-UI was all I needed. |
Ok cool, I'll try and keep the html and css part as small as possible, and keep going with this. We can always see how we like it later, or see if we get any feedback about it if it goes live |
Nice! I agree with minimal html/css stuff and adjust after feedback. Maybe it will also be pioneering some new capabilities for exercism on visualization for web languages tracks. |
Hi everyone, I'd like to get some early feedback on this.
Its a plan to create a concept for #639.
It is possible to shim the Browser module and the tests all run and pass and test all the important things.
There is a change to the elm.json, but just moving the Html dependency from indirect to direct, so I don't think we would need to update the docker images or anything (although we should update all the other elm.json's for consistency).
I think that any syllabus for learning Elm needs to include actually writing a web app, so I am keen to do this, but want to hear peoples thoughts.