Skip to content
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

ignore bower for now #896

Closed
wants to merge 4 commits into from
Closed

Conversation

RustyToms
Copy link
Contributor

@RustyToms RustyToms commented Oct 12, 2016

Summary
This PR is a possible short term patch if yarn needs to buy time to fix bower support. It's just a suggestion, and should be considered carefully before merging, if it gets merged at all. I won't be offended if it gets closed :)

This PR removes bower from the default list of registries. If the concept of this PR is acceptable, I might need some help updating tests. For now I just commented out the ones that seemed to rely on the bower code that is commented out.

Instead of deleting files I commented them out, as this is a short-term solution.

Why?
There are quite a few problems associated with bower at the moment:

Test plan

  • clone https://github.com/RustyToms/yarn-issue-616, a project with one bower and one npm dependency
  • bower install
  • yarn
  • Before, the bower_components file would be emptied after yarn was run, with this PR bower_components should be untouched

@sheerun
Copy link
Contributor

sheerun commented Oct 12, 2016

Why such move? As bower maintainer I consider endorsing Yarn as an alternative CLI, but if Yarn drops support for it, it's out of question.. How about fixing these bugs instead of removing support?

@RustyToms
Copy link
Contributor Author

@sheerun I agree they should be fixed. I couldn't figure out how to do it and I think the project maintainers aren't sure yet either, they weren't aware it was breaking until yesterday. This is a tourniquet to stop the bleeding so it doesn't destroy bower installs.

But if someone can put a PR together to actually fix it that would be better. The idea here is "do no harm", right now someone types in "yarn" and their bower_components file gets emptied, at least every time I have done it. Since there is no documentation for bower support that I could find, I figured it might be better to roll back on that until it gets fixed. Maybe there are some configurations where it isn't happening, it seems to work at least partially for some people. I would +1 a PR that can get it working right!

@sheerun
Copy link
Contributor

sheerun commented Oct 12, 2016

It might be a challenge to re-introduce Bower support if Yarn drops it. I think it's better to release a patch that fixes most annoying issues (like deleting bower_components or bower.json), and then improve support in small steps.

I see the potential of this project, as it solves most of the issues Bower currently has (file locking, reliable installs, much better codebase). I'd be glad to work on improving Bower support, so maybe eventually Yarn could become Bower's "next major version". I'll talk with @kittens about it..

@RustyToms
Copy link
Contributor Author

I was going to keep this open until there was some viable alternative, but I do agree with @sheerun about the importance of including bower support, especially if he is supporting it. So I'm going to close this, I guess a maintainer could reopen it if they really wanted to.

@RustyToms RustyToms closed this Oct 12, 2016
@jamiebuilds
Copy link
Contributor

Yeah, let's push forward one issue at a time. It probably makes sense to let the dust settle. We expected a ton of issues to be opened at launch, we just need to work through them. The problems will get smaller and smaller very quickly.

@sombriks
Copy link

so, if i understood correctly, bower projects just need keep a fair distance from yarn until it gets updated to ignore bower setups?

@ollisal
Copy link

ollisal commented Oct 13, 2016

Can I even instruct Yarn to skip messing with bower stuff via some command line or configuration option in the meantime?

With dozens of grave open issues concerning bower support, I think it would've been a good bet to disable bower stuff by default until those issues are sorted. Now it's pretty hard to figure out how/if yarn can be used safely together with bower, or to install the npm dependencies for a project that also uses bower in any way, for that matter.

@ollisal
Copy link

ollisal commented Oct 13, 2016

After some inspection of the source code and such, it looks like it's definitely the best to keep my distance for now - no way to get yarn to leave bower alone.

@leizhao4
Copy link

I think Yarn should eventually fix Bower support, but at this point it's broken and should be disabled by default until there is a fix. Having nothing is better than having a broken support which deletes my files.

@RustyToms
Copy link
Contributor Author

The easiest work around, if you don't have any .bowerrc files except for the one in the root of your project, appears to be to run bower install after you run yarn. In my experience the problem of files being deleted only happens the first time you run yarn. Then bower will have to install again. And it should be fine after that.

@tallaxes
Copy link

only happens the first time you run yarn

Or maybe anytime packages are installed? yarn add also appears to delete files ...

@mcfilib mcfilib mentioned this pull request Oct 14, 2016
15 tasks
AllenBW added a commit to AllenBW/manageiq-ui-service that referenced this pull request Oct 17, 2016
Yarn does not yet jive with bower, when it does this build step will be removed: yarnpkg/yarn#896
AllenBW added a commit to AllenBW/manageiq-ui-service that referenced this pull request Oct 17, 2016
Yarn does not yet jive with bower, when it does this build step will be removed: yarnpkg/yarn#896
AllenBW added a commit to AllenBW/manageiq-ui-service that referenced this pull request Oct 17, 2016
Yarn does not yet jive with bower, when it does this build step will be removed: yarnpkg/yarn#896
@eladchen
Copy link

eladchen commented Oct 19, 2016

How about allowing the two to coexist ?

As a temporary solution, Why not make 'yarn' move existing 'bower_components' ( if there is one )
to some random folder when an install / add process is ?

e.g: 'bower_components' > 'bower_components_temp_cf45f2fa62cc73f38220' and revert it back once yarn's install flow is done.

Thoughts ?

@RustyToms
Copy link
Contributor Author

Bower support was removed in #1441

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants