Introduction and ideas for project "Refactor class components to functional components"

Hello everyone
I'm Sudhanshu Tripathi, a pre-final year student at IIIT Naya Raipur. I'm very excited to apply for GSoC'23 for the project "Refactor class components to functional components". While analyzing the details of this project, I felt like it involved a lot of repetitive work, and may also be prone to mistakes. I think we can instead create a basic tool that parses the JavaScript code for the class-based components and generates a new file that uses functional components with relevant hooks, and maybe some optimizations. The tool once complete would speed up the refactoring process significantly. This would also help refactor the components that are not covered within the scope of GSoC'23. @sneridagh do you have any suggestions regarding this approach?

Hi. This is the detailed PLIP/proposal: Refactor class components to functional components · Issue #4460 · plone/volto · GitHub

1 Like

Thanks for sharing the link. I have already gone through the Github Issue. Can you provide any feedback on my idea? I would really appreciate it.

This project is not just about the code conversion but also about to carefully understand the functionality of every component, how it plays with the components around, and adjust the lifecycle to the existing one. This is usually not possible to make it automatic. So many nuances could be overlooked.

We will have also to provide a Cypress test for each conversion, and a StoryBook story to demonstrate that the features are intact.