Skip to content

Conversation

p3drosola
Copy link

@p3drosola p3drosola commented Sep 26, 2025

πŸ”— Linked issue

#1131

❓ Type of change

  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Lucid uses 'fast-deep-equal' for comparing values to track changes

As per the package documentation: https://github.com/epoberezkin/fast-deep-equal

To support ES6 Maps, Sets and Typed arrays equality use:
var equal = require('fast-deep-equal/es6');

Lucid does not use the es6 version, so comparing Sets always considers them equal, and as such will not save the changes.

We could use the es6 version with a minimal impact on performance, but I think this approach of allow custom equality comparators to be passed in is more flexible.

fast-deep-equal x 261,950 ops/sec Β±0.52% (89 runs sampled)
fast-deep-equal/es6 x 212,991 ops/sec Β±0.34% (92 runs sampled)

With my implementation it would allow custom equality comparison between currency objects, sets, or other custom data structures.

I will update the docs soon as I've gotten some feedback on this PR.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

…lumn config for attributes that are more complex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant