-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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
Conversation
There was a problem hiding this 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
Netlify deploy previewhttps://deploy-preview-45711--material-ui.netlify.app/ Bundle size report |
There was a problem hiding this 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');
There was a problem hiding this 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?
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.
not unless I accidentally introduce a regression |
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.