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] Add use-client to custom icons #38132

Merged
merged 3 commits into from
Aug 29, 2023

Conversation

mj12albert
Copy link
Member

@mj12albert mj12albert commented Jul 24, 2023

Fixes #38023

There are handful of custom icons outside of the /src directory; also packages/mui-icons-material/src/utils/createSvgIcon.js is not returned by findComponents/findHooks even though it needs 'use client' to work.

This PR adds support for:

  • additionalPaths?: string[] to handle paths that are outside packages/mui-*/src
  • additionalFiles?: string[] to handle arbitrary files that are neither components nor hooks

@mj12albert mj12albert changed the title Add use-client to custom icons [core] Add use-client to custom icons Jul 24, 2023
@mj12albert mj12albert added the core Infrastructure work going on behind the scenes label Jul 24, 2023
@mui-bot
Copy link

mui-bot commented Jul 24, 2023

Netlify deploy preview

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

Bundle size report

No bundle size changes (Toolpad)
No bundle size changes

Generated by 🚫 dangerJS against 8148f6f

@mj12albert mj12albert marked this pull request as draft July 24, 2023 07:02
@mj12albert mj12albert force-pushed the core/custom-icons-use-client branch 3 times, most recently from 1489568 to c087c64 Compare July 28, 2023 09:13
@mnajdova
Copy link
Member

@mj12albert should we push this forward so that we are complete with the RSC compatibility?

@mj12albert
Copy link
Member Author

@mj12albert should we push this forward so that we are complete with the RSC compatibility?

👌will finish this one this week @mnajdova

@mj12albert mj12albert force-pushed the core/custom-icons-use-client branch 21 times, most recently from 363e55e to f44a42d Compare August 25, 2023 17:19
@mj12albert mj12albert force-pushed the core/custom-icons-use-client branch from f44a42d to 0509f89 Compare August 28, 2023 06:50
@mj12albert mj12albert marked this pull request as ready for review August 28, 2023 08:15
@michaldudak
Copy link
Member

The build output doesn't contain the "use client" directive on the custom icons. You have to run yarn src:icons in the icons project directory to generate proper intermediate files.

@mj12albert
Copy link
Member Author

The build output doesn't contain the "use client" directive on the custom icons. You have to run yarn src:icons in the icons project directory to generate proper intermediate files.

@michaldudak Updated ~

Copy link
Member

@michaldudak michaldudak left a comment

Choose a reason for hiding this comment

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

All good!

@mj12albert mj12albert merged commit f2a254e into mui:master Aug 29, 2023
@mj12albert mj12albert deleted the core/custom-icons-use-client branch August 29, 2023 08:33
mnajdova pushed a commit to mnajdova/material-ui that referenced this pull request Sep 8, 2023
mnajdova pushed a commit to mnajdova/material-ui that referenced this pull request Sep 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Infrastructure work going on behind the scenes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[core] GitHubIcon and GoogleIcon ignored by rsc script
4 participants