-
Notifications
You must be signed in to change notification settings - Fork 516
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: add <interactive-example> custom element #12413
Conversation
…t was ready this was noticeable every so often when opening a live sample in the playground
Bundle StatsHey there, this message comes from a github action that helps you and reviewers to understand how these changes affect the size of this project's bundle. As this PR is updated, I'll keep you updated on how the bundle size is impacted. Total
View detailed bundle breakdownAdded
Removed
Bigger
Smaller No assets were smaller Unchanged
|
allow clear/formatting immediately when opening example only enable share if there's non-whitespace update button state after formatting code
This pull request has merge conflicts that must be resolved before it can be merged. |
…gating back to docs page
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.
No major blockers, it looks like auto-scroll for the console is broken. If that's fixed it's a go.
height: 513px; | ||
margin: 1rem 0; | ||
|
||
&[height="shorter"] { |
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.
I guess we want to change this to reflect the current ones?
Summary
https://mozilla-hub.atlassian.net/browse/MP-1804
Replaces #12283 and #12252
Adds these custom elements:
<interactive-example>
: not used anywhere yet, needs me to open a corresponding PR in rari<play-controller>
: used for common logic between the playground and interactive examples<play-editor>
<play-runner>
Also implements a
glean-click
event to allow callinggleanClick
from lit-land, in order to partially re-implement the interactive example pings we send (sans event count).Some outstanding issues we might need to discuss before merging:No use of code fence special classes, currently: these wouldn't help hiding them from css as the class is applied to the<pre>
within the.code-example
<div>
which needs to be hidden, so a pure css approach would require using a selector like.code-example:has(pre.interactive-example)
Code text gets bigger on mobile, and is smaller than the existing interactive examples size on desktop: being the same as the current sizes in the playgroundHow did you test this change?
So far, locally on localhost:3000
on https://developer.allizom.org/en-US/play for playground changes
on https://test.developer.allizom.org/en-US/docs/Web/JavaScript for testing migrated examples - though I suggest we don't let that block merging this, as they won't appear anywhere until the corresponding rari PR is merged (and we actually start migrating examples)