-
Notifications
You must be signed in to change notification settings - Fork 219
Migrate to storybook essentials, controls and evaluate docs / mdx format #3041
Comments
I think the path you outline for this issue sounds good (pick a component with an existing story to write the new Storybook flow with and demonstrate how to do). |
Hit a snag getting this going. The new addons use our The problem is that our Storybook uses Here's the relevant config in Storybook: (props @shilman for finding this!) |
I'm sorry I missed this earlier, are |
Sounds like a good plan to me @nerrad 😄 I don't think Under the hood it's using I'll switch my investigation to getting docs and controls (etc, via While we're on the topic, perhaps we could look at using TypeScript extension for our components and/or stories? If we are using TypeScript types, that feels like the path of least resistance to me (compared with using JSDoc). TypeScript is a superset of JS, so we could gradually adopt types. I'm not an expert in TypeScript - just an idea. |
This was a red herring, I was confused by the regex - it definitely includes |
More info about TypeScript-powered args/props/docs: https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#react-prop-tables-with-typescript I'm not sure if we need to do extra stuff to get the typescript stuff firing for our "TypeScript" in JSDoc comments, but 🤞 I'm working on that. |
Still having trouble getting On the PR I've made a few changes and confirmed that TypeScript components and stories are working, so that's one option (but pretty drastic!). |
We do have a simple workaround we could go with - Example: import QuantitySelector from '../';
export default {
title: 'WooCommerce Blocks/@base-components/QuantitySelector',
component: QuantitySelector,
};
const Template = ( args ) => <QuantitySelector { ...args } />;
export const Primary = Template.bind( {} );
Primary.args = {
disabled: false,
quantity: 1,
itemName: 'widgets',
};
Primary.argTypes = {
disabled: { control: { type: 'boolean' } },
}; |
Moved this to icebox for now - focusing on cart/checkout for cycle. |
I'd love it if we could start using MDX for our stories and/or automatically power our
@opr I'm keen for your thoughts / ideas on this. We got stuck last time I looked, maybe things have improved now. |
This issue has been marked as Internal: After 10 days with no activity this issue will be automatically be closed. |
This issue has been marked as Internal: After 10 days with no activity this issue will be automatically be closed. |
Storybook has a brand new way of writing stories and making interactive component docs.
Most of this is available in a bundle of addons: essentials.
In particular I think we could benefit from:
Outcomes for this issue (or separate follow up if needed):
Alternatively could add docs for a new component (not in storybook) to demonstrate best practices (2 & 3).
The text was updated successfully, but these errors were encountered: