If you upgrade from version < 5.0.0
see the following:
- 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
Still supported in version 5.x
but not supported from 6.0
on:
pagy_massage_params
method: use the:params
variable set to a lambdaProc
that does the same (but per instance). See Customizing the params.
- Added screenshot to the calendar extra (closes #346)
- Added bump.sh script to bump the version in multiple files; check for consistency and optionally commit the changes
- Minor fixes
- Changelog improvements
- Reversed CHANGELOG (closes #345)
- Calendar I18n small internal renaming and docs improvements
- Implemented localization of time labels through the i18n extra delegation
- Renamed internal module and files of SharedExtra to FrontendHelpers
- Added support for
*nav_js
to Calendar - Simplified page labelling, moved into the pagy classes and removed frontend methods
- Deprecated
pagy_massage_params
: use the :params variable set to a Proc that does the same, but per instance - Added apps README
- Completed overflow fix for pagy Countless
- Fix for overflow :empty_page in regular Pagy instances, not returning an empty page
- docs: add tutorial, simplify header (#343)
- Refactoring of rails_inline_input.rb (include and close #342)
- Fix for missing defined?(Calendar) checks; small simplification in headers extra
- Calendar docs improvements and fixes
- Reorganization of mock collection classes; enabled rubocop layout in tests
- Small refactoring of the overview extra
- A few improvements for the Calendar pagination; added the current_page_label method
- Small changes in code; updated gemfiles, tests and docs
- Implemented calendar extra to paginate a Time periods by unit (year, month, week or day)
- Added pagy_labeler frontend method overridable for changing the link text from a simple page number to any arbitrary string
- Enabled rubocop Style/Documentation cop
- Updated npm modules and gemfiles
- Docker better mounts
- Used gem-generic release-gem action
- Added single action standalone rails_inline_output.rb
- Small improvements in code and docs
- Fix for rails problem with internal params in pagy URL (closes #341)
- Documentation improvements
- A few details tag in the README should be opened by default
- Refactoring of pagy_url_for and relative test:
- Fix for ignoring the items_extra variable
- Replaced request.GET with request.params to enable POST pagination
- Refactoring of Mock test classes for better handling of params
- This reverts commit 1d77e672d5b7813108b40c13ca93fdec045f4c03. Generating the URL by using the application params method breakes rails apps because it requires manual changes in the apps.
- Fix and refactoring of pagy_url_for and relative test:
- Fix for ignoring the params not coming from the request
- Fix for ignoring the items_extra variable
- Refactoring of Mock test classes for better handling of params
- Improved code comments, formatting and docs fixes
- Countless extra: simplified code, internal renaming of locals and docs update
- Updated docs and issue templates
- Added cypress-dark theme to e2e test
- Refactoring of coverage to include 100% of line and condition branches covered
- Simplification of metadata extra
- Refactoring of exceptions
- Added CHANGELOG_LEGACY
Pagy 4 dropped the compatibility for old ruby versions >2.5
and started to refactor the code using more modern syntax and paradigms and better performance. It deprecated the legacy ones, printing deprecation warnings and upgrading instruction in the log, but still supporting its legacy API. Pagy 5.0.0 cleans up and removes all that transitional support code.
The changes for upgrading your app cannot be fixed with simple search and replace, but fear not! Fixing them should just take a few minutes with the following steps:
- Upgrade to the latest version of pagy 4
- Run your tests or app
- Check the log for any deprecations message starting with '[PAGY WARNING]'
- Update your code as indicated by the messages
- Ensure that the log is now free from warnings
- Upgrade to pagy 5
FYI: Here is the list of the deprecations that are not supported anymore:
Pagy::VARS[:anchor]
is nowPagy::DEFAULT[:fragment]
- The argument order in
pagy_url_for(page, pagy)
is now inverted:pagy_url_for(pagy, page)
The following optional positional arguments are passed with keywords arguments in all the pagy helpers:
- The
id
html attribute string with thepagy_id
keyword - The
url|absolute
flag with theabsolute
keyword - The
item_name
string with theitem_name
keyword - The
extra|link_extra
string with thelink_extra
keyword - The
text
string with thetext
keyword
There are a few renaming that have not been deprecated in previous versions because they are extremely easy to fix with simple search and replace (while implementing deprecations would have been detrimental to performance and complex for no reason)
A few elements have been renamed: you code may or may not contain them. Just search and replace the following strings:
- Rename
Pagy::VARS
toPagy::DEFAULT
- Rename
enable_items_extra
toitems_extra
- Rename
enable_trim_extra
totrim_extra
- Rename
Pagy::Helpers
toPagy::UrlHelpers
- Rename
pagy_get_params
topagy_massage_params
The items accessor does not adjust for the actual items in the last page anymore. This should not affect normal usage, so you can ignore this change unless you build something on that assumption.
If your code is relying on the actual number of items in the page, then just replace @pagy.items
with @pagy.in
wherever you meant that.
FYI: The @pagy.items
is now always equal to @pagy.vars[:items]
(i.e. the requested items), while the @pagy.in
returns the actual items in the page (which could be less than the items
when the page is the last page)
- Removed support for deprecations
- Refactoring of Pagy and Pagy::Countless classes, I18n, and url helpers
- Refactoring of the docker environment, addition of ready to use VSCode setup
- Changed general module structure (use of prepend instead of re-opening modules)
- Added gearbox extra for geared pagination
- Added configuration files for a full working VSCode devcontainer environment
- Added Run Configurations for RubyMine
- Improved the usage of e2e tests
- Updated doc, gemfiles and github workflow
- Other minor fixes and improvements in code and doc