-
Notifications
You must be signed in to change notification settings - Fork 257
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
Rename resource
to resourceType
in ResourceDetail
#11971
Rename resource
to resourceType
in ResourceDetail
#11971
Conversation
f634802
to
f127658
Compare
Signed-off-by: Phillip Rak <[email protected]>
f127658
to
8d6d46e
Compare
@eva-vashkevich you've addressed a lot of regressions in edit components by adding |
@richard-cox I'm adding you as a reviewer to get your feedback on whether or not we believe there to be too much risk associated with this change. My testing has been looking good up through this point, and I want to get a fresh perspective on this change. |
This does seem to fix the issues I've worked on that were fixed with inheritAttrs |
9b3399d
to
8d6d46e
Compare
General approach looks good, the more eyes on this the better though. I'd like to kick the tires a bit more before this merges |
@aalves08 @mantis-toboggan-md adding you as reviewers so that we can more eyes on this change |
This comment has additional information and a minimal repro to demonstrate the behavior: |
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 haven't been able to identify anything broken by this PR but it is a tough one to verify. Would this change potentially affect components under shell/detail/ as well? I see the ResourceDetail is used in both create.vue
and _id.vue
pages. I've searched for references to this.resource
and resource:
excluding test files and the shell/list directory looking for components that either define a resource prop or otherwise expect it passed in from ResourceDetail
.
The PR looks good from my perspective but I definitely agree about the need for multiple reviewers on this one.
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.
Given it a prod, looks good.
I also went through the ./shell/detail
components, no references to resource
there (which came from above).
Would vote for one more green tick and then we can 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.
All instances seem correctly replaced as for looking at the code in the editor, so LGTM
…dashboard#11971 Signed-off-by: Francesco Torchia <[email protected]>
…dashboard#11971 Signed-off-by: Francesco Torchia <[email protected]>
Summary
This resolves an issue that we've been seeing in edit components where the
resource
data prop, being passed to dynamically rendered components viav-bind="$data"
, is overwriting props in a grandchild component at the root of the child. The root cause of this issue is directly attributed to how Vue3 manages fallthrough attributes12.Fixes #
Occurred changes and/or fixed issues
resource
toresourceType
to preventresource
colliding with granchild props as a fallthrough attributeTechnical notes summary
I'm identifying all instances of
resource:
in our edit components with the followingWe have two potential alternatives to this change:
inheritAttrs: false
to each component undershell/edit
to disable attribute fallthrough behaviorv-bind.attr="$data"
orv-bind.prop="$data"
to prevent the fallthrough behavior2Areas or cases that should be tested
This change affects every component that can feasibly be rendered by `ResourceDetail.
Areas which could experience regressions
Any components with an actual
resource
prop that might be dynamically rendered via:dashboard/shell/components/ResourceDetail/index.vue
Lines 420 to 435 in f634802
It's difficult to assert that this is a safe approach without any form of contract between components that we can dynamically render and
ResourceDetail
.We would also need to assert that any mixins associated with any given component does not also declare a
resource
prop.Checklist
Footnotes
https://vuejs.org/guide/components/attrs.html#fallthrough-attributes ↩
https://vuejs.org/api/built-in-directives.html#v-bind ↩ ↩2