You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PR #7117 introduced @libetl's @storybook/source-loader, a reusable package for annotating stories with their source code. In addition to emitting an event (old behavior) every time a story is rendered, it also injects story source as story parameters.
The Storysource addon should be refactored to use the story parameters instead of the channel event. There are a few reasons:
There are race conditions on the channel, and parameters don't have this problem.
Story parameters are simpler, and we are standardizing on those for communicating between the preview & manager in many cases.
The event emitter code breaks when you use stories like the one below, because the modified code assumes that stories are called with a context argument, which is not the case in the following example:
import React from 'react';
import { DocsPage, DocsWrapper, DocsContent } from './DocsPage';
import * as storyStories from './Story.stories';
import * as previewStories from './Preview.stories';
import * as propsTableStories from './PropsTable/PropsTable.stories';
import * as sourceStories from './Source.stories';
import * as descriptionStories from './Description.stories';
export const empty = () => (
<DocsPage title={null}>
{storyStories.error()}
{propsTableStories.error()}
{sourceStories.sourceUnavailable()}
</DocsPage>
);
On top of all that #7117 introduced a bug where the Storysource addon no longer renders the story source once source-loader has been activated. Please fix this problem, either in source-loader or storysource (I haven't debugged the issue)
The text was updated successfully, but these errors were encountered:
PR #7117 introduced @libetl's
@storybook/source-loader
, a reusable package for annotating stories with their source code. In addition to emitting an event (old behavior) every time a story is rendered, it also injects story source as story parameters.The Storysource addon should be refactored to use the story parameters instead of the channel event. There are a few reasons:
On top of all that #7117 introduced a bug where the Storysource addon no longer renders the story source once source-loader has been activated. Please fix this problem, either in source-loader or storysource (I haven't debugged the issue)
The text was updated successfully, but these errors were encountered: