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

[pickers] Add deprecations when importing pickers from the lab #32950

Merged
merged 3 commits into from
Jun 4, 2022

Conversation

flaviendelangle
Copy link
Member

@flaviendelangle flaviendelangle commented May 30, 2022

The pickers have been moved to @mui/x-date-pickers since the 12th of April 2022.
Until now, we were re-exporting everything in @mui/lab without warning to give some time to stabilize them before forcing a migration.
But we now need to end the transition phase which is causing package duplication to some users using both @mui/x-date-pickers and @mui/lab for other components.
This PR adds clear warnings when using a picker component from the lab that those are deprecated.
The pickers will stop being re-exported from the lab during the 1st release of July 2022, at that point we will keep the warning but will not render anything anymore (like for DateRangePicker in @mui/lab currently).

@flaviendelangle flaviendelangle added the component: pickers This is the name of the generic UI component, not the React module! label May 30, 2022
@flaviendelangle flaviendelangle self-assigned this May 30, 2022
@mui-bot
Copy link

mui-bot commented May 30, 2022

Details of bundle changes

@material-ui/lab: parsed: +2.57% , gzip: +0.98%

Generated by 🚫 dangerJS against 61eaffd

Copy link
Member

@oliviertassinari oliviertassinari left a comment

Choose a reason for hiding this comment

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

I thought we already had these deprecations 😁

Could we expand on the PR's description of why we need to make the removal happen so soon (4 weeks/releases down the line)? It might have been discussed on Slack, but nobody from the community has access to this discussion. Thanks

@oliviertassinari oliviertassinari added deprecation New deprecation message package: lab Specific to @mui/lab labels May 30, 2022
@oliviertassinari oliviertassinari changed the title [pickers] Add deprecation warning when importing pickers from the lab [pickers] Add deprecations when importing pickers from the lab May 30, 2022
@DanailH
Copy link
Member

DanailH commented May 31, 2022

I've also opened a follow-up PR to remove the pickers doc page under the Lab section -> #32961

@oliviertassinari
Copy link
Member

oliviertassinari commented May 31, 2022

But we now need to end the transition phase which is causing package duplication to some users using both @mui/x-date-pickers and @mui/lab for other components.

@flaviendelangle Thanks for the context, so I assume it's meant to help fix mui/mui-x#4569.

As far as I know, only Option 0 or Option C will solve mui/mui-x#4569 at the root. Here, removing the dependency on July 1st is what I assume is a step in Option A. Sure it will help with this problem but not solve the root, I'm not sure that it's we need to go this far. It seems that the deprecation will be what will have the most impact. If a developer faces the error of mui/mui-x#4569, after this PR, he will get a deprecation warning giving a tip on what to do next.

So personally, I would advocate for the lab to keep the dependency on the pickers, until Material UI v6, to make it so developers can update Material UI v5 at their own pace to get React 18 support.
Alternatively, we could move slower, add the deprecations, and reevaluate in 4 weeks to see if we need the next step. However, another value of removing the dependency of the pickers in the lab could be to get more accurate npm download stats.

Copy link
Member

@mnajdova mnajdova left a comment

Choose a reason for hiding this comment

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

Nice, this should allow developers to have better transition 👍

@flaviendelangle flaviendelangle merged commit 2650f48 into mui:master Jun 4, 2022
@flaviendelangle flaviendelangle deleted the pickers-lab-warning branch June 4, 2022 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: pickers This is the name of the generic UI component, not the React module! deprecation New deprecation message package: lab Specific to @mui/lab
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants