-
Notifications
You must be signed in to change notification settings - Fork 49
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
APIs should allow introspection #300
Comments
I think it should be clear that this is for introspecting APIs, like available events (that is API) instead of available cameras (not API, but external resource/device) |
Summary from breakout:
|
We discussed the need or a negative example - one that is either too expensive or exposes info that can be used for fingerprinting. |
Another example: No way to get event constructor from event type (e.g. |
The more you expose these kind of things the harder changes might become as well. And for some of them there's indeed many questions one might ask. "Does the UA support onclick?" "Does the UA fire click?" "Does the UA fire click on this event target?" "What interface does the UA use for click for this event target?" (I'm pretty sure a general mapping is wrong and we use different event classes depending on the event target, e.g., We've had discussions about element names and classes too, but that too is tricky as we might want to change classes over time, etc. So while this can be useful, actually exposing it in a way that is sound is its own exercise that requires use cases and requirements and a solid understanding of the problem space, which is why I don't think it makes sense to require this upfront from all APIs. |
This was brought up in w3ctag/design-reviews#619
Namely, that it is too high effort for developers to slightly modify the default config, because it was not exposed anywhere and they would have to recreate it.
But this is a general point. The Web Platform has a history of APIs that are insufficiently introspective, causing developer pain and needless library bloat. It is common for Web APIs to keep large complex objects hidden and use them internally, without exposing them to developers. When developers need them, they need to re-create them manually.
Some examples:
on*
attributes but not all)HTML*Element
helps some, but doesn't even get you that close)Intl
: No way to get all supported currencies, time zones, locales, month names, week names(I will edit this post to add more examples as I remember them — pretty sure there are many more as I kept hitting this issue as a developer)
The text was updated successfully, but these errors were encountered: