-
Notifications
You must be signed in to change notification settings - Fork 91
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
Add a sensor interfaces to sensor features #2299
Conversation
@Elchi3 Is this usable in the absence of a specific sensor? Review feedback on "base class" types of features so far has been to bundle them w/ the first usable implementation. |
hm, what is the first usable implementation or specific sensor here? Looks like there is varying support and even re-implementations on top of "generic sensors" (this API). |
Yeah, I don't think we should create a feature just with those keys, because they don't represent a thing developers can use. This is an interesting case where we'd almost need these BCD keys to be duplicated into each of the features that use Sensor as a base class. Why don't we allow duplication of BCD keys by the way? @ddbeck? BCD keys:
Classes that inherit from Sensor
|
We just discussed about this PR on the WebDX CG call (minutes). The options seem to be the following:
I don't want to block this PR, but I do want to express my opinion, which is that we should either ignore the keys for now, or fold them under one of the concrete sensor classes (not sure which one). If people feel strongly that we need a Sensor feature, then I won't block the PR either. I'm having trouble seeing the value of creating a standalone generic Sensor feature in this repo. This repo is used to generate summarized browser support data for features that web developers want to use. Now, during the meeting, the learning argument was brought forward. That a dev would have to learn about the Sensor interface anyway, because that's what gives them at least half of the methods/events that they'll end up using. My counter argument here is that I don't think web-features needs to care about that too much. Web-features cares about "entry points", about the features that are in devs' minds. Web-features answers questions like "Is there a feature to detect light?", "Where is that feature supported?" |
This came at MDN's request, when feature authoring was considerably less sophisticated. It was (and is) ambiguous where an MDN page's status ought to come from, if the compat key can be in multiple features. I'm going to ask the MDN folks soon about their current perspective on this.
I agree that this is the long-term correct answer. AFAICT, you can't do anything useful with the In the mean time…
I think this is the correct way forward, if it's possible. The process would look like this: compare all the concrete sensor implementations and find the least common denominator (i.e., the sensor that is oldest and mostly widely implemented). I could imagine cases where this wouldn't work very cleanly (e.g., if the most widely implemented sensor is not the oldest). In that case, I'd say we ought to set aside these keys and work to resolve #1173 quickly. |
I talked to MDN about #1173 on Thursday. They said they'd be open to us proceeding with keys in multiple features, but not before January. I think the right thing to do here then is:
|
Added the generic Sensor interfaces to all specific sensors (except Magnetometer, that's still in a separate PR). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on the dists, it looks like orientation-sensor
has the oldest, least complicated support story involving Sensor
. I suggest you comment out the keys in all but that one feature. Though it appears that the keys might've been added to a feature erroneously; see line comment. Thank you!
See https://developer.mozilla.org/en-US/docs/Web/API/Sensor_APIs
Specific sensors: