Faithful Elm and the Amazing Router

I gave an Elm session in YGLF conf. This was a great excuse to free up some hours to work on a new v0.17 SPA (Single Page Application). You won’t believe what happened next…

Well, actually, you would: it was an awesome experience. :)
In fact, I’ve reached the point that the backend me is becoming jealous of the frontend me.

View demo

Get the source code

Fetch GitHub user's info on this fake login.

My goal with building this demo app, was to give a small, yet realistic, look into how Elm
allows us to accomplish daily tasks such as HTTP requests, routing, access, and more.
It was important for me to structure it in the same way that we structure larger apps built for production, so that it could demonstrate more effectively how Elm can be used in a project.

If you are interested in Elm, and want to get a feeling of how it could be built for your apps, this might be a good starting point. I even wanted to add a single test to show how it could be done. But Elm being such a fun, predictable, opinionated, and fun (no mistake here, it deserves the double fun) to work with, I ended up adding more and more tests.
Isn’t that yet another great sign for Elm? I was adding unit tests for a demo app, while we hardly added any unit tests for our Angular apps in production!

I held myself back from adding too many features, but I couldn’t resist polishing the existing ones, and adding lots of comments. With the compiler’s tough love and ever growing unit tests, changes were
so easy it almost felt like cheating (and note that I rarely write “easy” or “trivial” about development issues).

Continue reading…