question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Presets: Support recursive addon imports

See original GitHub issue

Currently, 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:closed
  • Created a year ago
  • Reactions:1
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
shilmancommented, Nov 13, 2022

@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 in preview.js? In other words, should I leave this closed?

0reactions
tmeasdaycommented, Nov 14, 2022

That sounds right to me @shilman

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found