Skip to content

Commit

Permalink
feat(Storybook): Add performance addon
Browse files Browse the repository at this point in the history
  • Loading branch information
m7kvqbe1 committed May 13, 2022
1 parent 1bd082f commit af655ea
Show file tree
Hide file tree
Showing 4 changed files with 395 additions and 8 deletions.
1 change: 1 addition & 0 deletions packages/react-component-library/.storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ module.exports = {
'@storybook/addon-a11y',
'@storybook/addon-controls',
'@storybook/addon-actions',
'storybook-addon-performance/dist/cjs/register',
],
core: {
builder: 'webpack5',
Expand Down
2 changes: 2 additions & 0 deletions packages/react-component-library/.storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react'
import '@defencedigital/fonts'
import 'iframe-resizer/js/iframeResizer.contentWindow'
import { ResizeObserver } from '@juggle/resize-observer'
import { withPerformance } from 'storybook-addon-performance/dist/cjs'

import { GlobalStyleProvider } from '../src/styled-components/GlobalStyle'

Expand Down Expand Up @@ -60,4 +61,5 @@ export const parameters = {
export const decorators = [
// https://github.com/storybookjs/storybook/issues/15223#issuecomment-1092837912
(Story) => <GlobalStyleProvider>{Story()}</GlobalStyleProvider>,
withPerformance,
]
2 changes: 2 additions & 0 deletions packages/react-component-library/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
"@storybook/manager-webpack5": "^6.5.0-alpha.49",
"@storybook/react": "^6.5.0-alpha.49",
"@testing-library/jest-dom": "^5.16.2",
"@testing-library/dom": "^8.0.0",
"@testing-library/react": "^12.0.0",
"@testing-library/react-hooks": "^7.0.0",
"@testing-library/user-event": "^14.1.1",
Expand Down Expand Up @@ -129,6 +130,7 @@
"react-hook-form": "6.15.8",
"react-hot-loader": "^4.12.19",
"source-map-loader": "^3.0.0",
"storybook-addon-performance": "^0.16.1",
"styled-components": "^5.3.3",
"timezone-mock": "^1.1.3",
"typescript": "^4.1.2",
Expand Down

0 comments on commit af655ea

Please sign in to comment.