-
Notifications
You must be signed in to change notification settings - Fork 106
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
Autotitle when not using storyStoreV7 #201
Comments
The second snag is reported here with a potential solution #142 |
3 tasks
PR to remove |
IanVS
added a commit
that referenced
this issue
Feb 18, 2022
Fixes #201 This enables the omission of `title` properties in the default export of stories (the new storybook "autotitle" feature). It's a little less powerful without #182, but it's still nice to support this, I think. I did notice an issue with HMR, but it seems not to be introduced in this PR, but exists in the react example on main as well. Changing a css value _does_ still HMR, so I think there is no regression here.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently, autotitle does not work without enabling storyStoreV7. We need to provide a global
STORIES
like the webpack builder does here: https://github.com/storybookjs/storybook/blob/e0c0a1429dc123219dfd74c8c4a1c6bfc9660f74/lib/builder-webpack4/src/preview/iframe-webpack.config.ts#L191-L194, so that it can be used here: https://github.com/storybookjs/storybook/blob/e0c0a1429dc123219dfd74c8c4a1c6bfc9660f74/lib/client-api/src/StoryStoreFacade.ts#L156-L164I've hit two snags so far. One, is that autoTitle uses
path
, which webpack polyfills but vite does not (there's a simple solution I have working, and I'll submit a PR to storybook soon). Second, the format of the loadable function we are providing to the call toconfigure
does not include the filenames, which means that autoTitle does not name the stories correctly, defaulting toexport_map_1
, rather than the actual filename. Here is where the loadable is used: https://github.com/storybookjs/storybook/blob/e0c0a1429dc123219dfd74c8c4a1c6bfc9660f74/lib/core-client/src/preview/executeLoadable.ts#L12, and this is how we are currently setting it up: https://github.com/eirslett/storybook-builder-vite/blob/fb289c1cb57c3b929eb5f586e87b7644f97e28be/packages/storybook-builder-vite/codegen-iframe-script.ts#L103-L106.The text was updated successfully, but these errors were encountered: