yesod-core 1.4.0.2 → 1.4.1
raw patch · 3 files changed
+5/−5 lines, 3 filesdep −network-conduitPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependencies removed: network-conduit
API changes (from Hackage documentation)
+ Yesod.Routes.TH.Types: Dynamic :: typ -> Piece typ
+ Yesod.Routes.TH.Types: FlatResource :: [(String, [Piece a])] -> String -> [Piece a] -> Dispatch a -> Bool -> FlatResource a
+ Yesod.Routes.TH.Types: Methods :: Maybe typ -> [String] -> Dispatch typ
+ Yesod.Routes.TH.Types: Resource :: String -> [Piece typ] -> Dispatch typ -> [String] -> CheckOverlap -> Resource typ
+ Yesod.Routes.TH.Types: ResourceLeaf :: (Resource typ) -> ResourceTree typ
+ Yesod.Routes.TH.Types: ResourceParent :: String -> CheckOverlap -> [Piece typ] -> [ResourceTree typ] -> ResourceTree typ
+ Yesod.Routes.TH.Types: Static :: String -> Piece typ
+ Yesod.Routes.TH.Types: Subsite :: typ -> String -> Dispatch typ
+ Yesod.Routes.TH.Types: data Dispatch typ
+ Yesod.Routes.TH.Types: data FlatResource a
+ Yesod.Routes.TH.Types: data Piece typ
+ Yesod.Routes.TH.Types: data Resource typ
+ Yesod.Routes.TH.Types: data ResourceTree typ
+ Yesod.Routes.TH.Types: flatten :: [ResourceTree a] -> [FlatResource a]
+ Yesod.Routes.TH.Types: frCheck :: FlatResource a -> Bool
+ Yesod.Routes.TH.Types: frDispatch :: FlatResource a -> Dispatch a
+ Yesod.Routes.TH.Types: frName :: FlatResource a -> String
+ Yesod.Routes.TH.Types: frParentPieces :: FlatResource a -> [(String, [Piece a])]
+ Yesod.Routes.TH.Types: frPieces :: FlatResource a -> [Piece a]
+ Yesod.Routes.TH.Types: instance Functor Dispatch
+ Yesod.Routes.TH.Types: instance Functor Piece
+ Yesod.Routes.TH.Types: instance Functor Resource
+ Yesod.Routes.TH.Types: instance Functor ResourceTree
+ Yesod.Routes.TH.Types: instance Lift t => Lift (Dispatch t)
+ Yesod.Routes.TH.Types: instance Lift t => Lift (Piece t)
+ Yesod.Routes.TH.Types: instance Lift t => Lift (Resource t)
+ Yesod.Routes.TH.Types: instance Lift t => Lift (ResourceTree t)
+ Yesod.Routes.TH.Types: instance Show typ => Show (Dispatch typ)
+ Yesod.Routes.TH.Types: instance Show typ => Show (Piece typ)
+ Yesod.Routes.TH.Types: instance Show typ => Show (Resource typ)
+ Yesod.Routes.TH.Types: methodsMethods :: Dispatch typ -> [String]
+ Yesod.Routes.TH.Types: methodsMulti :: Dispatch typ -> Maybe typ
+ Yesod.Routes.TH.Types: resourceAttrs :: Resource typ -> [String]
+ Yesod.Routes.TH.Types: resourceCheck :: Resource typ -> CheckOverlap
+ Yesod.Routes.TH.Types: resourceDispatch :: Resource typ -> Dispatch typ
+ Yesod.Routes.TH.Types: resourceMulti :: Resource typ -> Maybe typ
+ Yesod.Routes.TH.Types: resourceName :: Resource typ -> String
+ Yesod.Routes.TH.Types: resourcePieces :: Resource typ -> [Piece typ]
+ Yesod.Routes.TH.Types: resourceTreeName :: ResourceTree typ -> String
+ Yesod.Routes.TH.Types: resourceTreePieces :: ResourceTree typ -> [Piece typ]
+ Yesod.Routes.TH.Types: subsiteFunc :: Dispatch typ -> String
+ Yesod.Routes.TH.Types: subsiteType :: Dispatch typ -> typ
+ Yesod.Routes.TH.Types: type CheckOverlap = Bool
- Yesod.Core: class RenderRoute site => Yesod site where approot = ApprootRelative errorHandler = defaultErrorHandler defaultLayout w = do { p <- widgetToPageContent w; mmsg <- getMessage; withUrlRenderer (\ _render_aD2R -> do { id ((preEscapedText . pack) "<!DOCTYPE html>\ \<html><head><style type="text/css">#synopsis details:not([open]) > ul { visibility: hidden; }</style><title>"); id (toHtml (pageTitle p)); id ((preEscapedText . pack) "</title>"); asHtmlUrl (pageHead p) _render_aD2R; id ((preEscapedText . pack) "</head><body>"); maybeH mmsg (\ msg_aD2S -> do { id ((preEscapedText . pack) "<p class=\"message\">"); id (toHtml msg_aD2S); id ((preEscapedText . pack) "</p>") }) Nothing; asHtmlUrl (pageBody p) _render_aD2R; id ((preEscapedText . pack) "</body></html>") }) } urlRenderOverride _ _ = Nothing isAuthorized _ _ = return Authorized isWriteRequest _ = do { wai <- waiRequest; return $ requestMethod wai `notElem` ["GET", "HEAD", "OPTIONS", "TRACE"] } authRoute _ = Nothing cleanPath _ s = if corrected == s then Right $ map dropDash s else Left corrected where corrected = filter (not . null) s dropDash t | all (== '-') t = drop 1 t | otherwise = t joinPath _ ar pieces' qs' = fromText ar `mappend` encodePath pieces qs where pieces = if null pieces' then [""] else map addDash pieces' qs = map (encodeUtf8 *** go) qs' go "" = Nothing go x = Just $ encodeUtf8 x addDash t | all (== '-') t = cons '-' t | otherwise = t addStaticContent _ _ _ = return Nothing maximumContentLength _ _ = Just $ 2 * 1024 * 1024 makeLogger _ = do { loggerSet' <- newStdoutLoggerSet defaultBufSize; (getter, _) <- clockDateCacher; return $! Logger loggerSet' getter } messageLoggerSource a logger loc source level msg = do { sl <- shouldLogIO a source level; when sl $ formatLogMessage (loggerDate logger) loc source level msg >>= loggerPutStr logger } jsLoader _ = BottomOfBody makeSessionBackend _ = fmap Just $ defaultClientSessionBackend 120 defaultKeyFile fileUpload _ (KnownLength size) | size <= 50000 = FileUploadMemory lbsBackEnd fileUpload _ _ = FileUploadDisk tempFileBackEnd shouldLog _ _ level = level >= LevelInfo shouldLogIO a b c = return (shouldLog a b c) yesodMiddleware = defaultYesodMiddleware
+ Yesod.Core: class RenderRoute site => Yesod site where approot = ApprootRelative errorHandler = defaultErrorHandler defaultLayout w = do { p <- widgetToPageContent w; mmsg <- getMessage; withUrlRenderer (\ _render_aD2F -> do { id ((preEscapedText . pack) "<!DOCTYPE html>\ \<html><head><style type="text/css">#synopsis details:not([open]) > ul { visibility: hidden; }</style><title>"); id (toHtml (pageTitle p)); id ((preEscapedText . pack) "</title>"); asHtmlUrl (pageHead p) _render_aD2F; id ((preEscapedText . pack) "</head><body>"); maybeH mmsg (\ msg_aD2G -> do { id ((preEscapedText . pack) "<p class=\"message\">"); id (toHtml msg_aD2G); id ((preEscapedText . pack) "</p>") }) Nothing; asHtmlUrl (pageBody p) _render_aD2F; id ((preEscapedText . pack) "</body></html>") }) } urlRenderOverride _ _ = Nothing isAuthorized _ _ = return Authorized isWriteRequest _ = do { wai <- waiRequest; return $ requestMethod wai `notElem` ["GET", "HEAD", "OPTIONS", "TRACE"] } authRoute _ = Nothing cleanPath _ s = if corrected == s then Right $ map dropDash s else Left corrected where corrected = filter (not . null) s dropDash t | all (== '-') t = drop 1 t | otherwise = t joinPath _ ar pieces' qs' = fromText ar `mappend` encodePath pieces qs where pieces = if null pieces' then [""] else map addDash pieces' qs = map (encodeUtf8 *** go) qs' go "" = Nothing go x = Just $ encodeUtf8 x addDash t | all (== '-') t = cons '-' t | otherwise = t addStaticContent _ _ _ = return Nothing maximumContentLength _ _ = Just $ 2 * 1024 * 1024 makeLogger _ = do { loggerSet' <- newStdoutLoggerSet defaultBufSize; (getter, _) <- clockDateCacher; return $! Logger loggerSet' getter } messageLoggerSource a logger loc source level msg = do { sl <- shouldLogIO a source level; when sl $ formatLogMessage (loggerDate logger) loc source level msg >>= loggerPutStr logger } jsLoader _ = BottomOfBody makeSessionBackend _ = fmap Just $ defaultClientSessionBackend 120 defaultKeyFile fileUpload _ (KnownLength size) | size <= 50000 = FileUploadMemory lbsBackEnd fileUpload _ _ = FileUploadDisk tempFileBackEnd shouldLog _ _ level = level >= LevelInfo shouldLogIO a b c = return (shouldLog a b c) yesodMiddleware = defaultYesodMiddleware
Files
- Yesod/Core/TypeCache.hs +2/−2
- Yesod/Routes/TH/Types.hs +1/−0
- yesod-core.cabal +2/−3
Yesod/Core/TypeCache.hs view
@@ -31,7 +31,7 @@ -- Since 1.4.0 cached :: (Monad m, Typeable a) => TypeMap- -> m a+ -> m a -- ^ cache the result of this action -> m (Either (TypeMap, a) a) -- ^ Left is a cache miss, Right is a hit cached cache action = case clookup cache of Just val -> return $ Right val@@ -63,7 +63,7 @@ cachedBy :: (Monad m, Typeable a) => KeyedTypeMap -> ByteString- -> m a+ -> m a -- ^ cache the result of this action -> m (Either (KeyedTypeMap, a) a) -- ^ Left is a cache miss, Right is a hit cachedBy cache k action = case clookup k cache of Just val -> return $ Right val
Yesod/Routes/TH/Types.hs view
@@ -1,5 +1,6 @@ {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE TemplateHaskell #-}+-- | Warning! This module is considered internal and may have breaking changes module Yesod.Routes.TH.Types ( -- * Data types Resource (..)
yesod-core.cabal view
@@ -1,5 +1,5 @@ name: yesod-core-version: 1.4.0.2+version: 1.4.1 license: MIT license-file: LICENSE author: Michael Snoyman <michael@snoyman.com>@@ -74,6 +74,7 @@ Yesod.Core.Widget Yesod.Core.Internal Yesod.Core.Types+ Yesod.Routes.TH.Types other-modules: Yesod.Core.Internal.Session Yesod.Core.Internal.Request Yesod.Core.Class.Handler@@ -96,7 +97,6 @@ Yesod.Routes.TH.RenderRoute Yesod.Routes.TH.ParseRoute Yesod.Routes.TH.RouteAttrs- Yesod.Routes.TH.Types ghc-options: -Wall -- Following line added due to: https://github.com/yesodweb/yesod/issues/545@@ -148,7 +148,6 @@ , containers , lifted-base , resourcet- , network-conduit , network , async , conduit-extra