File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,6 +8,12 @@ js: update-js build-js
88update :
99 wasm32-wasi-cabal update
1010
11+ repl : update
12+ wasm32-wasi-cabal repl app -finteractive --repl-options=' -fghci-browser -fghci-browser-port=8080'
13+
14+ watch :
15+ ghciwatch --after-startup-ghci :main --after-reload-ghci :main --watch app/* .hs --debounce 50ms --command ' wasm32-wasi-cabal repl app -finteractive --repl-options="-fghci-browser -fghci-browser-port=8080"'
16+
1117build :
1218 wasm32-wasi-cabal build
1319 rm -rf public
Original file line number Diff line number Diff line change @@ -2,7 +2,17 @@ cabal-version: 3.0
22name : miso-todomvc
33version : 0.1
44
5+ flag interactive
6+ default :
7+ False
8+ manual :
9+ True
10+
511common options
12+ if flag (interactive)
13+ cpp-options :
14+ -DINTERACTIVE
15+
616 if impl(ghcjs) || arch(javascript)
717 cpp-options :
818 -DGHCJS_BOTH
@@ -23,6 +33,7 @@ common options
2333 cpp-options :
2434 -DVANILLA
2535
36+
2637executable app
2738 import :
2839 options
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ import qualified Miso.CSS as CSS
3030----------------------------------------------------------------------------
3131default (MisoString )
3232----------------------------------------------------------------------------
33- #if defined(wasm32_HOST_ARCH)
33+ #ifdef WASM
3434foreign export javascript " hs_start" main :: IO ()
3535#endif
3636----------------------------------------------------------------------------
@@ -95,11 +95,11 @@ main = startApp (defaultEvents <> keyboardEvents) app
9595app :: App Model Msg
9696app = (component emptyModel updateModel viewModel)
9797 { mount = Just FocusOnInput
98- #ifdef VANILLA
99- -- dmj: when using vanilla GHC append the styles to <head> in dev mode
98+ #ifdef INTERACTIVE
99+ -- dmj: when using WASM repl mode append styles to <head> in dev mode
100100 , styles =
101- [ Href " https://cdn.jsdelivr.net/npm/todomvc-common@1.0.5/base.min.css"
102- , Href " https://cdn.jsdelivr.net/npm/todomvc-app-css@2.4.3/index.min.css"
101+ [ Href " https://cdn.jsdelivr.net/npm/todomvc-common@1.0.5/base.min.css" True
102+ , Href " https://cdn.jsdelivr.net/npm/todomvc-app-css@2.4.3/index.min.css" True
103103 ]
104104#endif
105105 }
You can’t perform that action at this time.
0 commit comments