-
Notifications
You must be signed in to change notification settings - Fork 2.5k
feat(storybook)!: support storybook 9 #31172
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
base: master
Are you sure you want to change the base?
Conversation
View your CI Pipeline Execution ↗ for commit da609d4.
☁️ Nx Cloud last updated this comment at |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
packages/storybook/src/generators/migrate-9/calling-storybook-cli.ts
Outdated
Show resolved
Hide resolved
packages/storybook/src/generators/migrate-9/helper-functions.ts
Outdated
Show resolved
Hide resolved
packages/storybook/src/generators/migrate-9/helper-functions.ts
Outdated
Show resolved
Hide resolved
packages/storybook/src/executors/build-storybook/build-storybook.impl.ts
Outdated
Show resolved
Hide resolved
Related to the generation of story files, e.g.: here's a before/after code in case it helps! - import type { Meta, StoryObj } from '@storybook/react';
+ import type { Meta, StoryObj } from '@storybook/react-webpack5'; // the "renderer" is gone, we use the "framework" now
import { MyButton } from './my-button';
- import { within } from '@storybook/testing-library';
- import { expect } from '@storybook/jest';
+ import { expect } from 'storybook/test'; // all test utilities are part of storybook now
const meta: Meta<typeof MyButton> = {
component: MyButton,
title: 'MyButton',
};
export default meta;
type Story = StoryObj<typeof MyButton>;
export const Heading: Story = {
args: {
text: '',
padding: 0,
disabled: false,
},
- play: async ({ canvasElement }) => {
+ play: async ({ canvas }) => { // the within + canvasElement thing happens internally now
- const canvas = within(canvasElement);
- expect(canvas.getByText(/Welcome to MyButton!/gi)).toBeTruthy();
+ await expect(canvas.getByText(/Welcome to MyButton!/gi)).toBeTruthy(); // this should be awaited
},
}; |
7bf118c
to
ab4c17a
Compare
…erator BREAKING CHANGE: The `@nx/storybook:cypress-project` generator has been deprecated for some time and marked for removal in Nx 21. It has now been removed.
BREAKING CHANGE: @nx/react-native:stories generator removed as it is a pass through to @nx/react:stories. It has been deprecated and was supposed to be removed in Nx 19
1e7d18b
to
5f56d16
Compare
a42d64c
to
75a3c8e
Compare
75a3c8e
to
8ddcbf3
Compare
8ddcbf3
to
da609d4
Compare
🐳 We have a release for that!This PR has a release associated with it. You can try it out using this command: npx [email protected] my-workspace Or just copy this version and use it in your own command: 0.0.0-pr-31172-da609d4
To request a new release for this pull request, mention someone from the Nx team or the |
"@storybook/svelte-vite", | ||
"@storybook/sveltekit", | ||
"@storybook/vue-webpack5", | ||
"@storybook/vue-vite", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vue-vite is also umaintained since Storybook 8, as it relates to Vue2 and lower
"@storybook/vue3-vite", | ||
"@storybook/web-components-webpack5", | ||
"@storybook/web-components-vite" | ||
], | ||
"aliases": ["storybook7UiFramework"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this still be called storybook7?
const pm = getPackageManagerCommand(packageManager); | ||
|
||
output.log({ | ||
title: 'Storybook 8 Migration Guide', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
title: 'Storybook 8 Migration Guide', | |
title: 'Storybook 9 Migration Guide', |
output.log({ | ||
title: 'Storybook 8 Migration Guide', | ||
bodyLines: [ | ||
`You can run the following commands manually to upgrade your Storybook projects to Storybook 8:`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
`You can run the following commands manually to upgrade your Storybook projects to Storybook 8:`, | |
`You can run the following commands manually to upgrade your Storybook projects to Storybook 9:`, |
Current Behavior
We currently do not have support for Storybook 9, nor any migrations to help users switch to it.
Expected Behavior
Support Storybook 9 and add a migration for users to switch to v9
BREAKING CHANGE: Remove deprecated generators:
@nx/storybook:cypress-project
,@nx/react-native:storybook-configuration
,@nx/react-native:stories
,@nx/react-native:component-story