Skip to content

Upgrade to MUI v7 - #200

Merged
carojeandat merged 5 commits into
mainfrom
upgrade-to-mui-v7
Aug 6, 2026
Merged

Upgrade to MUI v7#200
carojeandat merged 5 commits into
mainfrom
upgrade-to-mui-v7

Conversation

@carojeandat

Copy link
Copy Markdown
Contributor

PR Summary

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Changes

MUI dependencies were upgraded to v7. Theme augmentation targets were updated. Grid imports now use the direct Grid export from @mui/material. Component logic remains unchanged.

MUI v7 migration

Layer / File(s) Summary
MUI dependency upgrade
package.json
@gridsuite/commons-ui and the MUI packages were updated to the specified versions.
Theme declaration update
src/module-mui.d.ts
Theme augmentation and re-export targets now use @mui/material/styles.
Grid import migration
src/components/App/HomePage.tsx, src/pages/announcements/*, src/pages/common/multi-chip-cell-renderer.tsx, src/pages/groups/*, src/pages/profiles/*, src/pages/users/*
Grid imports now use the direct Grid export from @mui/material. Component logic remains unchanged.

Suggested reviewers: achour94

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description contains only a template comment and does not provide meaningful details about the MUI v7 upgrade. Replace the template comment with a concise summary of the MUI v7 dependency and import changes.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely identifies the main change: upgrading the application to MUI v7.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@klesaulnier klesaulnier left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing package-lock.json

# Conflicts:
#	src/pages/users/modification/user-modification-form.tsx
@sonarqubecloud

sonarqubecloud Bot commented Aug 6, 2026

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/module-mui.d.ts`:
- Around line 13-14: Remove the self-referential export from the declare module
'`@mui/material/styles`' augmentation, leaving only declaration-merging content in
that block. If the module re-export is required elsewhere, move it outside the
augmentation rather than retaining it inside.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a6483bd7-80f7-4870-8d51-cafb2dd47e3a

📥 Commits

Reviewing files that changed from the base of the PR and between ec6cdd5 and 31dd019.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (2)
  • package.json
  • src/module-mui.d.ts

Comment thread src/module-mui.d.ts
Comment on lines +13 to +14
declare module '@mui/material/styles' {
export * from '@mui/material/styles';

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

npm run type-check

Repository: gridsuite/gridadmin-app

Length of output: 50379


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf 'Files matching module-mui.d.ts:\n'
fd -a 'module-mui\.d\.ts$' . || true

printf '\nRelevant content:\n'
for f in $(fd 'module-mui\.d\.ts$' .); do
  echo "--- $f"
  cat -n "$f"
done

printf '\nDependency versions:\n'
node - <<'JS'
const fs = require('fs');
const pkg = JSON.parse(fs.readFileSync('package.json','utf8'));
const deps = {...(pkg.dependencies||{}), ...(pkg.devDependencies||{})};
for (const [k,v] of Object.entries(deps)) {
  if (/^(`@mui`\/|typescript)$/.test(k)) console.log(`${k}: ${v}`);
}
JS

Repository: gridsuite/gridadmin-app

Length of output: 1894


🌐 Web query:

TypeScript module augmentation export reexport error @mui/material/styles Theme TypeScript

💡 Result:

When working with TypeScript module augmentation for Material UI (MUI), "export" or "re-export" errors—or scenarios where augmentations fail to apply—typically stem from how TypeScript handles module resolution and ambient declarations [1][2][3]. Key causes and solutions include: 1. Missing Import in Declaration Files: If your module augmentation resides in a .d.ts file or a file that is not directly importing the target module, TypeScript may ignore the declaration [1][2]. You must import the target module (e.g., '@mui/material/styles') within your declaration file to ensure TypeScript recognizes the module for augmentation [1][2]. Example: import '@mui/material/styles'; declare module '@mui/material/styles' { interface Theme { status: { danger: string; }; } } 2. Issues with Re-exports and Overriding: TypeScript can sometimes treat re-exports in a way that overrides existing interfaces rather than merging with them [4]. If you are distributing a library containing theme overrides, ensure your augmentation is correctly targeting the original source module (e.g., '@mui/material/styles') rather than a file that re-exports it [4][3]. 3. Library Distribution Challenges: When isolating a theme into a separate library, downstream applications may not automatically pick up the augmentations defined in your package [5][6]. To ensure these types propagate: - Ensure the file containing the declare module block is included in the package's exports or types field in package.json. - Consumers may need to reference the declaration file, sometimes by importing an empty type from the package in their tsconfig.json or a global declaration file (e.g., import type {} from '@your-org/theme-lib/types/mui';) [5][7]. 4. Performance and Circular Dependencies: In newer MUI versions, certain paths (like @mui/material/stylesOptimized) exist to avoid circular dependencies [8]. If you are experiencing persistent issues with type resolution, ensure that your import paths for createTheme and module augmentation match consistently throughout your project [8]. General Troubleshooting Steps: - Verify that your augmentation file is actually being included in the TypeScript compilation (check your tsconfig.json include property). - If using VS Code, restart the TypeScript server (Ctrl/Cmd + Shift + P -> "TypeScript: Restart TS server") to clear cached type definitions. - Always prefer importing the exact module you intend to augment, rather than relying on re-exported paths, to ensure predictable merge behavior [3].

Citations:


Remove the self-re-export from the @mui/material/styles augmentation.

MUI’s Theme and ThemeOptions are already exported from this module. TypeScript module augmentations should merge declarations only; keep export * from '@mui/material/styles' outside this block if it is needed at all.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/module-mui.d.ts` around lines 13 - 14, Remove the self-referential export
from the declare module '`@mui/material/styles`' augmentation, leaving only
declaration-merging content in that block. If the module re-export is required
elsewhere, move it outside the augmentation rather than retaining it inside.

@carojeandat
carojeandat merged commit 79de8c8 into main Aug 6, 2026
6 checks passed
@carojeandat
carojeandat deleted the upgrade-to-mui-v7 branch August 6, 2026 08:01
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.

2 participants