yiisoft / jquery-pjax

pushState + ajax = pjax
http://pjax.herokuapp.com
MIT License
144 stars 40 forks source link

Version confusion and backward incompatible changes #64

Closed tekord closed 2 years ago

tekord commented 7 years ago

Yii 2.0.12 has the following dependency:

"bower-asset/yii2-pjax": "~2.0.1"

Today I did composer update and Pjax has been broken. I looked into the bower/yii2-pjax/bower.json file:

  "name": "yii2-pjax",
  "version": "2.0.7.1",
  "main": "./jquery.pjax.js",

version is 2.0.7.1. I learned the change log and found the line:

2.0.7 Sep 27, 2017
-----------------
...
- Merged updates from upstream. The update contains backward-incompatible changes, see [changes list](https://github.com/yiisoft/jquery-pjax/issues/55#issuecomment-310109608) to adjust your application accordingly. (silverfire)

I tried to override version of bower-asset/yii2-pjax by setting it in my project's composer file like this:

"bower-asset/yii2-pjax": "2.0.6",

But composer update shows the error:

  Problem 1
    - The requested package bower-asset/yii2-pjax 2.0.6 exists as bower-asset/yii2-pjax[2.0.7.1, v1.8.0-patch1, 2.0.8] but these are rejected by your constraint.
  Problem 2
    - yiisoft/yii2 2.0.12 requires bower-asset/yii2-pjax ~2.0.1 -> satisfiable by bower-asset/yii2-pjax[2.0.7.1, 2.0.8] but these conflict with your requirements or minimum-stability.
    - yiisoft/yii2 2.0.12 requires bower-asset/yii2-pjax ~2.0.1 -> satisfiable by bower-asset/yii2-pjax[2.0.7.1, 2.0.8] but these conflict with your requirements or minimum-stability.
    - Installation request for yiisoft/yii2 ^2.0.12 -> satisfiable by yiisoft/yii2[2.0.12].

I looked at another Yii project which is not updated last days, they have the same composer.json in yiisoft/yii2, BUT the different yiisoft/pjax/bower.json:

  "name": "yii2-pjax",
  "version": "2.0.6",
  "main": "./jquery.pjax.js",

Version is 2.0.6.

How this could happen? Build-version (even not minor) has backward incompatible changes and it updates silently? And why I can't roll back to 2.0.6 version?

terR0Q commented 7 years ago

+1. Yep, I have same problem in my project.

schmunk42 commented 7 years ago

See

There are issues with downgrading bower-assets.


Another workaround might be to add asset-packagist as a repository to your project and run the update with --no-plugins.

tanakahisateru commented 7 years ago

It's not simply Composer problem, looks violating common versioning policy. I tried bower install with:

{
  "dependencies": {
    "yii2-pjax": "^2.0.7",
  }
}

v2.0.7 tagged version was installed instead of 2.0.7.1. It seems that 2.0.7.1 was not recognized as semantic version. ^2.0.7.1 was failed. Only 2.0.7.1 succeeded (but not expected).

They implicitly says that any released version (not pre-release) MUST contain just 3 numbers in http://semver.org/ .

Please reassign tag v2.0.8 and remove 2.0.7.1.

schmunk42 commented 7 years ago

Bower does not 4-digit numbers, see https://github.com/bower/bower/issues/118 - composer does.

samdark commented 2 years ago

Seems it's not an issue anymore. At least I haven't heard anything about it last years.