-
Notifications
You must be signed in to change notification settings - Fork 73
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
Add Web Components and LIT versions of Complex-DOM TodoMVC #285
Add Web Components and LIT versions of Complex-DOM TodoMVC #285
Conversation
@flashdesignory Please let me know if this approach looks good, this should work for the LIT implementation too, which we'll clean up tomorrow. |
...mvc/vanilla-examples/javascript-web-components/src/components/todo-app/todo-app.component.js
Outdated
Show resolved
Hide resolved
...vc/vanilla-examples/javascript-web-components/src/components/todo-item/todo-item.template.js
Outdated
Show resolved
Hide resolved
.../vanilla-examples/javascript-web-components/dist/components/todo-item/todo-item.component.js
Outdated
Show resolved
Hide resolved
resources/todomvc/big-dom-generator/javascript-web-components/generated-variables.css
Outdated
Show resolved
Hide resolved
@lpardosixtosMs - can you also add scores standalone / complex? |
Yes, I will post them here once we get the LIT implementation ready. |
resources/todomvc/architecture-examples/lit/src/lib/todo-item.ts
Outdated
Show resolved
Hide resolved
@flashdesignory here are the numbers: OS: macos 13.4.1 arm64. Device: MacBookPro17,1. CPU: Apple M1 8 cores. TodoMVC-Lit-Complex-DOM/total
TodoMVC-Lit/total
TodoMVC-WebComponents-Complex/total
TodoMVC-WebComponents/total
Sanity check: Numbers before this PR: TodoMVC-Lit/total
TodoMVC-WebComponents/total
|
Really great to see web components and shadowdom based tests going in here! We (Adobe) have much more complex scenarios and patterns of web components and shadowdom usage than even these complex benchmarks, and we see similar performance metrics across the browsers as these new numbers are indicating. Definitely worth having these more complex cases as some of our web apps have upwards of 8k+ nodes on the page at a time, as well as very deeply nested ShadowDOM trees, as a result we see performance degradation in some browsers in these cases, so its good to get these benchmarked so they can be improved upon. |
Not for this PR but I thought this would be a relevant place to discuss the new PR I'm working on. @flashdesignory the Lit version of the TodoMVC sets the "completed" classname to the li like the rest of the frameworks todomvc-litoverride render() {
const itemClassList = {
todo: true,
completed: this.completed ?? false,
editing: this.isEditing,
};
return html`
<li class="${classMap(itemClassList)}"> but the javascript-web-components TodoMVC uses an attribute "completed" in the custom component "todo-item" instead. toggleItem() {
// The todo-list checks the "completed" attribute to filter based on route
// (therefore the completed state needs to already be updated before the check)
this.setAttribute("completed", this.toggleInput.checked);
this.dispatchEvent(
new CustomEvent("toggle-item", {
detail: { id: this.id, completed: this.toggleInput.checked },
bubbles: true,
})
);
} Is it possible to make either of these use the same approach as the other, this would help with the complex versions being able to share handcrafted CSS. Is this possible? Or what would you suggest? |
The web component version is the only workload so far that is built according to my proposed css / a11y changes and therefore the structure is different from the other workloads. We are postponing making the same changes to the other todomvc apps and saving it for the next version (S4). If you want to make a change in the web component version, please add comments so that we can revert the changes at a later point. Also, I would prefer not to touch the |
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.
Just a few early comments. I think this will need to be updated after #291 anyway, right?
resources/todomvc/architecture-examples/lit-complex/scripts/build.js
Outdated
Show resolved
Hide resolved
resources/todomvc/vanilla-examples/javascript-web-components-complex/scripts/build.js
Outdated
Show resolved
Hide resolved
Thank you! and yes that's right. |
Okay that makes sense. Thanks! |
Add Web Components todoMVC complex DOM implementation. Co-authored-by: Luis Fernando Pardo Sixtos <lpardosixtos@microsoft.com>
Add complex DOM version of LIT. Co-authored-by: Luis Fernando Pardo Sixtos <lpardosixtos@microsoft.com>
9d415c6
to
f82c856
Compare
@flashdesignory @julienw. I updated the workload to work with handcrafted rules instead of a random generator. Can you take another look? I also updated the description and the workload design document. Here are the most recent perf numbers: Before: OS: macos 13.4.1 arm64. Device: MacBookPro17,1. CPU: Apple M1 8 cores. TodoMVC-Lit-Complex-DOM/total TodoMVC-Lit/total TodoMVC-WebComponents-Complex/total TodoMVC-WebComponents/total Sanity check. Numbers before this PR: TodoMVC-Lit/total TodoMVC-WebComponents/total |
@lpardosixtosMs @issackjohn - is the requested change from @issackjohn completed and resolved? |
Yes, but he's been out of office, that's why it is still there. |
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.
some minor cleanup nits
resources/todomvc/big-dom-generator/utils/web-components-css/app.css
Outdated
Show resolved
Hide resolved
resources/todomvc/big-dom-generator/utils/web-components-css/app.css
Outdated
Show resolved
Hide resolved
resources/todomvc/vanilla-examples/javascript-web-components-complex/a.out
Outdated
Show resolved
Hide resolved
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 left a few comments, tell me what you think!
resources/todomvc/vanilla-examples/javascript-web-components-complex/a.out
Outdated
Show resolved
Hide resolved
resources/todomvc/architecture-examples/lit/src/lib/todo-item.ts
Outdated
Show resolved
Hide resolved
resources/todomvc/architecture-examples/lit/src/lib/todo-item.ts
Outdated
Show resolved
Hide resolved
resources/todomvc/big-dom-generator/utils/web-components-css/lit/todo-item-extra-css.js
Outdated
Show resolved
Hide resolved
resources/todomvc/big-dom-generator/utils/web-components-css/lit/todo-item-extra-css.js
Outdated
Show resolved
Hide resolved
resources/todomvc/big-dom-generator/utils/web-components-css/lit/todo-item-extra-css.js
Outdated
Show resolved
Hide resolved
resources/todomvc/big-dom-generator/utils/web-components-css/lit/todo-item-extra-css.js
Show resolved
Hide resolved
resources/todomvc/big-dom-generator/utils/web-components-css/vanilla/todo-item-extra-css.js
Outdated
Show resolved
Hide resolved
Addressed the feedback, Thanks! @flashdesignory @julienw I realized that adding the extra style sheet in the @rniwa this change doesn't enable any test by default, do you want to take a look before merging? |
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.
Looks sane to me.
@lpardosixtosMs - these changes are only related to complex dom styles, correct? |
@flashdesignory correct. In the standalone case the extra stylesheet is not added (Web components) or an empty style entry is added (LIT). |
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.
Looks good to me, thanks
This PR adds the Web Components and LIT versions of the Complex-DOM todoMVC workload.
Changes to the complex DOM generator:
Changes to the standalone versions.
show-priority
class name to thetodo-list
elements.data-priority
attribute to thetodo-item
elements.window.extraTodoListCssToAdopt
andwindow.extraCssToAdopt
are populated and adopt the stylesheets stored in them. The variables should not be defined on the standalone version, and they are populated in the complex version from another script.This PR DOESN'T modify which workloads run in the benchmark. That will be done in a follow up PR.
Workload design: https://docs.google.com/document/d/1QoO1VzFf3PZY-lsHdHFKGX6m1p393iEqjHQOzmU0NUI/edit?usp=sharing
Hosted version: https://lpardosixtosMs.github.io/SpeedometerWebComponents/?suite=TodoMVC-WebComponents,TodoMVC-WebComponents-Complex,TodoMVC-LIT,TodoMVC-LIT-Complex-DOM