You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[GSoC] Playground / Toggle System for Live Documentation #3057
A better playground / toggle system for EUI live documentation. Right now we have flat, read-only code displayed next to static examples. It would be nice if people could change the code examples in-browser on our docs site and see the changes live in the examples.
Outcome
An edit mechanism that would allow users to change, add, or otherwise modify props and content in rendered examples.
Related Discussion
Discuss comment; Please note that the ideas mentioned are not requirements but concept suggestions that would need to be thoroughly vetted.
Discuss comment; "having the interactive playground inline in our documentation is something we'd really like to see"
My current thoughts are that I'd like to avoid creating a new tab to each documentation section. Instead, I'm thinking that it's basically a separate page(application) with all the components listed in it's own side nav on the left and toggles/code editor on the right. Then each component in our normal docs would just have a button/link that goes to it's playground section in this new page/app. I'll probably think through the design/layout of this over the next month, but that's the basic idea.
I'd like to avoid creating a new tab to each documentation section. Instead, I'm thinking that it's basically a separate page(application) with all the components listed in it's own side nav on the left and toggles/code editor on the right. Then each component in our normal docs would just have a button/link that goes to it's playground section in this new page/app.
@anishagg17 You can start exploring this idea. I'll do some research, as well.
Some things to consider:
How would this concept change the scope of your original proposal?
How would this concept change the technology choices (i.e., react-live) in your original proposal?
We would have to write out separate codeExamples for the playground, but about 40% would be copy pasted. Same code can also be used for both readOnly code and Playground but we would have to write out some complex function to remove all import statements and use them for import prop that might require special care for some examples as in case of EuiSideNav one import statement is multiline.
react-view looks interesting. Have you seen any usages where the prop configuration is less manual? Like, is it possible to consume prop types from PropTypes or TypeScript output?
(for most of the forms we would have to set some default onChange and value so that they can be made simple)
We have a kind of toggle system in place already for form controls, so they are lower on the priority list. We eventually move them over the playground, but we can wait.
@anishagg17 Thank you so much for all the work you did on this project!!! 🎉 🎉 It's amazing what's been accomplished over this past summer. The playground toggles really step up our documentation game and gives us such an easier way to test all the permutations of each component. Best of luck to you in future endeavors!
@anishagg17 Nothing more as far as EUI is concerned 😄 Just make sure you submit all your GSoC evaluations, etc. before the deadline later this week (if you haven't already).
You've done great work and should be proud of the last few months! I know all of us here were glad to have you and are thrilled with the outcome 🚀
Activity
thompsongl commentedon May 11, 2020
@anishagg17 We'll use this issue to discuss and track modifications to your proposal.
Comment in this thread and then I can assign the issue to you.
anishagg17 commentedon May 13, 2020
@thompsongl Sorry for the late reply , I think my
mention notificationsare turned off.Sure this would be great!
thompsongl commentedon May 13, 2020
@cchaos We'll use this issue to track discussion for the EUI docs project. Post anything you've been thinking about for design, etc.
I'll be updating the main summary area soon
cchaos commentedon May 13, 2020
My current thoughts are that I'd like to avoid creating a new tab to each documentation section. Instead, I'm thinking that it's basically a separate page(application) with all the components listed in it's own side nav on the left and toggles/code editor on the right. Then each component in our normal docs would just have a button/link that goes to it's playground section in this new page/app. I'll probably think through the design/layout of this over the next month, but that's the basic idea.
thompsongl commentedon May 15, 2020
@anishagg17 You can start exploring this idea. I'll do some research, as well.
Some things to consider:
anishagg17 commentedon May 16, 2020
Before coding , let's discuss several alternatives that can be used for this purpose
Also ,
Inculcates creating a new section within the docs-site this would be the first step later we can use the library of our choice and utilise it
anishagg17 commentedon May 16, 2020
react-live
Pros
Cons
anishagg17 commentedon May 16, 2020
react-view
Pros
Cons
40%would be copy pasted. Same code can also be used for both readOnly code and Playground but we would have to write out some complex function to remove all import statements and use them forimportprop that might require special care for some examples as in case ofEuiSideNavone import statement is multiline.thompsongl commentedon May 18, 2020
react-viewlooks interesting. Have you seen any usages where the prop configuration is less manual? Like, is it possible to consume prop types from PropTypes or TypeScript output?26 remaining items
anishagg17 commentedon Jul 2, 2020
Layout
onToggle, ComponentsextraActionandbuttonContent)Bottom Bar[Playground] EuiBottomBar #3870 (comment)Navigation
onClick)EuiKeyPadMenuItemseems simple it too has a functiononClick)onClick)onPageClick)EuiStepseems simple)EuiTabseems simple it too has a functiononClick)Display
onClick)onClick)EuiCommentseems simple)onClose)onMouseOut)Forms
(for most of the forms we would have to set some default
onChangeandvalueso that they can be made simple)levels)levels)Utilities
- [ ] EuiPortal (don't have any idea as it doesn't has any meaningful props)[GSoC] Playground / Toggle System for Live Documentation #3057 (comment)onToggle)I have added almost all the components which are already simple or could be made simple via some modifications in the
configfile.anishagg17 commentedon Jul 6, 2020
@thompsongl I have completed the list If you find any component missing you may add it.
thompsongl commentedon Jul 6, 2020
We have a kind of toggle system in place already for form controls, so they are lower on the priority list. We eventually move them over the playground, but we can wait.
thompsongl commentedon Jul 9, 2020
Let's start working on the Display components. Probably a single PR per component.
I think Badge, Card, and Toast can be added, also, as long as we fake the necessary
onClick/onClosefunctions.anishagg17 commentedon Jul 30, 2020
@thompsongl as
EuiIcondoesn't render props currently . So, should we skipEuiIconcomponent for now and can build it later on.thompsongl commentedon Jul 30, 2020
Yep, sounds like a good plan
anishagg17 commentedon Jul 31, 2020
@thompsongl I noticed that
EuiEmptyPrompthasactions,titleandbodyas some major props(all ReactNode) .If
bodyandactionsare set toString, andtitleis faked then it worksOtherwise , it's playground shouldn't be considered.
Also, since it is the last component of
Displaysection , do let me know whichsectionshould I work nextthompsongl commentedon Aug 10, 2020
Let's try this for
EuiEmptyPromptStart with Layout components, then Utilities
anishagg17 commentedon Aug 12, 2020
@cchaos does
EuiPortal(Utilities)requires a playground?thompsongl commentedon Aug 12, 2020
No, we can skip that one
anishagg17 commentedon Aug 25, 2020
@thompsongl #3959 marks the completion of all playgrounds 🎉 . Anything more that I need to do?
cchaos commentedon Aug 25, 2020
@anishagg17 Thank you so much for all the work you did on this project!!! 🎉 🎉 It's amazing what's been accomplished over this past summer. The playground toggles really step up our documentation game and gives us such an easier way to test all the permutations of each component. Best of luck to you in future endeavors!
thompsongl commentedon Aug 25, 2020
@anishagg17 Nothing more as far as EUI is concerned 😄 Just make sure you submit all your GSoC evaluations, etc. before the deadline later this week (if you haven't already).
You've done great work and should be proud of the last few months! I know all of us here were glad to have you and are thrilled with the outcome 🚀
thompsongl commentedon Aug 25, 2020
Closing this because @anishagg17 did all the things
We'll track anything related to component playground in the future in separate issues.