Skip to content

Commit

Permalink
docs(migration): added migration instructions for ProsePre, ProseCode…
Browse files Browse the repository at this point in the history
…, and ProseCodeInline (#2892)
  • Loading branch information
JessicaSachs authored Dec 7, 2024
1 parent 2bb8875 commit 1a364f5
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions docs/content/docs/1.getting-started/4.migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ Here is the list of breaking changes in Content v3:
- `searchContent()` is dropped in favor of new api `queryCollectionSearchSections`
- Full text search can easily be done using this API See [Full-Text Search Snippets](/docs/advanced/fulltext-search)
- `useContentHelpers()` is removed
- We consolidated the `ProsePre`, `ProseCode`, and `ProseCodeInline` components
- `ProseCodeInline` is now `ProseCode`
- `ProseCode` is now `ProsePre`

## Implement Document Driven mode in v3

Expand Down Expand Up @@ -97,3 +100,15 @@ const v3Surround = await queryCollectionItemSurroundings(
}
)
```

## Consolidate `ProsePre`, `ProseCode`, and `ProseCodeInline` components

Many `ProsePre` components are thin wrappers around the `ProseCode` component. We've consolidated these three components into two components. There is now no difference between `ProsePre` and multi-line code blocks.

1. MDC will now map and parse single backticks ``` as `ProseCode` instead of `ProseCodeInline`.
2. Block code examples (starting with three backticks) will now be mapped to the `ProsePre` component.

Suggested Changes
1. Your _current_ `ProseCode` logic should be moved to `ProsePre`
2. Rename your `ProseCodeInline` component to `ProseCode`

0 comments on commit 1a364f5

Please sign in to comment.