Skip to content

Commit

Permalink
feat(cart): add migration doc
Browse files Browse the repository at this point in the history
  • Loading branch information
dpellier committed Jul 29, 2024
1 parent ca821e8 commit 0321d35
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 3 deletions.
34 changes: 34 additions & 0 deletions packages/storybook/stories/components/cart/migration.from.17.x.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { Meta } from '@storybook/blocks';

<Meta title="ODS Components/User feedback/Cart/Migration From 17.x" />

# Cart - migrate from v17 to v18
----

Cart has been removed from ODS components. <img src="https://img.shields.io/badge/removed-FF0000" />

This component was too specific to a custom need and comes with quite a lot of downsides.

## Current component issues

### Performance & Complexity

The whole component was composed of 9 web-components, each with their own rendering lifecycle.

Each of those were relying on DOM queries to update their states accordingly to their parents/siblings, which
can become quite problematic performance-wise.

Also, in order to use this component, the integrators had to learn about the 9 different interfaces and all their possible combinations.

### Internal logic

ODS components tend to be presentational, thus the internal logic should be handled by the integrators.

The current implementation of Cart was trying to enforce some of the logic (e.g. quantity computation).

## How to use Cart in v18

This component is basically a very simple top-to-bottom layout, where each section can be rendered using `ods-text` or even
a simple text element. You can also use `ods-divider` to add some separation if needed.

All the colors and style properties can be found in the exposed design tokens.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Meta } from '@storybook/blocks';
# Content Addon - migrate from v17 to v18
----

Content Addon has been removed from ODS components.
Content Addon has been removed from ODS components. <img src="https://img.shields.io/badge/removed-FF0000" />

The same behaviour can be achieved with simple CSS.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Meta } from '@storybook/blocks';
# Flag - migrate from v17 to v18
----

Flag has been removed from ODS components.
Flag has been removed from ODS components. <img src="https://img.shields.io/badge/removed-FF0000" />

Using ODS Flag, pre V18, does require every project to setup a specific build configuration to be able to fetch the assets.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import * as PopoverStories from '../popover/popover.stories';
# Menu - migrate from v17 to v18
----

Menu has been removed from ODS components.
Menu has been removed from ODS components. <img src="https://img.shields.io/badge/removed-FF0000" />

The same component can be achieved with ods-popover.

Expand Down

0 comments on commit 0321d35

Please sign in to comment.