← Back to Pull requests

fix(docs): render all code example languages at build time #192

Merged
justin-schroeder merged 2 files (28 lines) on Jun 11, 2026 17:26 UTC
View on GitHub
justin-schroeder justin-schroeder commented on Jun 11, 2026 17:26 UTC
Author

Fixes #174 (only the React tab renders on drag-and-drop.formkit.com).

Root cause — two layers


1. The Vue/Solid/Native/Marko panes are server components mounted lazily (v-if on first tab click). On the statically deployed site, that mount issues a runtime /__nuxt_island/... request with no server to answer it → empty pane.
2. Eagerly prerendering them surfaced a second bug the lazy islands had been hiding: docs/examples/config/config.ts mirrors ParentConfig and still used the unparameterized handler types — after #186 that's TS2314, twoslash rejects the sample, and the Native island 500s even with a server. This is consistent with the issue reporting all non-React tabs blank.

Fix


  • All five panes render during SSG and toggle with v-show. The highlighted HTML ships in the static page; the client-perf win of server components (no shiki/twoslash on the client) is preserved — the cost moves to build time.

  • config.ts example updated to SortEvent<T> et al.
  • Verification


  • nuxt generate completes with zero prerender errors (71 island routes), where it previously failed.

  • Generated index.html contains the raw-code containers and shiki output for all five languages (774 highlighted blocks).

  • Copy button now works for every tab immediately (raw-code containers all present at load).
  • Diff: 28 lines (+16 / -12) across 2 files Reviewer: justin-schroeder Review duration: 0m
    All Vouch review confidence checks passed
    Residual risk 0.27 = Change Risk (0.49) × (1 − Review Confidence (0.44)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.49 · 28 lines diff across 2 files
    0.49
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.89 · 1 substantive comment(s)
    0.89
    Model 3 · Review Timing & Attention
    Session adequacy: 8% · Reviewer familiarity: 35%
    43%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.201
    Self Review self_review
    0.140
    Rapid Merge rapid_merge
    0.100
    Real PR Conversation Timeline
    3 items
    vercel[bot] vercel[bot] commented on Jun 11, 2026 17:26 UTC
    Bot

    [vc]: #NLgQa1Zh6KIc0nzFyIdNFP816YZnndS30t614EbfO6w=:eyJpc01vbm9yZXBvIjp0cnVlLCJ0eXBlIjoiZ2l0aHViIiwicHJvamVjdHMiOlt7Im5hbWUiOiJkcmFnLWFuZC1kcm9wLWRvY3MiLCJwcm9qZWN0SWQiOiJwcmpfbUNKSEUydjIwQnJmVFpuTlh3YW1QQTZrYks4bSIsInYwIjpmYWxzZSwiaW5zcGVjdG9yVXJsIjoiaHR0cHM6Ly92ZXJjZWwuY29tL2Zvcm1raXQvZHJhZy1hbmQtZHJvcC1kb2NzLzl3bzdUaE10WVlTOXRuQVdSejFVZmhhU0QyODYiLCJwcmV2aWV3VXJsIjoiZHJhZy1hbmQtZHJvcC1kb2NzLWdpdC1maXgtZG9jcy1jb2RlLXRhYnMtZm9ybWtpdC52ZXJjZWwuYXBwIiwibmV4dENvbW1pdFN0YXR1cyI6IkRFUExPWUVEIiwicm9vdERpcmVjdG9yeSI6ImRvY3MifV0sInJlcXVlc3RSZXZpZXdVcmwiOiJodHRwczovL3ZlcmNlbC5jb20vdmVyY2VsLWFnZW50L3JlcXVlc3QtcmV2aWV3P293bmVyPWZvcm1raXQmcmVwbz1kcmFnLWFuZC1kcm9wJnByPTE5MiJ9
    The latest updates on your projects. Learn more about Vercel for GitHub.

    | Project | Deployment | Actions | Updated (UTC) |
    | :--- | :----- | :------ | :------ |
    | drag-and-drop-docs | !Ready Ready | Preview | Jun 11, 2026 5:27pm |

    <a href="https://vercel.com/vercel-agent/request-review?owner=formkit&repo=drag-and-drop&pr=192" rel="noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://agents-vade-review.vercel.sh/request-review-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://agents-vade-review.vercel.sh/request-review-light.svg"><img src="https://agents-vade-review.vercel.sh/request-review-light.svg" alt="Request Review"></picture></a>

    justin-schroeder justin-schroeder commented on Jun 11, 2026 17:26 UTC
    Reviewer

    Review notes: payload size is the main tradeoff — five static panes per example instead of one. That's inert HTML (no extra JS), and it's what made the build catch the broken Native sample, which I consider the stronger argument: lazy islands turned doc-sample type errors into invisible runtime 500s. The loadedLangs machinery and its watch hook are gone; collectRawCode's retry loop is kept (it still guards slow hydration) but now finds every container on the first pass.

    Assignees
    justin-schroeder justin-schroeder
    Labels
    risk: low confidence: 43.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 48.6% (MEDIUM) · Higher = larger blast radius
    48.6%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 43.7% · Lower = rushed or shallow review
    43.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 27.4% · Safe to merge
    27.4%