-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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] Remove createSvgIcon duplication #20308
[core] Remove createSvgIcon duplication #20308
Conversation
Details of bundle changes.Comparing: e9fbcbf...e17db10 Details of page changes
|
@dmtrKovalenko No matter the outcome of this pull request, we will need to remove the imports above 2 layers, e.g: import createSvgIcon from '@material-ui/core/internal/svg-icons/createSvgIcon'; As far as I know, this means that developers could bundle the styles twice (1 ESM, 1 CJS), leading to bundle bloat and incorrect CSS injection order. |
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.
Can we move this into core/src/utils
instead? I don't think this tiny helper warrants its own module.
Still think that making this public is a bad idea. We're not creating a SVGIcon but a "Material-UI SVG icon". People will want us to support all sorts of different svg build scenarios.
Only the modules available at |
c8a2961
to
f1fb94d
Compare
f1fb94d
to
e17db10
Compare
This breaks the latest version of
|
@koistya which version of pickers are you using? |
does this impact @material-ui/lab? I recently bumped dependencies, "version": "4.0.0-alpha.48", and "version": "4.9.9", and when I run jest tests I am getting TypeError: (0 , _utils.createSvgIcon) is not a function when I include any ideas? |
getting this when I try and run the app: warning in ./node_modules/@material-ui/lab/esm/internal/svg-icons/FirstPage.js "export 'createSvgIcon' was not found in '@material-ui/core/utils' |
@koistya, @kelly-tock are you able to confirm that you only have 1 copy of |
@kelly-tock Upgrade your dependencies, you will be fine. |
@oliviertassinari from what I can tell, @kelly-tock is already using the latest |
ok, yarn messed with me. sorry about that. I removed node modules, cleared yarn cache. specifically did 4.9.9. and now its fine :) |
out of curiosity, do you all prefer yarn or npm? |
I personally prefer Yarn and find I'm not sure if this is what you did, but I would recommend against blowing away your lockfile because that typically should be a last resort, especially if you have a large dependency tree - you could introduce lots of subtle changes that cumulatively break your project and it would be hard to diagnose due to the size of the change. Instead, per https://material-ui.com/getting-started/faq/#why-arent-my-components-rendering-correctly-in-production-builds
you could either have another place in your project where you didn't update |
A follow-up on #20268.