feat(playground): add Sandpack component playground#349
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
bntvllnt
left a comment
There was a problem hiding this comment.
Review — 1 finding (blocking, published as COMMENT)
BLOCKING
C1 — Sandpack preview omits the VLLNT Tailwind contract- Evidence:
apps/registry/components/playground/sandpack-playground.tsx:92-100generates a sandbox Tailwind config with only./index.htmland./src/**/*.{ts,tsx}content,theme.extend: {}, and no@vllnt/ui/tailwind-preset/equivalent token theme. The sandbox examples import@vllnt/ui/styles.cssand@vllnt/ui/themes/default.css, and both/src/main.tsxplus the fallback demo use token utilities such asbg-background,text-foreground,bg-card, andtext-card-foreground. Those utilities are defined by the VLLNT Tailwind preset/theme, not Tailwind defaults. - Why it matters: the new playground is meant to render real
@vllnt/uiexamples, but Tailwind will not generate the design-token utilities or scan the package internals. Published components and the default fallback demo can render unstyled or partially styled in the preview even while the docs page itself looks correct. - Fix: make the generated sandbox Tailwind config consume the exported
@vllnt/ui/tailwind-presetor inline the same token theme/plugin contract, and include the published package/dist/source paths needed for component-internal class scanning.
- Evidence:
WARN
- None.
VERIFIED CLEAN
- Re-fetched PR #349 immediately before publishing; head is still
8c4961fd7bdb900848908515345c799252a5f6a0onfeat/256-sandpack-playground. - Re-checked the previously found blocker against the live diff and package contract:
@vllnt/uiexports./tailwind-preset, while the generated sandbox config still omits it. - Existing GitHub checks are green at this head.
VALIDATION
- Ran:
gh pr view 349 --repo vllnt/ui --json ...before review and before publish. - Ran:
gh pr checks 349 --repo vllnt/ui(all listed checks passing). - Inspected:
apps/registry/components/playground/sandpack-playground.tsx,apps/registry/lib/playground.ts,packages/ui/package.json,packages/ui/src/tailwind-preset.ts, and registry/package Tailwind configs. - Not run: live browser Sandpack smoke; this publication reconciles the already-local blocker against the current live head.
Note: GitHub rejected REQUEST_CHANGES from the current authenticated account because it is the PR author, so this formal COMMENT review carries the blocking review gate instead of a request-changes verdict.
| "/tailwind.config.js": `/** @type {import("tailwindcss").Config} */ | ||
| export default { | ||
| darkMode: ["class"], | ||
| content: ["./index.html", "./src/**/*.{ts,tsx}"], |
There was a problem hiding this comment.
Blocking: this generated Tailwind config does not load the VLLNT Tailwind preset/theme or scan @vllnt/ui internals. The sandbox imports @vllnt/ui/styles.css / themes/default.css, and the examples use token utilities such as bg-background, text-foreground, bg-card, and text-card-foreground, but those utilities are not Tailwind defaults. Without @vllnt/ui/tailwind-preset (or the equivalent token theme/plugin contract plus package content scanning), the playground can render real components/default examples unstyled or partially styled even though the docs page itself is styled. Please wire the generated sandbox Tailwind config to the exported VLLNT preset and include the package paths needed for component class scanning.
Closes #256
Summary
/components/[slug]/playgroundroute generated for every registry component.@vllnt/ui, and track opens with Vercel Analytics.@vllnt/ui/tailwind-presetand scan local sandbox files plus@vllnt/uipackagedist/srcpaths for token and component-internal classes.Dependency tradeoff
@codesandbox/sandpack-reacttoapps/registryonly. This brings Sandpack and CodeMirror editor dependencies for the live-editing experience, but it is route/tab scoped and not part of the package library build.Verification at HEAD
aaa7fadc3b9b9d8c4a3993b1c27be4b9d1b5a691pnpm -F @vllnt/ui-registry exec eslint components/playground/sandpack-playground.tsx— passedpnpm -F @vllnt/ui-registry exec tsc --noEmit --project tsconfig.json— passedpnpm -F @vllnt/ui lint— passedpnpm -F @vllnt/ui exec tsc --noEmit --project tsconfig.build.json— passedpnpm build— passedpnpm test:once— passed: 216 files, 1215 testsgit diff --check— passedCI status at HEAD
aaa7fadc3b9b9d8c4a3993b1c27be4b9d1b5a691Merge note
apps/registry/package.jsonandpnpm-lock.yaml; rebase may be needed if another registry dependency PR lands first.Vercel – ui.vllnt.aipreview check is rerun or accepted as an external cancellation.