Skip to content
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

Storybook v7 #154

Merged
merged 4 commits into from
Apr 9, 2023
Merged

Conversation

fooloomanzoo
Copy link
Contributor

@fooloomanzoo fooloomanzoo commented Dec 24, 2022

  • update dependencies
  • adjust to new addons setup configuration
  • adjust run scripts for new storybook-cli
  • add @storybook/blocks dependency
  • import controls from new location (@storybook/blocks)
  • apply styles for auto dark mode mode in preview
  • responsive flex box style fixes for controls

@vercel
Copy link

vercel bot commented Dec 24, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
storybook-addon-mock ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 3, 2023 6:25am

@nutboltu
Copy link
Collaborator

@fooloomanzoo, thanks for your contribution. Can you please specify if there are any breaking changes and if it's backward compatible?

Copy link
Contributor Author

@fooloomanzoo fooloomanzoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nutboltu
Additionally to the changes regarding the different locations and export declarations in storybook v7, there are some issues fixed in styling, so the controls better adjust to panel position changes and take over the provided theming by storybook. Storybook also changed something about the peer dependencies, what could be the reason for the integration tests failing (not sure).
also: https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#addon-authors

@@ -8,5 +8,5 @@ function managerEntries(entry = []) {

module.exports = {
managerEntries,
config,
previewAnnotations,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be a breaking change for older storybook version, since the entry has or will change

RangeControl,
TabsState,
} from '@storybook/components';
import { ObjectControl, RangeControl } from '@storybook/blocks';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The components for the controls distributed by storybook have been restructured also.

Comment on lines +36 to +38
border: ${({ theme }) => theme.input.border};
background: ${({ theme }) => theme.input.background};
border-radius: ${({ theme }) => theme.input.borderRadius};
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Color-theme-style changes are necessary since auto dark mode is also now integrated by storybook v7

@@ -1,5 +1,5 @@
import { FORCE_RE_RENDER, STORY_CHANGED } from '@storybook/core-events';
import addons from '@storybook/addons';
import { addons } from '@storybook/addons';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also changed, addons is not the default export of storybook-addon anymore

@fooloomanzoo
Copy link
Contributor Author

fooloomanzoo commented Jan 28, 2023

@nutboltu
storybook v7 also requires node 16 at least, which is also breaking currently the CI tests https://github.com/storybookjs/storybook/blob/next/code/package.json#L286

- update dependencies
- adjust to new addons setup configuration
- adjust run scripts for new storybook-cli
- add @storybook/blocks dependency
- import controls from new location (@storybook/blocks)
- apply styles for auto dark mode mode in preview
- responsive flex box style fixes
@lessless
Copy link

@nutboltu @fooloomanzoo thanks for taking a stab on this

@offbeat-dev
Copy link

hi @nutboltu,

thank you for your work on this addon.
Just wanted to know if there are any plans of merging this PR soon.
Would love to keep using in my Storybook V7 projects

thanks in advance for your help

@nutboltu
Copy link
Collaborator

hello everyone! I'm sorry for not being active in this project for a while. Due to my current workload, I couldn't spend time on this PR. I may have some time in early April to make it a stable release.

However, I am considering if there's a way to give this project an alpha release.

@nutboltu
Copy link
Collaborator

@nutboltu storybook v7 also requires node 16 at least, which is also breaking currently the CI tests https://github.com/storybookjs/storybook/blob/next/code/package.json#L286

@fooloomanzoo this project supports node 16. The build is failing due to some missing packages.

Screenshot 2023-03-22 at 8 52 31 am

Can you please take a look into these fixes? I want to release an alpha version with your changes to unblock others.

@nutboltu nutboltu added the feature request New feature or request label Mar 22, 2023
@fooloomanzoo
Copy link
Contributor Author

fooloomanzoo commented Mar 22, 2023

@nutboltu added the release candidate version. there is not yet a 7.0.0 storybook release. this was the reason
ready to be used for an alpha version

@JReinhold
Copy link

Hi @fooloomanzoo and @nutboltu, I just wanted to drop in and let you know that, Storybook v7.0.0 is out. It's only on the next tag for now, but it's still targetable with the ^7.0.0 semver range, so you should be able to develop against it with no dependency issues.

If you hit any issues with v7, we've written a migration guide for addon authors here and here.

You're also free to reach out to us in the #prerelease channel on our Discord Server and we'll happily help you out!

cc @ndelangen

@@ -1,5 +1,5 @@
import { FORCE_RE_RENDER, STORY_CHANGED } from '@storybook/core-events';
import addons from '@storybook/addons';
import { addons } from '@storybook/addons';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import { addons } from '@storybook/addons';
import { addons } from '@storybook/preview-api';

"@storybook/api": "^6.4.0",
"@storybook/components": "^6.4.0",
"@storybook/theming": "^6.4.0",
"@storybook/addons": "^7.0.0",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"@storybook/addons": "^7.0.0",
"@storybook/preview-api": "^7.0.0",

@nutboltu nutboltu changed the base branch from master to storybook-v7-support April 9, 2023 02:42
@nutboltu
Copy link
Collaborator

nutboltu commented Apr 9, 2023

@fooloomanzoo, thanks for the awesome contribution. However, the build is failing, and to accelerate the feature (storybook v7 support), I will merge the PR and fix the builds.

@nutboltu nutboltu changed the base branch from storybook-v7-support to master April 9, 2023 02:47
@nutboltu nutboltu merged commit 1970bec into linearlabs-workspace:master Apr 9, 2023
1 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants