-
Notifications
You must be signed in to change notification settings - Fork 157
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
[#2001] Extract c-authorship-file component from views/c-authorship #2096
[#2001] Extract c-authorship-file component from views/c-authorship #2096
Conversation
Hi @sopa301, we appreciate your efforts in trying this out! While this approach does break down the huge file into smaller parts, it creates multiple files that are highly interrelated instead of multiple loosely coupled components with good separation of concerns. I think it is better if we do our modularization by continuing to follow the Single-File Component pattern of Vue. Let us try to extract the various smaller components within the |
Thanks for the feedback! I'll look into extracting out a c-file first. |
75e60a1
to
89641b8
Compare
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.
Other than the brackets thing, LGTM!
* if the ref is on a v-for loop, else it will be a single HTMLElement. | ||
*/ | ||
getElementByRef(refName: string): HTMLElement { | ||
return Array.isArray((this.$refs[refName])) |
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.
Minor nit, but there brackets here are doubled
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 that! I fixed it.
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!
I was wondering if we could move some code of processFiles()
into child components so that the individual file processing that is not required by the parent c-authorship.vue
component can be moved into c-authorship-file.vue
. If possible (and helpful - more code explainability, chances of better performance), we can look into this in a future PR.
@sopa301 Can you also update the PR title to refer to the |
@vvidday Do give us your thoughts on 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.
Great work on this PR @sopa301! This is a great step towards our goal of breaking down the giant components. Just have some very minor questions.
Regarding the CSS changes, I agree that can be done in a separate PR.
Hmm the only thing I'm concerned regarding this is that currently the authorship component is updating the entire |
…01-split-views-authorship
…301/RepoSense into 2001-split-views-authorship
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!
The following links are for previewing this pull request:
|
Part of #2001
Proposed commit message
Other information
There was a bug in
dynamicMixinTooltip.ts
where if a component tried to access the methods that involve looking for specific elements while those elements are not in av-for
loop, the result returned bythis.$ref[elementName]
would not be an array, causing the code to crash. Credits to @jonasongg for discovering this bug and providing the solution.Also, there seems to be some scss code labelled as
segment
in thec-authorship-file
which should be inc-segment
instead. Perhaps it should be shifted there, maybe in another PR.