vazco / uniforms

A React library for building forms from any schema.
https://uniforms.tools
MIT License
1.96k stars 244 forks source link

Uniforms v2 compatible with AntD v4? #696

Closed oprobst88 closed 4 years ago

oprobst88 commented 4 years ago

Thanks for this awesome library. It is part of my daily work. I am currently switching to Ant Design v4. I startet a small test project using the current stable uniforms lib:

It seems everything is fine. Do you already spotted a bug/issue wrt to Ant Design v4?

Thanks for a quick reply. Regards, Oliver

radekmie commented 4 years ago

Hi @oprobst88! AntD@4 is still quite new and I haven't got time to check it out - both by using it nor reading through the migration guide. If you say that it just works - that's great.

If you want to help, download the repo, bump the AntD version and run tests - if everything is fine, we are set. If not, submit a PR and we'll work on it from there. If you don't have time or resources to do so - we'll need some time for it, as we're focused on making v3 usable.

oprobst88 commented 4 years ago

That is a pretty good idea. Report:

Uniforms

  1. Project cloned.
  2. npm install
added 2592 packages from 1154 contributors and audited 942223 packages in 153.188s

59 packages are looking for funding
  run `npm fund` for details

found 39545 vulnerabilities (39535 low, 10 high)
  run `npm audit fix` to fix them, or `npm audit` for details
  1. npm test
Test Suites: 175 passed, 175 total
Tests:       1681 passed, 1681 total
Snapshots:   0 total
Time:        41.461s
Ran all test suites.
  1. npm outdated
@babel/plugin-proposal-class-properties           7.5.5           7.5.5           7.8.3  uniforms-repository
@babel/polyfill                                   7.4.4           7.4.4           7.8.7  uniforms-repository
@babel/preset-env                                 7.5.5           7.5.5           7.9.0  uniforms-repository
@babel/preset-react                               7.0.0           7.0.0           7.9.4  uniforms-repository
@babel/preset-typescript                          7.3.3           7.3.3           7.9.0  uniforms-repository
@docusaurus/core                         2.0.0-alpha.43  2.0.0-alpha.43  2.0.0-alpha.40  uniforms-repository
@docusaurus/preset-classic               2.0.0-alpha.43  2.0.0-alpha.43  2.0.0-alpha.40  uniforms-repository
@material-ui/core                                 4.6.0           4.6.0           4.9.7  uniforms-repository
@material-ui/icons                                4.5.1           4.5.1           4.9.1  uniforms-repository
@types/classnames                                 2.2.9           2.2.9          2.2.10  uniforms-repository
@types/enzyme                                    3.10.3          3.10.3          3.10.5  uniforms-repository
@types/invariant                                 2.2.30          2.2.30          2.2.31  uniforms-repository
@types/jest                                     24.0.17         24.0.17          25.1.4  uniforms-repository
@types/lodash                                  4.14.136        4.14.136        4.14.149  uniforms-repository
@typescript-eslint/eslint-plugin                  2.6.1           2.6.1          2.25.0  uniforms-repository
@typescript-eslint/parser                         2.6.1           2.6.1          2.25.0  uniforms-repository
ajv                                              6.10.0          6.10.0          6.12.0  uniforms-repository
antd                                             3.19.5          3.19.5           4.0.4  uniforms-repository
babel-eslint                                     10.0.3          10.0.3          10.1.0  uniforms-repository
core-js                                           3.2.1           3.2.1           3.6.4  uniforms-repository
enzyme                                           3.10.0          3.10.0          3.11.0  uniforms-repository
enzyme-adapter-react-16                          1.14.0          1.14.0          1.15.2  uniforms-repository
eslint                                            6.6.0           6.6.0           6.8.0  uniforms-repository
eslint-config-prettier                            6.5.0           6.5.0          6.10.1  uniforms-repository
eslint-plugin-import                             2.18.2          2.18.2          2.20.1  uniforms-repository
eslint-plugin-prettier                            3.1.1           3.1.1           3.1.2  uniforms-repository
eslint-plugin-react                              7.16.0          7.16.0          7.19.0  uniforms-repository
graphql                                          14.4.2          14.6.0          14.6.0  uniforms-repository
husky                                             2.4.1           2.4.1           4.2.3  uniforms-repository
jest                                             24.8.0          24.8.0          25.2.3  uniforms-repository
lerna                                            3.15.0          3.15.0          3.20.2  uniforms-repository
lint-staged                                       9.2.1           9.2.1          10.0.9  uniforms-repository
prettier                                         1.18.2          1.18.2           2.0.2  uniforms-repository
react                                            16.8.6          16.8.6         16.13.1  uniforms-repository
react-dom                                        16.8.6          16.8.6         16.13.1  uniforms-repository
react-frame-component                             4.1.0           4.1.0           4.1.1  uniforms-repository
react-test-renderer                              16.8.6          16.8.6         16.13.1  uniforms-repository
rimraf                                            2.6.3           2.6.3           3.0.2  uniforms-repository
simpl-schema                                      1.5.5           1.5.7           1.5.7  uniforms-repository
stylelint                                        10.1.0          10.1.0          13.2.1  uniforms-repository
stylelint-config-prettier                         5.2.0           5.2.0           8.0.1  uniforms-repository
stylelint-prettier                                1.1.1           1.1.1           1.1.2  uniforms-repository
tslib                                            1.10.0          1.11.1          1.11.1  uniforms-repository
typescript                                        3.7.2           3.7.2           3.8.3  uniforms-repository
  1. npm install antd@latest

  2. npm test

Test Suites: 16 failed, 159 passed, 175 total
Tests:       169 failed, 1512 passed, 1681 total
Snapshots:   0 total
Time:        34.175s
Ran all test suites.
oprobst88 commented 4 years ago

Simply bumping antd does not work :-(

oprobst88 commented 4 years ago

I've tried to bump react as well, because antd says >=16.9.0. Then, some code changes are required (e.g. icon component). Afterwards, running tests cannot be executed. An error occurs:

tsc --build --incremental tsconfig.build.json

node_modules/rc-field-form/lib/Form.d.ts:18:27 - error TS2694: Namespace 'React' has no exported member 'ForwardRefRenderFunction'.

18 declare const Form: React.ForwardRefRenderFunction<FormInstance, FormProps>;

I am not good at those dependency management errors, but I think antd pulls rc-field-form into the dependency tree.

Do you have a clue?

oprobst88 commented 4 years ago

Sorry for the mess. I think a fixed most of the migration tasks. Basically, the icon is now a component and not a string. May I ask you to have a look for my PR?