-
Notifications
You must be signed in to change notification settings - Fork 19
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
[Modal] - migrate to new Modal from deprecated #808
Comments
Since this was made as a spike, I'll report my thoughts/findings here. Basically, I think this is possible, there's just several moving parts to consider. We should take into account 1) consumers who have already ran codemods for a v6 migration and have had deprecated Modals updated to the deprecated directory import path, and 2) consumers who have not yet ran codemods For Group 1, that would entail updating the import path back to the non-deprecated import directory -- this would most likely in turn require updating the For Group 2, that would entail checking to see if there's a data-codemods comment (such as if a consumer was using the previous Next implementation, then ran codemods to update import paths to just For both groups, we would then just a) add all of the subcomponents to the react import, b) grab several props that could have been passed to the deprecated Modal but are now meant to be passed to another sub-component (e.g. Any imports we added that weren't used would be removed from the no-unused-import rule (not ideal, but I feel is a little better than trying to traverse a file in the ImportDeclaration block and determine what needs to be imported from there; no strong opinion on this, though). One consideration is the fact that the deprecated Modal I believe did export a bunch of sub-components for consumers to build a composable implementation if they wanted. Is that something we want to take into account, and thus have another set of logic to deal with (e.g. having to check if DeprecatedSubComponent was used and try to figure out what current subcomponent needs to be used instead). If not, is it better to explicitly state that a codemod for this is meant for non-composable deprecated Modals -- which might be better if we make such a codemod require the --only flag. This also could be something to worry about only if it's brought up, as I'm not sure how many consumers really used a composable approach of the deprecated Modal. |
Notes from @wise-king-sullyman:
Will open a couple separate issues from all of this. |
Follow up to breaking change PR patternfly/patternfly-react#10799
Can we write a code mod to migrate from the old modal to the new composable version?
Required actions:
The text was updated successfully, but these errors were encountered: