w3c / resource-timing

Resource Timing
https://w3c.github.io/resource-timing/
Other
121 stars 35 forks source link

Expose everywhere #302

Closed Ms2ger closed 2 years ago

Ms2ger commented 2 years ago

Ref: https://github.com/tc39/proposal-shadowrealm/issues/331


Preview | Diff


Preview | Diff

yoavweiss commented 2 years ago

Hey! After talking to @domenic, I suspect that actually exposing Resource Timing to ShadowRealms would require a bit more than just an IDL change.

Please correct me if I'm wrong, but IIUC, it could be useful for folks to be able to use Shadow Realms in order to isolate their work from the rest of the document (or other realms). Hence, it could be useful to be able to know which resources your specific ShadowRealm loaded. That would require creating a separate performance timeline per ShadowRealm, and expose those entries there and only there.

Is Fetch aware of ShadowRealms? Would it be possible to pipe the ShadowRealm information from there? Have you looked into what work we'd need to do for PerformanceTimeline?

yoavweiss commented 2 years ago

FWIW, once we figure things out for Resource Timing, Server Timing is likely to follow.

littledan commented 2 years ago

fetch and other kinds of I/O (e.g., loading CSS and images) aren't exposed to ShadowRealms. So I'm not sure if resource timing will be very useful. And I can see the argument that, if ShadowRealms do expose resource timing some day, then they should be separated somehow. All together, I'd suggest that we don't merge this PR or the Server Timing one, unless there's something I'm misunderstanding here.

yoavweiss commented 2 years ago

Thanks @littledan! That makes perfect sense.

yoavweiss commented 2 years ago

Closing for now, but feel free to reopen if you think it's the wrong call.

Ms2ger commented 2 years ago

Thanks for looking into this, Dan!