If you've noticed a massive version bump for the Pagy gem, you're not seeing things! The Pagy team skipped straight to Version 43.0.0, calling it a "leap version" to signal that this isn't just a new major release—it’s a complete overhaul and redesign of the best Ruby pagination gem.
Here is a look at the critical changes and exciting improvements that make Pagy v43 simpler, faster, and smarter.
1. The Critical Change: A Complete Redesign for Simplicity 🛠️
The core philosophy behind v43 is "more... with less."
This release represents a fundamental refactoring and redesign of the code, API, and usage. While this is a breaking change (you must check the upgrade guide!), the result is a massively streamlined experience:
-
Dramatically Simpler API: The mental load is gone. You now primarily need just the
pagymethod and the resulting@pagyinstance to handle pagination for any collection type. - 99% Reduction in Configuration: Pagy is now smarter out of the box, requiring far less manual setup than ever before.
- Intelligent Autoloading: Say goodbye to unnecessary overhead. Methods are now autoloaded only if you use them, ensuring near-zero memory consumption for unused features.
2. 🚀 Performance and New Techniques
Pagy v43 pushes the boundaries of fast pagination techniques, offering options for every scenario.
The star of the show is the introduction of Keynav Pagination.
-
New Keynav: This exclusive Pagy technique is the next generation of keyset (cursor-based) pagination. It combines the extreme performance of keyset—which avoids slow
OFFSETandCOUNTqueries—with all of Pagy's powerful frontend helpers. -
Technique Versatility: Pagy now fully supports a comprehensive suite of pagination techniques, letting you choose the fastest method for your data:
- KEYNAV (The new fastest choice)
- KEYSET (Cursor-based)
- OFFSET (Traditional)
- COUNTLESS (For huge collections)
- CALENDAR (For time-based data)
3. 🪄 Better DX with New Interactive Dev-Tools
The new version includes features specifically designed to improve the developer experience (DX):
- New PagyWand: This interactive tool helps you integrate Pagy’s CSS with your app's themes in real-time. It’s a huge win for styling and customization.
- Pagy AI: A unique interactive AI is now available directly within the docs and your application to help you with specific Pagy usage questions.
- Automatic I18n Loading: Internationalization is now handled automatically, saving you setup time.
- Simplified JavaScript Setup: The process of setting up client-side rendering is now much easier.
Ready to Upgrade?
Pagy v43 is a powerful step forward. While the redesign is significant, the commitment to simplicity means your day-to-day coding will be cleaner and faster.
Be sure to check out the Upgrade Guide on the Pagy documentation to make your transition smooth!
Top comments (0)