Repository navigation
[SB-2009] Postpone Story Store access removal; keep the global emitted - #36739
obvious-autobuild[bot] wants to merge 3 commits into
Conversation
The preview.storyStore proxy getter, the window.__STORYBOOK_STORY_STORE__
global emitted by the vite and webpack5 builders, and the ambient type
declarations for that global are removed, along with
StoryStoreAccessedBeforeInitializationError, whose only throw site was
the getter. The deprecation notices promised removal in 9.0; the
codebase is developing 11.0.
Integrators reading the store should use the supported Preview API:
await preview.ready(), preview.loadStory({ storyId }),
preview.getStoryContext(), and preview.extract(). Integrators who
construct a DocsContext outside core can call the new
preview.createDocsContext(importPaths), which resolves the paths
against the story index, loads the CSF files, and constructs the
context with the internal store. The store instance never leaves the
preview.
The dev Storybook's docs loader migrates to the factory, so no
first-party code outside Preview reaches the store.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
About the red What the logs show (all 15 templates, identical): the sandbox builds and uploads succeed, then Chromatic's "Verifying your Storybook" step fails with What I verified in a real browser: the published internal-Storybook build from this branch's commit renders normally — manager and docs-block stories (e.g. ArgTypes, which go through the migrated Likely cause: this PR removes the Everything else is green: If the capture client is indeed still on the legacy global, this PR may need to sequence after the capture-cloud update ships (or the chromatic jobs re-run once it's deployed). Happy to rebase/re-trigger then. |
|
@codex review |
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 73b88a1d19
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| * @param importPaths the import paths of the CSF files, as they appear in the story index | ||
| * @param options.attach whether to attach the first CSF file to the context, making its stories | ||
| * the component stories of the context. Defaults to `true`, mirroring the dev Storybook loader. |
There was a problem hiding this comment.
Replace parameter tags with documented failure modes
Remove these @param tags and use the public API summary/type to explain attach; the repository's JSDoc rules explicitly prohibit @param while requiring @throws for caller-handled failures, but this method can reject both before preview initialization and when an import path is absent without documenting either condition. .agents/guidelines/comments-and-jsdoc.mdL37-L43
Useful? React with 👍 / 👎.
|
Holding this PR: the removal is delayed past 11.0. Chromatic's capture/extract client still reads the globals this PR removes (see the analysis above), and we are not asking Chromatic capture to change its client in this window — so merging now would break captures of 11.0+ builds. The PR stays up as a draft until the capture client migrates to the supported Preview APIs ( |
…tory-store-access # Conflicts: # MIGRATION.md
|
What changed
The removal of the two deprecated direct Story Store access paths — the
window.__STORYBOOK_STORY_STORE__global and thepreview.storyStoregetter — is postponed past 11.0.Chromatic's capture and extract clients read the global in production (render selection, play-function checks, JS-loaded detection, story extraction), and Chromatic is not being asked to change its client for this release. Merging the removal would break captures of 11.0+ builds: on the earlier revision of this PR, all 15 Chromatic template checks failed at story extraction for exactly that reason.
Decision 2026-10-13 (Norbert): keep the global emitted, postpone the removal.
What this PR does now
window.__STORYBOOK_STORY_STORE__and its type declarations stay — capture and extract behavior is unchanged fromnext.ready(),loadStory(),getStoryContext(),extract()).Preview.createDocsContext(importPaths)factory, so the last in-repo use of the deprecated access paths is gone and the store instance never leaves the preview.Refs SB-2009
🔗 Obvious Project · 🧵 Obvious Thread · 🔀 Obvious PR Artifact