-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
Document posibility of asset-packagist.org
usage.
#13064
Comments
I'd also recommend to document this: https://github.com/fxpio/composer-asset-plugin/blob/master/Resources/doc/index.md#use-no-api-option-of-vcs-githhub-driver Background: http://www.yiiframework.com/wiki/843/boost-composer-asset-plugin-update-speed/ |
Is there any documentation available for now? I do not understand this: if I have several projects, how do I disable fxp/composer-asset-plugin for few (replacing it with asset-packagist.org), and leave it for other. |
What triggers usage of asset-packagist.org is a line in |
But is complser-asset-plugin still used when asset-packagist.org is enabled? Looks like it still used. When I run
Assets are installed into |
Is typehead dependency registered at asset-packagist.org? If not, you need to manually register it. Will be fixed one day but that's how it is now. |
Yes it is: https://asset-packagist.org/site/search?query=bower-asset%2Ftypeahead.js This is not the case, same issue with jquery:
|
Then it's better to ask @hiqsol and @SilverFire. |
@cronfy If you have performance issues, you might give this config for the asset-plugin a try:
It will not query the GitHub API, but use local git repos, which is several times faster after the first run. Make also sure you've a GitHub token. Would be nice if you could give some feedback, since there are some other performance improvements possible, but we'd need to know if the current setup works as expected. |
@schmunk42 Here are some stats for All assets were installed correctly in all cases.
But my project uses private repo that can take 10±5 sec to update, so measures may be not very accurate. I also tried
So, asset-packagist is more preferable to me. I just would like to know how would I use composer-asset-plugin for some projects and asset-packagist.org for others, because I can't switch to asset-packagist.org for all projects at once. The problem is that I do not understand how to disable composer-asset-plugin on per-project basis. |
@cronfy why can't you use asset-packagist for all projects? We use it for really complex setups with lots of assets. composer-asset-plugin is installed globally (more precisely per user basis) and AFAIK there is no way to disable certain plugin on per project basis. It is possible to disable plugins at all, but it will disable yii2-composer too and you'll get non working setup. What you can do is use alternative composer home like (export COMPOSER_HOME=/home/user/.alt-composer; composer update) This way you can control which composer to use with or without composer-asset-plugin. |
@cronfy Thank you for the feedback, it's about that what can be expected at the moment.
Yes, you have to take that penalty once per machine. How often do you run Do you commit the |
@schmunk42 why would you run |
@samdark @schmunk42 I run @schmunk42 Yes, I commit |
@hiqsol I can use it for all projects, but I can't switch to it for all projects in a short time. Until I switch to it in all projects, I can't remove Thanks for suggesting alternate composer for switched projects. I was hoping I could avoid it, but if there is no other way to disable |
If there was a |
Because yii2 docs says that? :D |
@rob006 right, that's when you want the same environment as others after pulling code. |
Because it's much much faster and does not require any plugins to be installed at all, since all information is present in In our workflows there's usually only one or two developers, which run I have written this on our whiteboard in the office
(*) assuming that the tests are green ;) So after See this gist for an example: Run composer install two times on a project which actually requires "assets", but with a vanilla composer installation (used a vanilla composer binary via Docker, no caches, no plugins, even a host-volume for the vendor folder). |
@cronfy You mean like you want to work with repos for some of your extensions? |
@schmunk42 means that |
@rob006 That's the workflow for Yii contributors, not extensions per se. Or did i get that wrong? @samdark You should include Btw: Is all the npm stuff required? Wouldn't a strict composer workflow be preferable? Like putting the npm packages into
Let's put it like this, That's also why I asked if @cronfy wants to work with repos, since he said
Why run composer update when you want to push?! Composer can't push for itself. I don't want to impose a certain workflow to developers, but you can compare both actions like so: Imagine a Debian Distribution, running Only (Debian) maintainers run PS: PS2: Using |
My point is: if you work with other people on the same project, you probably will run |
@rob006 I am sorry, I didn't get the sarcasm in the first comment - shame on me LOL; OMG. |
@schmunk42 I have a project with When work is done, I need to do this:
|
@cronfy I share your pain, because we have the exact same workflow. And there are use-cases where you need to run What you should do by all means, is setting
See here for an example.
This is how a vanilla install should look like then; cloning only repos from dmstr, hrzg and schmunk42. Bonus: Some info about the composer update workflow. (I've just tweaked this :)) |
@hiqsol I've tried asset-packagist and it looks really great. Only problem I have: bower/npm assets are still installed to default location ( I already tried with |
You can use appropriate aliases: 'aliases' => [
'@bower' => '@vendor/bower-asset',
'@npm' => '@vendor/npm-asset',
], This question is completely covered at the about page. |
Great, thanks, I missed that, as I just followed the recommendation in one of your other comments. Coming back to the initial issue: If asset-packagist is added to the docs here, this should of course also be added there. |
@hiqsol I remember from somewhere, that it is not recommended to use asset-packagist and fxp. What was reason the behind this? Because composer does not prefer asset-packagist, because it's a "composer" repo. And therefore all asset-packages are getting scanned anyway? @francoispluchino Would it be possible to detect if a repo would be available via asset-packagist and skip it? Moreover, to both of you, wouldn't it make sense, that the asset plugin sends an API request to asset-packagist in such an setup? So we could have the best of all worlds, fast install + fallback + auto-registration of new asset packages for the next run. |
|
I mean just sending API requests like: https://asset-packagist.org/site/search?query=%PACKAGENAME% so packages in use get scanned. |
This plugin. You can use they server without my plugin. and it's an argument for them. They will always continue to purpose their solution based on the plugin, and they are not interested to merge the 2 solutions. As far as me on, I am open to any integration to improve the performance. |
@hiqsol Would it be OK for you if the plugin would trigger an API request, when an additional option is enabled? It's not about merging the two solutions, only to make it easier to switch to asset-packagist. As an example, if you've updated a project with the API search triggers, you can install the project from now on from asset-packagist (as long as you don't add more - unknown - asset-packages) |
Sure, we can add API to import new asset packages that are in use |
Resolved by #14025 |
Extracted from #8688
Posiblity of usage https://asset-packagist.org/ for asset installation istead of
asset-plugin
should be ducmented.The text was updated successfully, but these errors were encountered: