Feature/design-sync: import Primer ViewComponents into claude.ai/design - #517
Draft
akabiru wants to merge 1 commit into
Draft
Feature/design-sync: import Primer ViewComponents into claude.ai/design#517akabiru wants to merge 1 commit into
akabiru wants to merge 1 commit into
Conversation
Primer renders in Ruby, so there is no React entry point for the importer to consume. generate-adapter.mjs scrapes each routable Lookbook preview's real rendered HTML and wraps it in a React package, which keeps the cards byte-identical to Primer's own renderer instead of reimplementing components in JSX. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Imports this design system into claude.ai/design so the design agent builds with Primer's real components instead of generic ones.
Primer renders in Ruby, so there is no React entry point the importer can consume.
generate-adapter.mjsboots the demo Lookbook, scrapes every routable preview's real rendered HTML, and wraps it in a synthetic React package that side-effect-imports the compiled custom-element bundle. Cards are therefore byte-identical to Primer's own renderer rather than JSX lookalikes, and the stylesheet mirrorsdemo/app/assets/stylesheets/application.postcss.cssso text isn't left in the browser default serif. 89 components / 474 cells, all render-checked and reviewed. The cards intentionally expose no content props -<Name>Propsispreview/className/styleonly, since advertising the Ruby arguments would make the agent write props that silently do nothing;conventions.mdtells it to copy the markup and write Primer classes instead.Committed files are sync inputs only, so a re-sync is reproducible from a fresh clone.
NOTES.mdrecords the gotchas worth knowing next time, including thatcfg.overrides.skipis inert for this source shape.