1.2 upgrade - yesodweb/yesod GitHub Wiki
The Detailed change list and the Changelog have an overview of the changes. The release announcement explains some of the changes.
Scaffolding
Experience reports
https://plus.google.com/118323070335349339293/posts/JxZ2jpW8CfX
Sample patches
Changes
- change the cabal file to
yesod >= 1.2and bump any persistent dependencies to>= 1.2 - run
cabal update&& cabal install --force-reinstalls - most changes are visible in the commit that updates the scaffolding code for Yesod 1.2
- change
sqlSettingstosqlOnlySettings(details here)
Persistent
- change persistent imports:
-import qualified Database.Persist.Store
+import qualified Database.Persist
-import Database.Persist.GenericSql
+import Database.Persist.Sql
- change the
persistquasi-quoter topersistUpperCase. - add
deriving Typeableto any entities that trigger a compile-time error referring to generics. See this patch
Yesod
- Couldn't match expected type
RepJson' with actual typeValue'
-getJsonR :: Handler RepJson
-getJsonR = jsonToRepJson $ object ["message" .= ("Hello, World!" :: Text)]
+getJsonR :: Handler Value
+getJsonR = return $ object ["message" .= ("Hello, World!" :: Text)]
- For multiple representation types, use selectRep/provideRep and Handler TypedContent