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

Split storybook stories into individual files #2952

Merged
merged 7 commits into from
Nov 8, 2024

Conversation

carbonrobot
Copy link
Contributor

@carbonrobot carbonrobot commented Nov 5, 2024

Split storybook stories into individual files for easier maintenance and faster HMR. Improves the development experience by correct Types and Auto gen controls for props.

Previous format

// victory-area.stories.tsx
// cs2 format
export const Basic : () => 
...
export const Theme: () =>

New format

// victory-charts/victory-area/basic.stories.tsx
// cs3 format
export const Basic : { ...
// victory-charts/victory-area/theme.stories.tsx
// cs3 format
export const Theme: { ...

Copy link

changeset-bot bot commented Nov 5, 2024

⚠️ No Changeset found

Latest commit: 25ed241

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Nov 5, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
victory ✅ Ready (Inspect) Visit Preview Nov 7, 2024 9:25pm

@carbonrobot carbonrobot changed the title Split storybook stories into individual files for easier maintenance and faster HMR Split storybook stories into individual files Nov 5, 2024
@nlkluth
Copy link
Member

nlkluth commented Nov 5, 2024

Looks like a few places have control set to "string", but I think it should be "text"

stories/utils/arg-types.ts Outdated Show resolved Hide resolved
stories/victory-charts/victory-axis/config.ts Show resolved Hide resolved
nlkluth
nlkluth previously approved these changes Nov 6, 2024
Copy link
Member

@nlkluth nlkluth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Playing around a bit with the new file structure and everything seems good. I like it! 🎉

ramenhog
ramenhog previously approved these changes Nov 6, 2024
Copy link
Contributor

@ramenhog ramenhog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also liking the new file structure! This makes it much easier to read and maintain.

Left a comment about a type error I noticed with control: "string". It looks like it's affecting the following files:

  • stories/victory-charts/victory-animation/config.ts
  • stories/victory-charts/victory-box-plot/config.ts
  • stories/victory-charts/victory-candlestick/config.ts
  • stories/victory-charts/victory-chart/config.ts

Also can confirm that the as const fixes those arg type errors for me ☝️

stories/victory-charts/victory-animation/config.ts Outdated Show resolved Hide resolved
@carbonrobot carbonrobot dismissed stale reviews from ramenhog and nlkluth via d404e6e November 7, 2024 14:20
@carbonrobot carbonrobot force-pushed the refactor/storybook-demos branch from c3c6cc7 to d404e6e Compare November 7, 2024 14:20
@carbonrobot
Copy link
Contributor Author

Updated the types, fixed warnings, and corrected the VictoryLabel doc which listed props that were not actually defined on VictoryLabelProps.

ramenhog
ramenhog previously approved these changes Nov 7, 2024
Copy link
Contributor

@ramenhog ramenhog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing! Everything looks generally good now.

I am still seeing a themeKey type issue for certain stories, but I really can't tell why it'd be an issue for one file and not the other. The configs and everything look correct. So it might just be my local 🤷‍♀️

Screenshot 2024-11-07 at 10 37 22 AM

nlkluth
nlkluth previously approved these changes Nov 7, 2024
@carbonrobot carbonrobot merged commit d55eb2c into main Nov 8, 2024
8 checks passed
@carbonrobot carbonrobot deleted the refactor/storybook-demos branch November 8, 2024 00:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants