Skip to content
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

Include sample Storybook in template #27

Open
jessicaaustin opened this issue Sep 23, 2021 · 2 comments
Open

Include sample Storybook in template #27

jessicaaustin opened this issue Sep 23, 2021 · 2 comments

Comments

@jessicaaustin
Copy link
Contributor

jessicaaustin commented Sep 23, 2021

The Studio project makes use of Storybooks to help develop panels, which is great. It would be useful to have the Storybook infrastructure set up for the extension template created here as well, so we can have a place to start without setting that up ourselves.

In particular, this would be useful to have code to help set up a PanelExtensionContext for use in a storybook (or unit tests for that matter). For example, I'm looking at the Map and Teleop panels, and they both make use of studio-base/components/PanelExtensionAdapter and studio-base/stories/PanelSetup. I've spent some time trying to either import those or build something similar so I can get my custom panel loaded in a storybook, and keep running into issues.

(For context, I'm a React beginner and in general not a frontend expert, so I may be missing something obvious here)

@defunctzombie
Copy link
Contributor

Thanks for the feedback.

(For context, I'm a React beginner and in general not a frontend expert, so I may be missing something obvious here)

React isn't required for making a panel extension. This was a deliberate decision so that folks not as familiar with React and its nuances - or have prior non-react frontend experience - could cobble together something using techniques they might know. We'll see how this plays out over time tho.

We can add a mode to fox that does produce a react ready example with storybook to help folks get going that do want to use React. Or we could make a few example projects. @jhurliman what do you think?

@jessicaaustin
Copy link
Contributor Author

jessicaaustin commented Sep 23, 2021

React isn't required for making a panel extension.

Yep, understood, but the current template uses it (ExamplePanel.tsx), and at least right now everything in Studio uses React as well, so I figured it would be easier to start there since there are more examples to reference. The turtlesim extension is a non-react example, but that's incomplete.

So personally I would find it helpful to have a "react mode" like you suggest.

Thanks!

Edit: To be clear, this is a nice-to-have for sure. All my interesting code is in vanilla TS + unit tests, so I don't have to reload Studio too often to do an end-to-end test. But storybooks would be a nice intermediate point between unit tests and reloading the app+data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants