-
-
Notifications
You must be signed in to change notification settings - Fork 5.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
[RFR] Relax material ui version dependency #3102
Conversation
Some tests fail because we tested the implementation rather than the feature. Time to switch to react-testing-library! |
👍 We are migrating from the shallow to the mount API of enzyme in Material-UI. |
Material-UI V4 is coming...... |
It's only an alpha for now. We have time :) |
v4.0.0-beta.0 should be out this weekend, v4.0.0 should be out before the end of the month. |
@fzaninotto hey, when you will merge this? |
This allows usage of material ui v3, which is backwards compatible with v1 (Firefox 45 aside).
Tried to install it using yarn
Edited: Ok, it seems that this is not possible. When will you merge this? |
2f9b484
to
6414b14
Compare
@ricardovf You can't install a monorepo this way |
I know that many people are waiting for this one. We’re actually working on it, but it has no release date. |
@fzaninotto did you test capability on production build? I have run into the issue when classNames have wrong order after refreshing the page. I created a demo repo for it here https://github.com/andrewkslv/react-admin-with-material-ui-next |
@andrewkslv which issue? I don't understand your point. And no, we haven't tested that on production yet, as you can see the CI build is still red, we're working on it. |
@fzaninotto thank you! I recorded a video with the issue. https://i.imgur.com/xgJQZZj.mp4 |
...and made it accessible
The remaining warnings are deprecation warnings for material-ui. I hope they don't occur in production builds. |
@andrewkslv I don't know what you're supposed to have and what you're having instead. Please use the issue template to describe your problem in a new issue. |
@fzaninotto thanks. |
'WithStyles(FormHelperText)' | ||
); | ||
assert.equal(FormHelperTextElement.length, 0); | ||
expect(container.querySelector('p')).toBeNull(); |
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.
You're testing implentation details here. If the root tag changes for some reason the test will fails but the user won't actually see anything. Those tests may become a pain to maintain. I believe testing the Required field.
is not visible is enough
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.
You might use FormHelperTextProps
to pass a testid
prop if you really really want this
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.
This PR is already a great step in the right direction. I know I'm still testing implementation details every once in a while, but that's also because material-ui makes it somewhat hard.
If the tests about helper text break in the future, I'll fix them. At least, tests about values and label won't break anymore.
Many people are waiting for this change, so I suggest we merge it as is.
I'm sorry but I'll have to revert that change. There are 2 reasons:
In other terms, allowing react-admin to support both material-ui 1.X and 3.X is NOT possible. I'm sorry if I gave false hope, it's just that I really wanted it to work, too. We'll just have to wait for material-ui v4, which will require a major rewrite of both react-admin and your apps based on react-admin v2 😞 |
This is not true. Please don't spread misinformation before everybody had a chance to speak up. We don't just deploy code without any rationale. For anybody interested in why the warnings are logged the way they are I suggest reading the linked issue. |
@eps1lon You've lost me: I opened issue mui/material-ui#15397 to ask you specifically to turn these errors into logs or warnings, and you closed it. If you actually want to turn deprecation warnings into console warnings, then please reopen the said issue. I'm curious as to what you consider misinformation, as I linked the issue in my comment. Everyone can make up their mind. |
@fzaninotto can we make react-admin version that will work only on material ui v3? |
@dzienisz you sure can, by forking the repo. The core team won't do it in the current repository, for reasons explained in the FAQ. |
@fzaninotto To be precise. We won't change the warning strategy in v3. We will improve the strategy in v4: Improve the warning strategy (#15343). We want the warnings to log the component stack trace. It's a requirement we don't want to give up on. It really helps to identify where the wrong logic is. Handling breaking changes are painful enough, we are using all our leverages to simplify the migration. In order to do that, we have to use the prop-types module. This module happens to use In v4, we want to leverage the new React.warn() method. It logs the component stack trace with console.warn. We would be happy to have your input on the topic, help us shape the future of the library.
It wasn't designed for. I wouldn't try to do it. What prevents you from dropping Material-UI v1 support? As far as I know, you don't expose Material-UI directly, all the components are wrapped. Could you increase the Material-UI dependency from v1 to v3, fix all the warnings and release the change as a minor?
The v1 or v3 (it's the same) migration is detailed in https://next.material-ui.com/guides/migration-v3/. What point is specifically a "major rewrite"? |
This allows usage of material ui v3, which is backwards compatible with v1 (Firefox 45 aside).
I tested the simple and demo example: they work perfectly.
Now I regret we didn't do this earlier (!)