Board: Make Excalidraw onChange cheap and preload the editor from the list
Opening a board downloads 587 KB of gzip JS from the lazy Excalidraw chunks. BoardEditor.tsx:403-422 computes signature() over every element and calls setState('dirty') on every Excalidraw change, including appState-only changes such as picking a tool. Pressing 'r' measured an INP of 136-320 ms at 4x CPU, the only page over 200 ms. The page also calls getBoard twice (generateMetadata and the page). First scope: skip appState-only changes, use getSceneVersion for the signature, skip setState when already dirty, import() ExcalidrawCanvas on hover in BoardList, and wrap getBoard in cache(). Priority: medium. Effort: M.
Comentários 0
Ainda sem comentários.
Entre para comentar