Resource direct lookup support
Nobody has claimed this yet.
- Dominant language
- Bikeshed
- Stars
- 135
- Forks
- 40
- PR merge metrics
- No merged PRs in 30d
Description
Short (bad-version) idea: Have a way to associate a resource with its performance entry via the event handlers for the resource itself. This could be a callback of sorts or an identifier/reference. But something that helps me map this resource to its timing.
When building tooling to analyze the performance of requests, we need to measure a few things - status code, request options, response bodies, etc. In almost all perf tooling, we will also need to pull what information we can from the performance entries. As of right now, that needs to be some level of heavily nuanced fuzzy logic around timing and order (which can be different cross-browser and across the different resource types). This makes things pretty challenging and less reliable than we would like.
as a trivial ("bad version") example:
const img = document.createElement('img');
img.addEventListener('load', (event)=>{
performance.getEntriesByIdentifier(event.target.resourceIdentifier);
})
img.src = '/icon.jpg';
document.body.appendChild(img);
I'm less interested in what it looks like personally but meeting that goal of the direct lookup. I think it's totally acceptable for the entry to not be there yet (invalidating the above example for all usecases) and we can use that identifier in conjunction with the performance observer to associate resources.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the Resource Timing behavior described in the issue, especially resource event handlers, performance.getEntriesByIdentifier, and the PerformanceObserver association idea. Define the direct resource-to-performance-entry relationship and account for entries that are not available yet; done means the specification has a settled mechanism and its timing behavior is clear.
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