Skip to content
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

Support @mui/material package naming #423

Merged
merged 3 commits into from
Sep 11, 2021

Conversation

ramosbugs
Copy link
Contributor

The new Material UI 5.0 release candidate (5.0.0-rc.0) includes some package renaming from @material-ui/* to @mui/*. This PR performs that migration so that notistack 1.0.6-next.3 will work with the release candidate and its successors.

I've tested this change locally using npm pack and importing that tarball into my project, and the imports seem to resolve properly.

This change also inadvertently upgraded the package-lock.json file to NPM v7's format (due to my local dev environment), but that change is backward compatible to NPM 6.

@ramosbugs
Copy link
Contributor Author

cc: @joemaffei (thanks for the prior changes!)

@lomboboo
Copy link

lomboboo commented Sep 5, 2021

Looking forward to it. Good work 👍

@EliasJorgensen
Copy link

Thank you, was just looking for when notistack would be compatible with the MUI 5 RC 🙏

@hugofpsilva
Copy link

Looks like a nice effort, but you shouldn't import from @mui/styles as it is legacy content (link).
I'd suggest removing it and update the imports to use @mui/material instead (at least for now, as notistack is based on MUI's Material Design package).

@ramosbugs
Copy link
Contributor Author

hey @hugofpsilva, my understanding is that while @mui/styles is legacy content, notistack still currently depends on that legacy content. if you take a look at styled under the migration guide (https://next.material-ui.com/guides/migration-v4/#mui-styles), it says:

The styled JSS utility is no longer exported from @mui/material/styles. You can use @mui/styles/styled instead.

I think some additional work will be needed to migrate notistack from JSS to emotion. This PR just aims to update the imports to work with the latest RC.

package.json Outdated
"@emotion/react": "^11.4.1",
"@emotion/styled": "^11.3.0",
"@material-ui/core": "^5.0.0-beta.4"
"@mui/material": "^5.0.0-rc.0",
"@mui/styles": "^5.0.0-rc.0",
Copy link

@hugofpsilva hugofpsilva Sep 6, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This branch is no longer dependant on @mui/styles afaik.
You added it here where it was no longer present.

src/SnackbarContainer.tsx Outdated Show resolved Hide resolved
src/SnackbarContent/SnackbarContent.tsx Outdated Show resolved Hide resolved
@ramosbugs
Copy link
Contributor Author

looks like things do work without @mui/styles, so I'm not sure why the migration docs say styled isn't exported anymore 🤷‍♂️

@hugofpsilva
Copy link

From the migration guide:

The styled JSS utility is no longer exported from @mui/material/styles.

JSS's styled isn't exported anymore, it's the emotion's styled now. 😄

@FinnLawrence
Copy link

FinnLawrence commented Sep 9, 2021

Hey @ramosbugs @hugofpsilva thanks for the work on this! Any updates on when to expect a merge/release? We are waiting on this to upgrade to the MUI 5 RC.

Cheers

@iamhosseindhv
Copy link
Owner

Thanks @ramosbugs and @hugofpsilva for your contribution. I'll have a look and publish a new release with these changes during the weekend, if not before.

@rart
Copy link

rart commented Sep 9, 2021

Looking forward to this publish to unlock our upgrade to 5 process 🙂

@rart
Copy link

rart commented Sep 10, 2021

@iamhosseindhv wondering if you have a code sandbox ci so we could use this PRs content through the ci build.

Like they did here: mui/mui-x#2527 (comment)

@iamhosseindhv iamhosseindhv changed the title Support Material UI 5.0.0-rc.0 Support @mui/material package naming Sep 11, 2021
@iamhosseindhv iamhosseindhv merged commit 037f741 into iamhosseindhv:next Sep 11, 2021
@iamhosseindhv
Copy link
Owner

This is published as 1.0.6-next.3 downloadable by npm i notistack@next. Thanks all for your contribution.

@MonstraG
Copy link

This is published as 1.0.6-next.3 downloadable by npm i notistack@next. Thanks all for your contribution.

Could you publish it as 1.1.x, othervise ^1.0.6-next.3 updates to 1.0.10, and breaks(

iamhosseindhv added a commit that referenced this pull request Sep 26, 2021
* Closes #334 #333 - Fix collapse keys

* 1.0.3-alpha.0

* 1.0.4-alpha.0

* 1.0.6-alpha.0

* Fixes #355 - Update MUI peer dependency to next

* 1.0.6-next.0

* Use root classKey for Collapse

* 1.0.6-next.1

* Add support for Material-UI v5 beta (#418)

* upgrade to material-ui v5; modify code as recommended by the material-ui docs

* upgrade to material-ui v5; modify code as recommended by the material-ui docs

* add missing anchor classes to SnackbarItem; fix child class declarations

* update dependencies; run build

* package-lock update

* Allow passing classes from props

* Adapt new MUI breakpoints

* Bind this

* Mark emotion peerDeps as optional

* 1.0.6-next.2

Co-authored-by: Hossein Dehnokhalaji <hossein.dehnavi98@yahoo.com>

* Support @mui/material package naming (#423)

* Support Material-UI 5.0.0-rc.0

* Bump version to 1.0.6-next.3

* Remove @mui/styles dependency

* Prepare next to be published as latest (#436)

* Add tag for people on mui-v4

* Update simple example

* Update simple example

* Update redux example

* Update mobx example

* Minor

* Update next --> latest in example codes

* Update docs

* Update CHANGELOG

* Update MUI v5 peerDependencies

* Update version to v2.0.2

* Update docs.json

Co-authored-by: Joe Maffei <joemaffei@users.noreply.github.com>
Co-authored-by: David Ramos <ramos@cs.stanford.edu>
@iamhosseindhv
Copy link
Owner

@MonstraG Since mui v5 is published as stable release, you can now download notistack using npm i notistack@latest (v2.0.2)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants