chore: improve use view state perf #101
Merged
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.
变动类型
需求背景和解决方案
对于手风琴面板的视图,当隐藏时 viewState 会更新为
{width:0, height: 0}
,而实际此时面板只是被隐藏(display: none),尺寸并没有真正改变,再次展示时 (display: block) 导致例如 explorer、outline 这类可能有大量列表的组件频繁触发 render主要修改是在尺寸为 0 以及
display:block
情况下不更新 viewState,不影响实际拖拽行为补充一个对比图,打开 vscode repo, 展开 node_modules 的情况下
changelog