Repository navigation
SB-2014: Remove remaining storiesOf detection leftovers - #36736
Merged
obvious-autobuild[bot] merged 2 commits intoOct 13, 2026
Merged
Conversation
The runtime storiesOf API was removed in Storybook 8.0; what remained was the detection that refuses legacy files (kept here untouched), plus dead fixtures and wording that still said "deprecated" or "SB8 does not support". - Delete the 10 zero-reference `code/__mocks__/inject-decorator.*.txt` fixtures (354 lines) and the orphaned `docs/_snippets/storybook-migrate-stories-of-to-csf.md` snippet, which recommended the `storiesof-to-csf` codemod that no longer ships. - Reword the CsfFile.parse() storiesOf rejection to say storiesOf was removed in Storybook 8.0, keeping the `Unexpected \`storiesOf\` usage:` prefix (pinned by CsfFile.test.ts). - Reword the no-stories-of ESLint rule (header, description, message; id `doNotUseStoriesOf` unchanged), the rule doc title, and the eslint-plugin docs rule table in lockstep. - Replace the rule doc's dead link to `lib/core/docs/storiesOf.md` and its advice to run the removed `storiesof-to-csf` codemod with live pointers to the Storybook 8.0 migration guide and CSF docs. - Reword the addon-docs csf-plugin comment that implied legacy storiesOf files are a supported input. Code behavior unchanged. No detection behavior changes: the parser throw, both csf-plugin catch blocks, the three ESLint skip-guards, and the upgrade-hierarchy-separators codemod keep their behavior.
…ved-in-8.0 wording Review follow-up for #36736: the test @file header and the package README's generated-shape rule row still said "deprecated". Reworded to the canonical "storiesOf was removed in Storybook 8.0; use CSF instead." string produced by scripts/update-rules-list.ts (verified by running it: zero diff in the generator-owned eslint-plugin.mdx table).
obvious-autobuild
Bot
requested review from
jonniebigodes and
kylegach
as code owners
October 12, 2026 15:39
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
ndelangen
approved these changes
Oct 13, 2026
obvious-autobuild
Bot
deleted the
feat/sb-2014-remove-storiesof-leftovers
branch
October 13, 2026 09:25
This was referenced Oct 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes SB-2014 (Linear)
What I did
The
storiesOfruntime API was removed in Storybook 8.0 (PR #24655). What remained in the repo was not support code but the machinery that keepsstoriesOfunsupported — plus dead fixtures and wording that no longer matches reality. This PR deletes the dead remainder and corrects the stale user-facing wording. It changes no detection behavior.Why the detection stays (the title's literal reading, corrected): the
CsfFile.parse()rejection is the only place astoriesOffile reaches users as a build failure — story indexing calls it with no local catch (core-server/presets/common-preset.ts:266-273,StoryIndexGenerator.ts:420), so deleting it would make legacy files index as zero stories, silently. The addon-docs csf-plugin catches are generic parse-error resilience keyed on theCSF:message prefix, which the throw never carried; the three ESLinthasStoriesOfImportskip-guards are pinned by their valid-case tests; and theupgrade-hierarchy-separatorscodemod is migration tooling whose input is legacy files by definition. None of these is dead code.The one user-visible string change:
Changes, in reading order:
code/__mocks__/inject-decorator.*.txt— deleted all 10 fixtures (354 lines). Zero references:git grep "inject-decorator"returns nothing.docs/_snippets/storybook-migrate-stories-of-to-csf.md— deleted. Orphaned (zero references) and it recommended thestoriesof-to-csfcodemod, which no longer ships.code/core/src/csf-tools/CsfFile.ts— message only: "SB8 does not support" → "was removed in Storybook 8.0". TheUnexpected \storiesOf` usage:prefix is preserved (pinned by an unmodified test) and the message stays outside theCSF:` prefix namespace, so the csf-plugin still warns rather than going silent.code/lib/eslint-plugin/src/rules/no-stories-of.ts+code/lib/eslint-plugin/docs/rules/no-stories-of.md+docs/configure/integration/eslint-plugin.mdx— "deprecated" → "removed in Storybook 8.0" wording everywhere (rule header, description, message, doc title, rule table); message iddoNotUseStoriesOfunchanged.code/lib/eslint-plugin/docs/rules/no-stories-of.md— replaced the dead link tolib/core/docs/storiesOf.md(does not exist anywhere in the repo) and the advice to run the removedstoriesof-to-csfcodemod with live pointers to the Storybook 8.0 migration guide and the CSF docs (both links verified to resolve).code/addons/docs/src/csf-plugin/rollup-based-plugin.ts— comment only: no longer implies legacy storiesOf files are a supported input. The catch block's code is byte-identical tonext.Known gaps or risks
docs/frameworks.js:229-249has a feature-matrix "storiesOf stories" entry pointing at the nonexistentlib/core/preview-api/storiesOf.md; an out-of-repo docs-site consumer could not be excluded, so this is left for the docs owners as a follow-up.storiesof-to-csfmentions live only in historicalCHANGELOG.v1-5.md/CHANGELOG.v6.md/MIGRATION.mdrecords and are intentionally untouched.upgrade-hierarchy-separatorsfixtures at HEAD; the transform is byte-identical tonext, and both storiesOf fixtures were verified to reproduce their snapshots by invoking the transform directly.Checklist for Contributors
Testing
The changes in this PR are covered in the following automated tests:
Manual testing
Caution
This section is mandatory for all contributions. If you believe no manual test is necessary, please state so explicitly. Thanks!
yarn test csf-tools—CsfFile.test.tspasses unmodified, including the "storiesOf calls" test, which asserts that parsing still throws with theUnexpected \storiesOf` usage:` prefix.yarn test eslint-plugin— theno-stories-ofrule still reportsdoNotUseStoriesOf(now with the "removed" wording), and thestory-exports/default-exports/prefer-pascal-casevalid-case fixtures (storiesOf files) stay silent, proving the skip-guards are untouched.yarn test codemod— the codemod suite passes with theupgrade-hierarchy-separatorsstoriesOf fixtures and snapshots untouched..stories.jsfile that callsstoriesOf('X', module)and start Storybook — the index build fails withUnexpected \storiesOf` usage: . `storiesOf` was removed in Storybook 8.0. Write stories in CSF instead.`git grep "inject-decorator"andgit grep "storiesof-to-csf" docs/return no matches, confirming the dead fixtures and the removed-codemod advice are gone.storiesOf(...)calls) and the csf-plugin warning behavior for unparseable.storiesfiles (should still warn, not go silent).Documentation
MIGRATION.MD
Checklist for Maintainers
When this PR is ready for testing, make sure to add
ci:normal,ci:mergedorci:dailyGH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found incode/lib/cli-storybook/src/sandbox-templates.tsDeclare whether manual QA will be needed for this PR during the next release, through
qa:neededorqa:skipMake sure this PR contains one of the labels below:
Available labels
bug: Internal changes that fixes incorrect behavior.maintenance: User-facing maintenance tasks.dependencies: Upgrading (sometimes downgrading) dependencies.build: Internal-facing build tooling & test updates. Will not show up in release changelog.cleanup: Minor cleanup style change. Will not show up in release changelog.documentation: Documentation only changes. Will not show up in release changelog.feature request: Introducing a new feature.BREAKING CHANGE: Changes that break compatibility in some way with current major version.other: Changes that don't fit in the above categories.Test changes: deleted .txt files are dead fixture mocks with zero references, not tests; no test file, assertion, or snapshot was modified
Visual evidence: not applicable - backend/docs-only cleanup; the user-visible changes are CLI/log strings and deleted fixture files, nothing renders differently
🔗 Obvious Project · 🧵 Obvious Thread · 🔀 Obvious PR Artifact