Skip to content

Latest commit

 

History

History
128 lines (75 loc) · 4.28 KB

CHANGELOG.md

File metadata and controls

128 lines (75 loc) · 4.28 KB

None

  • Fix issue with filtering out query parameters @eahlberg
  • Support GHCs 9.0 and 9.2
  • Re-licensed from BSD3 to MIT
  • Released with tight lower bounds and no upper bounds
  • Internal modernizations
  • Add PaginationConfig and various *With-flavored functions for customizing things like per-page size and GET parameter naming @eahlberg
  • Functor, Foldable, and Traversable instances for Pages

    And so necessarily, Page.

    These work by applying the functions to a Pages' current Page, which is to apply it to each of the Page's items. These can be used to extend the data post-pagination; purely via fmap, or with effect using traverse.

    pages <- runDB $ do
      users <- selectPaginated 10 [UserFoo ==. foo] []
    
      -- for :: Pages User -> (User -> t UserWithPosts) -> t (Pages UserWithPosts)
    
      for users $ \user -> do
        posts <- selectList [PostUserId ==. user] [Desc PostCreatedAt, LimitTo 5]
        pure $ UserWithPosts user posts

    Yes, this does encourage N+1 queries, but the idea is they will not be harmful when N is small due to pagination.

  • Export getCurrentPage
  • Simplify some constraints with MonadHandler
  • Major rewrite

    Interfaces for paginate and selectPaginated now return a Pages a type, free of any visuals-related concerns. This value provides the paginated items and can be passed to functions from the Widgets model for rendering navigation HTML.

    The ellipsed widget is most like previous behavior with simple being a new, simpler alternative. These are (for the most part) not configurable, we should instead strive to create separate widgets if we need different behavior.

    Everything is now very type-safe: we use Natural everywhere, with newtypes to differentiate things like PerPage, PageNumbers, etc.

  • Officially drop support for GHC < 7.10

  • Add simplePaginationWidget
  • Support persistent-2.5
  • Require yesod-1.4 & persistent-2.0
  • Allow text-2.0
  • Require persistent-1.3

1.0 Release Candidate

No changes

  • Require yesod-1.2 & persistent-1.2
  • Require yesod-1.1 & persistent-1.1
  • Relax lower bounds on yesod & persistent back to 0.10 / 0.8
  • Support custom pagination widgets
  • Require yesod-1.0 & persistent-0.9
  • Add example
  • selectPaginated needs to be given to runDB by you
  • Fix disabling of next/prev links when appropriate

First released version.