-
-
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
[WIP] Bower package manager / non-PHP dependencies #3209
Conversation
jQuery is package is now fetched from Bower via bowerphp and loaded from bower_components directory. post-scripts are now in place to perform bower update/install after relevant composer command is issued.
Re-submitted the PR due to forked repo branch being deleted in the past. |
Travis break has to do with Bee-Lab/bowerphp#36 I 'll submit a PR there if the maintainer is too busy. |
nice |
This reverts commit d58c2c6. Bowerphp resolved the issue with Github API pagination and added proper version tagging
Should be fine now, maintainer fixed the pagination issue with Github API and has added proper release tags. |
Thumbs up for adding bower support out-of-the-box! |
pros
cons
|
I am still thinking that this is something composer should implement as it is the case with pear packages for example. What about the following situation: I have a yii extension that requires jquery > 2.0. how would I define that and does dependency resolving work properly? |
@cebe does this cover your question http://stackoverflow.com/questions/16442012/bower-install-2-versions-of-jquery ? |
that may be a workaround but in the first place I'd expect bower to complain about conflicting requirements when the app requires a different version that the extension. Can you explain how I can add bower.json to an extension? When installing the extension, ist it enough to require it in composer.json or do I need more? |
Sorry, I misread your comment @cebe. I would argue it is much better than packing the JS/CSS/Whatever within the yii extension itself. |
Don't get me wrong, I am for changing the current situation. But I am not sure if this solution really works. At least I did not fully understand the idea here and it looks to me there is something missing. |
|
As far as I see this problem can be solved better as a composer extension. Will try to check this option tomorrow. Thanks for your input so far! |
and how did you wann handle this ??
bourbon neat bitters are bower packages |
@cebe The yii extension will be added in composer.json of the project. The Bower assets of that extension are added to the bower.json of said extension, just like the PHP dependencies of said extension are added in the extension's composer.json. |
@brewing can you please elaborate a bit more about what problem you are describing? |
what does that mean? |
the alias are not exist For instance I would instruct a custom JUI-pmoust extension using jquery-ui vX.Y.Z to keep that package to @bower/jquery-ui-pmoust and keep that reference in the code itself. |
well for js files i think this will still work |
@pmoust Assuming we take this PR and we are building an application which needs to use |
@qiangxue should be just adding @cebe I am marking it WIP and will ping you to review when it is done. |
Could you create a new PR which handles |
Sorry to all, but even though I do believe is a good thing to have bower support, I have to admit (upon usage), that bower installations are not sync with composer installs and that causes our projects to be populated with folders such as:
And tones of repetitive files (lots of scripts do have the js installed through composer). So, a developer has to be very careful not to end up with lots of repetitive scripts everywhere. BowerPHP is a great source, I used in some of my projects but a developer must be very, very careful. I don't think is good for a general purposes and it just suits certain scenarios. |
Trying to look at the end design and pre-requisites to achieve that. Are we achieving somehow bower and composer to work together like this:
Assuming above is true and all dependencies between PHP code and required JS/CSS work magically --- following is needed We would also need to be kind of forcing a standard in building all extensions.
If both are not adhered strictly - we may fall into issues. Am I right in framing this target design specification? BTW - @pmoust great work so far. |
@pmoust Any news on it? Does that mean we will use famous bower instead of doubtful asset bundles approach? If so, than GREAT WORK! 👍 |
Btw why bowerphp instead of original bower??? Vote against it. |
@creocoder no, it's about getting JS/CSS files, not about serving or compressing these via asset bundles. Also phpbower allows you to use it right away while bower requires nodejs to be installed along with bower. |
@creocoder I 'll work on it during this weekend. I' ll choose whether closing this down in favor of a cleaner way to do things, or improve the current PR and request for review. As @samdark mentioned, the only reason we go with bowerphp vs bower is to reduce the dependencies for developers and/or deploying mechanisms. |
@creocoder it will make Yii dependent on nodejs. We can't afford it. |
@samdark Then i vote against about bower at all. Or original bower, or composer (we can live with that). We can't trust bowerphp at all. This is not official bower. |
this make no sense to use bower over php !!! |
The thing is that we cannot force requirement on nodejs, npm and bower since it will raise overall framework complexity significantly enough to lose very big part of the community. |
Discussed a lot with @creocoder, got the following cons/pros and decided to leave everything as is + create a guide to using bower with Yii2 (not sure if it will be in official docs or Yii cookbook yet): https://docs.google.com/document/d/1PttOYSBHj6xuE4-iaOcUYLj0Ly5lLjANitNOZTaB2l8 |
Relates; #2965 #3196