codemod icon indicating copy to clipboard operation
codemod copied to clipboard

feat(Codemod) : Preact Migrations vX

Open manishjha-04 opened this issue 1 year ago • 10 comments

📚This codemod automates the migration process from Preact versions earlier than 8 to the latest version (vX), ensuring compatibility and streamlining the upgrade.

  • [x] Tests for the changes have been added (for bug fixes/features)
  • [x] Docs have been added / updated (for bug fixes / features)

manishjha-04 avatar Aug 21 '24 10:08 manishjha-04

@manishjha-04 is attempting to deploy a commit to the Codemod Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Aug 21 '24 10:08 vercel[bot]

Hi @manishjha-04 this is awesome! Do you have some repos in mind we can use for testing before merging?

mohab-sameh avatar Aug 21 '24 13:08 mohab-sameh

@all-contributors add @manishjha-04 for code

mohab-sameh avatar Aug 21 '24 13:08 mohab-sameh

@mohab-sameh

I've put up a pull request to add @manishjha-04! :tada:

allcontributors[bot] avatar Aug 21 '24 13:08 allcontributors[bot]

Yeah Hii @mohab-sameh

I do have a couple of repositories you can check out: Nectarine and Spotifio-UI. Depending on the code, you might find that different codemods are needed for each.

You can use the migration recipe codemod preact/X/migration-recipe on them, as the required updates may vary for each.

manishjha-04 avatar Aug 21 '24 16:08 manishjha-04

Great work Manish, have you tested on these repos already?

arshcodemod avatar Aug 21 '24 18:08 arshcodemod

Yup @arshcodemod !

manishjha-04 avatar Aug 21 '24 18:08 manishjha-04

@manishjha-04 I'm trying to see if there are more popular test repo candidates so that you get the spotlight for a high-impact change. Something that has a large following (stars) and has active maintainers. Ideally, the recipe can open a PR for a popular tool that uses Preact < 8 to the latest version. People will thank you for that.

Do you have candidates in mind we can do this for?

mohab-sameh avatar Aug 22 '24 12:08 mohab-sameh

Hey @mohab-sameh Let me look into it and will let you know if i found the one! But surely next time will try to pick a framework which has latest updates so that we could have a wider reach!

manishjha-04 avatar Aug 22 '24 15:08 manishjha-04

I do have a couple of repositories you can check out: Nectarine and Spotifio-UI. Depending on the code, you might find that different codemods are needed for each.

The latter, "Spotifio-UI", is made with Deno's Fresh, which is only 3-ish years old; Fresh only supports Preact X, as X was pretty mature by the time it (Fresh) was created, and it (Fresh) requires APIs that weren't available in 8.

I'm not quite sure what codemods you run against that project, given it's already running & using the target version?

rschristian avatar Aug 30 '24 13:08 rschristian