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

feat: resolve issue #1028: optimising naming for best compression #1062

Closed
wants to merge 6 commits into from

Conversation

denisx
Copy link

@denisx denisx commented Mar 29, 2020

This PR contains a:

  • bugfix
  • new feature
  • code refactor
  • test update
  • typo fix
  • metadata update

Motivation / Use-Case

resolve issue #1028

For efficient gzip/br compression, plugin combine css hash via one symbol name,
as a classname position at file, with filepath hash:base64:8, to have strong sequences.

@denisx
Copy link
Author

denisx commented Mar 29, 2020

have some bugs from master :/
npm audit fix change package-lock.json ...

@joseprio
Copy link

joseprio commented Apr 4, 2020

We use a similar technique, but just defining a custom getLocalIdent. However, I don't think this plays well with the caching mechanism, as the classname generation isn't stable, right?

@denisx
Copy link
Author

denisx commented Apr 4, 2020

@joseprio

However, I don't think this plays well with the caching mechanism, as the classname generation isn't stable, right?

Css-loader get async files and parse, it is allways randomized work. Class save classnames positions for every file (a,b,c,...). As a file-path, it is always stable content hash for project. It is cache frendly.

@codecov
Copy link

codecov bot commented Apr 25, 2020

Codecov Report

Merging #1062 into master will decrease coverage by 0.31%.
The diff coverage is 93.65%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1062      +/-   ##
==========================================
- Coverage   97.17%   96.86%   -0.32%     
==========================================
  Files          10       11       +1     
  Lines         460      542      +82     
  Branches      153      176      +23     
==========================================
+ Hits          447      525      +78     
- Misses         12       16       +4     
  Partials        1        1              
Impacted Files Coverage Δ
src/plugins/one-letter-css.js 93.65% <93.65%> (ø)
src/index.js 100.00% <0.00%> (ø)
src/utils.js 98.88% <0.00%> (+0.11%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 431f620...1646bd7. Read the comment docs.

@denisx
Copy link
Author

denisx commented May 18, 2020

and https://gist.github.com/denisx/9dc0e8c542b810e67f41691c89e7b948 for check hash length

@jsf-clabot
Copy link

jsf-clabot commented May 26, 2020

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ denisx
❌ Denis 🎃 Khripkov


Denis 🎃 Khripkov seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.

@denisx
Copy link
Author

denisx commented May 26, 2020

Add css hash len suggest - we have full hash map after css-1-letter running.

@denisx denisx closed this Aug 25, 2020
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

3 participants