-
Notifications
You must be signed in to change notification settings - Fork 850
[HTML5 Article Renderer] Refactor Table Implementation #14002
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: develop
Are you sure you want to change the base?
[HTML5 Article Renderer] Refactor Table Implementation #14002
Conversation
Build Artifacts
|
rtibbles
left a comment
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.
A bit more cleanup I think we can do.
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.
As this prop is no longer being used, I think we can just delete 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.
You mean tableCounter? because I can't see it from this comment
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.
No - the stylingOverrides prop.
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.
Likewise, we can delete styleOverrides here too?
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 think the prop being consumed by SafeHtmlImage
| return { | ||
| functional: true, | ||
| render(h) { | ||
| const tableChildren = []; |
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.
Now that we're just adding safe-html class to the caption - couldn't we just use the passed in mapChildren function here to map the children and then return them - because it already does that!
| const vm = this; | ||
| return { | ||
| functional: true, | ||
| render(h) { |
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.
This implementation looks correct, but architecturally it introduces a potential source of confusion. We’re creating a functional component inside a computed property of a regular component—essentially building a mini component-factory within the component. This adds layers of complexity we’re trying to move away from.
A cleaner alternative would be to generate the table elements dynamically (not programmatically) and then assigning relevant styling defined within the component itself, thus the redundancy of the style override props.
Our goal is to migrate the current functional component (.js) into an Options API or, ideally, a composable-based component structure. This will help keep the codebase more consistent and maintainable going forward.
akolson
left a comment
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.
Hi Allan! Great start to this refactor. I left a comment that I think is important in better shaping the outcomes of this pr. Thanks
Summary
This PR restructures the SafeHtmlTable as a Vue single-file component.
closes #13850
References
#13850
Reviewer guidance
Please see and verify ;