-
Notifications
You must be signed in to change notification settings - Fork 708
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
Remove ../'s from bower_components paths #236
Conversation
The verbosity of wiredep commands is increasing, but if we get #235 approved, we can apply the wiredep command with same options for both HTML and Sass. |
Also, this adds some additional time to the |
I do not see any benefit to this whatsoever. If anything more verbosity is better, especially for first-time users. This is a generator, it should be as succinct and flexible as possible. These paths are being managed by a robot anyway. Nobody is manually manipulating these. |
The logic of the Also, when I'm debugging what wiredep injected in my file, I already know it's from Bower, so I don't need that |
I do not agree with this change. All urls should always be valid file references. If you part with this, you add complexity for the reader because they have to make a mental leap each time they need to resolve an url. Verbosity does not equal complexity. Often times the opposite is true. And this change takes the generator more in the direction of setting you up with a static page generator than an actual webpage. That said, the |
I'm +1 with @Munter about this adding complexity, but sympathise with the desire to simplify this setup. It's hard because We opted for similar file path patterns to what you're suggesting for Polymer projects and whilst it makes sense for an experienced developer, you'll find it introduces cognitive overhead for beginners who just want to point to clear paths. |
Ok, I agree with you guys. I actually mainly want to remove the <script src="../bower_components/modernizr/modernizr.js"></script> to: <script src="bower_components/modernizr/modernizr.js"></script> I don't think we have to move |
Ok, now we have an inconsistency: HTML: <script src="/bower_components/modernizr/modernizr.js"></script> Sass: @import "bower_components/bootstrap-sass-official/assets/stylesheets/_bootstrap.scss";
|
Ok, removed the inconsistency. Both now start with This is ready for merging, if you agree, @eddiemonge @sindresorhus @Munter @addyosmani. |
seems fine to me 👍 |
Rebased. |
By the way, this is now in sync with how generator-webapp does it. |
@@ -217,6 +217,7 @@ module.exports = yeoman.generators.Base.extend({ | |||
bowerJson: bowerJson, | |||
directory: 'bower_components', | |||
exclude: ['bootstrap-sass', 'bootstrap.js'], | |||
ignorePath: /^(\.\.\/)+/, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ignorePath: /^\.\.\//,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If just one ../ is being replaced, a string: "../" also works.
I'm fine with this, but can you document the behaviour in the readme as it's a bit magic? |
As this is more philosophically-oriented, I would rather put it under |
Yeah, sure. Just needs to be written down somewhere. |
Added the notes. |
Remove ../'s from bower_components paths
Lgtm. Nice work @silvenon! :) |
This is my proposition for the
bower_components
mess. Instead of only fixing that, I went further and removedbower_components
from URLs completely, because to me they are kind of verbose and potential issues with name conflicts seem unlikely enough.So instead of:
we would have:
Same goes for Sass. No more
../../../../
sillyness.Fixes #150.