-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #243 from oceanbase/dengfuping-dev
feat(docs): Add auto migration docs for @oceanbase/design, @oceanbase/ui and @oceanbase/charts
- Loading branch information
Showing
5 changed files
with
85 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,28 @@ | ||
--- | ||
title: 从 Ant Design Charts 迁移 | ||
title: 从 @ant-design/charts 迁移 | ||
order: 10 | ||
group: 可视化图表 | ||
--- | ||
|
||
OceanBase Charts 与 AntV 设计体系一脉相承,完全兼容 [Ant Design Charts](https://charts.ant.design) 的能力和 API。两者仅在图表样式、交互和部分扩展能力上存在差异,因此只需简单替换模块入口,即可从 Ant Design Charts 平滑迁移至 OceanBase Charts。 | ||
|
||
## 自动化迁移 | ||
|
||
- 使用 [@oceanbase/codemod](https://github.com/oceanbase/oceanbase-design/tree/master/packages/codemod) 可以从 `@ant-design/charts` 一键迁移到 `@oceanbase/charts`: | ||
|
||
```shell | ||
# Run directly through npx | ||
# `src` is the target directory or file that you want to transform. | ||
npx -p @oceanbase/codemod codemod src | ||
# options | ||
# --disablePrettier // disable prettier | ||
``` | ||
|
||
## 手动迁移 | ||
|
||
```diff | ||
- import { xxx } from '@ant-design/charts'; | ||
+ import { xxx } from '@oceanbase/charts'; | ||
``` | ||
|
||
作为 OceanBase 的图表最佳实践,大多数情况下,只需指定数据相关属性、无需定制图表样式和交互,即可保证最佳展示效果。因此迁移至 OceanBase Charts 后,如无必要,建议去掉自定义样式,直接使用默认样式和交互即可。 | ||
作为 OceanBase 的图表最佳实践,大多数情况下,只需指定数据相关属性、无需定制图表样式和交互,即可保证最佳展示效果。因此迁移至 OceanBase Charts 后,如无必要,建议去掉自定义样式,使用默认样式和交互即可。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
title: 从 antd 迁移 | ||
order: 5 | ||
group: 基础组件 | ||
--- | ||
|
||
OceanBase Design 与 Ant Design 设计体系一脉相承,完全兼容 [Ant Design](https://ant.design) 的能力和 API。两者仅在组件主题、样式和扩展能力上存在差异,因此只需简单替换模块入口,即可从 Ant Design 平滑迁移至 OceanBase Design。 | ||
|
||
## 自动化迁移 | ||
|
||
- 使用 [@oceanbase/codemod](https://github.com/oceanbase/oceanbase-design/tree/master/packages/codemod) 可以从 `antd` 一键迁移到 `@oceanbase/design`: | ||
|
||
```shell | ||
# Run directly through npx | ||
# `src` is the target directory or file that you want to transform. | ||
npx -p @oceanbase/codemod codemod src | ||
# options | ||
# --disablePrettier // disable prettier | ||
``` | ||
|
||
## 手动迁移 | ||
|
||
```diff | ||
- import { xxx } from 'antd'; | ||
- import { xxx } from 'antd/es/button'; | ||
+ import { xxx } from '@oceanbase/design'; | ||
+ import { xxx } from '@oceanbase/design/es/button'; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
title: 从 @alipay/ob-ui 迁移 | ||
order: 6 | ||
group: 基础组件 | ||
--- | ||
|
||
内部包 `@alipay/ob-ui` 由于包含多种类型的组件,不便于管理和使用。因此在对外开源时,将其拆分成了 `@oceanbase/design` 基础组件库和 `@oceanbase/ui` 业务组件库,且有一定的不兼容变更,建议使用我们提供的自动化工具进行迁移。 | ||
|
||
## 自动化迁移 | ||
|
||
- 使用 [@oceanbase/codemod](https://github.com/oceanbase/oceanbase-design/tree/master/packages/codemod) 可以从 `@alipay/ob-ui` 一键迁移到 `@oceanbase/design`: | ||
|
||
```shell | ||
# Run directly through npx | ||
# `src` is the target directory or file that you want to transform. | ||
npx -p @oceanbase/codemod codemod src | ||
# options | ||
# --disablePrettier // disable prettier | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
title: 从 @alipay/ob-ui 迁移 | ||
order: 6 | ||
group: 业务组件 | ||
--- | ||
|
||
内部包 `@alipay/ob-ui` 由于包含多种类型的组件,不便于管理和使用。因此在对外开源时,将其拆分成了 `@oceanbase/design` 基础组件库和 `@oceanbase/ui` 业务组件库,且有一定的不兼容变更,建议使用我们提供的自动化工具进行迁移。 | ||
|
||
## 自动化迁移 | ||
|
||
- 使用 [@oceanbase/codemod](https://github.com/oceanbase/oceanbase-design/tree/master/packages/codemod) 可以从 `@alipay/ob-ui` 一键迁移到 `@oceanbase/ui`: | ||
|
||
```shell | ||
# Run directly through npx | ||
# `src` is the target directory or file that you want to transform. | ||
npx -p @oceanbase/codemod codemod src | ||
# options | ||
# --disablePrettier // disable prettier | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters