-
Notifications
You must be signed in to change notification settings - Fork 88
PostMessage Cleanup - TodoMVC example (experimental) #509
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: main
Are you sure you want to change the base?
PostMessage Cleanup - TodoMVC example (experimental) #509
Conversation
✅ Deploy Preview for webkit-speedometer-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
*************************************************************************/ | ||
export class BenchmarkConnector { | ||
constructor(suites, name, version) { | ||
this.suites = suites; |
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 not use private variables?
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.
Is there a benefit in refactoring? Maybe that's a larger conversation if we want to prefer private variables in our code and might be better to tackle in a separate discussion. This is consistent with the previous example that uses the postMessage api and I rather want to avoid larger changes in a single pr.
resources/todomvc/vanilla-examples/javascript-web-components/dist/src/benchmark.mjs
Outdated
Show resolved
Hide resolved
resources/todomvc/vanilla-examples/javascript-web-components/dist/src/params.mjs
Outdated
Show resolved
Hide resolved
resources/todomvc/vanilla-examples/javascript-web-components/dist/src/test-invoker.mjs
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.
It looks good to me, but I think this can be somewhat improved.
Tell me what you think!
resources/todomvc/vanilla-examples/javascript-web-components/scripts/build.js
Outdated
Show resolved
Hide resolved
resources/todomvc/vanilla-examples/javascript-web-components/scripts/build.js
Outdated
Show resolved
Hide resolved
resources/todomvc/vanilla-examples/javascript-web-components/scripts/build.js
Outdated
Show resolved
Hide resolved
resources/todomvc/vanilla-examples/javascript-web-components/scripts/build.js
Show resolved
Hide resolved
resources/todomvc/vanilla-examples/javascript-web-components/scripts/build.js
Outdated
Show resolved
Hide resolved
resources/todomvc/vanilla-examples/javascript-web-components/scripts/build.js
Show resolved
Hide resolved
…cripts/build.js Co-authored-by: Julien Wajsberg <[email protected]>
…cripts/build.js Co-authored-by: Julien Wajsberg <[email protected]>
…cripts/build.js Co-authored-by: Julien Wajsberg <[email protected]>
resources/todomvc/vanilla-examples/javascript-web-components/dist/src/index.js
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.
thank you, this looks good to me now
.../todomvc/vanilla-examples/javascript-web-components/dist/src/speedometer-utils/benchmark.mjs
Show resolved
Hide resolved
.../todomvc/vanilla-examples/javascript-web-components/dist/src/speedometer-utils/benchmark.mjs
Show resolved
Hide resolved
...es/todomvc/vanilla-examples/javascript-web-components/dist/src/speedometer-utils/helpers.mjs
Show resolved
Hide resolved
...es/todomvc/vanilla-examples/javascript-web-components/dist/src/speedometer-utils/helpers.mjs
Show resolved
Hide resolved
|
||
switch (event.data.type) { | ||
case "benchmark-suite": | ||
const params = new Params(new URLSearchParams(window.location.search)); |
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.
So we're gonna propagate location.search from the main frame to iframe?
Maybe it's easier this one just grabbed params out of top.location.search
instead?
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's the benefit of doing it this way?
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.
So that we don't have to propagate / forward the query string from the main document to the iframe's document.
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 it would be nicer to explicitly forward this for debugging purposes. One would easily see the full URL including params for the frame in the network log and could open that separately.
Either approach would be fine.
This pr uses the todomvc web components workload and enables it for the post message api.
This is similar to what we've done for the news site example.
Benchmark changes
Workload changes
chrome:

safari:

todo: cb scores