Skip to content

Commit

Permalink
Forward-port changes from 0.7.4
Browse files Browse the repository at this point in the history
See #98.
  • Loading branch information
RyanGlScott committed Oct 5, 2023
1 parent d0eb7e2 commit cedb435
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ jobs:
source-repository-package
type: git
location: https://github.com/ku-fpg/javascript-bridge
tag: 1c449b0e2f7fc2eee6a0708139e21bb307f4b964
tag: a4be7cfcf7aaf3ca29cfea5c484bf0eab132bcce
package blank-canvas-examples
flags: +examples
Expand Down
3 changes: 3 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
## next
TODO

### 0.7.4 [2023.10.05]
* Support building with `scotty-0.20`.

### 0.7.3
* Allow building with GHC 9.0.

Expand Down
9 changes: 8 additions & 1 deletion Graphics/Blank.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
Expand Down Expand Up @@ -327,7 +328,7 @@ blankCanvas opts actions = do

-- There has to be a better way of doing this, using function, perhaps?
get (Scotty.regex "^/(.*)$") $ do
fileName :: Text <- Scotty.param "1"
fileName :: Text <- captureParam "1"
db <- liftIO $ atomically $ readTVar $ locals
if fileName `S.member` db
then do
Expand All @@ -343,6 +344,12 @@ blankCanvas opts actions = do
$ setTimeout 100
$ defaultSettings
) app
where
#if MIN_VERSION_scotty(0,20,0)
captureParam = Scotty.captureParam
#else
captureParam = Scotty.param
#endif

{-
generalSend :: forall m a . RunMonad m
Expand Down
5 changes: 4 additions & 1 deletion blank-canvas.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@ Library
mime-types >= 0.1.0.3 && < 0.2,
mtl >= 2 && < 2.4,
natural-transformation >= 0.4 && < 0.5,
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
-- Graphics.Blank.
scotty >= 0.10 && < 0.21,
semigroups >= 0.18 && < 1,
stm >= 2.2 && < 2.6,
text >= 1.1 && < 2.2,
Expand Down
2 changes: 1 addition & 1 deletion cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ package blank-canvas-examples
source-repository-package
type: git
location: https://github.com/ku-fpg/javascript-bridge
tag: 1c449b0e2f7fc2eee6a0708139e21bb307f4b964
tag: a4be7cfcf7aaf3ca29cfea5c484bf0eab132bcce

0 comments on commit cedb435

Please sign in to comment.