CHANGELOG
Release Policy
Pagy follows the Semantic Versioning 2.0.0, and introduces BREAKING CHANGES only for MAJOR versions.
We release any new version (MAJOR, MINOR, PATCH) as soon as it is ready for release, regardless of any time constraint, frequency or duration.
We rarely deprecate elements (releasing a new MAJOR version is just simpler and more efficient). However, when we do, you can expect the old/deprecated functionality to be supported ONLY during the current MAJOR version.
Recommended Version Constraint
Given a version number MAJOR.MINOR.PATCH (e.g. 43.8.5):
The gem 'pagy', '~> 43.0' Gemfile entry (without the PATCH number) ensures that the bundle update command will update pagy to
the most recent version WITHOUT BREAKING CHANGES.
Increment the MAJOR version in your Gemfile ONLY when you are ready to handle the BREAKING CHANGES.
Breaking Changes
Follow the Upgrade to 43 Guide.
If you upgrade from version < 9.0.0 see the following:
- Breaking changes in version 9.0.0
- Breaking changes in version 8.0.0
- Breaking changes in version 7.0.0
- Breaking changes in version 6.0.0
- Breaking changes in version 5.0.0
- Breaking changes in version 4.0.0
- Breaking changes in version 3.0.0
- Breaking changes in version 2.0.0
- Breaking changes in version 1.0.0
Tip
If you need to update through multiple versions, reimplementing the updated pagination from scratch might be faster.
Deprecations
-
Pagy.options: UsePagy::OPTIONSdirectly. -
Pagy.sync_javascript(...): UsePagy.sync(:javascript, ...)instead. -
:max_pagesoption: follow this method instead.
IMPORTANT: The Issue #890 still affect the:max_pagesoption, so stop using it ASAP. -
:client_max_limitand:max_limitoptions: use:client_limitinstead.
Version 43.8.5
- Recount instead of raising on a negative countish page param count (#940)
Version 43.8.4
- Restart the keynav pagination from the first of two empty pages
- A visited page is shown empty only when no records follow it
- The page shows the next records of the set, and the client forgets the visited pages after it
- The clients that do not guard the updates keep their pages
- Handle the malformed params in the Request only
- Handle malformed page and limit params instead of raising (#939)
Version 43.8.3
- Check the position of all the cutoffs of the keynav page
- The client stores its cutoffs at the positions from 1 to last - 1
- A page array with a cutoff missing from those positions, or present outside them, restarts from page 1
- A forged next cutoff can no longer produce a next page beyond the last one
- Noted by Zac (7a6163) in the review of the fix
- Restart the keyset pagination when the page param is not a cutoff
- A page param that decodes to an integer or a string no longer raises
- A page param that is not an array of the keyset size restarts from the first page
- Noted by Zac (7a6163) in the review of the fix
- Restart the keynav pagination when the page cutoff does not match the page position
- Only the last page has no cutoff: a page array that says otherwise restarts from page 1
- A forged page can no longer produce a next page beyond the last one
- Suggested by Zac (7a6163) in the review of the fix
- Share the keynav storage key among the navs of the same pagination
- The navs of a new pagination created a storage key each, leaving unused entries in the sessionStorage
- A re-rendered series_nav_js created a new one at each rendering
- Merge the short and empty visited keynav pages
- A short page is merged with the next page when their records fit in the limit
- An empty page is always replaced by the next page
- A short page followed by the last page is filled from it
- The clients that do not guard the updates keep their pages
- Limit the records of the visited keynav pages
- A visited page is fetched with a limit, so a forged cutoff cannot pull the whole set
- A page grown beyond the limit is split: its new cutoff is inserted before the old one
- The clients that do not guard the updates get the old cutoff replaced
- Reported by Zac (7a6163) in GHSA-v472-jp5g-c53f
- Skip the keynav cutoffs update generated by a stale page
- The client sends also the cutoff of the next page
- The server returns the cutoffs it received with the update
- The client updates its cutoffs only if they are still the ones the server received
- Reloading an old URL no longer overwrites the stored cutoffs
- Validate the keynav page param and require a matching cookie
- The page array restarts from page 1 when its types or its range are wrong
- A missing cookie no longer matches a null browser key
- A page param that does not decode to an array no longer raises
- Reported by Zac (7a6163) in GHSA-h648-g954-826q
Version 43.8.2
- Fix the page placeholder in the Croatian info_tag.no_count (#937)
- Require cgi/escape instead of cgi in a_lambda (#934)
- Build page URLs 1.5x faster by escaping the query with CGI.escape (#933)
Version 43.8.1
- Fix Active Record connection checkout in keyset pagination (#931)
Version 43.8.0
- Add Romanian localization (#930)
Version 43.7.1
- Fix the database error on an out-of-range page with a huge page number (#929)
Version 43.7.0
- Refactor the Search::Arguments and Searcher classes to allow more flexibility in chaining queres.
- Fix the non-standard "previous" link relation in headers_hash and JSON:API urls_hash
- headers_hash emits the conventional rel="prev" in the link header
- urls_hash returns the :prev key with jsonapi: true, as the JSON:API specification requires
- urls_hash keeps the :previous key otherwise
- Fix series_nav_js ignoring the :slots and :compact helper options
- The :slots and :compact options passed to the series_nav_js helpers were silently ignored
- The :steps option overrides the :slots option, while the :compact option applies to all the steps
- Fix the playground doc URLs and make the playground apps consistent
- Add :rails_active_search paginator, test and docs
Version 43.6.3
- Deprecate the :max_limit in favor of the more descriptive :client_limit option.
Version 43.6.2
- Fix nil records returned for Array collections on page overflow (#920) (Fix #919)
Version 43.6.1
- HTML escape URL strings in href attributes (Fix #914)
Version 43.6.0
- Add the max_result_window option to the searchkick and elasticsearch_rails paginators to get an accurate count (#910)
Version 43.5.6
- Validate I18n locale input, coerce dev_tools wand_scale, add input-safety docs (#908)
- Coerce dev_tools wand_scale to a float
- Validate the I18n locale against a BCP 47 pattern
- Update docs and comments about safety
Version 43.5.5
- Rescue malformed page request param in Pagy::Keyset and KeynavJsPaginator (#907)
- Rescue malformed page request param in Pagy::Keyset and KeynavJsPaginator
- Simplify decoding logic
Version 43.5.4
- Fix SERIES_SLOTS loading error (close #902)
Version 43.5.3
- Autoload series, a_lambda and page_label
- Add Hungarian localization file for Pagy (#896)
Version 43.5.2
- Add type validation for page and limit keys type (close #895)
- Simplify series_nav_js removing "pagy-rjs" CSS class (Fix #894)
Version 43.5.1
- Remove ghost code from cli; improve tests
Version 43.5.0
- Update javascripts according to es-linting
- Update min ruby version to 3.3 (remove EOL 3.2)
- Implement the NEW
pagy/nextentrypoint to run the NEXT version now - Refactor deprecations:
- Deprecated :client_max_limit in favor of :max_limit; moved code into deprecation.rb
- Move deprecated options out of class code, to keep the code clean
- Remove RBS resources. Not worth the maintenance effort.
Version 43.4.4
- Make typecasting in Keyset based classes safer and more efficient
Version 43.4.3
- Deprecate the :max_pages option (close #890)
Version 43.4.2
- Fix edge-case for queries with multiple orderings on same column (#888)
Version 43.4.1
- Normalize deprecations
Version 43.4.0
- Improve stylesheets and docs
- Improve JavaScript:
- Add sync method and task
- Deprecate sync_javascript
- Simplify build, configuration and docs
Version 43.3.3
- Fix Request#resolve_page with jsonapi, limit, and missing page param (#885)
- Fix pagy-tailwind.css inconsistencies
- Improve ts/js build process and wand help
- Move the next_tag into the Pagy class
Version 43.3.2
- Implement NumericUI module to avoid including the numeric helpers in keynav classes
- Improve offset accessors and update docs
- Add basic RBS
Version 43.3.1
- Update assets for a few apps
- Fix pagy.ts /.js input_nav update
Version 43.3.0
- Add :typesense_rails paginator (See typesense/typesense-rails#17)
- Accept a variable number of search arguments
- Improve resilience of internal pagy nav method
- Use Pagy::OPTIONS instead of Pagy.options for efficiency
- Simplify assign options
Version 43.2.10
- Add failing test and revert code that caused empty aria label
- Avoid invalid limit param (similar to #862)
- Add thread flag to /bin/pagy
- Add uri gem dependency to the gemspec
- Freeze the @order in key* apps
- Replace require with require_relative in Pagy::CLI
- Make Pagy::OPTIONS thread-safe
Version 43.2.9
- Fix NoMethodError with tampered params (#872)
Version 43.2.8
- Add fallback to 'en' for unknown locale. Implement #868.
- Fix resolve_page with empty page in classes with non-integer page. Close #863
- Simplify keyset syntax
Version 43.2.7
- Add a hint predicate for DB optimizers, to multi-column keysets
- Improve code readability and style
- Refactor anchor tag helpers
Version 43.2.6
- Refactor i18n:
-
Raise exceptions for missing 'pagy' and 'p11n' keys in the dictionary file
-
Improve efficiency and readability
-
Version 43.2.5
- Fix Pagy::I18n.locale to ensure to_s. Close #861.
- Reduce endless methods to very short, paramless ones
- Refactor the in_range? method:
- Remove implicit assignation to empty page variable
- Enforce freezing the Pagy::Request object and params
- Refactor calendar:
- Remove the marshaling
- Improve use and naming of locals
- Improve readability
- Refactor linkable:
- Improve use of locals
- Extend conditional sub to fragment
- Improve readability
- Improve simplicity and readability
Version 43.2.4
- Fix anchor_string option not being read from @options in a_lambda. Close #857
- Fix page '0' raising an exception
Version 43.2.3
- Remove rerun
- Improved direction handling in CSSs
Version 43.2.2
- Refactor bin/pagy to use the Pagy::CLI class
- Replace optimist with the optparse standard lib
- Simplify apps by using SQLite :memory:
Version 43.2.1
- Fix the shallow cloning of root_key params. Close #851.
- Implements support for easy overriding
- Add :current_url alias to :page_url
- Fix limit_tag_js not respecting the passed :client_max_limit option
- Fix data_hash returning keys with nil values, or URLs without page; add :current_url alias to :page_url
- Remove warning when fit_time
- Fix respond_to_missing definition arguments in Search::Arguments
Version 43.2.0
- Implement :countish paginator
- Simplify Pagy::Linkable
Version 43.1.8
- Refactoring of elasticsearch_rails paginator:
- Fix "response" shadowing. Close #842.
- Simplify code
- Improve readability: rename variables and methods in more natural and unambiguous language
Version 43.1.7
- Fix and improve search paginators:
-
Add support for elasticsearch_rails v8
-
Prioritize elasticsearch_rails response over raw_response in total_count (causing multiple query executions)
-
Fix the ignored :search_method paginator option
-
Close #837, close #838, close #839.
-
Version 43.1.6
- Ensure the request GET and POST merge into a proper params Hash
- Simplify code efficiency and readability
Version 43.1.5
- Fix and improve the composition of the page url. Close #835
Version 43.1.4
- Add full support for legacy countless params, url composition and (limited) behavior
Version 43.1.3
- Improve the page options handling for countless:
-
Replace the crippled handling of legacy last-less links params introduced in 43.1.2 by gracefully starting the pagination from the beginning
-
Remove the compose_page_param method (it would need a deep refactoring for compatibility with the legacy handling)
-
Improve testing
-
- Improve the info message for empty collection in countless paginations
Version 43.1.2
- Support easy countless page param overriding (for legacy param and behavior). See #816
- Handle legacy page param for :countless paginator. Close #832
- Improve mock collections
- Improve code comments
Version 43.1.1
- Makes keynav pagination compatible with nested params:
- Improve the URL composing and unescaping
- Adds the keynav+root_key.ru showcase app
- Simplify the request code and arguments
Version 43.1.0
- Translate the aria_label.nav entry in the id, ja, kn, sw locales. Close #588, close #590, close #591, close #603.
- Improve the Pagy AI panel
- Simplify the paginators code
- Allow nested :page and :limit request params and URLs:
- Add the :root_key option:
- Simplify the :jsonapi handling as a special case of nested params
- Fix and simplify the pagy console code
Version 43.0.7
- Add compatibility for searchkick 6. Close #831
- Fix the search paginators request in passive mode. Close #830.
Version 43.0.6
- Improve Pagy AI Widget scripts
Version 43.0.5
- Add console loader for easier usage
- Add comment for the calendar usage. Close #827.
Version 43.0.4
- Remove the Pagy::OPTIONS from the Calendar configuration. Close #825
Version 43.0.3
- Update tr.yml (#824)
Version 43.0.2
- Ensure the Pagy::Request#params are the original params sent with the request. Close #821
Version 43.0.1
- Reimplement reading params from POST requests; rename internal variables. Close #821
- Fix AI widget problem for apps. Close #817.
- Improve I18n documentation. Close #811
- Link to documentation website's CHANGELOG page (#804)
Version 43.0.0
We needed a leap version to unequivocally signal that it's not just a major version: it's a complete redesign of the legacy code at all levels, usage and API included.
Why 43? Because it's exactly one step beyond "The answer to the ultimate question of life, the Universe, and everything." 😉
Changes
- The Countless pagination remembers the last page
- Pagination navs now allow jumping forward after navigating back a few pages.
- Javascript refactoring
- The new
Pagy.sync_javascriptfunction used in thepagy.jsinitializer, avoids complicated configurations. - Added the plain
pagy.jsand relative source map files.
- The new
- I18n refactoring
- No setup required: the locales and their pluralization are autoloaded when your app uses them.
- The locale files are easier to override with
Pagy::I18n.pathnames << my_dictionaries.
- HTML and CSS refactoring
- Stylesheets are now based on CSS properties and calculations, for easier customization.
- The new PagyWand interactive tool generates the CSS Override for your custom styles and provides live feedback right in your app.
- Playground apps
- Better usability and styles
- Bootstrap and Bulma
- Fixed a few style glitches.