patrickhulce / patrickhulce/third-party-web

Attributing impact on Web Vitals 🧪

Open
#98 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
1.1k
Forks
112
Avg merge
22h 26m
Merged PRs (30d)
1

Description

TPW currently does a great job capturing the execution costs of individual third-party scripts.

I'm curious if there's a mechanism we can define for measuring the impact these third-parties have on web vitals. As an example, let's take CLS:

For each Lighthouse run via HTTP Archive/WPT:

  • Check the Cumulative Layout Shift elements audit for the top N DOM elements contributing to shifts *
  • Using some initiator or DOM API patching magic (wild hand waviness), discover what script initiated the injection of each of these DOM elements
  • Visualize attribution in a similar way as is done for script execution

Is this crazy-talk, @patrickhulce ? :)

  • Exploring this type of idea may rely on us being able to craft better 3P CLS attribution in Lighthouse itself first, so feel free to say this is not remotely possible for now. Current CLS audit looks at elements that were shifted but not necessarily why they shifted.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Lighthouse Cumulative Layout Shift elements audit and the HTTP Archive/WPT Lighthouse runs described here. Investigate whether initiator or DOM API patching can connect shifted elements to third-party scripts, then define attribution visualization comparable to the existing script-execution view. Done means a feasible measurement approach and visualization scope are established.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
performance, web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.