Skip to content

Commit 1d9ba6f

Browse files
committed
adding storybook-addon-performance
1 parent 591ff2c commit 1d9ba6f

File tree

5 files changed

+349
-5
lines changed

5 files changed

+349
-5
lines changed

.storybook/config.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import React from 'react';
22
import { addParameters, configure, addDecorator } from '@storybook/react';
33
import { create } from '@storybook/theming';
4-
import GlobalStylesDecorator from './decorator/global-styles';
4+
import { withPerformance } from 'storybook-addon-performance';
5+
import GlobalStylesDecorator from './custom-decorators/global-styles';
56
// adding css reset - storybook includes a css loader
67
import '@atlaskit/css-reset';
78
import { colors } from '@atlaskit/theme';
@@ -24,6 +25,7 @@ addParameters({
2425

2526
// Using theme would be good for this, but it looks like theme is just for the chrome around the story
2627
addDecorator(GlobalStylesDecorator);
28+
addDecorator(withPerformance);
2729

2830
// automatically import all files ending in *.stories.js
2931
const req = require.context('../stories/', true, /.stories.js$/);
@@ -40,7 +42,8 @@ const table = Object.prototype.hasOwnProperty.call(console, 'table')
4042
: console.log;
4143

4244
// Generated by: http://patorjk.com/software/taag/#p=display&f=ANSI%20Shadow&t=rbd
43-
console.log(`%c
45+
console.log(
46+
`%c
4447
██████╗ ██████╗ ██████╗
4548
██╔══██╗██╔══██╗██╔══██╗
4649
██████╔╝██████╔╝██║ ██║
@@ -49,7 +52,10 @@ console.log(`%c
4952
╚═╝ ╚═╝╚═════╝ ╚═════╝
5053
5154
%cBeautiful and accessible drag and drop
52-
`, `color: ${colors.G200}; font-size: 1.2em; font-weight: bold;`, `color: ${colors.P200}; font-size: 1.2em; font-weight: bold;`);
55+
`,
56+
`color: ${colors.G200}; font-size: 1.2em; font-weight: bold;`,
57+
`color: ${colors.P200}; font-size: 1.2em; font-weight: bold;`,
58+
);
5359

5460
table([
5561
['react-beautiful-dnd version', version],

.storybook/main.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
addons: ['storybook-addon-performance/register'],
3+
};

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@
132132
"rollup-plugin-size-snapshot": "^0.11.0",
133133
"rollup-plugin-strip": "^1.2.2",
134134
"rollup-plugin-terser": "^5.2.0",
135+
"storybook-addon-performance": "^0.7.0",
135136
"styled-components": "5.0.0",
136137
"stylelint": "^13.0.0",
137138
"stylelint-config-prettier": "^8.0.1",

0 commit comments

Comments
 (0)