-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Presets: Support recursive addon imports #19176
Comments
👍 This will help us to improve support for package managers that don't hoist, like pnpm and yarn pnp without some of the games we currently play like using |
Is this something that I could start working on, or do you envision it being something with sharp edges, @shilman @ndelangen? Edit: I'm giving it a shot. So far the trickiest part is figuring out how the |
OK, I've gotten further. I can now require the sub-addons just fine, but I think there's a fatal flaw here. I now have an array of
Now, I need to get that into the preview. But since there are objects with functions, I guess I can't just serialize it straight into the virtual module in the preview builder. The strings can be I've opened a draft PR in case anyone wants to take a look: #19530 |
Hurrah!! I just released https://github.com/storybookjs/storybook/releases/tag/v7.0.0-alpha.49 containing PR #19689 that references this issue. Upgrade today to the
Closing this issue. Please re-open if you think there's still more to do. |
That sounds right to me @shilman |
Currently, addons can reference other addons by name. For example,
addon-essentials
has the following structure:This matches how users configure addons in their
.storybook/main.js
file. However, it presents problems when it comes to package management / module resolution / hoisting, since the dependencies are implicit. If instead we supported the ability to reference other addons directly, this would mean that an addon's dependencies are explicit and we wouldn't have to play any games with module resolution.We should update Storybook's preset mechanism and port existing addons to this structure:
We wouldn't need to force users to adopt this in
main.js
, but it would be useful for addons that make use of other addons (e.g.addon-essentials
).The text was updated successfully, but these errors were encountered: