-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Release: Prerelease 9.1.0-alpha.4 #31725
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
Release: Prerelease 9.1.0-alpha.4 #31725
Conversation
# Conflicts: # code/core/src/csf/csf-factories.ts
# Conflicts: # code/addons/a11y/src/index.ts # code/addons/a11y/src/types.ts # code/addons/actions/src/index.ts # code/addons/backgrounds/src/index.ts # code/addons/controls/src/index.ts # code/addons/docs/src/index.ts # code/addons/essentials/src/index.ts # code/addons/essentials/src/types.ts # code/addons/highlight/src/index.ts # code/addons/highlight/src/types.ts # code/addons/interactions/src/types.ts # code/addons/links/src/index.ts # code/addons/measure/src/index.ts # code/addons/outline/src/index.ts # code/addons/pseudo-states/src/index.ts # code/addons/test/src/index.ts # code/addons/test/src/types.ts # code/addons/themes/src/index.ts # code/addons/viewport/src/index.ts # code/core/src/backgrounds/types.ts # code/core/src/csf/csf-factories.ts # code/core/src/viewport/types.ts # code/frameworks/nextjs-vite/src/index.ts # code/frameworks/nextjs/src/index.ts # code/renderers/react/src/csf-factories.test.tsx # code/renderers/react/src/preview.tsx
# Conflicts: # code/addons/vitest/src/types.ts
…er/csf-parameters
Docs: Point CSF Factories docs at RFC
# Conflicts: # docs/api/csf/csf-factories.mdx
CSF Factories: Add parameters/globals types, `extend` API, portable stories
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.
80 files reviewed, 8 comments
Edit PR Review Bot Settings | Greptile
| const docsContext = this.docsContext(renderStoryToElement); | ||
|
|
||
| const { docs } = this.store.projectAnnotations.parameters || {}; | ||
| const { docs } = this.store.projectAnnotations.parameters ?? ({} as { docs: any }); |
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.
style: Type assertion to { docs: any } is overly permissive and could hide legitimate type errors. Consider using a more specific type or handling undefined explicitly.
| export function definePreview<Addons extends PreviewAddon<never>[]>( | ||
| preview: { addons?: Addons } & ProjectAnnotations<ReactTypes & NextJsTypes & InferTypes<Addons>> | ||
| ): NextPreview<InferTypes<Addons>> { | ||
| // @ts-expect-error hard |
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.
logic: The // @ts-expect-error hard comment should be more descriptive about what type error is being suppressed and why it's necessary
| // @ts-expect-error (double exports) | ||
| export * from './portable-stories'; |
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.
style: Consider moving portable-stories export to a separate entry point to avoid the double export ts-expect-error
| export interface ReactStory extends Story<ReactRenderer> {} | ||
| export interface ReactStory<T extends ReactTypes, TInput extends StoryAnnotations<T, T['args']>> | ||
| extends Story<T, TInput> { | ||
| Component: ComponentType<Partial<T['args']>>; |
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.
style: Consider making Component readonly to prevent accidental overwrites
| id: k, | ||
| title: value.name, | ||
| icon: iconsMap[value.type], | ||
| icon: iconsMap[value.type!], |
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.
style: Type assertion unnecessary here - consider making viewport.type non-optional or handling undefined case explicitly
| get play() { | ||
| return input.play ?? meta.input?.play ?? (async () => {}); | ||
| }, |
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.
style: Default empty async function should be defined as constant to avoid recreating on each get.
| import { | ||
| CSF2StoryWithLocale, | ||
| CSF3Button, | ||
| CSF3ButtonWithRender, | ||
| CSF3InputFieldFilled, | ||
| CSF3Primary, | ||
| MountInPlayFunction, | ||
| MountInPlayFunctionThrow, | ||
| } from './Button.csf4.stories'; | ||
| import { CSF2Secondary, HooksStory } from './Button.csf4.stories'; |
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.
style: Consider consolidating the two imports from Button.csf4.stories into a single import statement for better maintainability
| import { | |
| CSF2StoryWithLocale, | |
| CSF3Button, | |
| CSF3ButtonWithRender, | |
| CSF3InputFieldFilled, | |
| CSF3Primary, | |
| MountInPlayFunction, | |
| MountInPlayFunctionThrow, | |
| } from './Button.csf4.stories'; | |
| import { CSF2Secondary, HooksStory } from './Button.csf4.stories'; | |
| import { | |
| CSF2StoryWithLocale, | |
| CSF3Button, | |
| CSF3ButtonWithRender, | |
| CSF3InputFieldFilled, | |
| CSF3Primary, | |
| MountInPlayFunction, | |
| MountInPlayFunctionThrow, | |
| CSF2Secondary, | |
| HooksStory, | |
| } from './Button.csf4.stories'; |
| previewConfigPath: string, | ||
| configDir: string | ||
| ) { | ||
| const previewConfig = await readConfig(previewConfigPath!); |
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.
style: Unnecessary non-null assertion operator - previewConfigPath is already required by function signature
| const previewConfig = await readConfig(previewConfigPath!); | |
| const previewConfig = await readConfig(previewConfigPath); |
This is an automated pull request that bumps the version from
9.1.0-alpha.3to9.1.0-alpha.4.Once this pull request is merged, it will trigger a new release of version
9.1.0-alpha.4.If you're not a core maintainer with permissions to release you can ignore this pull request.
To do
Before merging the PR, there are a few QA steps to go through:
And for each change below:
This is a list of all the PRs merged and commits pushed directly to
next, that will be part of this release:extendAPI, portable stories #30601If you've made any changes doing the above QA (change PR titles, revert PRs), manually trigger a re-generation of this PR with this workflow and wait for it to finish. It will wipe your progress in this to do, which is expected.
Feel free to manually commit any changes necessary to this branch after you've done the last re-generation, following the Make Manual Changes section in the docs, especially if you're making changes to the changelog.
When everything above is done:
Generated changelog
9.1.0-alpha.4
extendAPI, portable stories - #30601, thanks @kasperpeulen!Greptile Summary
Introduces CSF (Component Story Format) Factories with significant type system improvements and story composition features.
definePreviewwith type-safedefinePreviewAddonacross all core addons for better TypeScript inference.extendAPI enabling story composition and inheritanceconfigDirparameter to addon synchronization for improved path resolution