codemod-com / codemod

The e2e platform for creating, sharing, and running codemods, built on top of your favorite codemod engine. Automate code migrations, cleanups, and refactors for yourself, colleagues, and the community.
https://codemod.com
Apache License 2.0
229 stars 10 forks source link

[codemod][new] types-react: remove deprecated types related to mixins #643

Open alexbit-codemod opened 1 month ago

alexbit-codemod commented 1 month ago

on behalf of eps1lon:

"ComponentSpec and Mixin are now in create-react-class. It might be easiest to fork the deprecated-prop-types-types but with create-react-class instead of prop-types as the target package.

Needs real world codebase with usage to test on."

Note: The example section helps codemod contributors identify all the transformation patterns that this codemod should handle. Repeat before/after snippets for every transformation example you can find.

Code before transformation

//insert your code before transformation here

Code after transformation

//insert the expected **correct** output here

Applicability Criteria

Which types-react versions include the deprecated pattern?

Additional context or links

Add any other context about the problem here. This might include extra considerations, edge cases, relevant business logic, existing migration guides, relevant links, etc.

mohab-sameh commented 1 month ago

@alexbit-codemod the before/after snippets are placeholders. Is that intentional? I cannot find a reference to:

"ComponentSpec and Mixin are now in create-react-class. It might be easiest to fork the deprecated-prop-types-types but with create-react-class instead of prop-types as the target package.

in the migration doc.

alexbit-codemod commented 2 weeks ago

i might have made a mistake with the link... @eps1lon has a separate repo and list of missing codemods...ill try to get that later

alexbit-codemod commented 2 weeks ago

or maybe you can try to find it yourself

mohab-sameh commented 2 weeks ago

I could find the issue in @eps1lon's repo but it also doesn't have context about the before/after. @eps1lon if you can provide them, it would be great. Otherwise, I can investigate.

eps1lon commented 2 weeks ago

I could find https://github.com/eps1lon/types-react-codemod/issues/361 in @eps1lon's repo but it also doesn't have context about the before/after.

Same as deprecated-prop-types-types but with ComponentSpec and Mixin and create-react-class instead of prop-types.