Improve UI performance by optimizing reactivity
- Replace `ref`s with `shallowRef` when deep reactivity is not needed. - Replace `readonly`s with `shallowReadonly` where the goal is to only prevent `.value` mutation. - Remove redundant `ref` in `SizeObserver.vue`. - Remove redundant nested `ref` in `TooltipWrapper.vue`. - Remove redundant `events` export from `UseCollectionState.ts`. - Remove redundant `computed` from `UseCollectionState.ts`. - Remove `timestamp` from `TreeViewFilterEvent` that becomes unnecessary after using `shallowRef`. - Add missing unit tests for `UseTreeViewFilterEvent`. - Add missing stub for `FilterChangeDetails`.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import {
|
||||
WatchSource, readonly, shallowRef, triggerRef,
|
||||
WatchSource, shallowReadonly, shallowRef, triggerRef,
|
||||
} from 'vue';
|
||||
import { TreeRoot } from '@/presentation/components/Scripts/View/Tree/TreeView/TreeRoot/TreeRoot';
|
||||
import { useCurrentTreeNodes } from '@/presentation/components/Scripts/View/Tree/TreeView/UseCurrentTreeNodes';
|
||||
@@ -25,7 +25,7 @@ export class UseCurrentTreeNodesStub {
|
||||
return (treeWatcher: WatchSource<TreeRoot>) => {
|
||||
this.treeWatcher = treeWatcher;
|
||||
return {
|
||||
nodes: readonly(this.nodes),
|
||||
nodes: shallowReadonly(this.nodes),
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user