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

[core] Bring back individual icon dts #45711

Merged
merged 9 commits into from
Mar 27, 2025

Conversation

Janpot
Copy link
Member

@Janpot Janpot commented Mar 27, 2025

Fixes #45702

Not sure if that's a regression or not, but some linters apparently use the declaration file to check for duplication. We can bring back the individual declarations to get around it.

@Janpot Janpot requested a review from Copilot March 27, 2025 12:15
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR reintroduces the generation of individual type declaration files for icons.

  • Updated output paths from the lib directory to the build directory.
  • Refactored the icon typing function to create and write individual .d.ts files for each icon.
  • Updated both CommonJS and ESM targets for typings generation.
Files not reviewed (1)
  • packages/mui-icons-material/package.json: Language not supported

@mui-bot
Copy link

mui-bot commented Mar 27, 2025

Netlify deploy preview

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

Bundle size report

No bundle size changes (Toolpad)
No bundle size changes

Generated by 🚫 dangerJS against ce14821

@Janpot Janpot added the package: icons Specific to @mui/icons label Mar 27, 2025
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Mar 27, 2025
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Mar 27, 2025
@Janpot Janpot marked this pull request as ready for review March 27, 2025 18:15
@Janpot Janpot requested a review from Copilot March 27, 2025 18:16
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request restores individual icon declaration typings to address linter issues regarding duplicate declarations.

  • Changes target directories from "../lib" to "../build" for typings output
  • Updates the icon typings creation function to process multiple files concurrently and generate separate typings per icon
  • Updates index typings creation accordingly
Files not reviewed (1)
  • packages/mui-icons-material/package.json: Language not supported
Comments suppressed due to low confidence (2)

packages/mui-icons-material/scripts/create-typings.mjs:22

  • [nitpick] The custom iterator for processing the 'files' array adds unnecessary complexity. Consider iterating directly over the 'files' array in each worker to simplify the code and reduce potential for subtle issues.
const filesIterable = {

packages/mui-icons-material/scripts/create-typings.mjs:11

  • Verify that the updated target directories ('../build' and '../build/esm') exist and are properly configured within the build pipeline to avoid potential integration issues.
const TARGET_DIR = path.resolve(currentDirectory, '../build');

@aarongarciah aarongarciah changed the title Bring back individual icon dts [icons] Bring back individual icon dts Mar 27, 2025
@aarongarciah aarongarciah changed the title [icons] Bring back individual icon dts [core] Bring back individual icon dts Mar 27, 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.

@Janpot just to check I understand correctly, this is reverting to what we had previously, right?

Could changing this back cause issues to users that already migrated?

@Janpot
Copy link
Member Author

Janpot commented Mar 27, 2025

in v7 I changed the types to a single declaration file and pointed every icon to it. in this PR I'm reverting to provide a declaration file for each icon.

Could changing this back cause issues to users that already migrated?

not unless I accidentally introduce a regression

@Janpot Janpot merged commit d02835d into mui:master Mar 27, 2025
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: icons Specific to @mui/icons
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[MUI v7] @mui/icons-material and duplicate imports
3 participants