-
-
Notifications
You must be signed in to change notification settings - Fork 78.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
docs-assets: concatenate and minify all docs files. #11977
Conversation
IMHO, we may want to leave |
'docs-assets/js/holder.js', | ||
'docs-assets/js/application.js' | ||
], | ||
dest: 'docs-assets/js/docs.js' |
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.
Should probably be docs.min.js
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.
OK thought about it too but left it since customize.js doesn't include "min" either.
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.
Honestly, it also ought to be customize.min.js
; one of those little things that no one has gotten around to.
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.
Yeah I will change those now. I solved the issue with the CSS so I will add this too.
I plan to combine the CSS too but I haven't finished it yet. EDIT: I can't make it work right with clean-css' |
@cvrebert: please check now, I updated the PR. |
'docs-assets/css/pygments-manni.css' | ||
], | ||
dest: 'docs-assets/css/pack.min.css' | ||
|
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.
Extra line
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.
Fixed.
I'd prefer to leave the compiled Bootstrap files separated from any built files. Helps ensure consistency across all our docs, examples, etc. We can combine the docs and Pygments CSS though into one file, perhaps manually even. I don't know how much this really saves us—we have no hosting costs and the loading times aren't that bad right now with things as they are. Mostly what I see is more Grunt tasks. |
@mdo: I don't mind leaving bootstrap.css out and concatenate the rest. But we should definitely do this. It's not only about bandwidth from your side; it's about bandwidth from the user's side. |
Word, I hear you on the minification at least. I'm curious what the changes in size are though—how much are we gaining (er, losing)? |
For the CSS it's around 11KB and -2 HTTP requests. For the JS it should be bigger but don't have any numbers yet. |
@mdo: don't merge this yet. Yet another IE 8 bug with the CSS file size limit. I suppose on the server we won't see the issue since gzip is enabled but I'm currently looking into this. An alternative way will be to keep 2 CSS files, bootstrap.min.css and pack.min.css. And for consistency we can do this for the JS too. What do you think? |
Turns out it's a bug in clean-css or grunt-contrib-cssmin. I need to investigate this more but when I use So we still can combine everything when this issue is sorted. |
Worked around the issue for the time being by disabling advanced optimizations. Everything seems to work fine here. I also kept bootstrap.min.css and bootstrap.min.js. BTW, raw-files.js seems redundant now since it's being combined to customize.min.js. |
Looking at this again, some more things came to mind.
I'm all about optimizing, but not if it makes things more cumbersome to work with. |
Both can be resolved easily though. I can have a look tomorrow just give me a couple of hints how you want this addressed. |
PR rebased. @mdo: what exactly you don't like at the moment? You already have to run The only thing I find pointless is the raw-files.js. But I'd rather leave this to someone else. |
See #11976, docs.js has the normal BS banner atm.