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

Update storybook 6 #696

Merged
merged 17 commits into from Jun 22, 2021
Merged

Update storybook 6 #696

merged 17 commits into from Jun 22, 2021

Conversation

saralohr
Copy link

@saralohr saralohr commented Jun 18, 2021

The goal of this PR was to remove vulnerabilities in the TS-UI repo, and Storybook 5 was the source of some of those so this includes an update to Storybook 6.

What was done:

  • Addressed nested vulnerabilities
    • Our high risk vulnerabilities were all nested dependencies. I tried out setting these in a resolutions section in package.json with npm-force-resolutions. It is running as a pre-install script and seems to be doing the job. Happy to hear other suggestions on handling this if this is not the preferred method.
found 0 vulnerabilities in 3420 scanned packages
  • Update to Storybook 6
    • Storybook 6 has a bunch of cool features and some breaking changes, so this is a first pass at getting us set up in v6. There is a lot more that can be unlocked by moving from the storiesOf format to CSF or MDX stories.
    • v6 ships with a new config setup that has a lot more baked in. Was able to remove the entire webpack config and more
    • Added exports to all the stories so that they work with the Docs add-on, which is what shows all props on the component (used to be Info addon but that is deprecated)
    • Included new addon for showing rendered HTML
    • knobs is deprecated and wasn't working on some of the components (and causing errors) so I removed it in those cases. SB6 ships with a new Controls feature that is meant to replace knobs. It supposedly works out of the box once you update to Component Story Format.

@saralohr
Copy link
Author

PS if you want to take Storybook 6 for a spin without running it locally you can view it here: https://deploy-preview-696--ts-ui-storybook.netlify.app/?path=/docs/button--default

@ryanwi
Copy link
Contributor

ryanwi commented Jun 18, 2021

Awesome 💯 . How does the CI look with these 2 lines uncommented? https://github.com/teamsnap/teamsnap-ui/blob/master/.github/workflows/main.yml#L42 . Based on what you mentioned, that should be good to enable?

@saralohr
Copy link
Author

Oh yeah, good call... we'll see!

Copy link
Contributor

@bradjteamsnap bradjteamsnap left a comment

Choose a reason for hiding this comment

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

Nice! did you end running any migrations scripts, or do it all by hand?

@saralohr
Copy link
Author

I ended up doing it by hand. The migration script for transferring from storiesOf to CSF still required a lot manual parsing after the fact, so I abandoned that for another day. And then there were so many weird errors juggling between npm run build and build-storybook and start-storybook (these last two are totally different for some reason), that I just had to go step by step to keep track of what was breaking what. Good game of whack-a-mole!

Copy link
Contributor

@ryanwi ryanwi left a comment

Choose a reason for hiding this comment

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

I'm all onboard! But, I know little of storybook so deferring to the experts on that.

Copy link
Contributor

@l3aconator l3aconator left a comment

Choose a reason for hiding this comment

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

LGTM! Pulled locally and ran the Storybook commands and looked through the components in the UI.

@saralohr saralohr merged commit 9343c61 into master Jun 22, 2021
@saralohr saralohr deleted the update-storybook-6 branch June 22, 2021 14:48
bradcypert pushed a commit that referenced this pull request Jun 22, 2021
bradcypert added a commit that referenced this pull request Jun 30, 2021
* Merge pull request #696 from teamsnap/update-storybook-6

Update storybook 6

* add netlify toml

Co-authored-by: Sara Lohr <sara.lohr@teamsnap.com>
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.

None yet

4 participants