The Snap team is excited to announce the release of version 0.6 of the Snap Framework. This is a big release with a lot of new functionality. Here is a list of the major changes since 0.5.5:
New features / improvements
The most significant new feature in 0.6 is the snaplet API. It is a ground-up rewrite of our previous extensions system. Snaplets are self-contained portions of websites that can be easily composed to create larger sites. The snaplet infrastructure makes it simple to distribute snaplets for others to use, and provides a clear pathway for contributing to the community. State management, built-in config file infrastructure, and automatic snaplet resource installation are some of the notable things the snaplet infrastructure does for you. For more information on getting started with snaplets, check out the snaplet tutorial. Also be sure to take a look at the API documentation. It is written as prose and should function as a more comprehensive, api-oriented tutorial.
Added a session management interface and a built-in snaplet back end based on HTTP cookies.
Added a snaplet interface for user authentication. Out of the box, Snap 0.6 comes with a simple sample implementation of this user authentication interface that stores user information on the filesystem as an example. We expect, however, that users choose a more sophisticated implementation of this interface corresponding to their choice of data store. Jurriën Stutterheim will be releasing an implementation based on HDBC within a few days.
Added a new testing API to snap-core to make it easier to test Snap applications. See the
Cookiedata structure got two new fields for flagging secure or HTTP-only cookies.
Added a new convenience function
Made logging more flexible by allowing you to specify an arbitrary IO action.
markdownSpliceno longer requires the template directory as a parameter. It uses the directory of the template currently being processed.
heist: added the
spliceNamesfunctions to allow the user to see what templates and splices are being used by Heist.
snap-corehas been changed to an opaque data type, and the implementation has changed from
Data.Mapto the more efficient
unordered-containers. This will break code that expects
Headersto be a type alias for
Snap.Typesmodule has been renamed to the more appropriate
Snap.Typeshas been deprecated and made an alias, but will be going away with the next few major versions.
TemplateMonadto the more appropriate
TemplateMonadis still there, but deprecated and will be removed in a future release.
heist: deprecated the
Cachemodule now binds both a <cache> and <static> tag.
Removed previously deprecated fileServe functions.
Snap.Core; it read request bodies into memory without specifying a maximum size, meaning that an attacker could DoS a server using this function by uploading an arbitrarily large request. The function has been replaced by
readRequestBody, which forces you to choose a maximum length.
Removed the deprecated
Added a mime type for JSON.
- Increased the lower version bound on the case-insensitive package from 0.2 to 0.3.