Module Graph: Refactor from StoryDependencyService to open service-based ModuleGraphService#35048
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Package BenchmarksCommit: The following packages have significant changes to their size or dependencies:
|
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 18 | 18 | 0 |
| Self size | 1.26 MB | 1.28 MB | 🚨 +20 KB 🚨 |
| Dependency size | 9.27 MB | 9.27 MB | 🎉 -6 B 🎉 |
| Bundle Size Analyzer | Link | Link |
storybook
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 72 | 72 | 0 |
| Self size | 20.72 MB | 20.75 MB | 🚨 +34 KB 🚨 |
| Dependency size | 36.11 MB | 36.11 MB | 0 B |
| Bundle Size Analyzer | Link | Link |
@storybook/cli
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 203 | 203 | 0 |
| Self size | 908 KB | 908 KB | 🎉 -213 B 🎉 |
| Dependency size | 88.96 MB | 89.00 MB | 🚨 +34 KB 🚨 |
| Bundle Size Analyzer | Link | Link |
@storybook/codemod
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 196 | 196 | 0 |
| Self size | 32 KB | 32 KB | 0 B |
| Dependency size | 87.45 MB | 87.49 MB | 🚨 +34 KB 🚨 |
| Bundle Size Analyzer | Link | Link |
create-storybook
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 73 | 73 | 0 |
| Self size | 1.08 MB | 1.08 MB | 0 B |
| Dependency size | 56.83 MB | 56.86 MB | 🚨 +34 KB 🚨 |
| Bundle Size Analyzer | node | node |
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughRefactor change-detection to use a new core/module-graph open-service: add shared types/service definition, implement ModuleGraphEngine, rewire ChangeDetectionService to query module-graph, update server/presets/dev-server/docgen/index-json wiring, remove legacy barrels, and update tests and imports. ChangesModule-Graph Open-Service
ModuleGraphEngine Refactor
ChangeDetectionService Refactor
Core-server, Presets, Dev-server, Docgen, and index-json
Barrel removal and type-source consolidation
Misc, docs, and test import fixes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~65 minutes Possibly related PRs
Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
code/core/src/core-server/change-detection/change-detection.test-helpers.ts (1)
41-48: 💤 Low valueHardcoded
/repopath in test helper may cause path mismatch.The
toStoryIndexPath(storyFile, '/repo')uses a hardcoded working directory. If a test provides a differentworkingDirtocreateWiredChangeDetection, the mock's path conversion won't match the service's expectations.♻️ Consider parameterizing the workingDir
The
installModuleGraphQueryMockcould accept an optionalworkingDirparameter to align with the test's working directory, though the current approach works for existing test fixtures using/repo.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@code/core/src/core-server/change-detection/change-detection.test-helpers.ts` around lines 41 - 48, getStoriesForFiles uses a hardcoded workingDir when calling toStoryIndexPath, causing mismatches if tests call createWiredChangeDetection with a different workingDir; update the installModuleGraphQueryMock (or the helper that provides getStoriesForFiles) to accept an optional workingDir parameter and pass that through to getStoriesForFiles so toStoryIndexPath(storyFile, workingDir) is used instead of '/repo', and update any callers of installModuleGraphQueryMock in tests to forward their createWiredChangeDetection workingDir where needed.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@code/core/src/shared/open-service/services/module-graph/definition.ts`:
- Around line 171-176: The handlers that set or bump graphRevision (e.g., the
anonymous handler shown, applyGraphSnapshot, and bumpGraphRevision) update
state.graphRevision but do not clear state.latestChangedStoryFiles, causing
getLatestStoryChanges to return stale files; update each place that increments
or replaces the revision (the handler that sets status='ready',
applyGraphSnapshot, and bumpGraphRevision) to also reset
state.latestChangedStoryFiles to an empty collection (e.g., [] or {}) inside the
same ctx.self.setState callback so the newest revision has no leftover
changed-file entries.
In
`@code/core/src/shared/open-service/services/module-graph/engine/module-graph-engine.ts`:
- Around line 99-117: mirrorUpdate currently only uses the post-patch
reverseIndex lookup and can miss stories whose edges were removed by the patch;
change mirrorUpdate to accept (or obtain) the pre-patch dependents and union
them with the post-patch lookup results before computing bumpedStoryFiles.
Specifically, update the mirrorUpdate signature to accept an extra
prePatchDependents (Set<string> or string[]), or capture lookup(normalized)
before applying the patch in the caller and pass it in; then merge that set with
the current this.reverseIndex.lookup(normalized) results plus this.storyFiles
into bumpedStoryFiles, and keep the rest of the logic (options.onUpdate,
reverseIndexToStoriesByFile, toStoryIndexPath) unchanged so both pre- and
post-patch dependents are included.
- Around line 237-239: Register the adapter.onStartupFailure handler before
performing any async startup work so early failures aren't missed: move the
attachment of adapter.onStartupFailure?.(...) to occur before calling
getResolveConfig(), getIndex(), or build(), and ensure it forwards event.reason
and event.error to this.options.onUnavailable so any startup error during those
async calls will be emitted.
---
Nitpick comments:
In `@code/core/src/core-server/change-detection/change-detection.test-helpers.ts`:
- Around line 41-48: getStoriesForFiles uses a hardcoded workingDir when calling
toStoryIndexPath, causing mismatches if tests call createWiredChangeDetection
with a different workingDir; update the installModuleGraphQueryMock (or the
helper that provides getStoriesForFiles) to accept an optional workingDir
parameter and pass that through to getStoriesForFiles so
toStoryIndexPath(storyFile, workingDir) is used instead of '/repo', and update
any callers of installModuleGraphQueryMock in tests to forward their
createWiredChangeDetection workingDir where needed.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: f503b29f-7eea-4d79-b10d-fd9b95ebf43f
📒 Files selected for processing (47)
code/core/src/core-server/change-detection/active-service-registry.tscode/core/src/core-server/change-detection/adapters/index.tscode/core/src/core-server/change-detection/change-detection-service.test.tscode/core/src/core-server/change-detection/change-detection-service.tscode/core/src/core-server/change-detection/change-detection.test-helpers.tscode/core/src/core-server/change-detection/dependency-graph/index.tscode/core/src/core-server/change-detection/index.tscode/core/src/core-server/change-detection/parser-registry/index.tscode/core/src/core-server/dev-server.tscode/core/src/core-server/index.tscode/core/src/core-server/presets/common-preset.tscode/core/src/core-server/utils/index-json.test.tscode/core/src/core-server/utils/index-json.tscode/core/src/shared/open-service/README.mdcode/core/src/shared/open-service/services/docgen/server.test.tscode/core/src/shared/open-service/services/docgen/server.tscode/core/src/shared/open-service/services/module-graph/definition.tscode/core/src/shared/open-service/services/module-graph/engine/adapters/types.test.tscode/core/src/shared/open-service/services/module-graph/engine/adapters/types.tscode/core/src/shared/open-service/services/module-graph/engine/dependency-graph/dependency-graph-builder.test.tscode/core/src/shared/open-service/services/module-graph/engine/dependency-graph/dependency-graph-builder.tscode/core/src/shared/open-service/services/module-graph/engine/dependency-graph/incremental-patch.test.tscode/core/src/shared/open-service/services/module-graph/engine/dependency-graph/incremental-patcher.tscode/core/src/shared/open-service/services/module-graph/engine/dependency-graph/parse-resolve-cache.test.tscode/core/src/shared/open-service/services/module-graph/engine/dependency-graph/parse-resolve-cache.tscode/core/src/shared/open-service/services/module-graph/engine/dependency-graph/resolver-factory.test.tscode/core/src/shared/open-service/services/module-graph/engine/dependency-graph/resolver-factory.tscode/core/src/shared/open-service/services/module-graph/engine/dependency-graph/reverse-index.test.tscode/core/src/shared/open-service/services/module-graph/engine/dependency-graph/reverse-index.tscode/core/src/shared/open-service/services/module-graph/engine/dependency-graph/scope.tscode/core/src/shared/open-service/services/module-graph/engine/dependency-graph/types.tscode/core/src/shared/open-service/services/module-graph/engine/dependency-graph/walk-from-story.tscode/core/src/shared/open-service/services/module-graph/engine/module-graph-engine.test.tscode/core/src/shared/open-service/services/module-graph/engine/module-graph-engine.tscode/core/src/shared/open-service/services/module-graph/engine/parser-registry/builtins.test.tscode/core/src/shared/open-service/services/module-graph/engine/parser-registry/builtins.tscode/core/src/shared/open-service/services/module-graph/engine/parser-registry/mdx-parse.tscode/core/src/shared/open-service/services/module-graph/engine/parser-registry/parser-registry.test.tscode/core/src/shared/open-service/services/module-graph/engine/parser-registry/parser-registry.tscode/core/src/shared/open-service/services/module-graph/engine/parser-registry/types.tscode/core/src/shared/open-service/services/module-graph/errors.tscode/core/src/shared/open-service/services/module-graph/module-graph.test-helpers.tscode/core/src/shared/open-service/services/module-graph/server.test.tscode/core/src/shared/open-service/services/module-graph/server.tscode/core/src/shared/open-service/services/module-graph/story-files.tscode/core/src/shared/open-service/services/module-graph/types.tscode/core/src/types/modules/core-common.ts
💤 Files with no reviewable changes (7)
- code/core/src/core-server/utils/index-json.ts
- code/core/src/core-server/change-detection/adapters/index.ts
- code/core/src/core-server/change-detection/parser-registry/index.ts
- code/core/src/core-server/change-detection/active-service-registry.ts
- code/core/src/core-server/utils/index-json.test.ts
- code/core/src/core-server/change-detection/dependency-graph/index.ts
- code/core/src/core-server/change-detection/index.ts
Keep selectComponentEntriesByComponentId from the docgen phase-3 base while preserving module-graph subscription reactivity in docgen. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
code/core/src/core-server/presets/common-preset.ts (1)
333-367:⚠️ Potential issue | 🟠 Major | ⚡ Quick winKeep story-index resolution lazy in
services.
options.presets.apply('storyIndexGenerator')initializes the full generator immediately, so manager-only /ignorePreviewruns still build the story index before the guard on Lines 345-348 is checked. That defeats the skip documented there and can bring back unnecessary work or preview-side failures in flows that intentionally avoid preview output.Suggested change
- // `presets.apply` flattens the generator preset's returned promise, so this is the resolved - // generator, not a promise. - const storyIndexGenerator = - await options.presets.apply<StoryIndexGenerator>('storyIndexGenerator'); + const getIndex = async () => { + const storyIndexGenerator = + await options.presets.apply<StoryIndexGenerator>('storyIndexGenerator'); + return storyIndexGenerator.getIndex(); + }; registerModuleGraphService({ channel: options.channel, - getIndex: () => storyIndexGenerator.getIndex(), + getIndex, workingDir: process.cwd(), presets: options.presets, }); @@ registerDocgenService({ - getIndex: () => storyIndexGenerator.getIndex(), + getIndex, provider, workingDir: process.cwd(), });🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@code/core/src/core-server/presets/common-preset.ts` around lines 333 - 367, The code eagerly calls options.presets.apply('storyIndexGenerator') (symbol: storyIndexGenerator) which forces full story-index init even when preview is skipped; instead make resolution lazy: remove the top-level await and replace it with a lazily-resolving accessor (e.g. a getStoryIndex or storyIndexGeneratorPromise resolver) that only calls options.presets.apply('storyIndexGenerator') the first time getIndex is invoked, cache the resolved generator, and then have registerModuleGraphService and registerDocgenService use that accessor (replace getIndex: () => storyIndexGenerator.getIndex() with getIndex: () => getStoryIndex().then(g => g.getIndex()) or a sync wrapper that awaits internally) so the generator is only created when needed and the features/ignorePreview guard can skip creating it entirely.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@code/core/src/core-server/presets/common-preset.ts`:
- Around line 333-367: The code eagerly calls
options.presets.apply('storyIndexGenerator') (symbol: storyIndexGenerator) which
forces full story-index init even when preview is skipped; instead make
resolution lazy: remove the top-level await and replace it with a
lazily-resolving accessor (e.g. a getStoryIndex or storyIndexGeneratorPromise
resolver) that only calls options.presets.apply('storyIndexGenerator') the first
time getIndex is invoked, cache the resolved generator, and then have
registerModuleGraphService and registerDocgenService use that accessor (replace
getIndex: () => storyIndexGenerator.getIndex() with getIndex: () =>
getStoryIndex().then(g => g.getIndex()) or a sync wrapper that awaits
internally) so the generator is only created when needed and the
features/ignorePreview guard can skip creating it entirely.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 19e86824-5cc1-46b4-8e11-ed112a32806c
📒 Files selected for processing (4)
code/core/src/core-server/presets/common-preset.tscode/core/src/shared/open-service/services/docgen/server.test.tscode/core/src/shared/open-service/services/docgen/server.tscode/core/src/types/modules/core-common.ts
🚧 Files skipped from review as they are similar to previous changes (3)
- code/core/src/shared/open-service/services/docgen/server.ts
- code/core/src/shared/open-service/services/docgen/server.test.ts
- code/core/src/types/modules/core-common.ts
Per-story revision stamps let scoped subscribers react only to relevant graph changes, while watch-all no longer advances on irrelevant file events. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
🧹 Nitpick comments (2)
code/core/src/shared/open-service/services/module-graph/server.test.ts (2)
360-375: ⚡ Quick winConsider strengthening the assertion to match the comment.
The test comment (line 373) claims "The snapshot is a no-op for the revision," but the assertion
seen.at(-1).toBe(1)would pass whether the snapshot triggered a notification of0or not. To confirm the snapshot behavior, assert the full sequence.🧪 Recommended: Assert the exact notification sequence
- // The snapshot is a no-op for the revision; the update advances it to 1. - expect(seen.at(-1)).toBe(1); + // The snapshot is a no-op for the revision; only the update triggers a notification of 1. + expect(seen).toEqual([1]);🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@code/core/src/shared/open-service/services/module-graph/server.test.ts` around lines 360 - 375, The test should assert the full notification sequence from runtime.queries.getGraphRevision.subscribe to ensure applyGraphSnapshot did not emit a revision; after calling registerBareModuleGraph(), subscribe and push revisions into seen, then call runtime.commands.applyGraphSnapshot(...) and runtime.commands.applyGraphUpdate(...), and replace the final loose assertion with a strict equality assertion that seen equals [1] (i.e., assert the array contains only the single notification from applyGraphUpdate) to confirm the snapshot was a no-op; reference the runtime variable, registerBareModuleGraph(), runtime.queries.getGraphRevision.subscribe, applyGraphSnapshot, and applyGraphUpdate when making the change.
377-412: ⚡ Quick winStrengthen the assertion to verify selectivity.
The test validates that a scoped subscriber is notified "only when its story is bumped," but the assertion
seen.at(-1).toBe(2)only checks the final value. This would pass even if the subscriber were spuriously notified when Card was bumped (e.g.,seen = [0, 1, 2]).🧪 Recommended: Assert the full notification sequence
- expect(seen.at(-1)).toBe(2); + // Verify Card bump (revision 1) did not trigger notification; only Button bump (revision 2) did. + expect(seen).toEqual([2]);🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@code/core/src/shared/open-service/services/module-graph/server.test.ts` around lines 377 - 412, The test currently only checks the final seen value; strengthen it by asserting the full notification sequence so the subscriber wasn't notified on the Card bump. After subscribing via runtime.queries.getGraphRevision.subscribe (and after the initial applyGraphSnapshot and the two applyGraphUpdate calls), replace the final expect(seen.at(-1)).toBe(2) with an assertion that the entire seen array equals the expected sequence (e.g., [1, 2]) so you verify there was only the initial notification and the Button bump notification and no spurious notification for Card; locate this change around the test using registerBareModuleGraph, runtime.commands.applyGraphSnapshot, and runtime.commands.applyGraphUpdate.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@code/core/src/shared/open-service/services/module-graph/server.test.ts`:
- Around line 360-375: The test should assert the full notification sequence
from runtime.queries.getGraphRevision.subscribe to ensure applyGraphSnapshot did
not emit a revision; after calling registerBareModuleGraph(), subscribe and push
revisions into seen, then call runtime.commands.applyGraphSnapshot(...) and
runtime.commands.applyGraphUpdate(...), and replace the final loose assertion
with a strict equality assertion that seen equals [1] (i.e., assert the array
contains only the single notification from applyGraphUpdate) to confirm the
snapshot was a no-op; reference the runtime variable, registerBareModuleGraph(),
runtime.queries.getGraphRevision.subscribe, applyGraphSnapshot, and
applyGraphUpdate when making the change.
- Around line 377-412: The test currently only checks the final seen value;
strengthen it by asserting the full notification sequence so the subscriber
wasn't notified on the Card bump. After subscribing via
runtime.queries.getGraphRevision.subscribe (and after the initial
applyGraphSnapshot and the two applyGraphUpdate calls), replace the final
expect(seen.at(-1)).toBe(2) with an assertion that the entire seen array equals
the expected sequence (e.g., [1, 2]) so you verify there was only the initial
notification and the Button bump notification and no spurious notification for
Card; locate this change around the test using registerBareModuleGraph,
runtime.commands.applyGraphSnapshot, and runtime.commands.applyGraphUpdate.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: dc560138-c79c-4514-b83f-35556844404d
📒 Files selected for processing (5)
code/core/src/core-server/change-detection/change-detection-service.test.tscode/core/src/core-server/change-detection/change-detection.test-helpers.tscode/core/src/shared/open-service/services/module-graph/definition.tscode/core/src/shared/open-service/services/module-graph/server.test.tscode/core/src/shared/open-service/services/module-graph/types.ts
🚧 Files skipped from review as they are similar to previous changes (4)
- code/core/src/shared/open-service/services/module-graph/types.ts
- code/core/src/shared/open-service/services/module-graph/definition.ts
- code/core/src/core-server/change-detection/change-detection.test-helpers.ts
- code/core/src/core-server/change-detection/change-detection-service.test.ts
Resolve docgen/module-graph conflicts after the service-registration split, store workingDir in module-graph state now that query handlers cannot be overridden at registration, and address CodeRabbit engine feedback for pre-patch dependents and early startup failure handling. Co-authored-by: Cursor <cursoragent@cursor.com>
Index reconciliation and snapshot baseline must not leave prior story-file change lists attached to a newer graph revision. Co-authored-by: Cursor <cursoragent@cursor.com>
Move getStatus load into the service definition via a settlement bridge, and register module-graph before docgen in manifest tests that exercise docgen static output. Co-authored-by: Cursor <cursoragent@cursor.com>
…and. getStatus.load now invokes a server-registered command so manager runtimes route settlement over the open-service channel instead of relying on a module-level promise that never resolves outside the dev server. Co-authored-by: Cursor <cursoragent@cursor.com>
Ignore Playwright output dirs in Vite watch so trace writes do not reload the dev server during internal e2e, and harden preview-ready waits for cold starts. Co-authored-by: Cursor <cursoragent@cursor.com>
Avoid repeated index scans when mapping bumped story files to component IDs, and add focused unit coverage for the getLatestStoryChanges query contract. Co-authored-by: Cursor <cursoragent@cursor.com>







Closes #
What I did
This PR moves Storybook's story module graph out of change detection and into a new
core/module-graphopen service.Concretely, it:
shared/open-service/services/module-graph.core/module-graphas the single service boundary for module graph consumers../src/Button.stories.tsx, so future static snapshots do not leak absolute filesystem paths.getStatus— lifecycle state (booting,ready,error,unavailable) with serializableErrorLikeerrors.getStoriesForFiles— maps source files to affected story files and graph distance.getGraphRevision— monotonic graph/index revision for consumers that need to rescan derived state.getLatestStoryChanges— latest changed story files plus revision, used by DocGen reactivity.StoryDependencyGraphService/active-registry compatibility path; current consumers must use the open service.ChangeDetectionServiceconsume module graph data through open-service queries/subscriptions instead of engine callbacks.getLatestStoryChangesand proactively refreshing already-extracted docgen for affected component ids.Follow-up prompt: migrate addon-mcp to
core/module-graphChecklist for Contributors
Testing
The changes in this PR are covered in the following automated tests:
Focused validation run locally after resolving conflicts with
claude/docgen-phase-3-rcm-provider:npx vitest run --config code/core/vitest.config.ts code/core/src/shared/open-service/services/module-graph code/core/src/shared/open-service/services/docgen/server.test.ts code/core/src/core-server/change-detection/change-detection-service.test.ts(12files,150tests)FORCE_COLOR=0 yarn exec jiti ./scripts/check/check-package.ts --cwd code/coreyarn --cwd code lint:js:cmd core/src/shared/open-service/services/docgen/server.ts core/src/shared/open-service/services/docgen/server.test.ts core/src/shared/open-service/services/module-graph/definition.ts core/src/shared/open-service/services/module-graph/server.ts core/src/shared/open-service/services/module-graph/server.test.ts core/src/shared/open-service/services/module-graph/types.ts core/src/core-server/change-detection/change-detection-service.ts core/src/core-server/change-detection/change-detection.test-helpers.ts core/src/core-server/dev-server.ts --fixManual testing
Please QA the change detection path in a Storybook project using a builder that supports change detection, such as a React Vite Storybook.
Start from a clean git working tree in a Storybook project with at least one component story, for example a
Button.tsxcomponent andButton.stories.tsxstory.Enable the change detection feature flag in
.storybook/main.ts:If the project already has a
featuresobject, addchangeDetection: trueto it.Start Storybook in dev mode.
Open the manager UI and confirm the initial sidebar has no unexpected change-detection statuses for the clean working tree.
Edit the component file imported by the story, for example
Button.tsx, without committing the change.Confirm the related story receives the expected changed/modified status in the Storybook sidebar.
Edit a transitive dependency of that story, for example a helper/module imported by
Button.tsx, and confirm the dependent story receives the expected affected status.Add or rename a story file, then trigger story index regeneration by saving the file or requesting
index.json; confirm the story list and change-detection status update without restarting Storybook.Revert the edited files back to the clean git state and confirm the change-detection statuses clear after Storybook processes the file changes.
While Storybook is still running, make one more source-file edit and confirm the status updates again, verifying the module graph continues to process incremental changes after the initial build.
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.🦋 Canary release
This pull request has been released as version
0.0.0-pr-35048-sha-4dcfdcfd. Try it out in a new sandbox by runningnpx storybook@0.0.0-pr-35048-sha-4dcfdcfd sandboxor in an existing project withnpx storybook@0.0.0-pr-35048-sha-4dcfdcfd upgrade.More information
0.0.0-pr-35048-sha-4dcfdcfdjeppe-cursor/4b72cdff4dcfdcfd1781016771)To request a new release of this pull request, mention the
@storybookjs/coreteam.core team members can create a new canary release here or locally with
gh workflow run --repo storybookjs/storybook publish.yml --field pr=35048Made with Cursor
Summary by CodeRabbit
Refactor
New Features
Bug Fixes
Documentation