-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[code-infra] Remove deprecated data-mui-test
in favour of data-testid
#14882
[code-infra] Remove deprecated data-mui-test
in favour of data-testid
#14882
Conversation
Deploy preview: https://deploy-preview-14882--material-ui-x.netlify.app/ |
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.
If you can wait for the alpha, I'm in favor of dropping those from the pickers
We don't add them to any new element an nobody ever asked for them on the pickers
Why wait for the alpha? These are completely removed from the build by a plugin. They exist solely in our codebase afaik |
No build we publish have them? |
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.
Nice improvement! 👍
Never understood the reason for that custom query... 🤷 🙈
@@ -129,7 +125,9 @@ module.exports = function getBabelConfig(api) { | |||
} | |||
|
|||
if (process.env.NODE_ENV === 'production') { | |||
plugins.push(...productionPlugins); | |||
if (!process.env.E2E_BUILD) { | |||
plugins.push(['babel-plugin-react-remove-properties', { properties: ['data-testid'] }]); |
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.
What causes this to suddenly be necessary? If possible, would be nice to keep parity between babel configs across repos. With the hope of some day just embedding it in our build tooling.
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.
e2e tests build the source-code using this configuration and they rely on the data-testid
If this plugin is enabled they simply don't work.
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.
For more context, previously it wasn't an issue because in unit tests we were using data-mui-test
but e2e were using data-testid
, so the data-mui-test
could be removed regardless of build.
But since now both
use data-testid
, the issue appears
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.
interestingly, this rename in core was done without altering the babel config mui/material-ui#23498
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.
I noticed material
doesn't remove the data-testid
from the build, that is why they don't have this problem.
But most of the times they add data-testid
in the test themselves, not the source code.
Preparing for #14508, removing deprecated apis usage