Skip to content

Commit f3149af

Browse files
authored
docs: add README for compat package (#6499)
1 parent d468b8a commit f3149af

File tree

2 files changed

+59
-1
lines changed

2 files changed

+59
-1
lines changed

docs/ReadMeCompat.mdx

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import { Footer, TableOfContent, FilterBarExample } from '@sb/components';
2+
import { Meta } from '@storybook/blocks';
3+
4+
<Meta title="Legacy Components / Docs" />
5+
6+
<TableOfContent />
7+
8+
# @ui5/webcomponents-react-compat
9+
10+
The `compat` (compatibility) package provides components that were removed in the v2 release but are still available for backwards compatibility.
11+
12+
Some of these components lack accessibility or design support, while others have been replaced by UI5 web components. In general, we recommend using components from this package only as a temporary solution.
13+
14+
## Component Support
15+
16+
Components in this package will not receive any new features. Only critical bugs, that are outside the component's inherent limitations, will be addressed. This package will be maintained until the next major release (which is not currently on our roadmap).
17+
18+
## Installation
19+
20+
```bash
21+
npm install @ui5/webcomponents-react-compat
22+
```
23+
24+
## Importing Components
25+
26+
As the v1 `ui5-table` (`Table`) component is part of this package and some custom element names are equal to the new v2 `ui5-table`, importing components from the root (`import { Table } from "@ui5/webcomponents-react-compat"`) is discouraged.
27+
The primary reason is that tree-shaking capabilities are limited in the default configurations of most bundlers. As a result, custom elements for the v1 table will still be defined, even if only the `Toolbar` is imported. This can cause unexpected behavior if the v2 table is also used in the same app.
28+
29+
**Please only import components from the file path!**
30+
31+
E.g.:
32+
33+
- `import { Table } from '@ui5/webcomponents-react-compat/dist/components/Table/index.js';`
34+
- `import { Toolbar } from '@ui5/webcomponents-react-compat/dist/components/Toolbar/index.js';`
35+
36+
**It is not supported using the v1 `Table` and the v2 `Table` in the same application!**
37+
38+
<Footer />

packages/compat/README.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,33 @@
11
# @ui5/webcomponents-react-compat
22

3-
React wrappers for the [@ui5/webcomponents-compat](https://www.npmjs.com/package/@ui5/webcomponents-compat) package.
3+
The `compat` (compatibility) package provides components that were removed in the v2 release but are still available for backwards compatibility.
4+
5+
Some of these components lack accessibility or design support, while others have been replaced by UI5 web components. In general, we recommend using components from this package only as a temporary solution.
6+
7+
## Component Support
8+
9+
Components in this package will not receive any new features. Only critical bugs, that are outside the component's inherent limitations, will be addressed. This package will be maintained until the next major release (which is not currently on our roadmap).
410

511
## Installation
612

713
```bash
814
npm install @ui5/webcomponents-react-compat
915
```
1016

17+
## Importing Components
18+
19+
As the v1 `ui5-table` (`Table`) component is part of this package and some custom element names are equal to the new v2 `ui5-table`, importing components from the root (`import { Table } from "@ui5/webcomponents-react-compat"`) is discouraged.
20+
The primary reason is that tree-shaking capabilities are limited in the default configurations of most bundlers. As a result, custom elements for the v1 table will still be defined, even if only the `Toolbar` is imported. This can cause unexpected behavior if the v2 table is also used in the same app.
21+
22+
**Please only import components from the file path!**
23+
24+
E.g.:
25+
26+
- `import { Table } from '@ui5/webcomponents-react-compat/dist/components/Table/index.js';`
27+
- `import { Toolbar } from '@ui5/webcomponents-react-compat/dist/components/Toolbar/index.js';`
28+
29+
**It is not supported using the v1 `Table` and the v2 `Table` in the same application!**
30+
1131
## Documentation
1232

1333
You can find an interactive documentation in our [Storybook](https://sap.github.io/ui5-webcomponents-react/) (Legacy Components).

0 commit comments

Comments
 (0)