chore: upgrade MUI, MUI X to v9#12833
Open
seidior wants to merge 1 commit into
Open
Conversation
2814893 to
c10e53c
Compare
|
Pickaroo selected and notified reviewers for this PR! 🦘 message_ts: |
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.
Description
Step 3 of our never-ending React 19 upgrade: bringing MUI and MUI X up to date.
This upgrades MUI core and MUI X from v5 to v9 using a combination of automatic upgraders and adaptation to the new MUI syntax.
Removes
@mui/laband@mui/styles(both dropped in MUI 9), migrates allinputProps/InputPropsusages to theslotPropsAPI, and updates the MUI X Date Picker API. Introduces a customTabPanelcomponent to replace the removed@mui/labtab primitives.Ticket
This pull request partially resolves #16176.
Approach
Upgrades MUI core from 5.18.0 → 9.0.1 and MUI X Date Pickers from 5.0.20 → 9.4.0. Three categories of forced changes:
@mui/labremoval —TabContext/TabList/TabPanelfrom@mui/labno longer exist in MUI 9. Replaced with a customTabPanelcomponent (web/src/components/TabPanel.tsx) and MUITabs/Tab. Affected:LicenseTask,TwoTabDashboardLayout,ElevatorRegistrationTask,HotelMotelRegistrationTask,MultipleDwellingRegistrationTask,CrtkStatus,Xray,XrayTabZero.@mui/stylesremoval —makeStyles/createStylesdropped in MUI 9. Replaced withsxprop and inline style objects. Affected:ArrowTooltip,XrayStatus,CrtkStatus,CheckLicenseStatus,AnytimeActionSearch.inputProps/InputProps→slotPropsmigration — deprecated API removed in MUI 9. AllTextFieldusages updated toslotProps={{ htmlInput: {...}, input: {...} }}. Affected:GenericTextFieldand ~30 component/data-field files.MUI X Date Picker API migration —
inputFormat/InputPropsreplaced withformat/slotProps.handleTextInputChangewired toslotProps.textField.slotProps.htmlInput.onChangeto preserve thenameattribute on the backing input. Affected:DateOfFormation,FormationDate,EmergencyTripPermitDatePicker,CigaretteSalesStartDate.muiTheme.ts— removed@mui/stylestheme provider setup.Test harness fixes:
web/setupTests.js: addedaddEventListener/removeEventListenerto thematchMediamock (MUI X 9 calls these during picker initialization).web/cypress/support/commands.js—chooseDatePicker: MUI X 9's accessible date picker renders aria-hidden backing inputs; fixed usingnativeInputValueSetterpattern to trigger React's synthetic onChange.web/cypress/e2e/deadlinks.spec.ts: hardcoded password replaced withCypress.env("ADMIN_PASSWORD");web/cypress.config.jsupdated to forwardprocess.env.ADMIN_PASSWORDinto the Cypress env.web/cypress/support/helpers/helpers.ts—completeTaxClearanceFlow: added guard to detect and dismiss stale "Unlink Tax ID" state from prior test runs.SalesInfo.test.tsx,shared-submenu-components.test.tsx,onboarding-foreign.test.tsxto match new MUI 9 DOM/interaction patterns.Steps to Test
yarn workspace @businessnjgovnavigator/web test— all Jest unit tests should pass.yarn start:dev), then run./scripts/local-feature-tests.sh.Code author checklist
userData(includingprofileData,formationDataetc), then I added a new migration filecmsCollections.ts(see CMS Additions in Engineering Reference/FAQ on the engineering documentation site).envvalues in.env-template, in Bitwarden, and in our workspacespr-showorpr-reviewlabel on GitHub to show or request reviews