Skip to content

Upgrading @storybook/addon-links 7 to 8

Breaking7.6.24 โ†’ 8.6.19Breaking55Security15Platform7Deprecated3New135Changed267Fixed382Other57

BreakingUpgrade verdict

52 breaking changes and 7 platform requirement changes and 15 security fixes.

  • Removes the warnings API from the a11y addon.
  • The entrypoint used to load the Vitest plugin has a new name, so imports may need updating.
  • Support for .stories.mdx files is further removed, so those files will no longer be handled.
  • The globals setting in preview.js is now called initialGlobals, so existing configs using globals need updating.
Top 5 of 77 that need code or config changes

@storybook/addon-links publishes an official migration guide for version 8. It covers more than the release notes do.

Migration Guide โ†—

Drops @storybook/csf.

Installs 2 packages in all (was 4).

Breaking52
Removes the warnings API from the a11y addon.
Renames the Vitest plugin entrypoint.
Removes more .stories.mdx handling.
.stories.mdx
Renames preview.js globals to initialGlobals.
preview.jsglobalsinitialGlobals
Drops the unneeded UPDATE_STORY_ARGS event that was for SSv6.
UPDATE_STORY_ARGS
Removes the 'left' property from TooltipLinkList and Link components.
TooltipLinkListLink
Renames the --webpack-stats-json CLI flag to --stats-json since it works in Vite.
--webpack-stats-json--stats-json
CLI removes the argTypesRegex automigration.
argTypesRegex
CLI removes the logging to file feature from autoblockers.
Svelte removes deprecated SvelteComponentTyped in favor of SvelteComponent.
SvelteComponentTypedSvelteComponent
Removes defaultProps from the Link component in the UI.
LinkdefaultProps
Adds subcomponents support to ArgTypes and Controls, and removes the ArgsTable block.
subcomponentsArgTypesControlsArgsTable
Removes the passArgsFirst parameter flag.
passArgsFirst
Removes the deprecated config preset.
Removes deprecated APIs from the manager and preview APIs.
Removes the unused hideNoControlsWarning type from Addon Controls.
hideNoControlsWarning
Removes the deprecated Story type from Angular.
Story
Removes deprecated properties from manager-api.
manager-api
Removes the deprecated standalone webpackConfig option.
webpackConfig
Removes the storyStoreV7 feature flag.
storyStoreV7
Removes deprecated createChannel APIs.
createChannel
Removes the babel and SWC compiler from the Webpack5 builder.
Webpack5
Removes LinkTo from the direct import of @storybook/addon-links.
LinkTo
Removes deprecated parameters from Addon docs.
Removes the StorybookViteConfig type in favor of StorybookConfig.
StorybookViteConfigStorybookConfig
Removes the collapseAll and expandAll methods.
collapseAllexpandAll
Removes storyIndexers in favor of experimental_indexers.
storyIndexersexperimental_indexers
Removes the unused staticDir type.
staticDir
Removes deprecated props from the Description doc block.
DescriptionPrimarySourceStory
Removes the deprecated navigateToSettingsPage manager API method.
navigateToSettingsPage
Removes the deprecated setGlobalConfig portable stories API for React.
setGlobalConfig
Removes deprecated addons module types from TypeScript.
Removes the DecoratorFn, Story, ComponentStory, ComponentStoryObj, ComponentStoryFn and ComponentMeta types.
DecoratorFnStoryComponentStoryComponentStoryObjComponentStoryFnComponentMeta
Removes the Framework type in favor of Renderer types.
FrameworkRenderer
Removes deprecated WithTooltip props.
WithTooltip
CLI removes the --use-npm flag.
--use-npm
Core removes the unused warnOnLegacyHierarchySeparator type.
warnOnLegacyHierarchySeparator
Core removes vite plugins and drops Vite 3 support.
Removes stories.json support from the API.
stories.json
Removes the react peer dependency from Addon Docs.
react
Vue: Removes deprecated vue packages from next.
Vue: Removes unused preset-vue-webpack.
preset-vue-webpack
Removes unused and deprecated packages.
Removes the sb extract CLI command.
sb extract
Removes the storiesOf API.
storiesOf
Stops setting process.env.NODE_ENV and process.env.DEV.
process.env.NODE_ENVprocess.env.DEV
Adjusts beforeAll to be non-nullable in NormalizedProjectAnnotations.
beforeAllNormalizedProjectAnnotations
Requires a modifier key to trigger the F, A, D, S, T and / shortcuts.
FADST/
Errors on explicit actions while rendering or playing.
Changes StoryFnReactReturnType to JSX.Element.
StoryFnReactReturnTypeJSX.Element
Replaces Form.Button with the new Button component.
Form.ButtonButton
Replaces @storybook/jest with @storybook/test for interaction testing.
@storybook/jest@storybook/test
Security15
Prevents menu items from emitting arbitrary channel events.
Restricts preview postMessage to known manager origins.
postMessage
Separates manager and preview roles on the dev server channel.
Blocks iframe embedding of the dev server from non-localhost origins.
Rejects component search queries outside the project.
Validates component export name when creating a story.
Adds host validation warning and origin validation for MCP.
MCP
Contains save story path to the project root.
Validates save story name and arg keys as identifiers.
Disables browser file writes and command execution in Addon Vitest.
Adds request validation.
Hardens the websocket connection.
Replaces the ip function with a small helper function to address security concerns.
ip
Bumps webpack-dev-middleware to patch a high severity security issue.
webpack-dev-middleware
Core updates the ip dependency to fix CVE-2023-42282.
ip
Platform7
Adds @storybook/test as an optional peer dependency for ReactVite.
@storybook/test
Makes prettier an optional peer dependency.
prettier
Relaxes the peer dependency constraint of shim packages.
React: Supports v19 betas in peer dependencies.
CLI updates the minimum Node.js version requirement.
Updates the Node.js version requirement to >= 18.0.0.
Sets the engines field to Node.js >= 18 for packages.
Deprecated3
Addon Themes deprecates useThemeParameters.
useThemeParameters
Emits deprecated TESTING_MODULE_RUN_ALL_REQUEST for backward compatibility.
TESTING_MODULE_RUN_ALL_REQUEST
Refactors preview and deprecates the story store.
story store

Generated by DepDelta from published .d.ts files. Not mixed with prose notes.

  • removed: function LinkTo(): null
  • changed: const linkTo: (idOrTitle: string | ((...args: any[]) => string), nameInput?: string | ((...args: any[]) => string) | undefined) => (...args: any[]) => void โ†’ const linkTo: (idOrTitle: string | ((...args: any[]) => string), nameInput?: string | ((...args: any[]) => string)) => (...args: any[]) => void
  • changed: const withLinks: lib_preview_api_dist_addons.MakeDecoratorResult โ†’ const withLinks: (...args: any) => any
  • added: const default: () => core_dist_types.ProjectAnnotations<core_dist_types.Renderer>
  • added: const decorators: ((...args: any) => any)[]