Skip to content

Commit

Permalink
Docs(v3): Add migration guide for Heading elementType prop
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelklibani committed Oct 9, 2024
1 parent 53531b1 commit 6a4fae6
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
26 changes: 26 additions & 0 deletions docs/migrations/web-react/MIGRATION-v3.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,32 @@ Manually replace the props in your project.
- `<ButtonLink isSquare … />``<ButtonLink isSymmetrical … />`
</details>

### Heading elementType prop is now mandatory

The `Heading` component previously had a default `elementType` of `"div"`.
We've removed this default to encourage developers to explicitly choose a more appropriate semantic HTML element.

#### Migration Guide

🪄 Use codemods to automatically update your codebase:

```sh
npx @lmc-eu/spirit-codemods -p <path> -t v3/web-react/heading-elementType-prop
```

👉 See [Codemods documentation][readme-codemods] for more details.

⚠️ This codemod will add `elementType="div"` where it's missing.
**We highly recommend reviewing these changes and updating them to use the most appropriate semantic HTML elements.**

<details>
<summary>🔧 Manual Migration Steps</summary>

Manually replace the props in your project.

- `<Heading … />``<Heading elementType="{/* Your semantic HTML element here */}" … />`
</details>

---

Please refer back to these instructions or reach out to our team if you encounter any issues during migration.
Expand Down
9 changes: 9 additions & 0 deletions docs/migrations/web-twig/MIGRATION-v4.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@ Button `isSquare` prop was renamed to `isSymmetrical`.
- `<Button isSquare … />``<Button isSymmetrical … />`
- `<ButtonLink isSquare … />``<ButtonLink isSymmetrical … />`

### Heading elementType prop is now mandatory

The `Heading` component previously had a default `elementType` of `"div"`.
We've removed this default to encourage developers to explicitly choose a more appropriate semantic HTML element.

#### Migration Guide

- `<Heading … />``<Heading elementType="{/* Your semantic HTML element here */}" … />`

---

Please refer back to this guide or reach out to our team if you encounter any issues during migration.
Expand Down

0 comments on commit 6a4fae6

Please sign in to comment.