-
Notifications
You must be signed in to change notification settings - Fork 14
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
Support Element Timing on Containers #79
Comments
Hey Andy, I thought the conversation in Web Perf meeting was fantastic and I believe there were a few good concrete ideas that came out of that. I'd love to see a summary of all the notes as a concrete set of possible improvements. |
Let me take a stab at some summary that I heard:
Beyond Since our last group discussion a few of us had a separate breakout to discuss some options for next steps. We realized that We may still want to add this capability to the platform, it may be to improve DX/performance, or so it could be used by the LCP algorithm by default. So, how might we try a polyfill, and which Element-timing changes would be useful/needed?
Anything else? |
Hi Michal I think you've summarized it quite well and mentioned most of the points we have discussed.
Yep, there may be a "quick win" today with some compound elements such as
We (Bloomberg) do stream data into our components, for example: numbers being streamed into a grid. We are interested when this grid has been populated, but not when numbers or values have changed. I guess this can become complicated because I would see this as 2 paints:
In our case we care about the later, but the browser wouldn't be aware there is more content coming so this isn't as straight forward and may need more discussion. One idea is to have the candidate model instead of a single-fire (similar to LCP), and once there is interaction on the page we stop checking for candidates and report a final event.
@andydavies has been dealing with this area and he can certainly provide some insights to this. PolyfillWe're happy to help contribute to a polyfill or at least get the ball rolling.
This is a good point and not one that I've thought about, I guess if some elements are layered visually behind another, the browser wouldn't deem them paintable but the polyfill wouldn't know that so this would have some corner cases. I assume it's not enough to just calculate overlapping elements and there may be other reasons paint is skipped?
Yes I think so, frameworks like next.js/server side react will have pre-rendered content from the server side shown in the browser, then it will fire any useEffects after. This means we're bound to see usage of element-timing where the DOM node has already been painted and we just need to "check" that has happened. |
Here is a link to a prototype: |
Currently Element Timing only supports a small number of elements – image, text elements etc.
Developers increasingly think in terms of components, some of these may be a more complex elements e.g table, SVG, MathML, others may be collections on elements within a container – consent popup, product card, menus etc.
Timing these as a whole is an important use case but the closest we can get to that is timing individual elements and then choosing the last timestamp (within a container there's elements that might not be able to be timed)
Ideally developers should able to add the
elementtiming
attribute to a container element and have the timestamp report when all the children have rendered.This topic was discussed at the WebPerf Working Group on Dec 7th 2023
Slides from Jason and Andy's introduction: https://docs.google.com/presentation/d/1hX4okVFUpBnlvpHDkP117KBrOcqnFrw-FJR2eMNxxzc/edit?usp=sharing
Recording: https://youtu.be/MjGVtshDN7U
Minutes: https://w3c.github.io/web-performance/meetings/2023/2023-12-07/index.html
The text was updated successfully, but these errors were encountered: