AshoneA / antd-form-migration

A tool for automatic migrate your Ant Design form v3 to v4
7 stars 0 forks source link

Merge to codemod-v4? #1

Open afc163 opened 4 years ago

afc163 commented 4 years ago

https://github.com/ant-design/codemod-v4

作为一个选项开启。

AshoneA commented 4 years ago

好,我有空看下能不能改动下弄进去。

AshoneA commented 4 years ago

@afc163 放到这里来了 https://github.com/AshoneA/codemod-v4/blob/feat/migrate-form/README.md#migrate-your-form-v3-to-v4

https://github.com/AshoneA/codemod-v4/commit/2f672553a8c2d0a91c516080b1ac2f663b7a4eb7

大概操作如readme所写,因为旧版Form不能完全兼容新版Form,所以感觉以一个单独的命令(单纯执行迁移form)开启会比较好。后面再完善下细节(测试用例之类),整理代码(第一次用这个jscodeshift,代码写的有点乱)之后再给merge到codemod-v4

AshoneA commented 4 years ago

https://github.com/ant-design/codemod-v4/pull/73

conkyliu commented 4 years ago

能不能加个 全局删除export default Form.create()(DepartmentModal);

AshoneA commented 4 years ago

@conkyliu 后面可能迁移到官方的迁移工具上面,支持替换export default Form.create()(DepartmentModal)export default DepartmentModal https://github.com/ant-design/codemod-v4/pull/73