on master help sign in
Test debug menu
78a5c69Alexandre Esteves
skeleton/default.nix+12−1
@@ -8,9 +8,20 @@
8 }
8 }
9}:
9}:
10with obelisk;
10with obelisk;
11−project ./. ({ ... }: {
11+project ./. ({ pkgs, hackGet, ... }: {
12 android.applicationId = "systems.obsidian.obelisk.examples.minimal";
12 android.applicationId = "systems.obsidian.obelisk.examples.minimal";
13 android.displayName = "Obelisk Minimal Example";
13 android.displayName = "Obelisk Minimal Example";
14 ios.bundleIdentifier = "systems.obsidian.obelisk.examples.minimal";
14 ios.bundleIdentifier = "systems.obsidian.obelisk.examples.minimal";
15 ios.bundleName = "Obelisk Minimal Example";
15 ios.bundleName = "Obelisk Minimal Example";
16+
17+ packages = {
18+ reflex-dom-core = (hackGet ./dep/reflex-dom) + /reflex-dom-core;
19+ };
20+
21+ overrides = self: super: {
22+ ghcjs-dom = pkgs.haskell.lib.overrideCabal (super.ghcjs-dom) (drv: {
23+ configureFlags = [ "-fdebug" ];
24+ });
25+ reflex-dom-core = pkgs.haskell.lib.dontCheck super.reflex-dom-core;
26+ };
16})
27})
skeleton/frontend/frontend.cabal+1
@@ -7,6 +7,7 @@ library
7 hs-source-dirs: src
7 hs-source-dirs: src
8 build-depends: base
8 build-depends: base
9 , common
9 , common
10+ , ghcjs-dom
10 , obelisk-frontend
11 , obelisk-frontend
11 , obelisk-route
12 , obelisk-route
12 , jsaddle
13 , jsaddle
skeleton/frontend/src/Frontend.hs+3−1
@@ -19,6 +19,7 @@ import Reflex.Dom.Core
19import Common.Api
19import Common.Api
20import Common.Route
20import Common.Route
21
21
22+import GHCJS.DOM.Debug
22
23
23-- This runs in a monad that can be run on the client or the server.
24-- This runs in a monad that can be run on the client or the server.
24-- To run code in a pure client or pure server context, use one of the
25-- To run code in a pure client or pure server context, use one of the
@@ -29,9 +30,10 @@ frontend = Frontend
29 el "title" $ text "Obelisk Minimal Example"
30 el "title" $ text "Obelisk Minimal Example"
30 elAttr "link" ("href" =: static @"main.css" <> "type" =: "text/css" <> "rel" =: "stylesheet") blank
31 elAttr "link" ("href" =: static @"main.css" <> "type" =: "text/css" <> "rel" =: "stylesheet") blank
31 , _frontend_body = do
32 , _frontend_body = do
33+ prerender_ blank $ void addDebugMenu
32 el "h1" $ text "Welcome to Obelisk!"
34 el "h1" $ text "Welcome to Obelisk!"
33 el "p" $ text $ T.pack commonStuff
35 el "p" $ text $ T.pack commonStuff
34−
36+
35 -- `prerender` and `prerender_` let you choose a widget to run on the server
37 -- `prerender` and `prerender_` let you choose a widget to run on the server
36 -- during prerendering and a different widget to run on the client with
38 -- during prerendering and a different widget to run on the client with
37 -- JavaScript. The following will generate a `blank` widget on the server and
39 -- JavaScript. The following will generate a `blank` widget on the server and