Yesod 1.2 released
May 2, 2013
The Yesod team is pleased to announce the release of Yesod 1.2. You can get it with:
cabal install yesod-platform yesod-bin
The yesod binary is now a separate package which helps manage dependencies, but it does mean you need to remember to install 2 separate packages.
- Esqueleto was released shortly after Yesod 1.1. This gives SQL users the full power of raw SQL but fully type-checked queries.
- yesod-pure was released for those who want less Template Haskell and type-safety.
- Conduit 1.0 and Wai 1.4 were released
- TypeScript template support was added
- CSS templates support mixins
- Persistent 1.2 was released
- The Warp web server has been continually sped up. These kinds of efforts make Yesod look pretty good in a recently created benchmark suite. There is now a WAI entry in addition to the Yesod entries.
Previously discussed in the post: a better representation system, cleaner internals, and the request local cache. Providing different representation types (JSON or HTML) used to be cumbersome at times, but now it is simple using selectRep.
getResource :: Handler TypedContent getResource = do selectRep $ do provideRep $ [hamlet|<div>|] provideRep $ object ["result" .= "ok"]
Request local type-based caching
See the previous mentioned blog post, but you just need to create a newtype wrapper around some data and then you can cache it with the
Better streaming API
yesod-test was completely overhauled, making it easier to use and providing cleaner integration with hspec.. It is easy in Haskell to just lean against the type system for most things and skip testing, particularly if it is something that is hard to test with QuickCheck. But yesod-test (and wai-test) are there to prevent bugs that the type system cannot.
- More efficient session handling.
- yesod-auth email plugin now supports logging in via username in addition to email address.
- probably more stuff we forgot to mention
Conclusion & more info
FPComplete's development of the School of Haskell has been great for the Haskell community to keep spreading knowledge. It has also been running with the changes for 1.2 for quite a while which should contribute to making 1.2 a more stable release.
The book documentation for 1.2 has been started, but still needs more work to get fully up to date.
Most of the changes to upgrade your site to 1.2 should be fairly mechanical. I started a wiki page for the upgrade. If you have any issues, please note them there or on the mail list.
We hope you enjoy using Yesod 1.2