Skip to content

feat(demos): standardize the Demo embed contract on demoHeight - #90

Merged
nucliweb merged 1 commit into
mainfrom
feat/demo-contract-standardize
Jul 31, 2026
Merged

feat(demos): standardize the Demo embed contract on demoHeight#90
nucliweb merged 1 commit into
mainfrom
feat/demo-contract-standardize

Conversation

@nucliweb

Copy link
Copy Markdown
Owner

What

Standardizes the interactive-demo embed contract so new demos are trivial to author and existing ones size correctly.

  • Defaults the <Demo> component's heightKey to demoHeight (falls back to demoHeight regardless of the prop).
  • Migrates the three existing demos (raf-pipeline, yield-pipeline, network-waterfall) to post demoHeight.
  • Names the height-padding constant and adds an always-visible "Open demo in a new tab" fallback link.
  • Documents the authoring contract (height reporting, theme sync, self-contained) with a copyable template in public/demos/README.md.

Why

The three demos each posted a unique height key (rafDemoHeight, yieldDemoHeight, netWaterfallHeight) but no page passed heightKey, so only raf-pipeline matched the old default. yield-pipeline and network-waterfall were stuck at the 400px minimum, their real height never applied.

Verification (runtime, next dev)

Demo Page iframe height body + 24
yield-pipeline LongTask 439 ✅ (was stuck at 400)
network-waterfall Resource-Hints 627 ✅ (was stuck at 400)
raf-pipeline FSL 442

Also verified: dynamic auto-height via ResizeObserver (added 300px to the demo body → iframe grew by 314, reverted exactly on removal), light↔dark theme sync, and the fallback link renders with the correct href.

Default the Demo component's heightKey to "demoHeight" and migrate the three existing demos (raf-pipeline, yield-pipeline, network-waterfall) to post it. This fixes auto-height for yield-pipeline and network-waterfall, which posted keys that never matched the old "rafDemoHeight" default and were stuck at the 400px minimum.

Name the height padding constant, add an always-visible "Open demo in a new tab" fallback link, and document the authoring contract (height reporting, theme sync, self-contained) with a copyable template in public/demos/README.md.
@vercel

vercel Bot commented Jul 31, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
webperf-snippets Ready Ready Preview Jul 31, 2026 11:47pm
webperf-snippets-u6am Ready Ready Preview Jul 31, 2026 11:47pm

@nucliweb
nucliweb merged commit e47e0f3 into main Jul 31, 2026
4 checks passed
@nucliweb
nucliweb deleted the feat/demo-contract-standardize branch July 31, 2026 23:58
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.

1 participant