-
Notifications
You must be signed in to change notification settings - Fork 3
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
refactor: Refactor Editor into TypeScript with Smaller Components and Separate Concerns #830
Conversation
Still a lot of work if we want the entire Editor to be refactored. I simply just grabbed a few large components such as a few modals and localStorage and removed them to their own separate files ontop of providing type safety. I will be casually doing this when I have time but This current interation with TS allows me to more easily integrate new features. |
@@ -0,0 +1,908 @@ | |||
import type * as borsh from 'borsh'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this file be in Legacy/
? We need it right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes we use everything is Legacy its nothing more than a placeholder. Maybe I should rename it to something else such as EditorComponents and continue to refactor them out as I go?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Legacy makes me assume it is being phased out - and we still need this file. We could either move this one or rename Legacy?
@@ -96,7 +96,7 @@ const PublishFormView = ({ | |||
id="contractFilter" | |||
type="text" | |||
placeholder="social.near" | |||
value={startBlock === 'startBlockContinue' ? indexerDetails.rule.affected_account_id : contractFilter} | |||
value={startBlock === 'startBlockContinue' ? contractFilter : indexerDetails.rule.affected_account_id} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted back to Contract Filter is now Editable. I must have selected the wrong option in the merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for catching this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm slightly concerned there may be other cases of incorrect merge resolves, could you please do a quick scan to check? 🙏🏼
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reviewed the files and the PRs between the last few pushes to dev to make sure they are present. The changes to the contract filter and the changes to polling on latest indexer block are present ontop of prettier. I also went ahead and reviewed the files and there are no noteable differences.
@@ -1,4 +1,4 @@ | |||
import Editor from '@/components/Editor'; | |||
import Editor from '@/components/Editor/Legacy/Editor'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the purpose of Legacy?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey Morgan its just a container for what ill continue to refactor. The Legacy folder is a bit misleading in name but its simply a container for all the files I have yet to convert to TS or have not organized that are related to Editor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reviewed files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but can you update the PR title before merging, it should use refactor:
not feat:
Refactored Editor Component to TypeScript. This refactoring involved breaking down the Editor file into smaller chunks and separating concerns into distinct components. Also did some minor work on validator to ts as it is a major consumer in the editor. It is setup to later iterate on some additional test for validators.