Re: [compute-pressure] Clarify what supportedSources() should expose. (#266)

> in its current form, `supportedSources` is a hint that basically says "this implementation supports _at most_ these sources", but whether or not a source in `supportedSources` actually works depends on calling `observe()`. I don't know if this is a useful hint or not; perhaps calling `observe()` and checking for `NotSupportedError` is enough for developers, perhaps not.

I guess the only advantage is that you would know things earlier. Are there any wins for web developers with such an early hint? If not, then I'm not sure what a hint helps with (other than being potentially misleading).

See e.g. https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/createShaderModule#hints where early hints matter but see also the note box that we provided there.

I guess if we had `knownSources`, I would have a note box like:

> [!note]
> Note: The `knownSources` property is a merely hint about the sources your browser supports. It is not guaranteed pressure observation will work on your operating system or hardware.  Call `observe()` and check for `NotSupportedError` if pressure observation is possible. (or call `supportedSources()` [if made available]).



-- 
GitHub Notification of comment by Elchi3
Please view or discuss this issue at https://github.com/w3c/compute-pressure/issues/266#issuecomment-2076974992 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 25 April 2024 11:35:26 UTC