-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: improve performance of connecting blocks #6876
fix: improve performance of connecting blocks #6876
Conversation
Improve INP by allowing the browser to do a paint (closing the context menu) before we trigger callbacks. This improves the user experience for expensive callbacks (e.g. collapsing, or updating disabled).
6349740
to
99b95a4
Compare
When disconnecting the last block in the stack, the block would not be rerendered correctly (the top-start corner would not be reshaped)
The order for applying connections was changed so that connections were applied and then the insertion marker was hidden. This caused an error because hiding the insertion marker expected there to be a child block when there was not.
@NeilFraser This is ready for a look! Might be advisable to review this commit-wise. |
throw Error('Source connection not connected.'); | ||
} | ||
if (otherConnection.targetConnection !== this) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This used to double-check that the connections actually point at each other. Why did you remove that check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems a bit silly when we have the connectReciprocally
method. If this check errors, afaict it just means we coded a bug (or someone messed with targetConnection
directly, which is also our failing for making that public). Imo, these assertions should be covered by unit tests, not code. But I may be missing some context here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ConnectionType
is now unused, and you missed the lint warning (but now we can all enjoy it! 🤣)
The basics
npm run format
andnpm run lint
The details
Resolves
Related to #6130
Proposed Changes
Optimizes the performance of connecting blocks by:
updateDisabled
Reason for Changes
Cuts off ~100ms from wrapping an if block around the spaghetti code test blocks.
Test Coverage
Only manual testing :/
Documentation
N/A
Additional Information
Dependent on #6860