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

Drop grunt-recess for grunt-contrib-less #11790

Merged
merged 17 commits into from Dec 9, 2013
Merged

Drop grunt-recess for grunt-contrib-less #11790

merged 17 commits into from Dec 9, 2013

Conversation

mdo
Copy link
Member

@mdo mdo commented Dec 9, 2013

This is the first part to migrating away from Recess and to something that's more up to date with LESS. It adds a few other dependencies, and there are some kinks to work out though.

  • Drops grunt-recess and adds grunt-contrib-less.
  • Adds CSScomb for property ordering (non functional for some reason right now—halp?).
  • Requires addition of grunt-banner though since grunt-contrib-less hasn't implemented (and won't) banner support.

We'll need to integrate #11778 as part of this as well, either before or after. Perhaps @XhmikosR wants to join in on the fun here? Definitely could use some help.

@mdo
Copy link
Member Author

mdo commented Dec 9, 2013

I've asked the grunt-csscomb folks about the options here: csscomb/grunt-csscomb#9. Still can't figure that part out.

@mdo
Copy link
Member Author

mdo commented Dec 9, 2013

Also, meant to point to #11779 as the one to integrate with. At any rate, this has moving pieces 😀.

@cvrebert
Copy link
Collaborator

cvrebert commented Dec 9, 2013

@mdo I pushed a commit with the fixes suggested by the grunt-csscomb folks; seems to work!

dest: 'dist/css/<%= pkg.name %>-theme.min.css'
files: {
'dist/css/<%= pkg.name %>.sorted.css': ['dist/css/<%= pkg.name %>.css'],
'dist/css/<%= pkg.name %>.min.sorted.css': ['dist/css/<%= pkg.name %>.min.css'],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why bother combing minified files?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might as well be consistent :).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I screwed up—I get it now. Removed awhile back <3.

Conflicts:
	dist/css/bootstrap.min.css
Original discussion:
less/less.js#1437 (comment).

Since we’re switching to `grunt-contrib-less`, we can take advantage of
newer LESS features than what RECESS supported. Included in that is the
ability to `:extend`, and not only that, but `:extend(.mixin-name
all)`. By doing so, we remove duplicate CSS for all our elements that
were being clearfix-ed.

Fixes #8947, #8968, #8991, #9257, #9268, #9291, #9430, #9604, #9686,
#9929, #10731, #10793, #11305, #11498, #11533, #11570, #11604, #11652.

(dem issues, tho)
@mdo
Copy link
Member Author

mdo commented Dec 9, 2013

This is looking super good at this point—not much difference between the Recess version in master and this one. Definitely can make this happen with v3.1.0.

Also just pushed a fix for #8947, and like a dozen other issues, for the duplicate CSS problem. Aww yeah.

Conflicts:
	Gruntfile.js
	dist/css/bootstrap-theme.min.css
	dist/css/bootstrap.min.css
@mdo mdo mentioned this pull request Dec 9, 2013
Conflicts:
	Gruntfile.js
	package.json
@mdo mdo mentioned this pull request Dec 9, 2013
@mdo
Copy link
Member Author

mdo commented Dec 9, 2013

Just merged in #11778 and #11779 to consolidate all the Grunt changes.

@cvrebert @XhmikosR Any improvements or tweaks you'd make at this point?

options: {
compress: true
keepSpecialComments: 1,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you really want normalize.css' license header in the minified files? Also, now the banner is missing from the minified files.

https://github.com/XhmikosR/bootstrap/commit/fdc5d1dc34bf28e55c6359aeb098e608585ca6cb#diff-35b4a816e0441e6a375cd925af50752cR88

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see why not honestly. It's their code after all—credit due and all that. I'm open to feedback on this though. Why remove it, and is it even possible to do with grunt-contrib-less?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's your call if you want the license info in the minified files, I guess the correct thing would be to keep it.

About the options, ieCompat seems something that should be enabled in grunt-contrib-less. Can't find the docs about setting clean-css' options via grunt-contrib-less atm.

@cvrebert
Copy link
Collaborator

cvrebert commented Dec 9, 2013

@mdo I don't think we should have merged #11778. We should just enable grunt-contrib-less's clean-css-based minification options instead: https://github.com/gruntjs/grunt-contrib-less#cleancss

@XhmikosR
Copy link
Member

XhmikosR commented Dec 9, 2013

I agree with the above @cvrebert. That's what I meant it seemed better to switch to grunt-contrib-less, because it combines both things.

@mdo
Copy link
Member Author

mdo commented Dec 9, 2013

Ah, good call. A sign it's too late to be doing this :D. Pulled it and added the cleancss option. Thanks fellas <3.

Let me know if there's anything else.

@cvrebert
Copy link
Collaborator

cvrebert commented Dec 9, 2013

  • Enable source maps?
  • report: 'min' ?
  • strictMath: true ?

@XhmikosR
Copy link
Member

XhmikosR commented Dec 9, 2013

Yeah was looking at those too. About source maps, I wonder how that will work since clean-css doesn't support them.

@mdo
Copy link
Member Author

mdo commented Dec 9, 2013

Added strictMath: true, but Grunt crashed and burned apparently:

~/Sites/bootstrap (drop_recess_for_less) grunt dist
Running "clean:dist" (clean) task
Cleaning dist...OK

Running "less:compile" (less) task
FATAL ERROR: JS Allocation failed - process out of memory

I've already added report: 'min' as well—it's under the minify subtask. Should be the only place we need to show it, right?

I'm fine calling this good enough, too, and we can explore those other things afterwards. I'm not familiar enough with source maps (yet). This is already a pretty huge win :).

Two final questions:

  1. Does it make sense to put csslint that high up in the document? Seems like it should come after the compilation.
  2. It sucks we have to use usebanner, but I saw no other option for consistent banner adding. Is this legit?

<3

@cvrebert
Copy link
Collaborator

cvrebert commented Dec 9, 2013

(1) Agreed, it should be moved further down.

I've already added report: 'min' as well

Derp, my bad.

@XhmikosR
Copy link
Member

XhmikosR commented Dec 9, 2013

@mdo: how about the ieCompat option?

About csslint, since we are running it against the compiled dist css I guess you could move it. I added it there after jshint and jscs since it's for a similar job.

@cvrebert
Copy link
Collaborator

cvrebert commented Dec 9, 2013

@XhmikosR ieCompat defaults to true anyway

@XhmikosR
Copy link
Member

XhmikosR commented Dec 9, 2013

Oh ok didn't notice that.

@tlindig
Copy link
Contributor

tlindig commented Dec 9, 2013

Requires addition of grunt-banner though since grunt-contrib-less hasn't implemented (and won't) banner support

You could do it in same way you do it for js files, use concat task. No need for grunt-banner.

@mdo
Copy link
Member Author

mdo commented Dec 9, 2013

@tlindig Not a bad idea, I'll give that a go in a separate effort unless someone else wants to jump in :).

mdo added a commit that referenced this pull request Dec 9, 2013
Drop grunt-recess for grunt-contrib-less
@mdo mdo merged commit 25ec09f into master Dec 9, 2013
@mdo mdo deleted the drop_recess_for_less branch December 9, 2013 19:30
@mdo mdo mentioned this pull request Dec 9, 2013
interactivellama added a commit to ExactTarget/fuelux that referenced this pull request Apr 3, 2014
stempler pushed a commit to stempler/bootstrap that referenced this pull request Apr 11, 2014
Drop grunt-recess for grunt-contrib-less
stempler pushed a commit to stempler/bootstrap that referenced this pull request Nov 4, 2014
Drop grunt-recess for grunt-contrib-less
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants