Skip to content

Remove MUI, emotion, and the MUI theme from the app #2287

Open

Description

@trillium

Trillium Firstmate 🤖

Overview

After every screen is migrated, delete the MUI theme and provider and uninstall MUI and emotion. Nothing should be visible to users; the bundle gets smaller.

Dependencies

Action Items

Run yarn commands from client/, and commit client/package.json and client/yarn.lock together.

  • Confirm nothing is left: git grep -nE "@mui|@emotion|\bMui[A-Z]|\.Mui-" -- client/src must return no lines (apart from the files this ticket deletes). If a file still matches, finish it here and say so in the PR.
  • Remove ThemeProvider and the theme import from client/src/App.jsx.
  • Delete client/src/theme/ (index.js, palette.js). The tokens ticket already carries every value.
  • Remove @mui/material, @mui/system (if listed), @emotion/react, @emotion/styled (and @mui/x-date-pickers and @mui/icons-material if any are left) from client/package.json; update client/yarn.lock.
  • Root package.json: remove the unused @mui/icons-material (if still present) and styled-components. First confirm nothing in the repo imports styled-components.
  • Remove the temporary rules in the Tailwind theme that only existed for MUI interop, if any were added.
  • Run yarn build and record the new JS and CSS size next to the numbers from before the epic (JS about 1,345 kB / gzip about 405 kB; CSS about 54 kB) in the PR description.
  • Update CONTRIBUTING.md (UI section) to remove the "MUI may still appear in old files" wording.

Acceptance Criteria

  • git grep -nE "@mui|@emotion" -- client root package.json returns nothing.
  • The app builds, yarn test and yarn typecheck pass.
  • Before/after screenshots of three representative pages (home, check-in form, a project edit page) show no visible change.
  • The size comparison is in the PR.
  • The important flag is still on in this ticket (it is removed in the next one).

Resources/Instructions

  • Files: client/src/App.jsx, client/src/theme/, client/package.json, root package.json.
  • Earlier measurement: MUI + emotion + related packages were about a quarter of the minified JavaScript.

Additional Notes

  • This is a small ticket on purpose: the work was done in the screen tickets. Keeping it separate means it is easy to revert if something was missed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    dependenciesfeature: Design systemmilestone: missingrole: Front Endsize: 2pt

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions