-
Notifications
You must be signed in to change notification settings - Fork 2.9k
chore: upgrade storybook to v8 #35279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,7 @@ | ||
| import type { StorybookConfig as StorybookBaseConfig } from '@storybook/react-webpack5'; | ||
|
|
||
| export type StorybookConfig = StorybookBaseConfig & | ||
| Required<Pick<StorybookBaseConfig, 'stories' | 'addons' | 'webpackFinal'>>; | ||
| export type StorybookConfig = Omit<StorybookBaseConfig, 'stories' | 'addons' | 'webpackFinal'> & { | ||
| stories: NonNullable<Exclude<StorybookBaseConfig['stories'], Function>>; | ||
| addons: NonNullable<Exclude<StorybookBaseConfig['addons'], Function>>; | ||
| webpackFinal: NonNullable<StorybookBaseConfig['webpackFinal']>; | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,7 +9,7 @@ module.exports = /** @type {Omit<import('../../../.storybook/main'), 'typescript | |
| ...rootMain, | ||
| stories: [ | ||
| ...rootMain.stories, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why was this removed ? it's blank array but for sake of pattern and functionality consistency lets keep it
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a type issue, as SB stories could be both function or array, but I "fixed" it by updating the type https://github.com/microsoft/fluentui/pull/35279/files#diff-00d1e1e0f89e117cefac0fcff05d50990d81de0a7a4ba84873ebc41c61642be2R4 so we can revert this |
||
| '../src/**/*.stories.mdx', | ||
| '../src/**/*.mdx', | ||
| '../src/**/index.stories.@(ts|tsx)', | ||
| ...getPackageStoriesGlob({ packageName: '@fluentui/react-components', callerPath: __dirname }), | ||
| ...getPackageStoriesGlob({ | ||
|
|
@@ -37,7 +37,7 @@ module.exports = /** @type {Omit<import('../../../.storybook/main'), 'typescript | |
| previewUrl: process.env.DEPLOY_PATH, | ||
| }, | ||
| webpackFinal: (config, options) => { | ||
| const localConfig = /** @type config */ ({ ...rootMain.webpackFinal?.(config, options) }); | ||
| const localConfig = /** @type config */ ({ ...rootMain.webpackFinal(config, options) }); | ||
|
|
||
| // add your own webpack tweaks if needed | ||
| registerTsPaths({ configFile: tsConfigAllPath, config: localConfig }); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,8 @@ | ||
| import { Meta } from '@storybook/addon-docs'; | ||
| import { Meta } from '@storybook/blocks'; | ||
| import { FullscreenLink } from './utils'; | ||
| export const parentPath = 'concepts-developer-accessibility-stories'; | ||
| export const parentPath = 'concepts-developer-accessibility-scenarios'; | ||
|
|
||
| <Meta title="Concepts/Developer/Accessibility/Stories/List of scenarios" /> | ||
| <Meta title="Concepts/Developer/Accessibility/Scenarios" /> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why this change?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This page isn't visible on the current docsite, but after upgrade to v8 it rendered like this Screen.Recording.2025-11-04.at.15.21.06.mov
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh nice, probably caused by the blank spaces in the title ?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's because of the |
||
|
|
||
| # Accessibility Scenarios | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,7 +25,7 @@ import { CardPreview } from '@fluentui/react-components'; | |
|
|
||
| const Component = () => ( | ||
| <CardPreview> | ||
| <img src="https://url-of.the/image.jpg" alt="Preview of a Word document" /> | ||
| <img className="sbdocs-img" src="https://url-of.the/image.jpg" alt="Preview of a Word document" /> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should we introduce a custom
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we probably could do this, but I'd rather do it in a separate PR |
||
| </CardPreview> | ||
| ); | ||
| ``` | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.