Presets: Support recursive addon imports
See original GitHub issueCurrently, addons can reference other addons by name. For example, addon-essentials
has the following structure:
export const addons = async (existing) => ([...existing, '@storybook/addon-actions', ...]);
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:
export const addons = async (existing) => ([...existing, await import('@storybook/addon-actions'), ...]);
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
).
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:6 (6 by maintainers)
Top Results From Across the Web
@storybook/addon-actions | Yarn - Package Manager
Storybook Addon Actions can be used to display data received by event handlers ... Support Angular 15.0.4 #20287; CLI: execute automigrations when pressing ......
Read more >Smart Config - Import export full blender configuration with addons ...
Hi blenderheads, here's a little addon i wrote to import export all blender ... They're with all other default blender preset. ... Any...
Read more >Changelog - MACHIN3tools - MACHIN3.io
add usd import/export support; support toggling obj/fbx/usd (addon preferences) ... disable setting Cursor Orientation preset by default (addon preferences).
Read more >v2 Addon Format (Embroider Compatibility) - Ember RFCs
Any module you import, whether from an Ember package or a non-Ember package, gets transpiled by default such that it will support the...
Read more >Configuring Jest
nextTick() and adjust the limit of recursive timers that will be run: JavaScript; TypeScript. /** @type {import('jest').Config} */
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@IanVS @tmeasday is it correct that we won’t pursue this issue now that @IanVS 's PR has been merged/released, and if we do enhance it, it will be a different approach with an
addons
field inpreview.js
? In other words, should I leave this closed?That sounds right to me @shilman