Open SukkaW opened 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.
djb2
known-css-properties
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)?
toString(36)
toString(62)
Fixes #292
Use
djb2
to hash the entire css property. A test case usingknown-css-properties
has been added to make sure there is no collision.The bundle size before the change:
The bundle size after the change:
It is 500 bytes larger (after gzip).
Mark the PR as a draft for further discussion.
Potential optimization: use
toString(36)
or a self-implementedtoString(62)
?