Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[code-infra] Fix type resolution for @mui/types #45513

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

Janpot
Copy link
Member

@Janpot Janpot commented Mar 8, 2025

On a project that depends on @mui/material, when running tsc with the --traceResolution flag I can see that for moduleResolution: 'node' it prints

======== Module name '@mui/types' was successfully resolved to '/Users/janpotoms/Downloads/nbwiykrajq.github/node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@mui/types/index.d.ts' with Package ID '@mui/types/[email protected]+@types/[email protected]'. ========

and for moduleResolution: 'bundler' it prints

======== Module name '@mui/types' was not resolved. ========

Looking at the @mui/types package, it's indeed not a proper dual mode package, I'm aligning it with our other packages to get correctly resolving types.

Confirmed that this fixes #45510

@mui-bot
Copy link

mui-bot commented Mar 8, 2025

Netlify deploy preview

https://deploy-preview-45513--material-ui.netlify.app/

Bundle size report

No bundle size changes (Toolpad)
No bundle size changes

Generated by 🚫 dangerJS against c6c9162

@Janpot Janpot marked this pull request as ready for review March 8, 2025 07:49
@Janpot Janpot requested a review from DiegoAndai March 8, 2025 07:49
@Janpot Janpot changed the title Fix type resolution for @mui/types [code-infra] Fix type resolution for @mui/types Mar 8, 2025
Copy link
Member

@DiegoAndai DiegoAndai left a comment

Choose a reason for hiding this comment

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

Thanks for working on this fix @Janpot!

  1. Just to check that I understand this correctly: This seemed to start on 7.0.0-beta.3 but actually, it started on @mui/types 7.2.23 as we used the new package layout but the package wasn't ready for it, right?
  2. What should we do with versioning? Should this bump the major on @mui/types? It would become 8.0.0. I don't know the reason this package is versioned differently from the others.

@Janpot
Copy link
Member Author

Janpot commented Mar 10, 2025

@DiegoAndai The package was built differently than the others and it suddenly got an exports field without having the correct files. For some reason it's not bumped with the major version, I didn't realize, but really, this should follow the major version. I believe we could do the following:

  1. Merge and publish this PR asap as 7.2.24.
  2. For v6 dependencies, let's tighten its range to be <7.3
  3. for v7 publish to 7.3.0, then just let it follow major versions from then on

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: code-infra Specific to the core-infra product
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[material-ui] Some slotProps types broken when moduleResolution: "Bundler"
3 participants