mirror of
https://github.com/sharevb/it-tools.git
synced 2026-12-04 18:35:09 +03:00
* perf(bundle): improve initial load + loading of tool Render the sider once and only build the parts of it that are visible. - App.vue renders BaseLayout around the layout switch instead of inside each layout, so moving between a plain route and a tool route no longer unmounts and rebuilds the whole sider (~460 menu items) on every navigation. - CollapsibleToolMenu mounts a category's items the first time it opens. Every category starts collapsed, so the menu was built entirely out of view. - Its menuOptions computed no longer folds in the collapsed/active flags, which rebuilt every category's tools array -- and re-rendered every item -- per route change. They are read from the template instead. - MenuItemTooltip measures truncation with scrollWidth/clientWidth rather than a canvas measureText(), dropping a throwaway <canvas> and a getComputedStyle per menu item. Production build, 3 runs each, fresh profile per run: first contentful paint 2476-2735ms -> 814-974ms main-thread blocking 1806-2024ms -> 250-294ms requests at boot 384 -> 208 click a tool from home 991-1014ms -> 178-197ms switch between tools 281-322ms -> 74-125ms Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * Fix small width in mermaid exporter --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> Co-authored-by: sharevb <sharevb@gmail.com>
10 lines
328 B
TypeScript
10 lines
328 B
TypeScript
import PassthroughLayout from './passthrough.layout.vue';
|
|
import ToolLayout from './tool.layout.vue';
|
|
|
|
// BaseLayout is not here: App.vue renders it once around the switch, so it
|
|
// survives navigation instead of being remounted with every route.
|
|
export const layouts = {
|
|
base: PassthroughLayout,
|
|
toolLayout: ToolLayout,
|
|
};
|