mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-27 12:39:49 +08:00
Page:
v5 API 废弃流程
Pages
API Naming rules
Ant Design 设计基础简版
CSS in JS 迁移指南
Code convention for antd
Collaborators
Configuration for Documentation and Demo
Cookbook
Development
Document types conventions
FAQ
Home
PR principle
PR 规范
Template for Bug Report in IE8 9
Unique Panel Component
v5 API 废弃流程
什么是最小化重现,为什么这是必需的?
老版本和beta版本文档发布流程
设计文档上传流程
轮值规则和版本发布流程
This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
废弃警告
基于 feature
开启新的 branch。
TS 废弃提示
interface SampleProps {
// ...
/** @deprecated `propOld` is deprecated which will be removed in next major version. Please use `propNew` instead. */
propOld?: string;
propNew?: string;
}
console 废弃提示与兼容
const Sample = (props) => {
const { propOld, propNew, ...restProps } = props;
warning(!propOld, 'Sample', '`propOld` is deprecated which will be removed in next major version. Please use `propNew` instead.');
return <Component prop={propNew ?? propOld} {...restProps} />;
}
补充对应 test case:
it('deprecated warning', () => {
const errSpy = jest.spyOn(console, 'error').mockImplementation(() => {});
render(<Sample propOld="xxx" />);
expect(errSpy).toHaveBeenCalledWith('xxxxxxxx');
errSpy.mockRestore();
});
🚨🚨🚨 注意:不要删除或者修改原本的测试用例,总是新增测试用例以防止改动 Break 原本用法 🚨🚨🚨
文档更新
在 Demo 的 markdown 文件中搜索对应 prop,将其替换为最新 prop。
在组件文档中,搜索对应 prop 将其替换为最新 prop,🔥🔥🔥 并添加下一个 minor 版本版本号 🔥🔥🔥。
发起 PR
向 feature
branch 发起 PR。
V5 版本移除
上述 PR 合并后,在 next
branch 中,开新的 PR 移除该接口并且在 v5-note.md
中记录变更:
Sample 组件
dropdownClassName
替换为popupClassName
兼容包
兼容组件
在 https://github.com/ant-design/compatible 中,参考 AutoComplete 添加对应 TS 定义 以及 warning 信息。
导出组件
在 src/index.tsx
中导出组件:
export { default as Select } from './SelectBase';
export { default as AutoComplete } from './AutoComplete';
添加测试
参考 AutoComplete 添加对应测试用例。
- Home
- Cookbook
- FAQ
- Template for Bug Report in IE8 9
- Contributing
- Maintaining
- Design