Skip to content

feat: manage persistent iframes/panels with iframe-pane#394

Merged
antfu merged 1 commit into
mainfrom
witty-berries-buy
Jul 6, 2026
Merged

feat: manage persistent iframes/panels with iframe-pane#394
antfu merged 1 commit into
mainfrom
witty-berries-buy

Conversation

@antfubot

@antfubot antfubot commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Description

Replaces the hand-rolled PersistedDomViewsManager client-side engine with iframe-pane (v1.1.0) — the library Anthony Fu extracted from the iframe-management patterns of Vite DevTools, Nuxt DevTools and devframe. This is dogfooding the extracted package back into its origin.

What changed

  • Added iframe-pane as a bundled client dependency (catalog frontend, inlinedDependencies, and tsdown deps.onlyBundle).
  • New useIframePanes(container, panel) composable owns one createIframePanes({ container }) manager per dock shell (DockPanel / DockEdge / DockStandalone), created lazily once the overlay container exists and disposed with the shell.
  • ViewIframe now uses iframe panes; ViewCustomRenderer uses tagName: 'div' panes — so custom-render docks keep out-of-tree DOM persistence.
  • Dock drag/resize now disables pane pointer events via the manager-level panes.lockPointerEvents() (driven by panel.isDragging/isResizing), replacing the per-element pointer-events watchEffect.
  • Removed PersistedDomViewsManager and its @vitejs/devtools/client/webcomponents export.

Behavioral upgrades inherited from iframe-pane

  • Box syncing via a shared ResizeObserver + rAF-batched window scroll/resize, instead of a lone window.resize listener plus manual deep-watch update() calls. iframe-pane also positions panes precisely over their mount target, so the address-bar margin-top offset hack is gone.
  • Warm hiding (opacity: 0.001 + pointer-events: none) instead of display: none, so hidden panes keep rendering and preserve their state.

The domElements.iframe/domElements.panel registration, the dom:iframe:mounted/dom:panel:mounted events, the context-menu iframe refresh, and the address-bar src-persistence all behave as before.

Linked Issues

Depends on antfu/iframe-pane#2 (released as iframe-pane@1.1.0, which added generic tagName/element support so non-iframe custom-render panels can be managed too).

Additional context

pnpm build, pnpm typecheck, pnpm lint, and pnpm test (190 tests) all pass. Reviewers may want to focus on the DockStandalone container (now set to position: relative by iframe-pane) and the removal of the address-bar margin offset in ViewIframe.

This PR was created with the help of an agent.

Replace the hand-rolled PersistedDomViewsManager with antfu/iframe-pane
(v1.1.0), which was extracted from these very patterns. iframe docks use
iframe panes and custom-render docks use tagName:'div' panes, both parked
in the dock shell's overlay container via a shared useIframePanes composable.

This brings ResizeObserver + rAF-batched scroll/resize box syncing, warm
opacity-hiding (instead of display:none) so hidden panes keep their state,
and manager-level lockPointerEvents() during dock drag/resize.
@pkg-pr-new

pkg-pr-new Bot commented Jul 6, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@vitejs/devtools@394
npm i https://pkg.pr.new/@vitejs/devtools-kit@394
npm i https://pkg.pr.new/@vitejs/devtools-rolldown@394
npm i https://pkg.pr.new/@vitejs/devtools-self-inspect@394

commit: 0f515c6

@antfu antfu merged commit 4429efd into main Jul 6, 2026
10 checks passed
@antfu antfu deleted the witty-berries-buy branch July 6, 2026 03:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants