-
-
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
[pickers] Add codemods for breaking changes #6997
Comments
For the localeText prop, I should import: mui/material-ui#34430 |
@LukasTy About By the way, there is a typo in the migration example: The argument name is <DateTimePicker
- shouldDisableTime={(timeValue, view) => view === 'hours' && timeValue < 12}
+ shouldDisableTime={(time, view) => view === 'hours' && value.hour() < 12}
/> About |
I do think that we should do the migration from
🤦 I do think that
Indeed, those are somewhat pointless as codemods and would probably cover a very small percentage of use-cases anyways. 👌 |
OK, I will do the missing one + fix migration guide 👍 |
Closing this one as all the planned codemods for stable release have been added. 👍 |
The v6 for pickers is bringing quite a few breaking changes.
To ease users' migration we ought to try and cover as most changes with codemods as possible.
The codemod package can be found here. It already contains all the core setup needed in order to add new codemods to it.
This is intended as an umbrella issue to group all the codemods needed for
v.6.x
migration.Ideally as much migrations as possible should be provided with
preset-safe
codemod.The process of adding a new codemod
index.ts
preset-safe
—update this codemod with your newly added codemod making sure the codemods order is correct if codemod is sensitive to that (i.e. separate props should firstly be migrated tocomponentProps
and only later be passed through a codemod renamingcomponentProps
toslotProps
if we'd go with such approach)You can check @mui/codemod for inspiration on more advanced migration cases.
How to test your changes locally (on a different project)
P.S.
yarn link
does not create abin
command from a linked packagebuild
with eitheryarn workspace @mui/x-codemod build
oryarn build
if you are insrc/packages/x-codemod
cd build && yarn pack
7.tgz
file to the root of your project you want to run (test) the codemod in"@mui/x-codemod": "file:./<your_package_name>"
into your project dependenciesyarn install
npx @mui/x-codemod v6.0.0/preset-safe src
or by adding anx-codemod
script in your project)Breaking changes requiring codemods
Breaking changes related to pickers are documented here and relevant PRs are available with applied filters.
The text was updated successfully, but these errors were encountered: