From 83c473947589cd90fc74fb59e9c9c28a677583c3 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Sun, 6 Dec 2020 10:04:08 -0500 Subject: Finish Devalloc miso app prototype After hours of trying to get a page abstraction working in a Miso app (both Devalloc and Hero) I had a revelation: Miso is an SPA - *single* page application - framework, and so trying to put multiple pages into it is fundamentally at odds with the rest of the architecture. Of course this is also a problem with Elm's pattern of nesting models in order to create a page abstraction. They can pull it off because they don't also try to do isomorphic rendering. In hindsight this should be obvious... if I actually do want some kind of page-like abstraction or separation, then I need a much more complex server that can embed different Miso apps based on some logic. But this is more like multi-tenancy, or something. Also I'm starting to think that I don't want Devalloc to be an SPA anyway, so I'll try an experimental branch where I rip it out and just use Servant, Lucid, and Turbolinks. --- Biz/Devalloc/Page/Signup.hs | 46 --------------------------------------------- 1 file changed, 46 deletions(-) delete mode 100644 Biz/Devalloc/Page/Signup.hs (limited to 'Biz/Devalloc/Page/Signup.hs') diff --git a/Biz/Devalloc/Page/Signup.hs b/Biz/Devalloc/Page/Signup.hs deleted file mode 100644 index 8debf53..0000000 --- a/Biz/Devalloc/Page/Signup.hs +++ /dev/null @@ -1,46 +0,0 @@ -{-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE NoImplicitPrelude #-} - -module Biz.Devalloc.Page.Signup - ( Move (..), - Path, - Form (..), - path, - view, - host, - ) -where - -import Alpha -import Biz.App (HtmlApp (..)) -import Miso -import Miso.String -import Servant.API -import Servant.Links -import Servant.Server (Handler) - -data Move = NoMove - -type Path = View Move - -newtype Form = Form - { uri :: URI - } - -path :: URI -path = linkURI <| safeLink (Proxy :: Proxy Path) (Proxy :: Proxy Path) - -host :: Handler (HtmlApp (View Move)) -host = - Form {uri = path} - |> view - |> HtmlApp - |> pure - -view :: Form -> View Move -view _ = - div_ - [] - [ h1_ [] [text "Signup coming soon"], - p_ [] [a_ [href_ "/"] [text "Go back home"]] - ] -- cgit v1.2.3