-
Notifications
You must be signed in to change notification settings - Fork 279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: homepage gallery component #1464
Conversation
± Registry diff
📊 PerformanceKeyNote that each bar component rounds up to the nearest 100ms, so each full bar is an overestimate by up to 400ms.
If a row has only one bar instead of four, that means it's not a trio and the bar just shows the total time spent for that example, again rounded up to the nearest 100ms. Data
|
Deploying with Cloudflare Pages
|
Thanks @wodeni! Is the idea that these examples will show up on the landing page (https://penrose.cs.cmu.edu/)? |
You can preview the landing page here: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work, thanks so much for doing this! The new DOMParser()
and new XMLSerializer()
stuff looks pretty intense.
Description
Resolves #1288. Resolves #1307.
This PR adds a new
Gallery
component tocomponents
, which is used in the "Examples" page on our site. To make this work, I had to fix a SVG andImage
related issue: #1288. The overall strategy is to runsvgo.optimize
with two plugins (prefixIds
andinlineStyles
) at two places:yarn registry
test andeditor
SVG download.Implementation strategy and design decisions
inlineStyles
fixes this issueImage
import #1288: we are still usingmakeIdsUnique
introduced in feat: show multiple diagram instances on a grid ineditor
#1287 because runningsvgo
in real time can be quite slow. InGallery
, since we are pulling frommain
's cached SVGs, they are already optimized usingprefixIds
.Examples with steps to reproduce them
Checklist
Open question
prefixIds
andmakeIdsUnique
concurrently. This doesn't seem to cause a problem in general, but it's a bit odd.Gallery
andExampleBrowser
pull SVGs frommain
. We should find a way to run the registry and copy the cached SVGs intodocs-site
in another PR.