yii2-app-basic: Asset installation of 2.0.13 very slow with cap installed
What steps will reproduce the problem?
Install the basic-app with global fxp/cap installation
What’s expected?
- super-fast installation (with filled caches)
What do you get instead?
- slow installation, due to a lot of API requests
Additional info
| Q | A |
|---|---|
| Yii vesion | any |
| PHP version | any |
| Operating system | any |
Introduced by https://github.com/yiisoft/yii2-app-basic/commit/395e9c7faeba1094084d2308e00b519e9f0f1fd4
Whether you like the asset-plugin or not is no question here, but removing all the stuff introduced without BC-break in https://github.com/yiisoft/yii2-app-basic/commit/120d35506e411e575ee07aac900d7394b5b7386c - one day earlier, just makes no sense to me.
If you have a global cap installation you can not use this anymore, please do not force this onto the developers, I have plenty of reasons not to use AP in many projects. The settings and info have no effect, if do not have fxp/cap installed, they simply take care that things work as before, just almost as fast as with AP.
Such a removal has to be done in 2.1 not earlier. I’d assume the majority of users still have the plugin installed, since it was the recommended way for years.
If you want to disable fxp/cap, you could add a config option to composer.json for that, but I think this should also be the developers choice.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 25 (25 by maintainers)
Commits related to this issue
- Disable composer-asset-plugin if it's installed Refs #149 — committed to nkovacs/yii2-app-basic by nkovacs 7 years ago
- Disable composer-asset-plugin if it's installed See https://github.com/yiisoft/yii2-app-basic/issues/149 — committed to nkovacs/yii2-app-advanced by nkovacs 7 years ago
- Disable composer-asset-plugin if it's installed (#318) See https://github.com/yiisoft/yii2-app-basic/issues/149 — committed to yiisoft/yii2-app-advanced by nkovacs 6 years ago
- Disable composer-asset-plugin if it's installed (#318) See https://github.com/yiisoft/yii2-app-basic/issues/149 — committed to yangke687/yii2-eCommerce-mvp by nkovacs 6 years ago
http://www.yiiframework.com/doc-2.0/guide-structure-assets.html#bower-npm-assets
@SilverFire @samdark the plugin is disabled, but it should still have a useable config
But it will. c-a-p will feed composer the bower/npm packages it finds, but composer will also get those packages from asset-packagist, and both sets of packages will end up in composer’s dependency solver. That’s why you get bugs like https://github.com/hiqdev/asset-packagist/issues/72
But subtle bugs like that are exactly why it’s not a good idea to have both c-a-p and asset-packagist active in a project. Plus you’ll get inconsistent behavior if you’re working with someone else who doesn’t have c-a-p installed.
@nkovacs With which version of the asset-plugin did you run your benchmarks? The bower URL was updated in
1.4.2- if you are below that you are loosing a lot of time.My benchmarks for the yii2-basic-app are (2nd run):
with asset-packagist, c-a-p disabled:
with asset-packagist, c-a-p enabled and set to use git, last 2 days (like the previous config), first run:
second run:
More than a minute vs 2.5 seconds.
without using git, i.e. if you have c-a-p installed and you try to use this template:
Wait, wasn’t git supposed to be faster?
In all cases I ran composer update --profile without deleting vendor, and there were no updates. Feel free to benchmark other cases, but I think this is convincing enough.
So clearly the plugin should be disabled by default. If someone wants to use c-a-p, they can remove asset-packagist and re-enable the plugin in their composer.json.
Should be…
or
false😄Sorry, I don’t get it, what do you mean with “that”? I am just saying that there was a perfect configuration for all use-cases, now an essential speed upgrade is removed for no reason.