Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(storybook): Remove consideration of mjs from docgen plugin (#11346)
We created out Storybook framework package by starting with the [official framework package for React Vite](https://github.com/storybookjs/storybook/blob/next/code/frameworks/react-vite/). Included in this is a Vite plugin for [React Docgen](https://react-docgen.dev), which is used by Storybook to know what the "controls" are (aka props) for a given component. This is simply a QOL thing — With docgen: <img width="937" alt="Screenshot 2024-08-22 at 14 45 24" src="https://github.com/user-attachments/assets/273a12a2-0382-4df4-845b-f50f141747b5"> Without docgen: <img width="764" alt="Screenshot 2024-08-22 at 14 43 50" src="https://github.com/user-attachments/assets/c1ec00be-6bdc-4ba8-99f7-a5360cecbcb9"> With or without docgen, in order to be able to have interactive controls, you still need to [configure them](https://storybook.js.org/docs/essentials/controls). Docgen is mostly just used for [automatic argType inference](https://storybook.js.org/docs/api/arg-types#automatic-argtype-inference). The docgen plugin that we originally included in our framework package matches components in `mjs`, `tsx`, and `jsx` files. `tsx` and `jsx` are obvious requirements, and we didn't give any additional thought to the inclusion of `mjs`, though it now seems that if you *do* have any `.mjs` files that *aren't* components, [it'll completely break your ability to load stories](https://community.redwoodjs.com/t/storybook-in-redwood-is-moving-to-vite/7212/22?u=arimendelow), as discovered by @simoncrypta. Therefore, this PR simply removes the inclusion of those files. --------- Co-authored-by: Josh GM Walker <56300765+Josh-Walker-GM@users.noreply.github.com>
- Loading branch information