https://avo.cool logo
Hi, I've just been updating my app to use Pagy...
# avo-3
p
Hi, I've just been updating my app to use Pagy 43 to fix a bug I was hitting with Pagy. But I can't even run my app now. Looks like Avo is having trouble with it. I've just tried to update Avo too using rails avo:update but even that won't do anything as it seems to choke on missing old Pagy functionality. Why is Avo breaking due to a change in my own app? I hope I don;t need to go and undo all the changes i've just spent doing. It fixes a bug and really need Pagy 43.
m
Thread automatically created by rctneil in #1138182212655788054
l
Hi @purple-park-97233 avo doesn't support pagy 43 at this moment
Avo uses pagy gem for pagination and supports all versions pre 43
The biggest challenge to implement support for pagy 43 is backwards compatibility, that require conditionals on avo code based on the pagy version installed on the application
p
Oh. That's a shame. How can I install Pagy 43 for my app (to allow the bug i'm hitting to get fixed) but still allow and older version for Avo? Surely Avo should be able to use any version of gems and not dictate the version that the apps themselves use?
l
I get your point
The thing is, you can't have different verions of the same gem simultaneously installed on the same app
p
Right, Ok. I don't quite know what do now. as i need avo, but also 43 fixes an issue for me, but i cant run my app. Also just spent the time doing the pagy upgrade too. I'm now in a weird situation
l
I got you, the short answer unfortunately is that avo is not compatible with pagy 43 yet
And is not just avo, many gems are on the same situation
Pagy 43 introduced many breaking changes
You get through the update so you know it We would merge a PR that implements pagy 43 support but keeping backwards compatibility for pagy >= 7
The biggest challenge on our end is the backwards compatibility, since we don't want to force everyone to update pagy on theirs apps
If you want to give it a try with a contribution for this one I would be happy to pair with you and get a PR merged
Btw, what is the bug that pagy 43 is fixing on your end?
p
It's not a bug, but missing functionality that 43 supposedly provides (because i can't run my app i can't test)
It's to do with using the infinite-scroll library with it and targeting the link for Next and Previous. <43 don't have an element I can target when on the last page
Apparently it should allow me to use that method in 43 so i tried to update but then hit this.
I'm totally up for that, but I will be honest, that I haven't had much time to work on my own stuff recently (as you can see with the long time being that GitHub issue about Pagy and today) and thenswamped with work at other times. What method would you use for checking Pagy? Literally just the gem version?
l
I don't have an approach for it yet... we need to check for the gem version and call the methods accordingly. From the pagy upgrade guide I assume we need to change most of the current pagy calls I totally get the time pressure, we got our hands full as well Next week we're at SF Ruby, I'll try to write some insights on the GH issue during the next days
p
Ok. Keep me informed and i'll do my best. I guess i'll ahve to roll back the work i've done on upgrading this evening for the time being.
Thanks for letting me know, even if it isn't the news i wanted
l
Commit your changes
When we merge the compatibility PR you can just pick it up from there
Thank you for the availability, I'll ping you as soon as we get an approach for.the issue
a
@loud-jewelry-99127 Just running into this myself. Can we disable Pagy in Avo somehow or am I up a creek using Avo for this project?
l
Hi @acceptable-cartoon-88076 Avo uses pagy for pagination and I couldn't find any easy solution to keep avo using pagy < 43 and parent app pagy 43 On last avo release we locked pagy dependency to < 43 Until we implement pagy compatibility you can't use avo on an app that is using pagy 43
a
which, annoyingly, JumpstartPro uses 43 now 🙂
do you have a plan for this yet?
l
The easiest path and probably the one that we'll follow is to update pagy to the new 43 and make a dependency for pagy >= 43
But that means, any app updating avo will need to update pagy to 43
a
yeah
which has all kinds of cascading effects
I'm glad I'm on this side of the keyboard 🙂 Sounds like a nightmare
l
because keeping backwards compatibility is not easy with all the breaking changes