Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat(atoms)!: remove createdAt timestamp tracking #150

Merged
merged 1 commit into from
Jan 7, 2025

Conversation

bowheart
Copy link
Collaborator

@bowheart bowheart commented Jan 6, 2025

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 the createdAt property on all atom instances and graph edges. Instead, a plugin can listen to:

  • (v1) edgeCreated, evaluationFinished, and statusChanged plugin actions
  • (v2) edge (which we're possibly renaming to link), runStart, and cycle ecosystem events.

and either track creation time in a separate WeakMap/similar or (not recommended) by mutating the node or edge itself.

@bowheart bowheart added this to the Zedux v2 milestone Jan 6, 2025
@bowheart bowheart merged commit 28102e4 into master Jan 7, 2025
2 checks passed
@bowheart bowheart deleted the josh/remove-createdAt branch January 7, 2025 00:02
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant