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

Supporting storyStoreV7 #125

Closed
joshwooding opened this issue Oct 25, 2021 · 4 comments · Fixed by #126
Closed

Supporting storyStoreV7 #125

joshwooding opened this issue Oct 25, 2021 · 4 comments · Fixed by #126

Comments

@joshwooding
Copy link
Member

Has there been any discussions around supporting storyStoreV7? I know I might be jumping the gun a little since it's still in beta :)

I know @tmeasday mentioned it here but curious if there's been any more discussion?

@IanVS
Copy link
Member

IanVS commented Oct 25, 2021

I don't know of any other discussions so far, but it's definitely something I'd love to get working in vite. I haven't spent any time reverse-engineering the webpack loaders so far yet, though. If anyone wants to jump in and play around with it, I'd happily review a PR. :)

@joshwooding
Copy link
Member Author

@IanVS I'm willing to give it a go :P

@tmeasday
Copy link
Member

Hey folks, ping me if you want more details. Hopefully the way it is structured should make it reasonably straightforward. Here are the relevant bits of the WP4 builder:

  1. We create two virtual modules, one of which is an entry point:

https://github.com/storybooks/storybook/blob/c8c00340a5a5ea7026811603268634d991acffbb/lib/builder-webpack4/src/preview/iframe-webpack.config.ts#L96-L112

  1. The entry point looks like this (I suspect it could be copied directly over to Vite, except perhaps for the HMR which might require a bit of thought):

https://github.com/storybooks/storybook/blob/0253a81391a5bea1f0921f9a296d28bf0433a05f/lib/builder-webpack4/src/preview/virtualModuleModernEntry.js.handlebars#L1-L40

  1. The second entry is an importFn, which might require some discussion: https://github.com/storybookjs/storybook/blob/719c787150af282fa63cad500cc06919bb0d0bed/lib/core-common/src/utils/to-importFn.ts#L1-L54

IanVS pushed a commit that referenced this issue Nov 18, 2021
@IanVS
Copy link
Member

IanVS commented Nov 18, 2021

Released in version 0.1.8!

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 a pull request may close this issue.

3 participants