mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 00:12:22 +08:00
Merge branch 'fix/storystorev6-vite' into norbert/sb-1063-vite-in-dev-mode-with-storystorev6
This commit is contained in:
commit
3eb16e7ded
@ -337,7 +337,7 @@ export class Instrumenter {
|
||||
track(method: string, fn: Function, args: any[], options: Options) {
|
||||
const storyId: StoryId =
|
||||
args?.[0]?.__storyId__ ||
|
||||
global.window.__STORYBOOK_PREVIEW__.selectionStore.selection.storyId;
|
||||
global.window.__STORYBOOK_PREVIEW__.selectionStore?.selection?.storyId;
|
||||
const { cursor, ancestors } = this.getState(storyId);
|
||||
this.setState(storyId, { cursor: cursor + 1 });
|
||||
const id = `${ancestors.slice(-1)[0] || storyId} [${cursor}] ${method}`;
|
||||
|
@ -125,6 +125,10 @@ export class ClientApi<TRenderer extends Renderer> {
|
||||
private lastFileName = 0;
|
||||
|
||||
constructor({ storyStore }: { storyStore?: StoryStore<TRenderer> } = {}) {
|
||||
console.log(
|
||||
'CLIENT_API_MODULE, you should only see this log, exactly ONCE, in the browser console'
|
||||
);
|
||||
|
||||
this.facade = new StoryStoreFacade();
|
||||
|
||||
this.addons = {};
|
||||
|
@ -3,7 +3,7 @@ import { global } from '@storybook/global';
|
||||
import type { Renderer, ArgsStoryFn, Path, ProjectAnnotations } from '@storybook/types';
|
||||
import { createChannel } from '@storybook/channel-postmessage';
|
||||
import { FORCE_RE_RENDER } from '@storybook/core-events';
|
||||
import { addons } from '../addons';
|
||||
import { addons } from '../../addons';
|
||||
import { PreviewWeb } from '../../preview-web';
|
||||
import { ClientApi } from '../../client-api';
|
||||
|
||||
|
@ -24,6 +24,8 @@ import { FramesRenderer } from './FramesRenderer';
|
||||
|
||||
import type { PreviewProps } from './utils/types';
|
||||
|
||||
const { FEATURES } = global;
|
||||
|
||||
const getWrappers = (getFn: API['getElements']) => Object.values(getFn<Addon>(types.PREVIEW));
|
||||
const getTabs = (getFn: API['getElements']) => Object.values(getFn<Addon>(types.TAB));
|
||||
|
||||
@ -70,7 +72,7 @@ const createCanvas = (id: string, baseUrl = 'iframe.html', withLoader = true): A
|
||||
const [progress, setProgress] = useState(undefined);
|
||||
|
||||
useEffect(() => {
|
||||
if (global.CONFIG_TYPE === 'DEVELOPMENT') {
|
||||
if (FEATURES?.storyStoreV7 && global.CONFIG_TYPE === 'DEVELOPMENT') {
|
||||
const channel = addons.getServerChannel();
|
||||
|
||||
channel.on(PREVIEW_BUILDER_PROGRESS, (options) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user