Open gajus opened 3 years ago
Agreed, object-hash
is large enough, but JSON.stringify
doesn't preserve object equivalence: for identical objects with different order of their keys, it results in different values.
Another thing to keep note of: very large objects will result in very large keys, whereas a hash function will have the same length regardless of the object sizes.
There are alternatives, smaller and (maybe) faster. Too many actually. But I have not done much research:
But again, they are stringifiers, not hashers.
also scope hoist in parcel (not sure about webpack) doesn't work because of object-hash
I will look into alternatives. Thank you for bringing it up. 🙏🏻
Any chance of this getting addressed? It is currently being flagged as the biggest dead weight in our app.
There is no obvious reason for using
object-hash
here and it adds 32kb to the bundle size.https://bundlephobia.com/result?p=use-async-resource@2.2.1