argoproj / argo-ui

Argoproj shared React components
Apache License 2.0
220 stars 178 forks source link

Replace custom components with `antd` components #553

Closed agilgur5 closed 3 months ago

agilgur5 commented 3 months ago

Motivation

Reduce the scope of this component library, reduce its bundle size, use more tooling from the UI libraries we import, and have more consistent styling with that UI library. Should help with #453

We already use antd, let's use its components everywhere instead of having custom components in some places. At the very least, if we need custom functionality, we can wrap the antd components.

Also would be good to remove foundation-sites since that's another (dated) UI library and standardize on antd

Use Cases

A few components that can be replaced from a quick glance:

  1. AutoComplete
  2. Checkbox
  3. Dropdown
  4. Form
  5. Notification
  6. Popup -> Popover / Popconfirm / Modal / Alert
  7. Select
  8. SlidingPanel -> Drawer
  9. Tabs
  10. Tooltip

Probably several others too

agilgur5 commented 3 months ago

We already use antd

Oh this might not be correct actually. It's only used in ./antd and nowhere else. That might explain how #387 managed to work.

Huh, I guess Workflows might not use antd at all, just installs it with argo-ui but does not end up bundling it

Also would be good to remove foundation-sites since that's another (dated) UI library and standardize on antd

I think that also means that these two UI libraries don't actually overlap? We are using foundation-sites but not antd

agilgur5 commented 3 months ago

Indeed there aren't even any components in ./antd, there are only Storybook stories 😕

Apparently it was supposed to be used in v2: https://github.com/argoproj/argo-ui/pull/161#pullrequestreview-820560829, but that never happened (been 2.5 years since then now 😕)

Given that it's all unused code and unused deps, and complicates the build unnecessarily (another Storybook build, Less and Gulp usage for some reason, etc), and given the state of this repo per #453, I'm actually pretty inclined to remove it entirely.

What we may want to do in the future, per #453, is to switch all Argoproj UIs to use antd or another component library (foundation-sites is more a CSS library; there might be a wrapper component library but it's dated in any case) directly instead of via argo-ui.

CD and Workflows don't use antd at all right now. Rollouts does, but it of course does not import antd components from this library since they don't exist. Rollouts is perhaps partially an example of what CD and Workflows should move to (only partially since it does still use argo-ui in some places).

agilgur5 commented 3 months ago

Closing as unplanned due to deprecation