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
This fixes a gnarly performance issue when the number of node or edge types is large (roughly over 20). The browser would essentially lock up and be nearly unuseable.
The problem was that the effect that watch for the
Input
value change was being fired way too often, including the initial render, and the state update is very slow.The fix was to properly debounce the value change and also compare to previous value. This led to another fix in the
usePrevious
hook where it didn't always have the correct value.And finally, I did some cleanup in the
SingleEdgeStyling
andSingleNodeStyling
components to lean on Recoil selectors to simplify the logic.Changelog
I accidentally pushed the changelog update to
main
directly. Since it is a non-destructive change, I'm just going to leave it there rather than revert it and add it to this PR.fc0a0e5
Validation
Related Issues
Check List
license.
pnpm checks
to ensure code compiles and meets standards.pnpm test
to check if all tests are passing.Changelog.md
.