-
-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Limit the import of versions of packages for a VCS Repository #44
Comments
I made It limited reading for angular, but not for angular-resources. |
@walletzilla It's a proposition of implementation, not a feature already implemented! :-) |
I'd vote for Solution 2 as this is a natural approach and works in most cases without the user knowing about this. Solution 1 is not good imo, performance should not be configurable. |
@cebe we are all agree. I would do the tests tomorrow. |
Solution 2 added by c1d81f0. |
@cebe The update of doc and the FAQs will be available soon. |
I have just tested this with the latest version of composer, running the following command:
I get the following error after all packages are installed:
Verbose composer output is here: https://gist.github.com/cebe/b69c1694b03632ff5a8a Despite the error it is running really fast compared to before :) |
We are using version constraints like |
@cebe There is no asset dependencies in the root package, I do not understand why there is this error. I look this tomorrow morning. |
For example for jquery, the dev-master branch is selected and not the 2.1.1. I think that the problem comes from here. |
Thanks! |
For example, if you add the dependencies bellow in your root Composer package: {
"require": {
"bower-asset/jquery": ">=2.1@beta",
"bower-asset/punycode": ">=1.3.1@stable",
"bower-asset/jquery.inputmask": ">=3.1.27@stable",
"bower-asset/bootstrap": ">=3.2@stable",
"bower-asset/typeahead.js": ">=0.10.5@stable"
}
} you will get: $ composer update --prefer-dist -v
Loading composer repositories with package information
Updating dependencies (including require-dev)
Reading bower.json of bower-asset/jquery (2.1.1-RC2)
Importing tag 2.1.1-RC2 (2.1.1.0-RC2)
Reading bower.json of bower-asset/jquery (2.1.1-RC1)
Importing tag 2.1.1-RC1 (2.1.1.0-RC1)
Reading bower.json of bower-asset/jquery (2.1.1-beta1)
Importing tag 2.1.1-beta1 (2.1.1.0-beta1)
Reading bower.json of bower-asset/jquery (2.1.1)
Importing tag 2.1.1 (2.1.1.0)
Reading bower.json of bower-asset/jquery (2.1.0)
Importing tag 2.1.0 (2.1.0.0)
Reading bower.json of bower-asset/jquery.inputmask (3.1.27)
Importing tag 3.1.27 (3.1.27.0)
Reading bower.json of bower-asset/punycode (v1.3.1)
Importing tag v1.3.1 (1.3.1.0)
Reading bower.json of bower-asset/yii2-pjax (v2.0.0)
Importing tag v2.0.0 (2.0.0.0)
Reading bower.json of bower-asset/bootstrap (v3.2.0)
Importing tag v3.2.0 (3.2.0.0)
Reading bower.json of bower-asset/typeahead.js (v0.10.5)
Importing tag v0.10.5 (0.10.5.0)
- Installing yiisoft/yii2-composer (dev-master 458cae9)
Loading from cache
Extracting archive
- Installing bower-asset/jquery (2.1.1)
Loading from cache
Extracting archive
- Installing bower-asset/yii2-pjax (v2.0.0)
Loading from cache
Extracting archive
- Installing bower-asset/punycode (v1.3.1)
Loading from cache
Extracting archive
- Installing bower-asset/jquery.inputmask (3.1.27)
Loading from cache
Extracting archive
- Installing ezyang/htmlpurifier (v4.6.0)
Loading from cache
Extracting archive
- Installing bower-asset/bootstrap (v3.2.0)
Loading from cache
Extracting archive
- Installing swiftmailer/swiftmailer (dev-master 9359e59)
Loading from cache
Extracting archive
- Installing cebe/markdown (0.9.x-dev 6a3c373)
Loading from cache
Extracting archive
- Installing yiisoft/yii2 (dev-master e16233a)
Loading from cache
Extracting archive
- Installing phpspec/php-diff (dev-master 30e103d)
Loading from cache
Extracting archive
- Installing yiisoft/yii2-swiftmailer (dev-master 4ac514c)
Loading from cache
Extracting archive
- Installing bower-asset/typeahead.js (dev-master 0fd2467)
Loading from cache
Extracting archive
- Installing yiisoft/yii2-codeception (dev-master e47cb29)
Loading from cache
Extracting archive
- Installing yiisoft/yii2-bootstrap (dev-master 362bda6)
Loading from cache
Extracting archive
- Installing yiisoft/yii2-debug (dev-master db03889)
Loading from cache
Extracting archive
- Installing yiisoft/yii2-gii (2.0.0-beta)
Loading from cache
Extracting archive
- Installing fzaninotto/faker (dev-master 1ce76e8)
Loading from cache
Extracting archive
- Installing yiisoft/yii2-faker (dev-master 7c4de16)
Loading from cache
Extracting archive
Writing lock file
Generating autoload files |
Great, it is working now. Thanks! |
On the install, or especially during the update, an VCS repository containing many versions can become extremely slow.
For example, 2 slow packages:
Solution 1:
The solution would be to add in the configuration of root Composer package, a constraint version for each package. In this way the Solver will search only in packages really imported, and therefore, it would limit the number of import of the informations of each package.
Example of configuration:
With this example, Composer will import only 2 versions of
jquery
(2.1.0 and 2.1.1) for the update.Of course, if your project requires a dependency with a non-imported version, an exception will thrown, but this exception may not indicate that this is caused by the filter of asset package version. It is also for this reason that the configuration is only found in the root Composer package.
Solution 2:
This solution doesn't add any configuration, but uses the dependencies in the root Composer package. It complements the lazy loading system (already implemented).
At the plugin initialization,the plugin retrieves the list of dependencies added to the root Composer package. If the asset packages are defined, then the plugin will add only the branches and tags accepted by the constraint version defined in the root Composer package.
In this way, we will keep the same experience that currently, tout en but also keeping the native behavior of dependency analysis, while dramatically optimizing the number of requests for getting the informations of packages.
Example:
With this example, Composer will import only 2 versions of
jquery
(2.1.0 and 2.1.1) for the update, even ifbower-asset/bootstrap
has a dependency forjquery
>=1.9
.The text was updated successfully, but these errors were encountered: