-
Notifications
You must be signed in to change notification settings - Fork 17
Functional components prototype #108
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
base: main
Are you sure you want to change the base?
Functional components prototype #108
Conversation
|
As an added note, I think doing this would be a great help into frontend maintainability. For example, the issue with #110 seems to be harder to solve due to somewhat intricate component structures and state logic. Please keep in mind I don't want to blindly criticise your (and other contributors') work, @bpowers! I am just trying to help the way I know how, and I highly appreciate the work you've done here: it's spectacular what a tiny group of people are able to do with dedication. You are welcome to reject or push back on any of these ideas, of course. I am just trying to find a way to "ease into" the project to implement some of these features we all(?) seem to want, like multi-selection, run management, etc. |
|
this broadly looks reasonable to me! One concrete thing is that after your Login.tsx changes I can't enter text in the email field that pops up after clicking "login by email" |
|
@bpowers fixed! You were totally right, I moved a bit too fast here :P Should be good now. As an piggy-backed changed, I delegated even more work to the browser (client-side validation of fields) and removed some unnecessary state because of that. The component is simpler and the functionality should be the exact same, except that the messages look "browser-default". I personally don't mind this, but you should give it an OK for use to move forward with this choice from now on. |
|
great - I will look closer tomorrow. Happy to have more client side validation! we'll need to keep server side validation as well. You didn't remove anything, so I think we're on the same page, just wanting to say it for posterity |
|
Yeah, for sure! I did not change any of the client/server responsibilities at all! I just moved the client-side ones from the application code to the browser :) Everything should be checked on the server, that's a given! |
|
I'll open this so it can be merged, and then I'll continue refactoring stuff bit by bit, as needed! |
This is a prototype/preview of what functional components could look like, potentially.
I want to stress that this change would be mostly made incrementally, as needed, and not all at once. There's specific places where it would be beneficial to have functional components, for example in places where it's more semantic to use
useLocationto navigate (as I did in theHomeexample).Two things to note:
usefunction/hook, but I got hit by a bunch of errors from Typescript, ESLint, etc. that I couldn't solve. I also am not really experienced with working with these sort of "workspace" repos, where tons configuration is shared among many parts of the project. E.g. I don't fully understand why theappdirectory has both a.eslintrc.jsand aeslint.config.jsfiles, and simlinks to the roottsconfig.jsonand also has atsconfig.browser.json. This is tangential to the PR, of course, but it's the kind of thing that I believe slows down the entry of a new developer (like me! eheh)How to analyse at this
I think the best way to take a look is to ignore the PR view on Github, and just first look at the new file on its own. Get a feel for it, and how the semantics look and feel like. Then maybe side-by-side with the old version.
Let me know what you think :)