-
Notifications
You must be signed in to change notification settings - Fork 69
[3895] Reduce the number & scope of re-renders of the Explorer #5020
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
Open
pcdavid
wants to merge
21
commits into
master
Choose a base branch
from
pcd/enh/reduce-explorer-renders
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7575816
to
168e433
Compare
Bug: #3895 Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
Bug: #3895 Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
Bug: #3895 Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
Bug: #3895 Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
Bug: #3895 Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
Bug: #3895 Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
…ench.tsx Bug: #3895 Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
Bug: #3895 Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
Bug: #3895 Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
…lected tree item Bug: #3895 Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
Bug: #3895 Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
…rked items Now that a tree item only renders itself, we can pass it its individual selected & marked status instead of the full lists. Also lift up the dragStart callback which itself needs to know the full selectedTreeItemIds, but can be defined outside of TreeItem. Bug: #3895 Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
Bug: #3895 Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
Use the data-treeitemid from the drag event target to make the callback independent on the TreeItem instance. The callback is still dependent on selectedTreeItemIds, but at least should change only *once* per selection change. Bug: #3895 Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
…uting a new array value on each render Bug: #3895 Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
Bug: #3895 Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
This allows client components to toggle the selected state of an item without depending themselves on the state of the selection. Bug: #3895 Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
Bug: #3895 Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
Bug: #3895 Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
… possible Even when the user simply *selected* a different tree item, with no item expanded or collapsed, we modified the value of state.expanded with an equivalent but distinct value, which prevented non-impacted tree items to be properly memoized. Bug: #3895 Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
Instead of using selectedTreeItemIds to test if the clicked item is selected, let it pass the information directly. Bug: #3895 Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
168e433
to
4861a01
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Pull request template
General purpose
What is the main goal of this pull request?
Project management
priority:
andpr:
labels been added to the pull request? (In case of doubt, start with the labelspriority: low
andpr: to review later
)area:
,difficulty:
,type:
)CHANGELOG.adoc
been updated to reference the relevant issues?CHANGELOG.adoc
? (Including changes in the GraphQL API)CHANGELOG.adoc
? For example indoc/screenshots/2022.5.0-my-new-feature.png
Architectural decision records (ADR)
[doc]
?CHANGELOG.adoc
?Dependencies
CHANGELOG.adoc
?CHANGELOG.adoc
?Frontend
This section is not relevant if your contribution does not come with changes to the frontend.
General purpose
Typing
We need to improve the typing of our code, as such, we require every contribution to come with proper TypeScript typing for both changes contributing new files and those modifying existing files.
Please ensure that the following statements are true for each file created or modified (this may require you to improve code outside of your contribution).
useMutation<DATA_TYPE, VARIABLE_TYPE>(…)
useQuery<DATA_TYPE, VARIABLE_TYPE>(…)
useSubscription<DATA_TYPE, VARIABLE_TYPE>(…)
useMachine<CONTEXT_TYPE, EVENTS_TYPE>(…)
useState<STATE_TYPE>(…)
?.
(if the GraphQL API specifies that a field cannot benull
, do not treat it has potentiallynull
for example)let diagram: Diagram | null = null;
)Backend
This section is not relevant if your contribution does not come with changes to the backend.
General purpose
Architecture
Review
How to test this PR?
Please describe here the various use cases to test this pull request