Skip to content

chore(deps): bump storybook from v8.6.14 to v9.1.16 #936

Merged
tbouffard merged 5 commits intomainfrom
chore/bump_storybook_to_v9
Nov 24, 2025
Merged

chore(deps): bump storybook from v8.6.14 to v9.1.16 #936
tbouffard merged 5 commits intomainfrom
chore/bump_storybook_to_v9

Conversation

@tbouffard
Copy link
Copy Markdown
Member

@tbouffard tbouffard commented Oct 31, 2025

Upgrade Storybook from v8.6.14 to v9.1.16 using the official upgrade command with automatic migrations.
Update dependabot configuration to let it update react and vite as Storybook v9 now supports the latest versions of these dependencies.


Key changes:

  • Essential addons (viewport, controls, interactions, actions) moved
    to Storybook core and removed as separate packages
  • Migrated from renderer-based to framework-based configuration
    (@storybook/html → @storybook/html-vite)
  • Replaced @storybook/addon-storysource with new built-in Code Panel
  • Added @storybook/addon-docs explicitly for documentation features
  • Installed eslint-plugin-storybook for better linting support
  • Updated module resolution with getAbsolutePath helper for monorepo
  • Removed deprecated docs.autodocs configuration
  • Added debug-storybook.log to .gitignore

Automigrations applied:

  • eslintPlugin: Installed and configured Storybook ESLint plugin
  • addon-storysource-code-panel: Migrated to new Code Panel feature
  • consolidated-imports: Updated renamed/consolidated packages
  • renderer-to-framework: Moved to framework-based configuration
  • remove-essential-addons: Removed addons now in core
  • remove-docs-autodocs: Updated docs configuration
  • wrap-require: Fixed module resolution for special environments

Tested:

  • Build completes successfully
  • Dev server starts and runs correctly on port 8901

Migration guide: https://storybook.js.org/docs/9/releases/migration-guide-from-older-version

Summary by CodeRabbit

  • Chores

    • Upgraded Storybook to the 9.x series and adjusted addon/configuration to match the new release.
    • Updated Dependabot settings to resume updates for React and React DOM and to consider Vite updates.
    • Added debug log file to .gitignore.
  • New Features

    • Enabled an inline code panel in Storybook docs for improved code viewing.

✏️ Tip: You can customize this high-level summary in your review settings.

@tbouffard tbouffard added the chore Build, CI/CD or repository tasks (issues/PR maintenance, environments, ...) label Oct 31, 2025
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Oct 31, 2025

Walkthrough

Replace Storybook 8.x setup with 9.x entries in packages/html, update Storybook config to resolve addons/framework dynamically, switch MDX imports from @storybook/blocks to @storybook/addon-docs/blocks, remove some Dependabot ignore entries, and add debug-storybook.log to .gitignore.

Changes

Cohort / File(s) Summary
Dependabot & Gitignore
​.github/dependabot.yml, ​.gitignore
Removed react, react-dom, and vite from Dependabot ignore list and updated comment about Storybook 9.x; added debug-storybook.log to .gitignore.
Storybook Main Config
packages/html/.storybook/main.ts
Add ESM helpers and a getAbsolutePath(value: string) resolver; replace hard-coded addon/framework strings with dynamic path resolution; remove static docs.autodocs block.
Storybook Preview Config
packages/html/.storybook/preview.ts
Change Preview type import from @storybook/html@storybook/html-vite; enable docs.codePanel: true in preview parameters.
Package Dependencies
packages/html/package.json
Upgrade Storybook to ~9.1.16; remove 8.6.14-era packages (addon-essentials, addon-storysource, blocks, etc.) and add/update 9.x packages (@storybook/addon-docs, @storybook/addon-links, @storybook/html-vite, storybook).
MDX Stories
packages/html/stories/*
packages/html/stories/Anchors.mdx, .../Animation.mdx, .../AutoLayout.mdx, .../Boundary.mdx, .../Control.mdx, .../FixedPoints.mdx, .../Wires.mdx, .../Wrapping.mdx, .../ZoomAndFit.mdx
Replace import { Meta } from '@storybook/blocks' with import { Meta } from '@storybook/addon-docs/blocks' across MDX story files.

Sequence Diagram(s)

sequenceDiagram
  participant Dev as Storybook Host
  participant Main as packages/html/.storybook/main.ts
  participant Resolver as getAbsolutePath
  participant FS as node:fs / require.resolve
  participant Storybook as Storybook Runtime

  Dev->>Main: load configuration
  Main->>Resolver: resolve("...-addon-links") / resolve("...-addon-docs") / resolve("...-html-vite")
  Resolver->>FS: locate package.json for module
  FS-->>Resolver: absolute path
  Resolver-->>Main: absolute addon/framework paths
  Main->>Storybook: export final config (addons, framework)
  Storybook-->Dev: start with resolved addons/framework
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20–30 minutes

  • Review getAbsolutePath correctness and ESM/CJS interop in main.ts.
  • Verify package.json dependency changes are consistent and do not leave incompatible Storybook entries.
  • Confirm MDX imports updated consistently and preview type change is compatible with other typings.

Possibly related PRs

Suggested labels

dependencies, javascript

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: upgrading Storybook from v8.6.14 to v9.1.16, which is the primary objective of this pull request.
Description check ✅ Passed The description is comprehensive and addresses most template requirements: it explains what was changed and why, includes key changes and automigrations applied, provides testing details, and references migration documentation. However, the PR checklist items are not explicitly addressed in the description format.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/bump_storybook_to_v9

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2be362d and ab28bdf.

📒 Files selected for processing (1)
  • packages/html/.storybook/main.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/html/.storybook/main.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: build (ubuntu-24.04)
  • GitHub Check: build (windows-2022)
  • GitHub Check: build (macos-14)
  • GitHub Check: build

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@tbouffard tbouffard added the skip-changelog Do not include in Changelog and Release Notes label Nov 3, 2025
Upgrade Storybook from v8.6.14 to v9.1.16 using the official upgrade
command with automatic migrations.

Key changes:
- Essential addons (viewport, controls, interactions, actions) moved
  to Storybook core and removed as separate packages
- Migrated from renderer-based to framework-based configuration
  (@storybook/html → @storybook/html-vite)
- Replaced @storybook/addon-storysource with new built-in Code Panel
- Added @storybook/addon-docs explicitly for documentation features
- Installed eslint-plugin-storybook for better linting support
- Updated module resolution with getAbsolutePath helper for monorepo
- Removed deprecated docs.autodocs configuration
- Added debug-storybook.log to .gitignore

Automigrations applied:
- eslintPlugin: Installed and configured Storybook ESLint plugin
- addon-storysource-code-panel: Migrated to new Code Panel feature
- consolidated-imports: Updated renamed/consolidated packages
- renderer-to-framework: Moved to framework-based configuration
- remove-essential-addons: Removed addons now in core
- remove-docs-autodocs: Updated docs configuration
- wrap-require: Fixed module resolution for special environments

Tested:
- Build completes successfully
- Dev server starts and runs correctly on port 8901

Migration guide: https://storybook.js.org/docs/9/releases/migration-guide-from-older-version
@tbouffard tbouffard force-pushed the chore/bump_storybook_to_v9 branch from 15eff33 to 2be362d Compare November 24, 2025 14:36
@tbouffard tbouffard marked this pull request as ready for review November 24, 2025 15:02
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

♻️ Duplicate comments (7)
packages/html/stories/ZoomAndFit.mdx (1)

1-1: LGTM!

The import path change is consistent with the Storybook 9.x migration (same verification applies as in Control.mdx).

packages/html/stories/Wires.mdx (1)

1-1: LGTM!

The import path change is consistent with the Storybook 9.x migration (same verification applies as in Control.mdx).

packages/html/stories/AutoLayout.mdx (1)

1-1: LGTM!

The import path change is consistent with the Storybook 9.x migration (same verification applies as in Control.mdx).

packages/html/stories/Boundary.mdx (1)

1-1: LGTM!

The import path change is consistent with the Storybook 9.x migration (same verification applies as in Control.mdx).

packages/html/stories/Wrapping.mdx (1)

1-1: Duplicate: Import path verification needed.

Same import path change as flagged in Animation.mdx. Please verify across all MDX files.

packages/html/stories/FixedPoints.mdx (1)

1-1: Duplicate: Import path verification needed.

Same import path change as flagged in Animation.mdx.

packages/html/stories/Anchors.mdx (1)

1-1: Duplicate: Import path verification needed.

Same import path change as flagged in Animation.mdx.

🧹 Nitpick comments (1)
packages/html/.storybook/main.ts (1)

44-46: Improve type safety: Replace any with string.

The getAbsolutePath function returns any, which bypasses type checking. Since it always returns a string (the directory path), the return type should be string.

Apply this diff to improve type safety:

-function getAbsolutePath(value: string): any {
+function getAbsolutePath(value: string): string {
   return dirname(require.resolve(join(value, 'package.json')));
 }
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 799f385 and 2be362d.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (14)
  • .github/dependabot.yml (1 hunks)
  • .gitignore (1 hunks)
  • packages/html/.storybook/main.ts (1 hunks)
  • packages/html/.storybook/preview.ts (2 hunks)
  • packages/html/package.json (1 hunks)
  • packages/html/stories/Anchors.mdx (1 hunks)
  • packages/html/stories/Animation.mdx (1 hunks)
  • packages/html/stories/AutoLayout.mdx (1 hunks)
  • packages/html/stories/Boundary.mdx (1 hunks)
  • packages/html/stories/Control.mdx (1 hunks)
  • packages/html/stories/FixedPoints.mdx (1 hunks)
  • packages/html/stories/Wires.mdx (1 hunks)
  • packages/html/stories/Wrapping.mdx (1 hunks)
  • packages/html/stories/ZoomAndFit.mdx (1 hunks)
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: tbouffard
Repo: maxGraph/maxGraph PR: 849
File: packages/html/stories/DragSource.stories.js:98-101
Timestamp: 2025-06-13T07:48:10.300Z
Learning: User tbouffard prefers answers in English; avoid switching to other languages in future replies.
📚 Learning: 2025-01-05T15:35:57.645Z
Learnt from: tbouffard
Repo: maxGraph/maxGraph PR: 617
File: packages/ts-example/package.json:12-12
Timestamp: 2025-01-05T15:35:57.645Z
Learning: We keep Vite 5 specifically in the package that uses Storybook (the "html" package), while the other packages can safely use a newer version of Vite without compatibility issues.

Applied to files:

  • packages/html/package.json
  • packages/html/.storybook/main.ts
  • packages/html/.storybook/preview.ts
  • .github/dependabot.yml
📚 Learning: 2025-04-22T16:34:40.309Z
Learnt from: tbouffard
Repo: maxGraph/maxGraph PR: 774
File: packages/ts-example-selected-features/package.json:11-13
Timestamp: 2025-04-22T16:34:40.309Z
Learning: In the maxGraph project, TypeScript is defined as a dependency in the root package.json (~5.8.2) and not in individual package.json files for example packages. The build scripts in example packages can use `tsc` commands because the TypeScript dependency is hoisted in the monorepo structure.

Applied to files:

  • .github/dependabot.yml
📚 Learning: 2025-04-22T16:34:40.309Z
Learnt from: tbouffard
Repo: maxGraph/maxGraph PR: 774
File: packages/ts-example-selected-features/package.json:11-13
Timestamp: 2025-04-22T16:34:40.309Z
Learning: In the maxGraph project, TypeScript is defined as a dependency in the root package.json and not in individual package.json files for example packages. The build scripts in example packages can use `tsc` because it's available through this hoisted dependency in the monorepo structure.

Applied to files:

  • .github/dependabot.yml
🔇 Additional comments (10)
.gitignore (1)

28-28: LGTM!

Adding debug-storybook.log to the ignore list is appropriate for Storybook debug files.

.github/dependabot.yml (1)

25-27: LGTM!

The updated comment correctly reflects the current Storybook version (9.x) in use after this migration.

packages/html/.storybook/preview.ts (2)

107-109: Code Panel configuration is correct and verified.

The docs.codePanel: true parameter in your preview config is the correct way to enable the Code Panel feature in Storybook 9.x, and your implementation matches the official documentation exactly.


17-17: The Preview type import path is correct for Storybook 9.x html-vite framework.

The import import type { Preview } from '@storybook/html-vite' matches the official Storybook migration documentation for framework-specific Preview imports. This change correctly aligns with the renderer-to-framework migration in Storybook 9.x.

packages/html/stories/Control.mdx (1)

1-1: Import path verified as correct for Storybook 9.x.

The import path @storybook/addon-docs/blocks for Meta, Canvas, and Controls components is correct and matches the official Storybook 9.x documentation. The code change is accurate.

packages/html/.storybook/main.ts (3)

17-20: LGTM: ES module compatibility setup.

The ES module compatibility setup using createRequire is correct and necessary for the getAbsolutePath function to resolve package paths in a monorepo environment.


32-35: LGTM: Addon configuration aligned with Storybook 9.

The addon configuration correctly uses dynamic path resolution for addon-links and addon-docs. The removal of addon-essentials and addon-storysource aligns with Storybook 9's move to include essential addons in core and replace addon-storysource with the built-in Code Panel.


37-40: LGTM: Framework configuration updated for Storybook 9.

The framework configuration correctly migrates from renderer-based (@storybook/html) to framework-based (@storybook/html-vite) configuration, which is a key change in Storybook 9.

packages/html/stories/Animation.mdx (1)

1-1: The import path is correct for Storybook 9.

The correct import path for the Meta component in Storybook 9 MDX files is @storybook/addon-docs/blocks, which matches the code in Animation.mdx. The review comment incorrectly suggests this path should be changed to @storybook/blocks.

Likely an incorrect or invalid review comment.

packages/html/package.json (1)

14-16: Verify Storybook 9.1.16 compatibility with custom addons and Vite 6 integration.

Storybook 9.1.16 is generally compatible with React 19.1.0 and Vite 6.4.1, but there are known compatibility issues including React 19 addon/manager-bundle problems, peerDependency alignment issues, and Vite 6 related bugs like local hostname access failures. Before merging, please:

  1. Test custom addons — verify any custom Storybook addons work correctly with 9.1.16 and React 19
  2. Verify Vite 6 network access — confirm Storybook is accessible from localhost and any configured hostnames
  3. Check peerDependencies — ensure monorepo dependency resolution doesn't require manual overrides for React 19 compatibility

The PR shows successful build and dev server operation, which is a good sign, but full CI/dev workflows and custom addon testing are recommended.

@tbouffard
Copy link
Copy Markdown
Member Author

✔️ Tested locally with the artifact built by GH Actions
✔️ Tested with the local dev server

@sonarqubecloud
Copy link
Copy Markdown

@tbouffard tbouffard merged commit 8357f9f into main Nov 24, 2025
12 checks passed
@tbouffard tbouffard deleted the chore/bump_storybook_to_v9 branch November 24, 2025 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Build, CI/CD or repository tasks (issues/PR maintenance, environments, ...) skip-changelog Do not include in Changelog and Release Notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant