Repository navigation
ui: remove dead antd styles, selectors, tests and packages (backport 2.1) - #36552
Conversation
* ui: remove dead antd styles, selectors, tests and packages Nothing renders antd any more, so .ant-* LESS rules that target classes no component emits are deleted, along with the dead .ant-* checks in TSX, the antd mocks and assertions in unit tests, the no-op antd selectors in Playwright, and the unused rc-picker and react-antd-column-resize packages. Classes OSS still emits itself (ant-form-item-explain-error, ant-select-selection-item, ant-typography-ellipsis-custom, ant-layout-content, ant-space-authMechanism) keep their rules, and antd-master.less stays, so nothing renders differently. * ui: format, prune playwright suppressions and lower the corpus count * ui: drop comments left behind by removed antd rules * ui: keep the antd sidebar popup wait and update the Playwright handbook * ui: remove the antd package, antd-master.less and the antd ESLint rules antd's global element reset, the --ant-* defaults and the rules for the two ant-* class names still rendered move to src/styles/legacy-base.css, compiled with variables.less so the emitted global CSS is unchanged. The rest of antd-master.less becomes master.less. rc-virtual-list is now a direct dependency, the rc-* type imports are local, and the dead tagRender and TagRenderer are deleted. * ui: rename the --ant-* variables and ant-* classes, drop antd from tw-guard The theme colour properties become --theme-*, the navbar height becomes --navbar-height, and the class names still rendered become form-field-error, loader-content and auth-mechanism-space. The ant-select-selection-item rules left by the deleted TagRenderer go, tw-guard and tw-audit stop looking for antd imports, and the token files and specs are regenerated for the styles removed earlier. * ui: load legacy-base.css and master.less before every other global stylesheet antd-master.less was first in globalStyles.ts only because import sorting put "antd" before "app". Its replacements sorted after app.less and the other global sheets, so antd's base rules (p margin-bottom: 1em, among others) and master.less's layout rules started winning ties they used to lose. They now sit in their own import group above the sorted list, and a unit test pins the order. Also formats the files the previous commit touched. * ui: drop the antd names left in identifiers waitForAntOverlayToOpen becomes waitForOverlayToOpen and loses its check for ant-zoom classes, which nothing renders. TableV2's size maps and IngestionListTable's sort types no longer carry an Antd prefix. * ui: sort the imports touched by the waitForOverlayToOpen rename (cherry picked from commit aada83e)
Code Review ✅ Approved🔴 High risk · Removing Ant Design and replacing global styles across 211 UI files could cause widespread layout or interaction regressions if retained styles differ. Backports the removal of the antd package, its ESLint rules, and dead VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|



Describe your changes:
Backport of #36373 to
2.1. Part of open-metadata/openmetadata-collate#7504.The merge commit
aada83e157dapplied as a patch with a 3-way merge. A plain cherry-pick could not fetch some objects in this partial clone, but the result is the same. There was one conflict, inplaywright/eslint-rules/tests/corpus.test.mjs:2.1sits at 537 positional-locator suppressions because it never gotmain's task-count helper removal, and this change removes two, so the count is 535. The suppression baseline test confirms it.What it carries is described in #36373:
antdpackage,antd-master.lessand the antd ESLint rules are removed.legacy-base.css, loaded first, ahead ofmaster.less.--ant-*variables are renamed to--theme-*, and--ant-navbar-heightto--navbar-height.ant-*class names are renamed..ant-*selectors, tests and Playwright checks are removed.tw-guardandtw-auditstop checking for antd imports.Prerequisite checked:
2.1already contains #35509, andsrc/has noantdimports, so removing the package is safe.Not in this backport:
2.1still has.ant-skeletonwaits in some Playwright specs (AuditLogs,CustomProperties,ContextCenterPermission,importUtils,task.ts).mainremoved them in a separate PR, #36307, which belongs to that PR's backport.Collate
2.1: Collate2.1tracks OpenMetadata2.1and keeps building after this merges, because it imports none of the deleted stylesheets. It still reads three--ant-*variables, though:--ant-navbar-heightinCreateChartForm, and--ant-primary-2/--ant-primary-5instyles/variables.less. Those need the rename from open-metadata/openmetadata-collate#7913, backported to Collate2.1alongside this PR.Type of change:
Tests:
Unit tests
styles,TagsUtils,CronExpressionUtils,useThemeCssVariables,FieldErrorTemplate,Loader,SelectableList,IngestionListTable,SettingsSso,SSOUtils,formPureUtils): 24 suites, 540 tests passed.Backend integration tests
Playwright (UI) tests
Not run locally: OpenMetadata PRs don't run Playwright locally by default. The Playwright edits are the same as in #36373.
Manual testing performed
2.1:2.1's ownantd-master.lesswas compiled with antd 4.24.16 and compared rule by rule with this branch'slegacy-base.css+master.less.2.1'svariables.lessdiffers frommain's, which is why this was re-checked here.[data-drop-target] table:not(.ant-table)rules becametable, which matches the same elements now that nothing renders.ant-table.yarn install --frozen-lockfile: passes, andantdis no longer installed.yarn tsc:check: 0 errors.yarn build: passes.check-bundle-chunks: passes (1337 emitted / 1156 small JS files).yarn ui-checkstyle:changedon the 45 changedsrcfiles andyarn ui-checkstyle:playwright:changedon the 33 changed Playwright files: clean, with no diff left by the tools.yarn lint:playwright: 0 errors.yarn test:eslint-rules: 170/170, including the corpus baseline at 535.generate-playwright-rule-table --check: passes.check-drift.js(token drift): clean.token-audit: 77 errors, the same count as onmain.tw-deprecation-guard.test.js: 5/5.scripts/harness/check_decision_records.py: clean.Checklist: