Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Allow >= 1.1.0 & 2.x for Pagerfanta #194

Merged
merged 4 commits into from
May 21, 2018
Merged

Allow >= 1.1.0 & 2.x for Pagerfanta #194

merged 4 commits into from
May 21, 2018

Conversation

sampart
Copy link
Owner

@sampart sampart commented May 1, 2018

The latest 1.x release is https://github.com/whiteoctober/Pagerfanta/releases/tag/v1.1.0, which the previous constraint wouldn't have allowed.

@sampart
Copy link
Owner Author

sampart commented May 1, 2018

Some tests here are failing because of translation string changes in Pagerfanta. They'll be fixed by getting #189 complete and merged (assuming we then rebase this branch off that).

The 404 error in tests is probably something else, but I'll look into that once the translation ones are fixed and it's clearer where we're at!

@emodric
Copy link
Contributor

emodric commented May 7, 2018

2.x should be allowed too :)

@sampart
Copy link
Owner Author

sampart commented May 8, 2018

Thanks for the input, @emodric.

Since Pagerfanta is following Semantic Versioning, 2.x could include backwards-incompatible changes, whereas it's guaranteed that 1.x won't. Therefore, it makes sense to leave this as it is - if a 2.x is released, we'd then need to ensure that this bundle worked correctly with it before updating the version constraint.

@emodric
Copy link
Contributor

emodric commented May 8, 2018

@sampart As far I can see, there's no breaking changes in Pagerfanta 2.0 compared to 1.1, so allowing it should not break anything.

@sampart
Copy link
Owner Author

sampart commented May 8, 2018

Sorry, I forgot I'd already done a 2.0.0 release of Pagerfanta! Whoops.

However, since that bumps Pagerfanta to be PHP 7, I wouldn't want to make this bundle use that until we also moved the bundle to PHP 7 (and bumped its major version too). We have issue #193 for that.

@emodric
Copy link
Contributor

emodric commented May 8, 2018

Well, you don't have to bump the bundle to PHP 7 only. It can remain on PHP 5 & 7, and allow Pagerfanta 1.x and 2.x. My point is, to allow Pagerfanta 2, this bundle doesn't need a new major version.

@sampart
Copy link
Owner Author

sampart commented May 8, 2018

This is a tricky one to call. However, Pagerfanta 2.x is effectively stating that whilst it may work with PHP < 7 (the code hasn't changed), it's no longer officially supported there - it's not tested against PHP < 7, and composer.json now states PHP >= 7 as a requirement for install.

Given that, I wouldn't want this library to claim support for PHP < 7 whilst including in its core functionality a library which doesn't support that. Hence the need for a version number bump.

@emodric
Copy link
Contributor

emodric commented May 8, 2018

I see your point, yes, but I'm not sure I agree. If this bundle is compatible with Pagerfanta 2.x, and it is, it should allow installing it.

People using PHP 5, will not be able to install Pagerfanta 2.x anyhow and they will fallback automatically to 1.x, while PHP 7 users will get 2.x. I don't see a problem with that.

Nice sideeffect too would be easy and automatic upgrade to Pagerfanta 2.x for projects which depend on the bundle and not on the lib.

But I will leave the decision to you, you're the boss :)

@sampart
Copy link
Owner Author

sampart commented May 8, 2018

People using PHP 5, will not be able to install Pagerfanta 2.x anyhow and they will fallback automatically to 1.x, while PHP 7 users will get 2.x. I don't see a problem with that.

That's a really good point. I hadn't thought about the automatic fallback. I think you're probably right that we don't need a major version jump, then. Thanks for taking the time to work this one through with me.

I'll update the PR.

Sam Partington added 2 commits May 8, 2018 11:46
The latest 1.x release is https://github.com/whiteoctober/Pagerfanta/releases/tag/v1.1.0, which the previous constraint wouldn't have allowed.
See discussion at #194
@emodric
Copy link
Contributor

emodric commented May 8, 2018

Thanks for listening! :)

@sampart
Copy link
Owner Author

sampart commented May 8, 2018

I've resolved the merge conflicts in the initial commit, and added an "allow 2.x" commit too now. The branch name is now out-of-date therefore, but I can live with that! 😉

Just waiting on #189 now. I'll ping them for an update in a week or two.

These changes were originally in #189, but I've brought them across into this branch as they require Pagerfanta >= 1.1.0
@sampart sampart changed the title Allow 1.x for Pagerfanta Allow 1.x & 2.x for Pagerfanta May 17, 2018
@sampart
Copy link
Owner Author

sampart commented May 17, 2018

I was slightly mistaken - to bring this bundle and Pagerfanta into line on using prev_message rather than previous_message, we needed both the changes in #189 and the version bump in here - neither can be done without the other.

Given that, I've brought the changes from #189 across into this PR and closed #189.

Once @olorton has re-reviewed this PR, I'll merge it.

@sampart
Copy link
Owner Author

sampart commented May 17, 2018

The failing tests here are (now) unrelated to this work - they're because of known issue #182 with PHP 5.3(!)

The reason for this is that older versions of Pagerfanta still (incorrectly) use the option previous_message rather than prev_message in the Default template (whiteoctober/Pagerfanta#230), but this branch now uses prev_message everywhere.
In order to keep the two in-step, we need to ensure that this code is running against Pagerfanta >= 1.1.0
@sampart sampart changed the title Allow 1.x & 2.x for Pagerfanta Allow >= 1.1.0 & 2.x for Pagerfanta May 17, 2018
@sampart sampart merged commit a489542 into master May 21, 2018
@sampart sampart deleted the pagerfanta-1.x branch May 21, 2018 08:36
@sampart
Copy link
Owner Author

sampart commented May 21, 2018

I've created release https://github.com/whiteoctober/WhiteOctoberPagerfantaBundle/releases/tag/v1.2.1 for this.

@emodric
Copy link
Contributor

emodric commented May 21, 2018

@sampart What happened to 1.2.0 ? :)

@sampart
Copy link
Owner Author

sampart commented May 21, 2018

@emodric, whoops - that was a Monday morning kind of mistake on my part! I've updated that release to have the right name and tag name: https://github.com/whiteoctober/WhiteOctoberPagerfantaBundle/releases/tag/v1.2.0

@sampart
Copy link
Owner Author

sampart commented May 21, 2018

Thank you so much for pointing out my mistake so quickly!

@emodric
Copy link
Contributor

emodric commented May 21, 2018

You're welcome!

Thank you for allowing Pagerfanta 2.x :)

@emodric
Copy link
Contributor

emodric commented May 21, 2018

Also, you shoud probably delete 1.2.1 from packagist.org too: https://packagist.org/packages/white-october/pagerfanta-bundle#v1.2.1

@sampart
Copy link
Owner Author

sampart commented May 21, 2018

Good point, thanks. Done now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants