thysultan / stylis

light – weight css preprocessor
https://stylis.js.org
MIT License
1.71k stars 82 forks source link

Fix: #292 #293

Open SukkaW opened 2 years ago

SukkaW commented 2 years ago

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)?

coveralls commented 2 years ago

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


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

💛 - Coveralls