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

Docs: Remove references to the storiesOf API #25963

Merged
merged 7 commits into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
17 changes: 2 additions & 15 deletions code/lib/preview-api/README-client-api.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
# `@storybook/client-api` -- Deprecated Story APIs (`storiesOf`)
# `@storybook/client-api` -- Removed Story APIs (`storiesOf`)

**NOTE** This API is deprecated, and the CSF format is preferred for all stories.

## `storiesOf` API

The `@storybook/client` API provides the [`storiesOf()` API](./docs/storiesOf.md), which is proxied through to the CSF API.

### Internals

In order to appear to the store like the CSF API, a call to `storiesOf().add()` does the following:

- Tracks the story added in a synthetic `StoryIndex` data structure
- Constructs a `moduleExports` object that is equivalent to the exports from a CSF file that produced the same stories.

In order to achieve the old `storySort` functionality, the client API also needs access to the project annotations.
**NOTE** This API is deprecated, and the CSF format is preferred for all stories.
97 changes: 0 additions & 97 deletions code/lib/preview-api/docs/storiesOf.md

This file was deleted.

4 changes: 1 addition & 3 deletions docs/api/main-config-indexers.md
Original file line number Diff line number Diff line change
Expand Up @@ -351,9 +351,7 @@ function JsonStoriesPlugin(): PluginOption {

<summary>Generating stories with an alternative API</summary>

You can use a custom indexer and builder plugin to create your own API for defining stories, such as imperatively defining stories similar to the legacy [`storiesOf`](https://github.com/storybookjs/storybook/blob/main/code/lib/preview-api/docs/storiesOf.md) format.

The [dynamic stories proof of concept](https://stackblitz.com/edit/github-h2rgfk?file=README.md) is an elaborate, functional example of doing just that. It contains everything needed to support such a feature, including the indexer, a Vite plugin and a Webpack loader.
You can use a custom indexer and builder plugin to create your API to define stories extending the CSF format. To learn more, see the following [proof of concept](https://stackblitz.com/edit/github-h2rgfk?file=README.md) to set up a custom indexer to generate stories dynamically. It contains everything needed to support such a feature, including the indexer, a Vite plugin, and a Webpack loader.

</details>

Expand Down
10 changes: 5 additions & 5 deletions docs/configure/frameworks-feature-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ Community frameworks have fewer contributors which means they may not be as up t

To align the Storybook ecosystem with the current state of frontend development, the following features and addons are now deprecated, no longer maintained, and will be removed in future versions of Storybook

| Feature | Status |
| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Knobs](https://github.com/storybookjs/addon-knobs) | The Knobs addon was officially deprecated with the release of Storybook 6.3 and is no longer actively maintained. We recommend using the [controls](../essentials/controls.md) instead. |
| [Storyshots](../writing-tests/snapshot-testing.md) | The Storyshots addon was officially deprecated with the release of Storybook 7.6, is no longer actively maintained and was removed in Storybook 8. See the [migration guide](../writing-tests/storyshots-migration-guide.md) for the available alternatives. |
| [`StoriesOf`](https://github.com/storybookjs/storybook/blob/next/code/lib/preview-api/docs/storiesOf.md) | The `storiesOf` API was officially removed with the release of Storybook 8 and is no longer maintained. We recommend using the [CSF API](../api/csf.md) instead for writing stories.<br/>See the [migration guide](../migration-guide.md#storiesof-to-csf) for more information. |
| Feature | Status |
| --------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Knobs](https://github.com/storybookjs/addon-knobs) | The Knobs addon was officially deprecated with the release of Storybook 6.3 and is no longer actively maintained. We recommend using the [controls](../essentials/controls.md) instead. |
| [Storyshots](../writing-tests/snapshot-testing.md) | The Storyshots addon was officially deprecated with the release of Storybook 7.6, is no longer actively maintained and was removed in Storybook 8. See the [migration guide](../writing-tests/storyshots-migration-guide.md) for the available alternatives. |
| StoriesOf | The `storiesOf` API was officially removed with the release of Storybook 8 and is no longer maintained. We recommend using the [CSF API](../api/csf.md) instead for writing stories.<br/>See the [migration guide](../migration-guide.md#storiesof-to-csf) for more information. |
Loading
Loading