Don't fetch stories.json from the manager in v6 mode

This commit is contained in:
Tom Coleman 2021-10-12 22:52:52 +11:00
parent 962bee0b7a
commit e265f122d1
3 changed files with 10 additions and 4 deletions

View File

@ -36,7 +36,7 @@ import { Args, ModuleFn } from '../index';
import { ComposedRef } from './refs';
import { StoryIndexClient } from '../lib/StoryIndexClient';
const { DOCS_MODE } = global;
const { DOCS_MODE, FEATURES } = global;
const INVALIDATE = 'INVALIDATE';
type Direction = -1 | 1;
@ -502,9 +502,11 @@ export const init: ModuleFn = ({
}
);
indexClient = new StoryIndexClient();
indexClient.addEventListener(INVALIDATE, () => fullAPI.fetchStoryList());
await fullAPI.fetchStoryList();
if (FEATURES.storyStoreV7) {
indexClient = new StoryIndexClient();
indexClient.addEventListener(INVALIDATE, () => fullAPI.fetchStoryList());
await fullAPI.fetchStoryList();
}
};
return {

View File

@ -38,6 +38,7 @@ export async function managerWebpack(
releaseNotesData,
presets,
modern,
features,
}: Options & ManagerWebpackOptions
): Promise<Configuration> {
const envs = await presets.apply<Record<string, string>>('env');
@ -99,6 +100,7 @@ export async function managerWebpack(
globals: {
CONFIG_TYPE: configType,
LOGLEVEL: logLevel,
FEATURES: features,
VERSIONCHECK: JSON.stringify(versionCheck),
RELEASE_NOTES_DATA: JSON.stringify(releaseNotesData),
DOCS_MODE: docsMode, // global docs mode

View File

@ -37,6 +37,7 @@ export async function managerWebpack(
releaseNotesData,
presets,
modern,
features,
}: Options & ManagerWebpackOptions
): Promise<Configuration> {
const envs = await presets.apply<Record<string, string>>('env');
@ -98,6 +99,7 @@ export async function managerWebpack(
globals: {
CONFIG_TYPE: configType,
LOGLEVEL: logLevel,
FEATURES: features,
VERSIONCHECK: JSON.stringify(versionCheck),
RELEASE_NOTES_DATA: JSON.stringify(releaseNotesData),
DOCS_MODE: docsMode, // global docs mode