-
Notifications
You must be signed in to change notification settings - Fork 515
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade antd to 4.24.13 #1734
Upgrade antd to 4.24.13 #1734
Conversation
Signed-off-by: Ansh Goyal <anshgoyal1704@gmail.com>
Signed-off-by: Ansh Goyal <anshgoyal1704@gmail.com>
Signed-off-by: Ansh Goyal <anshgoyal1704@gmail.com>
Signed-off-by: Ansh Goyal <anshgoyal1704@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This snapshot file is very very huge and is basically useless. I would try to remove snapshot testing from this, to introduce some expect statements
Signed-off-by: Ansh Goyal <anshgoyal1704@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Q: are any of these changes possible with antd 3.x, i.e. before the actual upgrade?
Not really, because most of these changes include type updates, which are supplied by antd 4.x. |
Signed-off-by: Ansh Goyal <anshgoyal1704@gmail.com>
Signed-off-by: Ansh Goyal <anshgoyal1704@gmail.com>
Signed-off-by: Ansh Goyal <anshgoyal1704@gmail.com>
Signed-off-by: Ansh Goyal <anshgoyal1704@gmail.com>
Signed-off-by: Ansh Goyal <anshgoyal1704@gmail.com>
Signed-off-by: Ansh Goyal <anshgoyal1704@gmail.com>
Signed-off-by: Ansh Goyal <anshgoyal1704@gmail.com>
Signed-off-by: Ansh Goyal <anshgoyal1704@gmail.com>
Signed-off-by: Ansh Goyal <anshgoyal1704@gmail.com>
Signed-off-by: Ansh Goyal <anshgoyal1704@gmail.com>
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #1734 +/- ##
==========================================
- Coverage 96.31% 96.26% -0.06%
==========================================
Files 239 239
Lines 7492 7495 +3
Branches 1964 1964
==========================================
- Hits 7216 7215 -1
- Misses 276 280 +4
☔ View full report in Codecov by Sentry. |
@yurishkuro |
There are some known significant visual changes in v4, which I haven't modified, like the Header Dropdown for |
This is why I don't like this lock step upgrade that requires a huge PR. It would be easier if we could do changes component by component. If you know the "known" changes, let's list then and decide one by one. |
Are you certain that there were no intermediate versions of antd where both old and new style components were available? Usually frameworks give a grace period for upgrades where old way is deprecated (and logs warnings) but is still working, precisely to allow for this kind of situation where a big bang upgrade is too large to do in a single change. |
Yes. Most probably, I checked that by manually installing the initial few versions of antd v4, ranging from Here's that quick analysis: 4.12.3 issue persists all over The header thing looked easy to tackle so, I changed that too in the v4.23.13, as, a few other things were breaking in the v4.1.0 |
Signed-off-by: Ansh Goyal <anshgoyal1704@gmail.com>
Signed-off-by: Ansh Goyal <anshgoyal1704@gmail.com>
@yurishkuro https://gist.github.com/anshgoyalevil/6081a14efbc9c7defa436a3a96263c0d |
Signed-off-by: Ansh Goyal <anshgoyal1704@gmail.com>
Do you mean compile errors? If there are minimal errors in earlier versions, could we split this PR and merge in phases? |
cc @mmorel-35 I remember you mentioned incremental upgrades of some deps to have more narrow scope of changes, was it for antd or other deps? |
Yes, we could do that too. There are some compile errors, as well as some UI changes, like Monitor page's grid view. Would have to start all over, to determine the exact changes, to split into multiple PRs. Should I close this PR and create a narrow PR? As it would be somewhat difficult to go back in these changes and check. |
How big of a change would be needed to go to antd/v4.0.0 as the first step? How many components would not compile or would not work correctly? |
Can't exactly say that currently. Will update here asap. |
I just checked the whole scenario at v4.0.0, and here's an overview:
Which components are same as per the main branch? [1]
Can we narrow down the scope of this PR:
|
I'm not sure. But, concerning antd migration, the guide seems to have a long todo list. They even have a codemod cli to help on that task from I can read. |
@yurishkuro Any views upon this? #1734 (comment) |
It seems the basic prep they suggest is to move to the latest 3.x version and make sure that no deprecation warnings are showing. I assume they may have added new things in 3.x already while supporting the old behaviors. If that's the case then we can probably make some incremental changes before 4.x upgrade? |
So here's what I got so far:
What can we do before this PR?
Here's how I would be going:
|
## Which problem is this PR solving? - This PR is a part of the antd v3 to v4 process - Related to #1734 ## Description of the changes - This PR adds a ant-design/compatible package to make form work with the antd v4. Since antd v4 introduces some breaking changes with respect to redux, and redux-form. - The nested grids are fixed ## How was this change tested? - Manually as well as automated testing ## What's next? - The antd lib would need to be upgraded to v4.0.0 to fix type errors ## Checklist - [x] I have read https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md - [x] I have signed all commits - [x] I have added unit tests for the new functionality - [x] I have run lint and test steps successfully - for `jaeger`: `make lint test` - for `jaeger-ui`: `yarn lint` and `yarn test` Signed-off-by: Ansh Goyal <anshgoyal1704@gmail.com>
## Which problem is this PR solving? - part of: #1734 - This PR is a part of upgrading antd to latest version of 4.x ## Description of the changes - Disabled the NavBar hover effect which was un-necessarily introduced - NavBar's height was increased internally. Fixed it to match previous height (48px) - The Monitor -> EmptyPage was using the offsets to align content to the center, but it is not required now, as it is a default behavior - `SorterResult` API is removed, so used lodash in place of that - `CompareFn` typedef is no longer required - Mocked the `window.matchMedia`, since some tests were using it - `dataIndex` now requires an array instead of nested string. Ex: `"abc.def.ghi"` -> `["abc", "def", "ghi"]` - Tests are updated according to these changes - Snapshots are updated according to internal changes in components ## How was this change tested? - Manually, and using automated testing ## What's next? - In the next PRs, the antd would be upgraded to 4.20.0 (or higher), to minimise the changes in a single PR. - New type errors would be introduced thereby, like NumberInput lookback changes, etc. ## Checklist - [x] I have read https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md - [x] I have signed all commits - [x] I have added unit tests for the new functionality - [x] I have run lint and test steps successfully - for `jaeger`: `make lint test` - for `jaeger-ui`: `yarn lint` and `yarn test` --------- Signed-off-by: Ansh Goyal <anshgoyal1704@gmail.com>
## Which problem is this PR solving? - part of the upgrade process of ant-design - related to: #1734 ## Description of the changes - This PR fixes NavBar's dropdown "About Jaeger" which was changed due to some internal changes in antd v4.16.0 ## How was this change tested? - Manually, and automated testing ## What's Next? - antd would be upgraded to latest version of v4.x ## Checklist - [x] I have read https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md - [x] I have signed all commits - [x] I have added unit tests for the new functionality - [x] I have run lint and test steps successfully - for `jaeger`: `make lint test` - for `jaeger-ui`: `yarn lint` and `yarn test` --------- Signed-off-by: Ansh Goyal <anshgoyal1704@gmail.com>
## Which problem is this PR solving? - part of: #1734 - part of the ant-design dependency upgrade process ## Description of the changes - This PR changes the type from `Input` to `InputRef` as per antd typescript changes. - InputNumber now guarantees the type of input to be `number | null` which was previously `string | number | undefined` - Tests related to these change are updated accordingly. ## How was this change tested? - manually, and automated testing ## What's next? - This is the final PR for antd upgrade to version 4. ## Checklist - [x] I have read https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md - [x] I have signed all commits - [x] I have added unit tests for the new functionality - [x] I have run lint and test steps successfully - for `jaeger`: `make lint test` - for `jaeger-ui`: `yarn lint` and `yarn test` --------- Signed-off-by: Ansh Goyal <anshgoyal1704@gmail.com>
Which problem is this PR solving?
antd
tov4.24.13 (Latest as of 28-08-2023
Description of the changes
window.matchMedia
API is not provided by jsdom, so custom mocking logic needs to be in placedataIndex
now requires an array of keys to work with tables with nested keys.antd/compatible
library is used to make forms work with the existing librariesMost of the suggestions have been taken up from the PR #1261, thanks to @mszabo-wikia
Checklist
jaeger
:make lint test
jaeger-ui
:yarn lint
andyarn test