Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Migrate to latest Storybook best-practices #5249

Closed
sunyatasattva opened this issue Nov 25, 2021 · 0 comments · Fixed by #5264
Closed

Migrate to latest Storybook best-practices #5249

sunyatasattva opened this issue Nov 25, 2021 · 0 comments · Fixed by #5264
Assignees
Labels
skip-changelog PRs that you don't want to appear in the changelog. type: refactor The issue/PR is related to refactoring. type: technical debt This issue/PR represents/solves the technical debt of the project.

Comments

@sunyatasattva
Copy link
Contributor

sunyatasattva commented Nov 25, 2021

Storybook 6 has introduced various improvements and deprecations. The goal of this issue is to migrate our current implementation to take advantage of everything that has been added and streamline the process of component/stories creation.

In particular:

…and more.

@sunyatasattva sunyatasattva self-assigned this Nov 25, 2021
@sunyatasattva sunyatasattva added type: refactor The issue/PR is related to refactoring. skip-changelog PRs that you don't want to appear in the changelog. type: technical debt This issue/PR represents/solves the technical debt of the project. labels Nov 25, 2021
sunyatasattva added a commit that referenced this issue Nov 26, 2021
Previously our Babel configuration conflicted with the one provided by
default by Storybook, making us unable to leverage the automatic
detection of properties from both JS and TS components to create
controls (formerly known as knobs).

Upgrading to 6.4.0 fixes a bug that makes it easier to work with
Babel configurations. Also done here:

* Removed a few deprecated addons in favor of the replacement ones
bundled within Storybook Essentials.
* Add auto-detection of certain control types depending on the property names
* Add support for TS stories

More context: storybookjs/storybook#12292
sunyatasattva added a commit that referenced this issue Nov 26, 2021
Previously our Babel configuration conflicted with the one provided by
default by Storybook, making us unable to leverage the automatic
detection of properties from both JS and TS components to create
controls (formerly known as knobs).

Upgrading to 6.4.0 fixes a bug that makes it easier to work with
Babel configurations. Also done here:

* Removed a few deprecated addons in favor of the replacement ones
bundled within Storybook Essentials.
* Add auto-detection of certain control types depending on the property names
* Add support for TS stories

More context: storybookjs/storybook#12292
sunyatasattva added a commit that referenced this issue Dec 1, 2021
Stories include:

* Default generic error
* API error
* Unknown error
* Error without possibility to retry
* Base Error atom

Where applicable, the **Retry** button will not only trigger the appropriate
action, but also simulate the loading state of the error component.
sunyatasattva added a commit that referenced this issue Dec 1, 2021
…) (#5264)

* Migrate Storybook to 6.4.0 and enable auto-detection of controls (#5249)

Previously our Babel configuration conflicted with the one provided by
default by Storybook, making us unable to leverage the automatic
detection of properties from both JS and TS components to create
controls (formerly known as knobs).

Upgrading to 6.4.0 fixes a bug that makes it easier to work with
Babel configurations. Also done here:

* Removed a few deprecated addons in favor of the replacement ones
bundled within Storybook Essentials.
* Add auto-detection of certain control types depending on the property names
* Add support for TS stories

More context: storybookjs/storybook#12292

* Use `react-docgen` only in development environments

This should reduce production bundle size dramatically. The only
problem here is that Storybook runs its `build` command with the
`NODE_ENV` set to `production`. For this reason, we change the
script to provide `BABEL_ENV` set to `development` to still make sure
the correct configuration is loaded, while trying to reduce any
side-effects on changing the whole `NODE_ENV`.
sunyatasattva added a commit that referenced this issue Dec 1, 2021
Stories include:

* Default generic error
* API error
* Unknown error
* Error without possibility to retry
* Base Error atom

Where applicable, the **Retry** button will not only trigger the appropriate
action, but also simulate the loading state of the error component.
sunyatasattva added a commit that referenced this issue Dec 2, 2021
* Convert `ErrorPlaceholder` and `ErrorMessage` to TypeScript

* Add stories for `ErrorPlaceholder` and `ErrorMessage` (#5255)

Stories include:

* Default generic error
* API error
* Unknown error
* Error without possibility to retry
* Base Error atom

Where applicable, the **Retry** button will not only trigger the appropriate
action, but also simulate the loading state of the error component.

* Update references to `ErrorMessage` component to leave the file extension out

Fix #5255
Refs #5249
jonny-bull pushed a commit to jonny-bull/woocommerce-gutenberg-products-block that referenced this issue Dec 14, 2021
…commerce#5249) (woocommerce#5264)

* Migrate Storybook to 6.4.0 and enable auto-detection of controls (woocommerce#5249)

Previously our Babel configuration conflicted with the one provided by
default by Storybook, making us unable to leverage the automatic
detection of properties from both JS and TS components to create
controls (formerly known as knobs).

Upgrading to 6.4.0 fixes a bug that makes it easier to work with
Babel configurations. Also done here:

* Removed a few deprecated addons in favor of the replacement ones
bundled within Storybook Essentials.
* Add auto-detection of certain control types depending on the property names
* Add support for TS stories

More context: storybookjs/storybook#12292

* Use `react-docgen` only in development environments

This should reduce production bundle size dramatically. The only
problem here is that Storybook runs its `build` command with the
`NODE_ENV` set to `production`. For this reason, we change the
script to provide `BABEL_ENV` set to `development` to still make sure
the correct configuration is loaded, while trying to reduce any
side-effects on changing the whole `NODE_ENV`.
jonny-bull pushed a commit to jonny-bull/woocommerce-gutenberg-products-block that referenced this issue Dec 14, 2021
…ce#5294)

* Convert `ErrorPlaceholder` and `ErrorMessage` to TypeScript

* Add stories for `ErrorPlaceholder` and `ErrorMessage` (woocommerce#5255)

Stories include:

* Default generic error
* API error
* Unknown error
* Error without possibility to retry
* Base Error atom

Where applicable, the **Retry** button will not only trigger the appropriate
action, but also simulate the loading state of the error component.

* Update references to `ErrorMessage` component to leave the file extension out

Fix woocommerce#5255
Refs woocommerce#5249
jonny-bull pushed a commit to jonny-bull/woocommerce-gutenberg-products-block that referenced this issue Dec 16, 2021
…commerce#5249) (woocommerce#5264)

* Migrate Storybook to 6.4.0 and enable auto-detection of controls (woocommerce#5249)

Previously our Babel configuration conflicted with the one provided by
default by Storybook, making us unable to leverage the automatic
detection of properties from both JS and TS components to create
controls (formerly known as knobs).

Upgrading to 6.4.0 fixes a bug that makes it easier to work with
Babel configurations. Also done here:

* Removed a few deprecated addons in favor of the replacement ones
bundled within Storybook Essentials.
* Add auto-detection of certain control types depending on the property names
* Add support for TS stories

More context: storybookjs/storybook#12292

* Use `react-docgen` only in development environments

This should reduce production bundle size dramatically. The only
problem here is that Storybook runs its `build` command with the
`NODE_ENV` set to `production`. For this reason, we change the
script to provide `BABEL_ENV` set to `development` to still make sure
the correct configuration is loaded, while trying to reduce any
side-effects on changing the whole `NODE_ENV`.
jonny-bull pushed a commit to jonny-bull/woocommerce-gutenberg-products-block that referenced this issue Dec 16, 2021
…ce#5294)

* Convert `ErrorPlaceholder` and `ErrorMessage` to TypeScript

* Add stories for `ErrorPlaceholder` and `ErrorMessage` (woocommerce#5255)

Stories include:

* Default generic error
* API error
* Unknown error
* Error without possibility to retry
* Base Error atom

Where applicable, the **Retry** button will not only trigger the appropriate
action, but also simulate the loading state of the error component.

* Update references to `ErrorMessage` component to leave the file extension out

Fix woocommerce#5255
Refs woocommerce#5249
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
skip-changelog PRs that you don't want to appear in the changelog. type: refactor The issue/PR is related to refactoring. type: technical debt This issue/PR represents/solves the technical debt of the project.
Projects
None yet
1 participant