davesnx / styled-ppx

Type-safe styled components for ReScript, Melange and native with type-safe CSS
https://styled-ppx.vercel.app
BSD 2-Clause "Simplified" License
400 stars 32 forks source link

Update hash function to match emotion #377

Closed jchavarri closed 10 months ago

jchavarri commented 10 months ago

Updates the hash function in native so that it behaves exactly like the original one in emotion.

This has the advantage that there's no need to patch any existing user of styled-ppx & server-reason-react to override the emotion/hash function on the melange build, plus we lower the chances of collision / issues in the hashing algorithm as the original Emotion hash has been tested over time.

The PR also adds some basic cram test to make sure the results returned by each implementation are the same.

@davesnx Feel free to discard or take anything from the PR.

vercel[bot] commented 10 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment | Name | Status | Preview | Comments | Updated (UTC) | | :--- | :----- | :------ | :------- | :------ | | **styled-ppx** | ⬜️ Ignored ([Inspect](https://vercel.com/davesnx/styled-ppx/8aU4TWShLzWxy5WXcK3Mt28EMS56)) | [Visit Preview](https://styled-ppx-git-hash-emotion-davesnx.vercel.app) | | Nov 7, 2023 8:23am |
davesnx commented 10 months ago

That's amazing