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

Refactor Storybook <Button /> #213

Merged
merged 12 commits into from
Dec 7, 2020
8 changes: 4 additions & 4 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
module.exports = {
stories: ["../src/components/**/*.stories.tsx"],
addons: [
"@storybook/addon-actions",
"@storybook/addon-essentials",
"@storybook/addon-knobs",
"@storybook/addon-notes",
"@storybook/addon-storysource",
],
reactOptions: {
fastRefresh: true,
strictMode: true,
// TODO: fix warn "Rendered more hooks than during the previous render."
// knobを完全に排除できたタイミングで再度調査
// strictMode: true,
Comment on lines +14 to +16
Copy link
Contributor Author

Choose a reason for hiding this comment

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

memo

},
};
2 changes: 2 additions & 0 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import * as React from "react";
import { ThemeProvider, createTheme } from "../src/themes";
import "@storybook/addon-console";
Copy link
Contributor Author

Choose a reason for hiding this comment

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



const theme = createTheme();

Expand Down
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,9 @@
"styled-components": ">= 5.X"
},
"devDependencies": {
"@storybook/addon-actions": "^6.1.6",
"@storybook/addon-knobs": "^6.1.6",
"@storybook/addon-notes": "^5.3.21",
"@storybook/addon-storysource": "^6.1.6",
"@storybook/addon-console": "^1.2.2",
"@storybook/addon-essentials": "^6.1.9",
"@storybook/addon-knobs": "^6.1.9",
Copy link
Contributor

Choose a reason for hiding this comment

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

こいつ残してるのは、前のやつとの互換とるためかな?
knobsとessentialsに含まれてるcontrolsがほぼ同じやつだと認識してるんだけど、もしかして理解足りてない...?w

Copy link
Contributor Author

@youchann youchann Dec 7, 2020

Choose a reason for hiding this comment

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

そうですね。前のやつと互換を取るためです!

knobsとessentialsに含まれてるcontrolsがほぼ同じやつだと認識

合ってます!がライブラリとしては別モノなので、一気に乗り換えるためには修正は必要でして。。。
https://github.com/storybookjs/storybook/tree/next/addons/controls#how-do-i-migrate-from-addon-knobs

いずれ全て変わるので、一気にやらなくても良いかなという判断です!

Copy link
Contributor

Choose a reason for hiding this comment

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

👍

"@storybook/react": "^6.1.6",
"@svgr/rollup": "^2.4.1",
"@testing-library/jest-dom": "^5.11.0",
Expand All @@ -70,6 +69,8 @@
"gh-pages": "^1.2.0",
"jest": "^26.1.0",
"prettier": "^2.1.2",
"react": ">= 16.6.1",
"react-dom": ">= 16.6.1",
"rollup": "^2.33.3",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-imagemin": "^0.4.1",
Expand Down
Loading