Skip to content

chore: upgrade storybook to 10.6 and remove legacy-peer-deps - #343

Merged
korvin89 merged 7 commits into
release/v11from
t-20261109-v11-uikit-v8-npmrc
Nov 12, 2026
Merged

korvin89 merged 7 commits into
release/v11from
t-20261109-v11-uikit-v8-npmrc

Conversation

@korvin89

@korvin89 korvin89 commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

Upgrades Storybook 7.6 to 10.6 on release/v11 and removes legacy-peer-deps=true from .npmrc.

Storybook 7 accepted React 18 at most, while the repository develops on React 19, so npm ci needed the flag. With Storybook 10 a strict npm ci passes. The lockfile also moves react-draggable to 4.7.2, the version applications already get.

Details

Storybook

  • Packages ^10.6.7: storybook, @storybook/react, @storybook/react-webpack5. Storybook 10 needs Node 20.19 or 22.12 and later; .nvmrc is 22.
  • Removed packages:
    • @storybook/addon-essentials: controls, actions, viewport and the toolbars are part of storybook now;
    • @storybook/addon-knobs (abandoned at 7.0.2, not used);
    • @storybook/cli (storybook provides the CLI). The build-storybook script calls storybook build. main-preview.yml runs that script instead of npx sb build: Storybook 10 has no sb binary.
  • Compiler: since Storybook 8 the webpack5 builder does not compile TypeScript itself. @storybook/addon-webpack5-compiler-babel is added; it uses the existing .babelrc.json.
  • Dependencies that came with Storybook 7 and are now declared:
    • @babel/preset-env, @babel/preset-react, @babel/preset-typescript (used by .babelrc.json);
    • @types/react-transition-group (typecheck of ActionPanel failed without it).
  • Config:
    • imports move to storybook/manager-api, storybook/theming, storybook/viewport;
    • the theme addon is registered from manager.ts: listed as an addon in main.ts, Storybook 10 loads it as a preset and fails on its JSX;
    • main.ts drops fastRefresh and docs.autodocs: false (autodocs is on only for stories with the autodocs tag, and there are none), and sets features.backgrounds: false to keep the backgrounds tool off, as before;
    • preview.tsx uses initialGlobals and viewport.options instead of the deprecated forms; the unused jsx parameter is removed;
    • the brand title in theme.ts is wrapped in one block: the brand container became a flex row, and the two lines stood side by side;
    • Story → StoryFn in DashKit.stories.tsx.
  • src/plugins/Title/index.ts: export type {PluginTitleSize, TitleFontParams}. Both are types; webpack warned that ./types has no such exports. The emitted JavaScript is the same.

react-draggable 4.7 and the React 18 job

The Tests (React 18) job runs npm install --no-save react@^18 …. Without the flag this install re-resolves the tree and takes react-draggable 4.7.2 instead of the locked 4.4.6, and the test passive-resize › cancels settled width commit on unmount failed with it (on React 19 as well):

  • 4.7 requests one animation frame on unmount to remove its selection class from body;
  • the test expected zero timers after unmount and counted that frame.

Applications already get 4.7.2, because react-grid-layout asks for react-draggable ^4.4.5. So:

  • the lockfile moves react-draggable to 4.7.2, to test what applications run;
  • the test no longer fakes requestAnimationFrame, so it counts only timers. It still fails when the cancellation of the settled width commit is removed from componentWillUnmount.

A value re-export of types leaves an import of nothing in per-file compilers:
webpack warned that './types' has no such exports.
Storybook 7 peers React 18 at most, while the repository develops on React 19.

- the webpack5 builder no longer compiles TypeScript itself: add the babel compiler addon
  and declare the babel presets .babelrc.json uses (they came with storybook 7)
- manager code moves to @storybook/manager-api; Story type -> StoryFn
- remove the abandoned @storybook/addon-knobs (unused) and @storybook/cli
- declare @types/react-transition-group, which also came with storybook 7
With storybook 8 the dependency tree is valid: a strict npm ci passes and npm ls is clean.
It is an optional peer of @storybook/react; storybook builds and starts without it.
@gravity-ui-bot

Copy link
Copy Markdown
Contributor

Preview is ready.

- essentials, viewport, manager-api and theming are part of the storybook package now:
  the separate packages are removed and the imports point to storybook/*
- the theme addon is registered from manager.ts; as a main.ts addon it was loaded as a preset
- preview: initialGlobals and viewport.options replace the deprecated forms; the unused
  jsx parameter is removed
- features.backgrounds: false keeps the backgrounds tool off, as before
- the brand title is one block again: the brand container became a flex row
The lockfile held react-draggable 4.4.6, while applications get 4.7.2 through
react-grid-layout. 4.7 requests an animation frame on unmount, and the unmount test counted
it as a timer of dashkit. The test no longer fakes animation frames; it still fails when the
settled width commit is not cancelled.
@korvin89 korvin89 changed the title chore: upgrade storybook to 8.6 and remove legacy-peer-deps chore: upgrade storybook to 10.6 and remove legacy-peer-deps Nov 12, 2026
@korvin89
korvin89 marked this pull request as ready for review November 12, 2026 12:40
Comment thread package.json Resolved
Storybook 10 has no sb binary: npx sb build would download a separate package instead of
using the installed CLI.

Addresses: 4550777224
@korvin89
korvin89 merged commit a9407e9 into release/v11 Nov 12, 2026
4 checks passed
@korvin89
korvin89 deleted the t-20261109-v11-uikit-v8-npmrc branch November 12, 2026 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants