Remove unused legacy Headings component#73661
Open
levadadenys wants to merge 1 commit into
Open
Conversation
apps/src/legacySharedComponents/Headings.jsx has zero imports across the monorepo and is marked "@deprecated Use DSCO Typography instead". Its sibling Headings.story.jsx renders MUI Typography directly and does not import Headings.jsx, so it is orphaned once the component is removed. Delete both. MUI Typography examples are already covered by apps/src/templates/temp/typography/MuiTypography.story.tsx. The apps/tools/codemod/typography-to-mui.js codemod is kept: it migrates DSCO Typography wrappers (Heading1..6, BodyOneText..FourText, EmText, StrongText, Figcaption) to MUI Typography, and those wrappers still ship from frontend/packages/component-library/typography and have at least one live consumer (frontend/packages/markdown/src/components/Markdown.tsx). Note: Headings.jsx was re-added on 2026-06-13 via a "Revert of Revert" commit (58a1eca). Confirm that revert-of-revert was intentional before merging.
Contributor
There was a problem hiding this comment.
Pull request overview
Removes an unused legacy headings wrapper (Heading1/Heading2/Heading3) and its orphaned Storybook story from the apps/ (webpack) codebase, aligning with the ongoing shift toward DSCO/MUI Typography.
Changes:
- Delete
apps/src/legacySharedComponents/Headings.jsx(deprecated legacy<h1>/<h2>/<h3>wrappers and style constants). - Delete
apps/src/legacySharedComponents/Headings.story.jsx(MUITypographyexamples that no longer correspond to a local component).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| apps/src/legacySharedComponents/Headings.jsx | Removes deprecated legacy heading components and style exports with no remaining imports. |
| apps/src/legacySharedComponents/Headings.story.jsx | Removes a Storybook story that documents MUI Typography rather than any local legacySharedComponents component. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Delete
apps/src/legacySharedComponents/Headings.jsxand its sibling story file. Both are unused.Headings.jsx(108 lines) exportsHeading1,Heading2,Heading3and their style objects. It is marked@deprecated Use DSCO Typography insteadand has zero imports across the monorepo. All name hits forHeading1/Heading2/Heading3resolve to@code-dot-org/component-library/typography(a different origin) or toapps/tools/codemod/typography-to-mui.js(which migrates callers off this file).Headings.story.jsxdoes not importHeadings.jsx— it renders MUITypographydirectly. OnceHeadings.jsxis gone, the story is an orphan living inlegacySharedComponents/that documents a component that no longer exists there. MUITypographyexamples are already covered byapps/src/templates/temp/typography/MuiTypography.story.tsx.Note for the reviewer:
Headings.jsxwas re-added on 2026-06-13 via commit 58a1eca ("Revert of Revert: RE-158 UI polish…"). Please confirm the revert-of-revert was intentional (i.e. no consumer is expected to land soon that depends on this file) before merging.Keeping
apps/tools/codemod/typography-to-mui.js. The codemod migrates DSCO Typography wrappers (Heading1..6,BodyOneText..FourText,EmText,StrongText,Figcaption) to MUI Typography. Those wrappers still ship fromfrontend/packages/component-library/src/typography/and have at least one live consumer —frontend/packages/markdown/src/components/Markdown.tsximportsHeading1..4,StrongText,EmTextfrom the DSCO. The codemod's own TODO says to delete it "when all DSCO Typography components have been replaced with MUI Typography" — we are not there yet.Links
Testing story
Deletion-only change, no runtime surface to drive. Verification is compile/import based:
Headings.jsx,legacySharedComponents/Headings, and every exported symbol (Heading1,Heading2,Heading3,h1Style,h2Style,h3Style,h3RebrandingStyle) acrossapps/,frontend/,dashboard/,lib/,shared/, and the root — zero import hits../tools/hooks/pre-commit) clean.Generated by Claude Code