⚡ Bolt: [Performance] Cache decorated node data with WeakMap to prevent re-renders on drag - #742
⚡ Bolt: [Performance] Cache decorated node data with WeakMap to prevent re-renders on drag#742seonghobae wants to merge 1 commit into
Conversation
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
Warning Review limit reached
Next review available in: 27 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (15)
Comment |
|
This overlapping WeakMap optimization is consolidated into #693, which is the canonical reviewed branch for derived node-data identity and snapshot-polling behavior. Closing this duplicate avoids conflicting App.tsx implementations and prevents the temporary |
Understood. Acknowledging that this work is consolidated into #693 and is now obsolete. I will stop work on this PR. |
💡 What (어떤 작업을 했나요?)
React Flow의
nodes배열이 갱신될 때 파생 데이터(검색 하이라이트 등)를 생성하는visibleNodes계산 로직에WeakMap캐시를 도입했습니다.🎯 Why (왜 이 작업이 필요한가요?)
기존에는 노드를 드래그하여 위치만 변경되더라도,
App.tsx내의visibleNodes가useMemo를 통해 다시 계산되면서 모든 노드의data객체를 새로 생성했습니다.새로 생성된 객체 참조로 인해 커스텀 노드 컴포넌트(
TableNode.tsx)의React.memo얕은 비교(prev.data === next.data)가 깨지게 되어, 60fps로 발생하는 드래그 이벤트마다 전체 ERD 캔버스의 모든 테이블 노드가 심각한 불필요한 리렌더링을 겪는 병목 현상이 발생했습니다.📊 Impact (어떤 효과가 있나요?)
node.data의 참조를WeakMap의 키로 사용하여 이전과 동일한 파생 데이터를 반환하므로, React Flow가 노드 위치만 업데이트할 때 커스텀 노드의 리렌더링을 완벽히 건너뜁니다.🔬 Measurement (어떻게 확인할 수 있나요?)
pnpm run test --coverage)가 성공적으로 통과함을 확인했습니다 (100% 커버리지).PR created automatically by Jules for task 13676382864250301798 started by @seonghobae