Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 6 additions & 1 deletion MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- [Node.js 20.19+ or 22.12+ required](#nodejs-2019-or-2212-required)
- [Require `tsconfig.json` `moduleResolution` set to value that supports `types` condition](#require-tsconfigjson-moduleresolution-set-to-value-that-supports-types-condition)
- [`core.builder` configuration must be a fully resolved path](#corebuilder-configuration-must-be-a-fully-resolved-path)
- [Removed x-only builtin tags](#removed-x-only-builtin-tags)
- [From version 8.x to 9.0.0](#from-version-8x-to-900)
- [Core Changes and Removals](#core-changes-and-removals)
- [Dropped support for legacy packages](#dropped-support-for-legacy-packages)
Expand Down Expand Up @@ -580,6 +581,10 @@ export const core = {
};
```

#### Removed x-only builtin tags
During development of Storybook [Tags](https://storybook.js.org/docs/writing-stories/tags), we created `dev-only`, `docs-only`, and `test-only` built-in tags. These tags were never documented and superseded by the currently-documented `dev`, `autodocs`, and `test` tags which provide more precise control. The outdated `x-only` tags are removed in 10.0.
During development of Storybook [Tags](https://storybook.js.org/docs/writing-stories/tags), we created `dev-only`, `docs-only`, and `test-only` built-in tags. These tags were never documented and superceded by the currently-documented `dev`, `autodocs`, and `test` tags which provide more precise control. The outdated `x-only` tags are removed in 10.0.

## From version 8.x to 9.0.0

### Core Changes and Removals
Expand Down Expand Up @@ -1806,7 +1811,7 @@ These sections explain the rationale, and the required changes you might have to

### Deprecated `@storybook/testing-library` package

The `@storybook/testing-library` package has been deprecated with the release of Storybook 8.0, and we recommend using the `@storybook/test` package instead. If you're migrating manually, you'll need to install the new package and update your imports as follows:
The `@storybook/testing-library` package has been deprecated with the release of Storybook 8.0, and we recommend using the `@storybook/test` package instead. If you're migrating manually, you'll need to install the new package and update your imports as follows:

```diff
- import { userEvent } from '@storybook/testing-library';
Expand Down
10 changes: 0 additions & 10 deletions code/core/src/core-server/presets/common-preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -278,16 +278,6 @@ export const resolvedReact = async (existing: any) => {
}
};

/** Set up `dev-only`, `docs-only`, `test-only` tags out of the box */
export const tags = async (existing: any) => {
return {
...existing,
'dev-only': { excludeFromDocsStories: true },
'docs-only': { excludeFromSidebar: true },
'test-only': { excludeFromSidebar: true, excludeFromDocsStories: true },
};
};

export const managerEntries = async (existing: any) => {
return [
pathe.join(resolvePackageDir('storybook'), 'dist/core-server/presets/common-manager.js'),
Expand Down
10 changes: 1 addition & 9 deletions code/core/src/manager/components/sidebar/TagsFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,7 @@ import { TagsFilterPanel } from './TagsFilterPanel';

const TAGS_FILTER = 'tags-filter';

const BUILT_IN_TAGS_HIDE = new Set([
'dev',
'docs-only',
'test-only',
'autodocs',
'test',
'attached-mdx',
'unattached-mdx',
]);
const BUILT_IN_TAGS_HIDE = new Set(['dev', 'autodocs', 'test', 'attached-mdx', 'unattached-mdx']);

const Wrapper = styled.div({
position: 'relative',
Expand Down
3 changes: 0 additions & 3 deletions code/core/src/manager/components/sidebar/TagsFilterPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ import type { Link } from '../../../components/components/tooltip/TooltipLinkLis
const BUILT_IN_TAGS = new Set([
'dev',
'test',
'dev-only',
'test-only',
'docs-only',
'autodocs',
'attached-mdx',
'unattached-mdx',
Expand Down
18 changes: 0 additions & 18 deletions code/e2e-tests/tags.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,6 @@ test.describe('tags', () => {
await new SbPage(page, expect).waitUntilLoaded();
});

test('should correctly filter dev-only, docs-only, test-only stories', async ({ page }) => {
const sbPage = new SbPage(page, expect);

await sbPage.navigateToStory('core/tags-config', 'docs');

// Sidebar should include dev-only and exclude docs-only and test-only
await expect(page.locator('#core-tags-config--dev-only')).toHaveCount(1);
await expect(page.locator('#core-tags-config--docs-only')).toHaveCount(0);
await expect(page.locator('#core-tags-config--test-only')).toHaveCount(0);

// Autodocs should include docs-only and exclude dev-only and test-only
const preview = sbPage.previewRoot();

await expect(preview.locator('#anchor--core-tags-config--dev-only')).toHaveCount(0);
await expect(preview.locator('#anchor--core-tags-config--docs-only')).toHaveCount(1);
await expect(preview.locator('#anchor--core-tags-config--test-only')).toHaveCount(0);
});

test('should correctly add dev, autodocs, test stories', async ({ page }) => {
const sbPage = new SbPage(page, expect);

Expand Down
Loading