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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

sort style classes #597

Merged
merged 5 commits into from
Apr 4, 2016
Merged

sort style classes #597

merged 5 commits into from
Apr 4, 2016

Conversation

alexlamsl
Copy link
Collaborator

So rather than going with a simplistic global frequency count, this optimises for longest chain output.

Similar to #594, we get some savings in compressed outputs in most cases. What surprised me was the Google benchmark 馃槷

Usual warning about my choice and taste of variable names - suggestions welcome 馃槗

TODOs:

  • apply chain.js to sortAttributes
  • combine first-pass scanning of sortAttributes and sortClassName

alexlamsl referenced this pull request Apr 4, 2016
### Sorting attributes / style classes

Minifier options like `sortAttributes` and `sortClassName` won't impact the plain-text size of the output. However, they form long repetitive chains of characters that should improve compression ratio of gzip used in HTTP compression.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@kangax
Copy link
Owner

kangax commented Apr 4, 2016

Looks great. I would just rename Chain to TokenChain for clarity.

@alexlamsl
Copy link
Collaborator Author

@kangax the rebase was fun (since the file was introduced in the very first commit), but it's all done 馃槑

@alexlamsl alexlamsl merged commit d63dbed into kangax:gh-pages Apr 4, 2016
@alexlamsl alexlamsl deleted the issue-267 branch April 4, 2016 18:42
@kangax
Copy link
Owner

kangax commented Apr 4, 2016

馃憤

@alexlamsl alexlamsl mentioned this pull request Apr 7, 2016
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.

None yet

2 participants