yesod-fay 0.6.0.1 → 0.6.1
raw patch · 2 files changed
+23/−4 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Yesod.Fay: fayFileProdWithConfig :: (Config -> Config) -> YesodFaySettings -> Q Exp
+ Yesod.Fay: fayFileReloadWithConfig :: Name -> YesodFaySettings -> Q Exp
Files
- Yesod/Fay.hs +22/−3
- yesod-fay.cabal +1/−1
Yesod/Fay.hs view
@@ -67,6 +67,8 @@ -- * Include Fay programs , fayFileProd , fayFileReload+ , fayFileProdWithConfig+ , fayFileReloadWithConfig , FayFile -- * Commands , CommandHandler@@ -128,7 +130,7 @@ CompileError) #endif import Language.Fay.Yesod (Returns (Returns))-import Language.Haskell.TH.Syntax (Exp (LitE, AppE, VarE), Lit (StringL, StringPrimL, IntegerL),+import Language.Haskell.TH.Syntax (Exp (LitE, AppE, VarE), Lit (StringL, StringPrimL, IntegerL), Name, Q, qAddDependentFile, qRunIO) import Data.Text.Encoding (decodeUtf8)@@ -351,11 +353,19 @@ -- embeds the Fay-generated Javascript as a static string. File changes during -- runtime will not be reflected. fayFileProd :: YesodFaySettings -> Q Exp-fayFileProd settings = do+fayFileProd = fayFileProdWithConfig id++-- | Like 'fayFileProd', but also takes a function so that the fay+-- configuration can be modified.+--+-- Since 0.6.1+fayFileProdWithConfig :: (Config -> Config) -> YesodFaySettings -> Q Exp+fayFileProdWithConfig modifier settings = do let needJQuery = yfsRequireJQuery settings qAddDependentFile fp qRunIO writeYesodFay eres <- qRunIO $ compileFayFile fp+ $ modifier $ addConfigPackages packages $ config { configExportRuntime = exportRuntime } case eres of@@ -414,11 +424,20 @@ -- | Performs no type checking on the Fay code. Each time the widget is -- requested, the Fay code will be compiled from scratch to Javascript. fayFileReload :: YesodFaySettings -> Q Exp-fayFileReload settings = do+fayFileReload = fayFileReloadWithConfig 'id++-- | Like 'fayFileReload', but also takes the name of a function used+-- to modify the fay configuration can be modified. The type of this+-- function is expected to be @(Config -> Config)@.+--+-- Since 0.6.1+fayFileReloadWithConfig :: Name -> YesodFaySettings -> Q Exp+fayFileReloadWithConfig modifier settings = do let needJQuery = yfsRequireJQuery settings qRunIO writeYesodFay [| liftIO (compileFayFile (mkfp name)+ $ $(return $ VarE modifier) $ addConfigPackages packages $ config { configTypecheck = typecheckDevel
yesod-fay.cabal view
@@ -1,5 +1,5 @@ name: yesod-fay-version: 0.6.0.1+version: 0.6.1 synopsis: Utilities for using the Fay Haskell-to-JS compiler with Yesod. description: For initial discussion, see <http://www.yesodweb.com/blog/2012/10/yesod-fay-js>. This is a work-in-progress. homepage: https://github.com/fpco/yesod-fay