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

Support css modules in storybook #4931

Merged
merged 102 commits into from
Aug 22, 2024
Merged

Conversation

gyfchong
Copy link
Contributor

@gyfchong gyfchong commented Aug 16, 2024

Why

Storybook's existing config to process styles is outdated and cannot support both SCSS and CSS modules at the same time.

What

  • Created a new storybook config using the latest Vite which supports the functionality out of the box and provides a significant speed boost.

Notes

The DST has had conversations about using next-storybook to remain consistent with the rest of the business however the DS goals require much less config (and support for different config eg. MDX) than the rest of the business, which could lead to slower development time.

Also on the note of config, the next-storybook makes heavy use of custom plugins, due to the complexity it has been difficult to upgrade it to newer versions and config syntax, namely the move to ESM which will take some time to resolve all dependencies which don't support ESM. So if Kaizen were to adopt this technology, we'd potentially lose out on benefits which could improve our productivity.

That isn't to say we shouldn't ever adopt next-storybook just that this isn't the right time to do it as we don't gain very much for the time invested in potentially upgrading it ourselves. Eventually I can see the next-storybook becoming simpler as it no longer needs to cater for things like excluding/including packages for processing styles.

Copy link

changeset-bot bot commented Aug 16, 2024

🦋 Changeset detected

Latest commit: 2da5bdd

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@kaizen/hosted-assets Minor
@kaizen/design-tokens Minor
@kaizen/tailwind Minor
@kaizen/components Minor

Not sure what this means? Click here to learn what changesets are.

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

@gyfchong gyfchong marked this pull request as ready for review August 19, 2024 02:16
@gyfchong gyfchong requested a review from a team as a code owner August 19, 2024 02:16
@gyfchong gyfchong marked this pull request as ready for review August 21, 2024 00:08
@gyfchong gyfchong marked this pull request as draft August 21, 2024 07:12
@gyfchong gyfchong marked this pull request as ready for review August 22, 2024 00:01
.stylelintignore Outdated Show resolved Hide resolved
@gyfchong gyfchong marked this pull request as draft August 22, 2024 02:11
@gyfchong gyfchong marked this pull request as ready for review August 22, 2024 02:46
@gyfchong gyfchong merged commit febd282 into main Aug 22, 2024
17 checks passed
@gyfchong gyfchong deleted the support-css-modules-in-storybook branch August 22, 2024 05:36
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