feat(atoms)!: remove createdAt
timestamp tracking
#150
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Zedux core has never needed to track timestamps when nodes are created. It's always been possible for plugins to implement this and will be much easier with the new plugin system in Zedux v2.
Since this functionality is so rarely useful, it isn't worth the constant overhead, especially in prod. We'll make sure plugins can implement this. I'll also probably implement it as part of the official Zedux dev tools.
Breaking Changes
ecosystem._idGenerator.now
is gone as well as thecreatedAt
property on all atom instances and graph edges. Instead, a plugin can listen to:edgeCreated
,evaluationFinished
, andstatusChanged
plugin actionsedge
(which we're possibly renaming tolink
),runStart
, andcycle
ecosystem events.and either track creation time in a separate WeakMap/similar or (not recommended) by mutating the node or edge itself.