-
Notifications
You must be signed in to change notification settings - Fork 10
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
Move source to options #262
Comments
I think the reason for // valid
observe({ type: "resource", buffered: true });
observe({ type: "event", durationThreshold: 160 });
observe({ entryTypes: ["mark", "measure"] });
// invalid
observe({ entryTypes: ["resource"], buffered: true });
observe({ entryTypes: ["event", "mark"], durationThreshold: 160 });
observe({ entryTypes: ["resource"], type: "event" }); So in PressureObserver, you need to decide if you want to allow await observer.observe({ sources: ["cpu", "gpu"], sampleInterval: 2500 }); / valid?
await observer.observe({ source: "cpu", sampleInterval: 2500 }); // valid
await observer.observe({ sources: ["cpu", "gpu"], gpuSpecificOption: "foo" }); // invalid?
await observer.observe({ source: "gpu", gpuSpecificOption: "foo" }); // valid
I think I would say having both makes sense. Especially, if you believe there will be source-specific options. |
I think it is a bit early to say if we get source specific options, but that could definitely happen. I generally think that observer.observe({ source: "gpu" }) is more clear than observer.observe("gpu") |
@rakuco do you have any input? |
My understanding is that "source" (or even "sources" depending on the outcome of #258 and the above) will always be a required parameter given the semantics of this API. This is similar to You could also make it a |
That is exactly what it was modelled after @rakuco I just wanted to make sure that we really thought this through. Maybe PerformanceObserver is a bit of the odd one out here. I think we are good and should close this. |
To be on the safe side, it may be worthwhile to loop in the @w3ctag and hear their opinion on the matter. |
True, if the @w3ctag disagree with our reasoning, please reopen |
Following up on @Elchi3 's #256 where the following was suggested
This is pretty consistent with PerformanceObserver, the "type" (and "entryTypes") is also part of the options.
We could do
now (pre shipping), and add
sources
in the future.Or does @Elchi3 believe we should just support
sources
and notsource
?The text was updated successfully, but these errors were encountered: