Skip to content
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

trial of converting class-based React components to functions #1544

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

R-Stev
Copy link

@R-Stev R-Stev commented Mar 26, 2024

Description

Progress for #1543
I appear to be unable to run the python backend on linux to confirm everything still works correctly, so this updates only one of the relevant *.jsx for now.

Checklist

  • Updated HISTORY.rst and link to any relevant issue (if these changes are user-facing)
  • Updated the user's guide (if needed)
  • Tested the Workbench UI (if relevant)

@R-Stev R-Stev closed this Mar 26, 2024
@R-Stev
Copy link
Author

R-Stev commented Mar 26, 2024

I noticed that I am still able to run yarn test-renderer which shows that it wasn't quite correct, so aborting.

@R-Stev R-Stev reopened this Mar 29, 2024
@R-Stev
Copy link
Author

R-Stev commented Mar 29, 2024

workbench/src/renderer/components/DataDownloadModal/index.jsx
workbench/src/renderer/components/HomeTab/index.jsx
workbench/src/renderer/components/LogTab/index.jsx
workbench/src/renderer/components/OpenButton/index.jsx
workbench/src/renderer/components/Portal/index.jsx
workbench/src/renderer/components/SaveAsModal/index.jsx
workbench/src/renderer/components/SettingsModal/index.jsx
workbench/src/renderer/components/SetupTab/ArgsForm/index.jsx

Converted to functional components, and passes yarn test-renderer. Included in this pull request.

workbench/src/renderer/components/ErrorBoundary/index.jsx

Currently no way to write an error boundary as a function component, leave unchanged or look at https://github.com/bvaughn/react-error-boundary ? (see note in https://react.dev/reference/react/Component#catching-rendering-errors-with-an-error-boundary)

workbench/src/renderer/app.jsx
workbench/src/renderer/components/InvestTab/index.jsx
workbench/src/renderer/components/SetupTab/index.js

I was unable to get these to the point of passing all tests. Not included.

@dcdenu4
Copy link
Member

dcdenu4 commented Apr 2, 2024

Hey @R-Stev, thanks for jumping in and taking a stab at this. We are currently in the process of putting together contribution guidelines for our project and working through some legalese with Stanford University to make sure we can accept non trivial contributions. So we might sit on this for a bit until we learn more! We are really excited to be able to take contributions from the open source community, so thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants