-
Notifications
You must be signed in to change notification settings - Fork 85
Experimental Workload: Responsive Design #453
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?
Conversation
1da5897
to
34a545e
Compare
Adding reviewers for visibility, feel free to take a look :) |
It seems to me that the test doesn't really take the advantage of responsive design since iframe's size is always same. Maybe we should add steps to resize iframe so that responsive design comes into play? |
Currently, we are resizing the the iframe with id |
Oh, I see. We're resizing the inner iframe. I guess that works. |
Gentle ping 😄 |
I still see rather short run times for individual steps (close to 1.6ms in chrome canary) which might introduce a bit too much noise in the long run.
ScrollToChatAndSendMessage and (and especially it's sub-items) will show some aliasing from timer resolution which is ~ 0.1ms on chrome. |
<title>Cooking with Lit and Tailwind</title> | ||
</head> | ||
<body style="overflow: hidden; margin: 0"> | ||
<iframe title="Cooking Website with Recipes" id="content-iframe" src="iframe.html" width="800px" height="600px" style="border: none"></iframe> |
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.
Can we start off with 100% width/height as the maximum size (the step-resize sounds ok to be done with explicit sizes again)?
Albeit not fully exposed, we can set a custom viewport size in the params.mjs and it's used in the runner.
This workload would currently not support this directly.
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.
Sounds good to me
To bump up the step durations, I am thinking of
currently no proposed changes for |
I'll add a fix for that. The webpage was designed to be viewed in 800x600, as that's how it will appear within the benchmark.
Yes, that is expected. Do we prefer a different behavior?
Yes, they are just placeholders. We intended the video elements to be there but did not plan for them to play any actual videos. |
I guess it makes sense for the tests, since it shifts elements on the page. That said, it's not something you'd see on the web (hopefully). I'd expected a modal or something like that instead.
Thanks for clarifying. |
@issackjohn - maybe rebase / merge main, to get the updated test runner in there. That should ensure the checks don't fail. |
Let's aim for > 5ms for each measured subtest (I'd still aim for roughly 10ms if possible). Does this sound reasonable? |
Sounds good. |
Sounds reasonable to me, I'll add some more actions. |
cd96d0b
to
3413c3d
Compare
Just double checked on Chrome, Firefox, Safari and the noise levels are in-sync with the rest of the workloads. |
Thanks! Looking forward to addressing anymore feedback from folks. |
057e604
to
e7887e9
Compare
✅ Deploy Preview for webkit-speedometer ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
e7887e9
to
698c725
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.
Ths looks pretty good to me!
I see that when running npm run dev
the dist files get overridden. Do you know if we can make it so the dev files are written in a different location, to minimize risks of errors in the future?
Otherwise my main issue is that the width setting in ReduceWidthIn5Steps
and IncreaseWidthIn5Steps
don't seem to be captured properly, at least in Firefox on my current machine (which is a bit slow). IMO this needs to be fixed, but this can be done in a follow-up.
Then I have a few more minor comments here and there. I haven't looked very closely at the tailwind code because I'm not familiar with it.
Also I wonder if we could include matchMedia
somewhere.
Thanks!
Please add new changes in a separate commit.
@@ -35,3 +35,4 @@ | |||
|
|||
/resources/charts/node_modules/ | |||
/resources/todomvc/big-dom-generator/node_modules/ | |||
/experimental/responsive-design/node_modules/ |
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.
at this point, we should just add node_modules
which would ignore all directories name that way :-) (but that can be done in a follow-up PR)
src/tailwind.generated.css | ||
src/tailwind.chat-window.generated.css |
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.
maybe use *.generated.css
?
@@ -46,3 +46,5 @@ package-lock.json | |||
/resources/perf.webkit.org | |||
|
|||
/resources/react-stockcharts | |||
|
|||
/experimental/responsive-design/ |
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'd remove that, we want the workload to follow the same code style.
The 2 existing ignores are there mostly because they're dumps of existing projects. (I'm not sure this is a good reason, but well that's the history)
{ | ||
"arrowParens": "always", | ||
"bracketSameLine": false, | ||
"bracketSpacing": true, | ||
"htmlWhitespaceSensitivity": "css", | ||
"printWidth": 250, | ||
"semi": true, | ||
"singleQuote": false, | ||
"tabWidth": 4, | ||
"trailingComma": "es5", | ||
"useTabs": false, | ||
"plugins": ["prettier-plugin-tailwindcss"] | ||
} |
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.
let's use the project-wide prettier configuration
(should be changed soon finally)
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.
but if you want to do it after #371 that's fine by me too.
@@ -0,0 +1,74 @@ | |||
export default [ |
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.
let's use the project-wide eslint configuration
"dev:rollup": "rollup --config rollup.config.js --watch", | ||
"dev:serve": "web-dev-server --watch", | ||
"lint:check": "eslint **/*.{js,mjs,jsx,ts,tsx}", | ||
"lint:fix": "eslint \"**/*.{js,mjs,jsx,ts,tsx}\" --fix", |
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.
nit:
"lint:fix": "eslint \"**/*.{js,mjs,jsx,ts,tsx}\" --fix", | |
"lint:fix": "npm lint:check -- --fix", |
const breakpoint = breakpoints.find((bp) => width >= bp.minWidth); | ||
this.visibleButtons = breakpoint ? this.buttons.slice(0, breakpoint.buttons) : this.buttons.slice(0, 2); |
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'm curious, why it's not done with CSS or window.matchMedia?
Is it just to exercize ResizeObserver?
Can we please have a comment to explain that? (also in the other file where it's used)
querySelector(selector, path = []) { | ||
const lookupStartNode = this._frame.contentDocument; | ||
querySelector(selector, path = [], inIframe = false) { | ||
const lookupStartNode = inIframe ? this._frame.contentDocument : this._frame.contentDocument; |
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.
The 2 parts of the ternary are identical, is that expected?
|
||
widths.forEach((width) => { | ||
iframeElement.setWidth(`${width}px`); | ||
page.layout(); |
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 layout doesn't work, possibly because the resize observer is async?
I think you should try doing several steps instead of just one, so that the async part is properly captured.
const widths = [560, 640, 704, 768, 800]; | ||
|
||
widths.forEach((width) => { | ||
iframeElement.setWidth(`${width}px`); |
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.
same here
This pull request introduces a new experimental responsive design workload, featuring a single-page cooking website built with Lit and Tailwind CSS.
The hosted version can be found here.
Quick link to dev mode with workload selected.
Please look at the README in
experimental/responsive-design
for more information about the code and how it is organized.Not included in this PR: