I recently took some time to review and refactor the code for my elm-super-rentals app which I first talked about here.
Here’s the new structure of the app:
There was a lot of code cleanup and reorganization but the major updates were the following:
-
I removed the
NotFound
route. There is aNotFound
page but aNotFound
route didn’t seem to make any sense and it led to an illegal state showing up in myRoute.href
function. What URL shouldRoute.NotFound
map to? Now, the question can’t even be asked. -
I started using http-server-spa for local development which I first encountered in the “Elm in Action” book. This means that when developing locally I can now jump to any URL in the app and my front-end routing will work.
-
For production, I switched from GitHub pages to Netlify and got front-end routing working there as well. So now I can send you directly to this page, if I wanted.
-
Finally, I tweaked the various widgets so that they can better serve as examples for writing reusable views.