kansas-comet 0.4.1 → 0.4.2
raw patch · 3 files changed
+31/−15 lines, 3 filesdep ~basedep ~scottyPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base, scotty
API changes (from Hackage documentation)
Files
- CHANGELOG.md +3/−0
- Web/Scotty/Comet.hs +12/−5
- kansas-comet.cabal +16/−10
CHANGELOG.md view
@@ -1,3 +1,6 @@+## 0.4.2 [2023.10.05]+* Support building with `scotty-0.20`.+ ## 0.4.1 [2021.10.09] * Allow building with `aeson-2.0.0.0`.
Web/Scotty/Comet.hs view
@@ -16,7 +16,8 @@ , defaultOptions ) where -import Web.Scotty (ScottyM, text, post, capture, param, setHeader, get, ActionM, jsonData)+import qualified Web.Scotty as Scotty+import Web.Scotty (ScottyM, text, post, capture, setHeader, get, ActionM, jsonData) import Data.Aeson (Value(..)) import Control.Monad import Control.Concurrent.STM as STM@@ -104,7 +105,7 @@ get (capture $ prefix opt ++ "/act/" ++ server_id ++ "/:id/:act") $ do setHeader "Cache-Control" "max-age=0, no-cache, private, no-store, must-revalidate" -- do something and return a new list of commands to the client- num <- param "id"+ num <- captureParam "id" when (verbose opt >= 2) $ liftIO $ putStrLn $ "Kansas Comet: get .../act/" ++ show num@@ -141,8 +142,8 @@ post (capture $ prefix opt ++ "/reply/" ++ server_id ++ "/:id/:uq") $ do setHeader "Cache-Control" "max-age=0, no-cache, private, no-store, must-revalidate"- num <- param "id"- uq :: Int <- param "uq"+ num <- captureParam "id"+ uq :: Int <- captureParam "uq" --liftIO $ print (num :: Int, event :: String) when (verbose opt >= 2) $ liftIO $ putStrLn $@@ -171,7 +172,7 @@ post (capture $ prefix opt ++ "/event/" ++ server_id ++ "/:id") $ do setHeader "Cache-Control" "max-age=0, no-cache, private, no-store, must-revalidate"- num <- param "id"+ num <- captureParam "id" when (verbose opt >= 2) $ liftIO $ putStrLn $ "Kansas Comet: post .../event/" ++ show num@@ -200,6 +201,12 @@ lookupKM = KeyMap.lookup #else lookupKM = HashMap.lookup+#endif++#if MIN_VERSION_scotty(0,20,0)+ captureParam = Scotty.captureParam+#else+ captureParam = Scotty.param #endif -- | 'kCometPlugin' provides the location of the Kansas Comet jQuery plugin.
kansas-comet.cabal view
@@ -1,5 +1,5 @@ Name: kansas-comet-Version: 0.4.1+Version: 0.4.2 Synopsis: A JavaScript push mechanism based on the comet idiom Homepage: https://github.com/ku-fpg/kansas-comet/ Bug-reports: https://github.com/ku-fpg/kansas-comet/issues@@ -21,8 +21,11 @@ , GHC == 8.4.4 , GHC == 8.6.5 , GHC == 8.8.4- , GHC == 8.10.4- , GHC == 9.0.1+ , GHC == 8.10.7+ , GHC == 9.0.2+ , GHC == 9.2.7+ , GHC == 9.4.4+ , GHC == 9.6.1 Description: A transport-level remote JavaScript RESTful push mechanism. @@ -37,15 +40,18 @@ -- TODO: Eventually, we should bump the lower version -- bounds to >=2 so that we can remove some CPP in -- Web.Scotty.Comet.- aeson >= 0.9 && < 2.1,- base >= 4.6 && < 4.16,- containers >= 0.4 && < 0.7,+ aeson >= 0.9 && < 2.3,+ base >= 4.6 && < 4.20,+ containers >= 0.4 && < 0.8, data-default-class >= 0.0.1 && < 0.2,- scotty >= 0.10 && < 0.13,+ -- TODO: Eventually, we should bump the lower version+ -- bounds to >=0.20 so that we can remove some CPP in+ -- Web.Scotty.Comet.+ scotty >= 0.10 && < 0.21, stm >= 2.2 && < 2.6,- text >= 0.11.3.1 && < 1.6,- time >= 1.2 && < 1.11,- transformers >= 0.3 && < 0.6,+ text >= 0.11.3.1 && < 2.2,+ time >= 1.2 && < 1.13,+ transformers >= 0.3 && < 0.7, unordered-containers >= 0.2.3 && < 0.3 GHC-options: -Wall