yesod-purescript 0.0.4.4 → 0.0.4.5
raw patch · 2 files changed
+17/−6 lines, 2 filesdep −directorydep −filepathdep −parsecdep ~purescript
Dependencies removed: directory, filepath, parsec
Dependency ranges changed: purescript
Files
- Yesod/PureScript.hs +15/−1
- yesod-purescript.cabal +2/−5
Yesod/PureScript.hs view
@@ -19,7 +19,8 @@ addPureScriptWidget, createYesodPureScriptSite, defaultYesodPureScriptOptions,- getPureScriptRoute+ getPureScriptRoute,+ yesodPureScript ) where @@ -49,6 +50,7 @@ , TypedContent (TypedContent) , Yesod , YesodSubDispatch+ , addScript , getYesod , mkYesodSubDispatch , shamlet@@ -484,4 +486,16 @@ Right _js -> return _js let thLit = litE $ stringL $ T.unpack compiled -- this is string literal we can insert at TH call site [|toWidget $ toJavascript $ rawJS $ T.pack $(thLit)|]+++-- | Either add link to dynamically compiled PureScript or return statically compiled PureScript.+-- yesodPureScript :: Bool -> Route -> YesodPureScriptOptions -> Text -> Q Exp+yesodPureScript dev routeName ypso moduleName =+ if dev then+ [|addScript $ $(conE routeName) $ getPureScriptRoute $ map T.pack [$(thModuleNameStrLit)]|]+ else+ addPureScriptWidget ypso moduleName+ where+ thModuleNameStrLit = litE $ stringL $ T.unpack moduleName+
yesod-purescript.cabal view
@@ -1,5 +1,5 @@ name: yesod-purescript-version: 0.0.4.4+version: 0.0.4.5 synopsis: PureScript integration for Yesod description: PureScript is an awesome statically typed language that compiles to JS and runs in your browser, and this module makes it easier to use PureScript in Yesod. homepage: https://github.com/mpietrzak/yesod-purescript@@ -24,12 +24,9 @@ , bytestring , containers , data-default- , directory- , filepath , formatting , fsnotify- , parsec- , purescript >= 0.6.4 && < 0.6.6+ , purescript >= 0.6.4 && < 0.6.7 , regex-tdfa , regex-tdfa-text , shakespeare >= 2