on master help sign in
Merge branch 'develop' into deprecated-optparse-function
commitfea668f936df1e4a185db8e75721f93a74fad4e3 authorAli Abrar <aliabrar@gmail.com> dateWed 20 Nov 2019, 11:00 (7 years ago) parentc80ade0e9054fc
7 files changed+15−9
ChangeLog.md+3 FAQ.md+2−2 README.md+2−1 dep/reflex-platform/github.json+2−2 lib/command/src/Obelisk/Command.hs+1−1 lib/command/src/Obelisk/Command/Project.hs+3−1 lib/frontend/src/Obelisk/Frontend.hs+2−2
ChangeLog.md+3
@@ -9,6 +9,9 @@ This project's release branch is `master`. This log is written from the perspect
99* Add "ob doc" command, which lists paths to haddock documentation for specified packages
1010* Bump reflex-platform so that obelisk now uses GHC 8.6.5 and the nixos-19.03 nixpkgs set
1111* Add support in obelisk-route for single parameters in URL paths
12+* Bump reflex-platform so that obelisk now uses reflex-dom 0.5.2.0
13+* Use a `--pure` nix shell in `ob run` for parity with `ob repl` and more resilience against "works on my machine".
14+* Use `--keep NIX_PATH` for all pure shells so references to `<nixpkgs>` continues to work.
1215
1316## v0.2.0.0 - 2019-8-17
1417
FAQ.md+2−2
@@ -81,7 +81,7 @@ project's dependencies and,
8181Assuming we are in a project created with `ob init`, `ob run` calls (see
8282`lib/command/src/Obelisk/Command.hs`):
8383
84− nix-shell -A shells.ghc --run 'ob --no-handoff internal run-static-io <real-run-function>'
84+ nix-shell --pure --keep NIX_PATH -A shells.ghc --run 'ob --no-handoff internal run-static-io <real-run-function>'
8585
8686where
8787
@@ -109,7 +109,7 @@ It is defined in `lib/run/src/Obelisk/Run.hs`:
109109 * or to `serveDefaultObeliskApp` (`lib/backend/src/Obelisk/Backend.hs`) to
110110 serve static assets.
111111* Starts `runWidget`
112− which itself runs
112+ which itself runs
113113 [runSettingsSocket](https://hackage.haskell.org/package/warp-3.2.26/docs/Network-Wai-Handler-Warp.html#v:runSettingsSocket)
114114 (the *“TCP listen loop”*):
115115 * it binds to TCP socket, and
README.md+2−1
@@ -105,7 +105,8 @@ Obelisk leverages ghcid to provide a live-reloading server that handles both fro
105105ob run
106106```
107107
108−Now go to http://localhost:8000 (or the address/port specified in `config/common/route`) to access your app.
108+Now, with an appropriate browser, go to http://localhost:8000 (or the address/port specified in `config/common/route`) to access your app.
109+Firefox will not be able to properly run the development website due to [issue 460](https://github.com/obsidiansystems/obelisk/issues/460). Fortunately, this problem does not occur on a fully built website.
109110
110111Every time you change the Haskell source files in frontend, common or backend, `ob run` will automatically recompile the modified files and reload the server. Furthermore, it will display on screen compilation errors and warnings if any.
111112
dep/reflex-platform/github.json+2−2
@@ -2,6 +2,6 @@
22 "owner": "reflex-frp",
33 "repo": "reflex-platform",
44 "branch": "develop",
5− "rev": "b75dfe258c31eb1688090d121f33b62a07071589",
6− "sha256": "0isvqn6y8nnfb4a3nabjsafrz4mfa01vhkn6i61idh6zfb8gciqf"
5+ "rev": "aa8a9d1ac3d41ad51fbe04e575d4350da65cf3db",
6+ "sha256": "0hffy5rcfy6ay06ww3cxykqzp024jfcdg6w1yrmnf0h80sjfgdcm"
77}
lib/command/src/Obelisk/Command.hs+1−1
@@ -106,7 +106,7 @@ data ObInternal
106106inNixShell' :: MonadObelisk m => StaticPtr (ObeliskT IO ()) -> m ()
107107inNixShell' p = withProjectRoot "." $ \root -> do
108108 cmd <- liftIO $ unwords <$> mkCmd -- TODO: shell escape instead of unwords
109− projectShell root False "ghc" (Just cmd)
109+ projectShell root True "ghc" (Just cmd)
110110 where
111111 mkCmd = do
112112 argsCfg <- getArgsConfig
lib/command/src/Obelisk/Command/Project.hs+3−1
@@ -206,7 +206,9 @@ projectShell :: MonadObelisk m => FilePath -> Bool -> String -> Maybe String ->
206206projectShell root isPure shellName command = do
207207 (_, _, _, ph) <- createProcess_ "runNixShellAttr" $ setCtlc $ setCwd (Just root) $ proc "nix-shell" $
208208 [ "default.nix"] <>
209− [ "--pure" | isPure ] <>
209+ -- Keep $NIX_PATH in the env for --pure shells so '<nixpkgs>' works in sub-commands
210+ -- TODO: Don't use <nixpkgs> for anything!
211+ (if isPure then [ "--pure", "--keep", "NIX_PATH" ] else []) <>
210212 [ "-A"
211213 , "shells." <> shellName
212214 ] <> case command of
lib/frontend/src/Obelisk/Frontend.hs+2−2
@@ -229,7 +229,7 @@ runFrontendWithConfigsAndCurrentRoute mode configs validFullEncoder frontend = d
229229renderFrontendHtml
230230 :: ( t ~ DomTimeline
231231 , MonadIO m
232− , widget ~ RoutedT t r (SetRouteT t r (RouteToUrlT r (ConfigsT (CookiesT (PostBuildT t (StaticDomBuilderT t (PerformEventT t DomHost)))))))
232+ , widget ~ RoutedT t r (SetRouteT t r (RouteToUrlT r (ConfigsT (CookiesT (HydratableT (PostBuildT t (StaticDomBuilderT t (PerformEventT t DomHost))))))))
233233 )
234234 => Map Text ByteString
235235 -> Cookies
@@ -241,7 +241,7 @@ renderFrontendHtml
241241 -> m ByteString
242242renderFrontendHtml configs cookies urlEnc route frontend headExtra bodyExtra = do
243243 --TODO: We should probably have a "NullEventWriterT" or a frozen reflex timeline
244− html <- fmap snd $ liftIO $ renderStatic $ fmap fst $ runCookiesT cookies $ runConfigsT configs $ flip runRouteToUrlT urlEnc $ runSetRouteT $ flip runRoutedT (pure route) $
244+ html <- fmap snd $ liftIO $ renderStatic $ runHydratableT $ fmap fst $ runCookiesT cookies $ runConfigsT configs $ flip runRouteToUrlT urlEnc $ runSetRouteT $ flip runRoutedT (pure route) $
245245 el "html" $ do
246246 el "head" $ do
247247 baseTag