-
Notifications
You must be signed in to change notification settings - Fork 19
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
[GH#4] Addon Panel UI #5
[GH#4] Addon Panel UI #5
Conversation
@brendanrygus great work. I'll have a look at this tonight, if I want to do some changes would you want me to open up a PR against your branch or just commit directly? just from the looks of it we might be able to use some of the built in types from the Anyway, looking forward to digging into this more! |
@lifeiscontent Oh yeah, feel free to commit directly to the branch. I don't have a lot of experience working with the |
@brendanrygus Hey, I took a look at this PR over the weekend. I couldn't figure out how to get it to register the panel. I think what I might end up doing is remove tsdx as the plugin itself will only need to run in the context of storybook so I'll just use I tried doing this, however still couldn't get the panel UI to register. 2 things, would you want to pair on this together or try to take another stab at it with removing tsdx? it also looks like you went off the master branch which doesn't use apollo 3.0 by default. it's a bit of a weird setup, but in order to maintain multiple forks I have branches for each major version I think what you meant to use was to use the 3.0 branch |
src/register.tsx
Outdated
addons.add(PANEL_ID, { | ||
title, | ||
type: types.PANEL, | ||
render: ({ active = false, key }) => ( |
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.
@brendanrygus I think we might want to follow the same convention the storybook team uses for panels here.
https://github.com/storybookjs/storybook/blob/master/addons/knobs/src/register.tsx
rather than rendering a component tree, it's a single component if we need to change anything in the future, this kind of pattern will give us more flexibility.
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.
Sure thing, makes sense to me
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.
This is updated now, forgot to comment last time 👍
Thanks for testing and your feedback. I got reassigned on to a project and am no longer able to contribute to OSS during my 9-5, but hopefully will have a chance to get back into things this weekend.
I'll try the |
639e974
to
da633c9
Compare
da633c9
to
b90a592
Compare
@brendanrygus sorry about the delay, I've got a few other things on my plate. I hope to get to this soon. |
@lifeiscontent any updates on this? Would really like to use it. |
@JohannesKlauss Hey, sorry, I haven't had much time to dig into the build step either. Going to reach out to a TS expert I know and see if he can help with some next steps! |
I plan on working on this more next weekend. I've been busy on other projects. |
@brendanrygus again, if you want, we can pair on it together if you have time! 👍 |
@lifeiscontent thanks, I hope to find the time soon 🙏 I'll test it out this week then pass it on to you |
This branch is now updated with the latest build changes. Thanks a million to @micmro for taking this on during his time off from our regular job! Could you take another shot at registering the plugin in your realworld app? |
Updated the readme as well, give it a test run when you can |
@brendanrygus @micmro super excited to see this come together! Happy holidays to the both of you. I'll try to look at it on Saturday. Take care guys! |
Background
Related issue: #4
Proposed Changes
ApolloClientPanel
component to interface with StoryapolloClient
parametersMockedProvider
"mocks" prop input and convert data for displayErrorBoundary
to prevent unexpected behaviour in the addon UI from crashing the parent Storybook instanceDecorator Usage
So far, I have only tested this using the addon at the Story decorator level using v3.
From my experience, the
MockedProvider
is only useful as a global decorator if all stories use the same mocked data. Ex. it is difficult to switch between a successfully loaded Story, and a loading state Story, when using the global decorator.Potential UI or configuration improvements:
MockedProvider
props.Screenshots