-
-
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
[icons] Remove SvgIcon data-testid in production #45333
Conversation
Netlify deploy preview
@material-ui/core: parsed: -0.07% 😍, gzip: -0.13% 😍 Bundle size reportDetails of bundle changes (Toolpad) |
Terrible! Terrible folks! What on earth are y folks doing over there? |
@EfstathiadisD Trimming unnecessary bloat from production code, these test ids end up in server rendered html and potentially clash with user defined test ids. The component still spreads props on the svg element, so a user defined testid will still end up there. Wouldn't that suffice for your use-case? Could you elaborate a bit more on why you think this should be kept? |
It was one of the most efficient ways to write tests! We all had 1 way to test them, and now people are gonna start renaming it how they like. I think options hurt the ecosystem more than strictness. I understand that it might not be beneficial but consider an approach where this Icons can have predefined data-testId. Like a flag or something. And I suppose this goes to V7 as a breaking change. In our repo it about 35 instances of this. And our apps aren't huge! Just IMHO! |
Would it work for you if we add the test id only when |
I think this is a good compromise, I can't imagine anyone wanting to have these in production. |
Yeah. That makes lots of sense! Thank You!!🙏 |
Removes the default
data-testid
prop when in production. Adds a section to the migration guide and remove the docs that describe this behavior.