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

Fix: #292 #293

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

Fix: #292 #293

wants to merge 2 commits into from

Conversation

SukkaW
Copy link
Contributor

@SukkaW SukkaW commented Apr 24, 2022

Fixes #292

Use djb2 to hash the entire css property. A test case using known-css-properties has been added to make sure there is no collision.

The bundle size before the change:

index.js → dist/umd/stylis.js...
 stylis.js ⏤  4.11 kB

created dist/umd/stylis.js in 385ms

index.js → dist/stylis.mjs...
 stylis.mjs ⏤  3.97 kB

The bundle size after the change:

index.js → dist/umd/stylis.js...
 stylis.js ⏤  4.54 kB

created dist/umd/stylis.js in 378ms

index.js → dist/stylis.mjs...
 stylis.mjs ⏤  4.41 kB
created dist/stylis.mjs in 388ms

It is 500 bytes larger (after gzip).

Mark the PR as a draft for further discussion.

Potential optimization: use toString(36) or a self-implemented toString(62)?

@SukkaW SukkaW marked this pull request as draft April 24, 2022 05:57
@coveralls
Copy link

Pull Request Test Coverage Report for Build 424ce9bebb747f859fd8378478ef4e3a59762144-PR-293

  • 9 of 9 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.02%) to 98.856%

Totals Coverage Status
Change from base Build a2fdca83a2377230a66f8d9c5d477bc87c10c188: 0.02%
Covered Lines: 273
Relevant Lines: 275

💛 - Coveralls

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.

Potential collision in hash
2 participants