8000 Optimize layout calculations for ESM and React components by philippjfr · Pull Request #7989 · holoviz/panel · GitHub 8000
[go: up one dir, main page]

Skip to content

Conversation

@philippjfr
Copy link
Member
@philippjfr philippjfr commented Jun 17, 2025

ESM components were still treated as fully managed layouts, i.e. we would perform full layout calculations every time children on an ESM component were rendered. For nested ESM components this meant going up to the root and then triggering a full re-computation from the root on down. Since rendering, particularly in React based components happens asynchronously, these computations would happen many times consecutively.

This PR effectively turns ESM components into un-managed layouts, i.e. they no longer propagate layout changes upwards to parent containers. We also no longer compute BBox and we only trigger a single layout invalidation after all children are rendered.

Potential concerns:

  • Maybe we should only switch on unmanaged mode if all parents are themselves ESM components
  • Some components may skip mounting certain children, e.g. Card or Tabs, in this case the mount callback will not fire and layout invalidation will not occur.

@codecov
Copy link
codecov bot commented Jun 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.07%. Comparing base (8492008) to head (cf9d92f).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7989   +/-   ##
=======================================
  Coverage   87.07%   87.07%           
=======================================
  Files         346      346           
  Lines       53374    53374           
=======================================
+ Hits        46473    46476    +3     
+ Misses       6901     6898    -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@philippjfr philippjfr merged commit 0bb1ccc into main Jun 18, 2025
32 of 35 checks passed
@philippjfr philippjfr deleted the optimize_esm_layout branch June 18, 2025 08:32
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 30, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0