-
-
Notifications
You must be signed in to change notification settings - Fork 298
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
Fix support for next version of @material-ui/core #387
Fix support for next version of @material-ui/core #387
Conversation
Not sure without diving too deep. Would be great to test whether v5 will have problems like this, after |
Hi @mnajdova - i'm happy to help test your code in my own project... in general should be something like the following
Then cd to a different project set up with material ui v5...
the npm link commands help build symbolic links which you can use to develop your code locally without publishing npm packages |
Thanks @mlake, will try this tomorrow. |
It's probably worth saying that this approach was already tested and released on the data grid with mui/mui-x#1627 |
I've tried testing locally, but there is a problem with the improts. Basically the import:
is being transformed to:
which then fails as |
I tried testing locally, but I got some |
also got the invalid hook call when I tested..wasn't sure how to go about fixing it |
@iamhosseindhv Do you have guidance on these changes? |
looks like you guys also have no idea from which package you need to import |
@DmitriySot What do you mean? |
I mean that material-ui updated a few weeks ago with some breaking changes related to migration and removing jss. And for me is not too clear from which package I need to import something that will not be deprecated in the next version.And I see that @mnajdova also can't update notistack for that time |
@DmitriySot The |
I'm just trying to upgrade |
@DmitriySot comments like this are not really helpful and productive.
We would like to contribute to make notistack compatible with both Material-UI v4 and v5 at the same time, so that it won't break until it is upgraded to v5. Regarding what should we imported from where, we try to list everything in the migration guide, for these specific changes, there is more info https://github.com/mui-org/material-ui/blob/next/docs/src/pages/guides/migration-v4/migration-v4.md#material-uicorestyles Anyway I don't think it's productive to discuss things like this in this PR, you can open an issue for clarifying things. Again, whoever can help test out notistack with both v4 and v5 would help with merging the PR. |
I'm getting an error with the new release of MUI. styles$2.withStyles is not a function |
I prepared codesanboxes: I see the warning for v5:
|
@yurtaev Hey, it looks like the spacing between the notifications is missing? 🤔 |
@iamhosseindhv Do we have some news please ? |
This comment has been minimized.
This comment has been minimized.
Note: related #396 to fix #387 (comment) |
EDIT: Just use When
On top of that something appears to still be broken - My
Any suggestions on how to use the MUI v5 beta with this? The Code Sandbox example above appears to play nice... |
Apologies for responding so late. Been dealing with Covid and international travel. Thanks @mnajdova for opening the PR. Couple of things I can think of:
Could this PR be rebased and merged into |
thanks @iamhosseindhv . I look forward to trying out the new version. Hope all is well. |
I think that material-ui made the decision for you. I ran into the problem that changes in 4.12 reflect was will be happening in 5.x. So i think you master branch should switch to 4.12 or 5 and above and people who locked their version of material-ui to 4.11 and bellow most likely have also lock notistack to 1.09. If not they will update material ui or lock notistack to 1.09.
Anyway you know what your doing!
Thanks for doing it!
|
thoughts? |
That's what this PR is about to fix |
what's the timeline for this PR being merged? |
I thought there is one branch (master) to support all versions. If this is not the case, I would say the best is to migrate to emotion in the |
eventually, need a tagged version of notistack on master that uses material-ui v4 with JSS and a tagged version of notistack on master that uses material-ui v5 with emotion so people can choose which version of notistack they want that's in alignment with the version of material-ui theyre using. until notistack next branch gets merged into master, next branch should only have emotion, then when next branch gets merged into master, the release will be the aforementioned tag on master that uses material-ui v5. for now we definitely need this PR on the next branch of notistack so we can use it with material-ui next
|
When will we have a version that supports MUI beta v5? I've been waiting for this package to update for 2 months but still no results. |
Same here. Good thing my project is still in development. I hope this PR gets merged soon. |
Just upgrade to notistack@next and it will work with material UI 5 |
It's not totally correct, it works only with MUI >= 5.00-alpha.34:
|
Material-UI is currently at its second beta of v5 and styling functions are not part of "core" anymore, therefore notistack cannot work with the new version of MUI |
@iamhosseindhv I propose updating to the When this PR was introduced, the goal was to make notistack compatible with both v4 and v5 in the transition period. Now that Material-UI is in beta and this was still not merged, I propose we abandon it and focus on updating the |
@iamhosseindhv currently we don't have any opened tickets or pull-requests to track progress with getting notistack work with MUI v5 beta |
mui5 is released and has a new package name(@mui/material). Do you want to make notistack compatible? @iamhosseindhv |
There is a codemod that should enable fast migration to the new package names - https://github.com/mui-org/material-ui/blob/next/packages/mui-codemod/README.md#mui-replace |
Changes done:
makeStyles
,withStyles
,createStyles
from@material-ui/core/styles
with ones from@material-ui/styles
.defaultTheme
is required to be passed in order to preserve previous behavior.created- reverted these changes see Fix support for next version of @material-ui/core #387 (comment)createTheme
util that maps to the legacycreateMuiTheme
or the newcreateTheme
Not sure how to test the changes locally, any help is appreciated.
Related to mui/material-ui#26382