theRAPTLab / meme-2023

MEME 2023 grant development (fork from MEME 2018)
MIT License
0 stars 0 forks source link

Test use ChatGPT to migrate ResourceView.jsx #13

Closed benloh closed 2 weeks ago

benloh commented 4 weeks ago

Used ChatGPT3 to convert ResourceView.jsx using the command:

convert this component to MUI5 using the 'styled' utility: ...

The response was:

To convert the given component to MUI5 using the styled utility, you'll need to make several changes. Specifically, you'll replace the withTheme HOC with the styled utility from @mui/material/styles and update the component styles accordingly. Here’s how you can do it:

  1. Remove the withTheme import and the corresponding usage.
  2. Use the styled utility to create styled components.
  3. Update class names and ensure the styles are applied correctly.

Summary:

In this refactored version:

  • The withTheme HOC has been removed.
  • Styles have been converted to use the styled utility from @mui/material/styles.
  • The class names have been replaced with the corresponding styled components.

Although it's difficult to assess the success of the conversion, React warnings and errors have been removed.


Converting EvidenceLink.jsx was much more problematic 96b81a8:

  1. theme.palette appears to be undefined.
  2. subcomponents have been oversimplified, instead of being broken down into functional chunks

FOR REVIEW PURPOSES ONLY! DO NOT MERGE!!!

benloh commented 2 weeks ago

Will not merge. This was an experimental branch.