feat(client): Add the internal capabilities API (no handshake) #3077
Conversation
|
A drive-by naming nit, but we should also consider whether "capabilities" is the right term here. For big things like "signup" and "choose-what-to-sync" it fits, but if we use the same mechanism to let the device choose between e.g. halting or continuing to settings, then it doesn't sound like a "capability" so much as a "customization". |
I'm working on a separate entity for that, for those exact reasons. I'm calling those |
I'm trying to tease these two concepts apart because they feel different. One says what an environment is capable of, the other controls flow. |
|
@rfk - I should start with a problem statement(s) to give context. All behaviors/capabilities are currently hard coded into the brokers and views. This leads to screen->screen transition control being partly handled in views and partly in brokers. Modifying existing behaviors/capabilities, or adding new screen transitions, or dynamically changing screen transitions requires views, brokers, and sometimes reliers to be updated. Desired system attributes/behaviors
Here are a few links to show how I currently think about these two concepts and how they are used. Feedback appreciated. CapabilitiesBehaviors |
|
@vladikoff - could I get your thoughts on this? Specifically, whether this API is suitable, or whether there are ideas from your former PR that should be brought over here to bring the APIs into alignment? |
| * a truthy value to indicate whether it's supported. | ||
| */ | ||
| defaultCapabilities: { | ||
| signup: true |
vladikoff
Sep 22, 2015
Contributor
this is a great start, but it is really simplified. Not sure if that is good or bad. It totally make sense in the refactor but could be problematic for the client integration.
In my case I wanted to make sure that a capability had more distinct names (+ versions) and were also objects that can contain extra details.
this is a great start, but it is really simplified. Not sure if that is good or bad. It totally make sense in the refactor but could be problematic for the client integration.
In my case I wanted to make sure that a capability had more distinct names (+ versions) and were also objects that can contain extra details.
|
I'm putting this in the FxA-27 fennec web login milestone because this is for the internal API, not the handshake portion. The internal API will be used to determine whether certain features are supported, e.g., the "open preferences" button. |
|
For "behaviors", see #3097 |
|
@vladikoff and I generated a list of possible data formats at http://oksoclap.com/p/fxa-capabilities. @rfk and I discussed the merits of these and decided on a solution that should allow us to provide the functionality that we need, using a modified version of capabilities: {
// indicate capability is not supported
choose_what_to_sync_web_v1: false, // false could be some other falsy value.
// for a simple boolean "yep, it's supported"
choose_what_to_sync_web_v1: true,
// or, for a more complex case where data is needed:
choose_what_to_sync_web_v1: {
customEngines: [
"bookmarks",
"passwords"
]
}
}When new versions of choose what to sync are needed, a new capability will be created with a new name. |
Capabilities are a way to query whether the given environment supports a feature. The goal is to query Firefox to see which FxA features it supports. With this PR, the `signup` capability is hard coded, without querying Firefox. issue #2771
|
@vladikoff - mind a re-review? Can you see #3077 (comment) |
feat(client): Add the internal capabilities API (no handshake) r=vladikoff
|
So this PR is pretty much like last time I reviewed it, Good start! |
Capabilities are a way to query whether the given environment supports
a feature. The goal is to query Firefox to see which FxA features it supports.
With this PR, the
signupcapability is hard coded, without querying Firefox.issue #2771
@vladikoff - mind reviewing this to give feedback and see if this is in line with how you were imagining the capabilities API?