Skip to content

Manager UI - Delete 12 dead .less stylesheets - #4302

Open
agalin920 wants to merge 1 commit into
devfrom
fix/4300-delete-dead-less-stylesheets
Open

Manager UI - Delete 12 dead .less stylesheets#4302
agalin920 wants to merge 1 commit into
devfrom
fix/4300-delete-dead-less-stylesheets

Conversation

@agalin920

Copy link
Copy Markdown
Contributor

Closes #4300

Phase 1 of #4265, the .less retirement. Deletes the 12 stylesheets that cannot affect anything that renders — 269 lines, no insertions — taking src/ from 82 .less files to 70 and from 3,110 LOC to 2,842. Eleven of them are referenced from nothing anywhere in the repo, verified by grepping each basename across the whole tree rather than just src/, and there is no dynamic route by which they could still be pulled in: require.context appears nowhere, no glob or template-literal stylesheet import exists, and .less is absent from resolve.extensions (src/shell/webpack.config.js:106) so a bare import "./Content" cannot resolve to Content.less.

The twelfth needs its own sentence, because it is the only one that was imported. src/shell/webpack.config.js:263-278 runs every .less through css-loader with modules: { localIdentName: "[local]--[contenthash:base64:5]" } — unconditionally; the dev/prod ternary above that rule wraps only the ts-loader/babel-loader entry. So .FieldTypeUUID is emitted as FieldTypeUUID--<hash>, obtainable only from the imported styles binding. FieldTypeUUID.js never dereferences that binding, sets no className at all, and spreads no props — it names required, value, name, datatype and onChange individually, so a parent cannot inject a class through it either, and its sx targets the MUI global .MuiInputBase-readOnly rather than a module class. Nothing else in the repo imports the file or hardcodes the class. Those rules therefore already apply to no element on dev today; deleting them changes no rendered pixel. Restoring that styling would be a new design ask, not a regression from this PR. The now-dangling import styles line goes with it, along with the import cx from "classnames" beside it, which is unused for the same reason.

No colour or token work is included, so this phase is independent of #4264. Both npm run build:dev and npm run build:stage compile the branch with zero errors — the latter cacheless by construction, since webpack's filesystem cache is enabled only when NODE_ENV === "development" — which is the check that matters here: a resolving build is the only way to prove no importer was left dangling. tsc --noEmit reports no errors.

Phase 1 of #4265. None of these stylesheets can affect a rendered
element:

- 11 are orphans with zero importers anywhere in the repo.
- FieldTypeUUID.less was imported by FieldTypeUUID.js, but that file
  dereferences no `styles.*` key and sets no className at all. Every
  .less goes through css-loader with `modules: { localIdentName:
  "[local]--[contenthash:base64:5]" }` (src/shell/webpack.config.js),
  so `.FieldTypeUUID` is emitted under a hashed name that nothing
  carries. The rules were already inert on dev.

Removes the now-unused import from FieldTypeUUID.js; no other change
to that file. Restyling these components would be a new design ask,
not a revert of this commit.

Closes #4300
@github-actions

Copy link
Copy Markdown
Contributor

Coverage Report

Overall Coverage

Lines Statements Branches Functions
61.34% 60.90% 56.20% 55.70%

Changed Files Coverage

File Lines Statements Branches Functions
src/shell/components/FieldTypeUUID/FieldTypeUUID.js 53.84% 53.84% 87.50% 28.57%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Manager UI - Delete the 12 dead .less stylesheets (#4265 phase 1)

1 participant