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

Minify Assets / Get Rid of Generated style.css In Repo #704

Closed
zoffixznet opened this issue Jul 14, 2016 · 9 comments
Closed

Minify Assets / Get Rid of Generated style.css In Repo #704

zoffixznet opened this issue Jul 14, 2016 · 9 comments
Assignees

Comments

@zoffixznet
Copy link
Contributor

Currently, we have two issues:

  1. Assets are not minified which makes Google like us less and our users download more.
  2. We currently store in the repo style.css which is an auto-generated file (reasons).

We can solve both of those by including minification and SASS processing as an optional part of the build process that will run as part of the doc generation for docs.perl6.org, but if a contributor builds locally and they don't have prereqs for minification/SASS, they won't get that step run.

To still let users use the dev app without having the SASS-related prereqs, we can add a routes that will fetch the JS/CSS assets from https://docs.perl6.org/ if local versions aren't found.

z

@AlexDaniel
Copy link
Member

I have some questions:

  1. “Assets are not minified which makes Google like us less” – What does it mean exactly? Does it mean that it affects page ranking?
  2. “and our users download more” – How much are we going to win? I mean, what's the size difference after gzip? I am asking because if the difference is really small, then maybe we should not do that. Minified assets complicate micro contributions, so I'd much rather prefer a couple of stuff contributed by random people than tiny amount of saved bandwidth. That being said, if the difference is significant, then indeed we should minify.

@AlexDaniel
Copy link
Member

Partially answering my own question 2:

Using http://compressorrater.thruhere.net/ I figured that we are going to save about that much:

0.4 (main.js) + 0.5 (search.js) ≈ 1 kB (optimistically)

So if we minify, then we are going to save about 1 kB for the initial load of js files (subsequent loads should not download these files because of caching). Is it significant? I don't think so. What do others think?

@AlexDaniel
Copy link
Member

AlexDaniel commented Jul 14, 2016

Ah crap! Just looked at the screenshot. :D

Thinking about it again, I don't think that the numbers on the screenshot are after gzip.

@zoffixznet
Copy link
Contributor Author

“Assets are not minified which makes Google like us less” – What does it mean exactly? Does it mean that it affects page ranking?

Google's algorithm is secret, of course, but failing mobile tests on that assessment page in the screenshot does rank you lower for mobile viewers—so it's natural to assume failing desktop tests would have similar consequences.

“and our users download more” – How much are we going to win? I mean, what's the size difference after gzip? I am asking because if the difference is really small, then maybe we should not do that. Minified assets complicate micro contributions, so I'd much rather prefer a couple of stuff contributed by random people than tiny amount of saved bandwidth. That being said, if the difference is significant, then indeed we should minify.

It's 24.3KB on https://docs.perl6.org/type/ComplexStr page.

What are the complications for micro contributions? The assets will remain unminified in the repo. The only penalty for contributors would be extra prereqs when building a local copy of the docs, though even that can be avoided by extra Mojolicious routes ([Coke] is currently -1 on that idea)

@AlexDaniel
Copy link
Member

AlexDaniel commented Jul 14, 2016

What are the complications for micro contributions?

You can work on small things directly in your browser, without even cloning a repo. If JS is minified, then it is much harder.

That being said, I have nothing against minifying CSS or HTML. So +1 for that, we should do definitely do that.

@zoffixznet
Copy link
Contributor Author

You can work on small things directly in your browser

You mean using GitHub editor or...?

@AlexDaniel
Copy link
Member

[00:44:43] «Zoffix» AlexDaniel, do you mean editing code using GitHub editor or working on the live site using some sort of plugins? RE "You can work on small things directly in your browser, without even cloning a repo."
[00:47:41] «AlexDaniel» Zoffix: it is possible to change JS in, for example, chromium default developer tools. So yea, I meant doing quick small changes on the live site, and then suggesting them in a github issue or submitting a pull request using the github editor.
[00:48:04] «Zoffix» OK. I'll leave JS alone

@zoffixznet zoffixznet self-assigned this Aug 3, 2016
@coke
Copy link
Collaborator

coke commented Feb 7, 2017

@zoffixznet - is there anything left to do on this ticket? if we're skipping minifying, and it looks like the .css is no longer kept int he repo...

@coke coke assigned coke and zoffixznet and unassigned zoffixznet Feb 7, 2017
@zoffixznet
Copy link
Contributor Author

Oh yeah, everything was done in 54fb4b3 and other commits around Christmas. I forgot there was an open issue as well.

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

No branches or pull requests

3 participants