Schema.hash
/ AST.hash
should not use JSON.stringify
#2719
Labels
enhancement
New feature or request
Needs Proposal
This issue needs a plan that clarifies the finer details of how it could be implemented.
schema
What is the problem this feature would solve?
Currently
Schema.hash
/AST.hash
is implemented usingHash.string(JSON.stringify(ast, null, 2))
which is inefficient and for larger schemas turns into a bottleneck or can fail all together withRangeError: Invalid string length
What is the feature you are proposing to solve the problem?
Ideally the hashing mechanism was implemented on a case by case basis on the AST level itself instead of relying on stringifying the AST.
Improving this implementation could also help to make hashes more stable across different Effect schema versions.
What alternatives have you considered?
No response
The text was updated successfully, but these errors were encountered: