Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Core: Remove storyStoreV7 feature flag #24658

Merged
merged 44 commits into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
534e49c
Initial run-through deleting all ssv6 code
tmeasday Oct 30, 2023
01836ba
Convert all Preview Web code to async/await
tmeasday Oct 30, 2023
7e1e2b6
Small fixups
tmeasday Oct 30, 2023
d21b6b4
Remove public APIs from packages
tmeasday Oct 31, 2023
36f2199
Drop unused vars
tmeasday Oct 31, 2023
b3dcefe
Remove unused var
tmeasday Nov 1, 2023
4b9abd6
Drop `buildStoriesJson` flag
tmeasday Nov 1, 2023
fc2236c
Remove unused imports
tmeasday Nov 1, 2023
a80b47c
remove all references of storyStoreV7
ndelangen Nov 1, 2023
9ab83e8
delete unused files
ndelangen Nov 1, 2023
a71d368
remove unused files
ndelangen Nov 1, 2023
0d995eb
cleanup
ndelangen Nov 1, 2023
c66a48b
disable broken tests
ndelangen Nov 1, 2023
811c4e9
cleanup
ndelangen Nov 1, 2023
dc02dd3
Merge branch 'tom/remove-ssv6' into norbert/remove-storystorev7
ndelangen Nov 2, 2023
99dabfe
Merge branch 'release-8-0' into norbert/remove-storystorev7
ndelangen Nov 2, 2023
7403b82
fix
ndelangen Nov 2, 2023
1bbaa48
fix
ndelangen Nov 2, 2023
53b4827
Merge branch 'norbert/remove-storiesof' into norbert/remove-storystorev7
ndelangen Nov 2, 2023
0285cd1
cleanup
ndelangen Nov 2, 2023
b20ea34
Merge branch 'norbert/remove-storiesof' into norbert/remove-storystorev7
ndelangen Nov 2, 2023
a4ffcf1
make it work
ndelangen Nov 2, 2023
191cafc
Merge branch 'release-8-0' into norbert/remove-storystorev7
ndelangen Nov 24, 2023
4ab1b3e
update exports file
ndelangen Nov 24, 2023
15ad095
Merge branch 'next' into norbert/remove-storystorev7
ndelangen Dec 11, 2023
7f4f035
fix
ndelangen Dec 12, 2023
17784c1
Merge branch 'next' into norbert/remove-storystorev7
valentinpalkovic Dec 13, 2023
32747ee
Merge branch 'next' into norbert/remove-storystorev7
ndelangen Dec 19, 2023
c82ddc3
fixes
ndelangen Dec 19, 2023
6c48ab8
Merge branch 'next' into norbert/remove-storystorev7
ndelangen Dec 21, 2023
8439fb7
Merge branch 'next' into norbert/remove-storystorev7
ndelangen Jan 3, 2024
4754c78
Merge branch 'next' into norbert/remove-storystorev7
ndelangen Jan 5, 2024
1358226
remove docs references to storyStoreV7
ndelangen Jan 5, 2024
f04ab82
remove more
ndelangen Jan 5, 2024
7633037
upgrade to latest icons
ndelangen Jan 5, 2024
28b76a3
upgrades
ndelangen Jan 5, 2024
3e38d5d
fix typings
ndelangen Jan 5, 2024
8461727
fix snapshots
ndelangen Jan 5, 2024
e71db1b
fix typings
ndelangen Jan 5, 2024
98e5882
Merge branch 'next' into norbert/remove-storystorev7
ndelangen Jan 6, 2024
5c1a76d
Update yarn.lock
valentinpalkovic Jan 8, 2024
2ade10d
Downgrade markdown-to-jsx
valentinpalkovic Jan 8, 2024
03cf69c
Remove buildStoriesJson references in docs
valentinpalkovic Jan 8, 2024
8bd86ad
Remove unnecessary await
valentinpalkovic Jan 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
893 changes: 0 additions & 893 deletions .yarn/releases/yarn-4.0.0.cjs

This file was deleted.

893 changes: 893 additions & 0 deletions .yarn/releases/yarn-4.0.2.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ nodeLinker: node-modules

npmPublishAccess: public

yarnPath: .yarn/releases/yarn-4.0.0.cjs
yarnPath: .yarn/releases/yarn-4.0.2.cjs
5 changes: 3 additions & 2 deletions code/.yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ compressionLevel: 0

enableGlobalCache: true

installStatePath: ../.yarn/code-install-state.gz

logFilters:
- code: YN0005
level: discard
Expand All @@ -23,7 +25,6 @@ plugins:
unsafeHttpWhitelist:
- localhost

yarnPath: ../.yarn/releases/yarn-4.0.0.cjs
installStatePath: '../.yarn/code-install-state.gz'
yarnPath: ../.yarn/releases/yarn-4.0.2.cjs
# Sometimes you get a "The remote archive doesn't match the expected checksum" error, uncommenting this line will fix it
# checksumBehavior: 'update'
2 changes: 1 addition & 1 deletion code/addons/a11y/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"@storybook/client-logger": "workspace:*",
"@storybook/components": "workspace:*",
"@storybook/global": "^5.0.0",
"@storybook/icons": "^1.2.1",
"@storybook/icons": "^1.2.3",
"@storybook/manager-api": "workspace:*",
"@storybook/preview-api": "workspace:*",
"@storybook/theming": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/backgrounds/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
},
"dependencies": {
"@storybook/global": "^5.0.0",
"@storybook/icons": "^1.2.1",
"@storybook/icons": "^1.2.3",
"memoizerific": "^1.11.3",
"ts-dedent": "^2.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion code/addons/controls/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,4 +176,4 @@ Like [story parameters](https://storybook.js.org/docs/react/writing-stories/para

### How do controls work with MDX?

When importing stories from your CSF file into MDX, controls will work the same way. See [the documentation](https://storybook.js.org/docs/writing-docs/mdx#basic-example) for examples.
When importing stories from your CSF file into MDX, controls will work the same way. See [the documentation](https://storybook.js.org/docs/writing-docs/mdx#basic-example) for examples.
2 changes: 1 addition & 1 deletion code/addons/interactions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
},
"dependencies": {
"@storybook/global": "^5.0.0",
"@storybook/icons": "^1.2.1",
"@storybook/icons": "^1.2.3",
"@storybook/types": "workspace:*",
"jest-mock": "^27.0.6",
"polished": "^4.2.2",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/measure/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
},
"dependencies": {
"@storybook/global": "^5.0.0",
"@storybook/icons": "^1.2.1",
"@storybook/icons": "^1.2.3",
"tiny-invariant": "^1.3.1"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion code/addons/outline/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
},
"dependencies": {
"@storybook/global": "^5.0.0",
"@storybook/icons": "^1.2.1",
"@storybook/icons": "^1.2.3",
"ts-dedent": "^2.0.0"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion code/addons/themes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"@storybook/client-logger": "workspace:*",
"@storybook/components": "workspace:*",
"@storybook/core-events": "workspace:*",
"@storybook/icons": "^1.2.1",
"@storybook/icons": "^1.2.3",
"@storybook/manager-api": "workspace:*",
"@storybook/preview-api": "workspace:*",
"@storybook/theming": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/viewport/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"@storybook/components": "workspace:*",
"@storybook/core-events": "workspace:*",
"@storybook/global": "^5.0.0",
"@storybook/icons": "^1.2.1",
"@storybook/icons": "^1.2.3",
"@storybook/manager-api": "workspace:*",
"@storybook/preview-api": "workspace:*",
"@storybook/theming": "workspace:*",
Expand Down
48 changes: 0 additions & 48 deletions code/builders/builder-vite/src/codegen-entries.ts

This file was deleted.

116 changes: 0 additions & 116 deletions code/builders/builder-vite/src/codegen-iframe-script.ts

This file was deleted.

5 changes: 0 additions & 5 deletions code/builders/builder-vite/src/codegen-importfn-script.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import * as path from 'path';

import type { Options } from '@storybook/types';
import { logger } from '@storybook/node-logger';

import { listStories } from './list-stories';

Expand All @@ -28,11 +27,7 @@ function toImportPath(relativePath: string) {
async function toImportFn(stories: string[]) {
const { normalizePath } = await import('vite');
const objectEntries = stories.map((file) => {
const ext = path.extname(file);
const relativePath = normalizePath(path.relative(process.cwd(), file));
if (!['.js', '.jsx', '.ts', '.tsx', '.mdx', '.svelte', '.vue'].includes(ext)) {
logger.warn(`Cannot process ${ext} file with storyStoreV7: ${relativePath}`);
}

return ` '${toImportPath(relativePath)}': async () => import('/@fs/${file}')`;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ export async function generateModernIframeScriptCode(options: Options, projectRo
window.__STORYBOOK_PREVIEW__ = window.__STORYBOOK_PREVIEW__ || new PreviewWeb();
window.__STORYBOOK_STORY_STORE__ = window.__STORYBOOK_STORY_STORE__ || window.__STORYBOOK_PREVIEW__.storyStore;
window.__STORYBOOK_CLIENT_API__ = window.__STORYBOOK_CLIENT_API__ || new ClientApi({ storyStore: window.__STORYBOOK_PREVIEW__.storyStore });
window.__STORYBOOK_PREVIEW__.initialize({ importFn, getProjectAnnotations });
${generateHMRHandler(frameworkName)};
Expand Down
17 changes: 2 additions & 15 deletions code/builders/builder-vite/src/plugins/code-generator-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ import * as fs from 'fs';
import type { Plugin } from 'vite';
import type { Options } from '@storybook/types';
import { transformIframeHtml } from '../transform-iframe-html';
import { generateIframeScriptCode } from '../codegen-iframe-script';
import { generateModernIframeScriptCode } from '../codegen-modern-iframe-script';
import { generateImportFnScriptCode } from '../codegen-importfn-script';
import { generateVirtualStoryEntryCode, generatePreviewEntryCode } from '../codegen-entries';
import { generateAddonSetupCode } from '../codegen-set-addon-channel';

import {
Expand Down Expand Up @@ -90,27 +88,16 @@ export function codeGeneratorPlugin(options: Options): Plugin {
return undefined;
},
async load(id, config) {
const storyStoreV7 = options.features?.storyStoreV7;
if (id === virtualStoriesFile) {
if (storyStoreV7) {
return generateImportFnScriptCode(options);
}
return generateVirtualStoryEntryCode(options);
return generateImportFnScriptCode(options);
}

if (id === virtualAddonSetupFile) {
return generateAddonSetupCode();
}

if (id === virtualPreviewFile && !storyStoreV7) {
return generatePreviewEntryCode(options);
}

if (id === virtualFileId) {
if (storyStoreV7) {
return generateModernIframeScriptCode(options, projectRoot);
}
return generateIframeScriptCode(options, projectRoot);
return generateModernIframeScriptCode(options, projectRoot);
}

if (id === iframeId) {
Expand Down
Loading