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
Update to new schema #86
Conversation
7254d06
to
cfa25ef
Compare
5abc5c8
to
dab651c
Compare
0f9f005
to
f9bfbe8
Compare
following properties: | ||
|
||
#### `"version_added"` | ||
Contains a string with the version number the sub-feature has |
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.
This is an extra suggestion, but I think we should define and enforce, for each runtime, what the version syntax must be. I'm thinking here of something like: mdn/kumascript#131 - are Edge versions like "12.34567", or "34567" or "12"? If we don't define this, then we'll end up with a mix, and it will become really hard to work with the data.
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.
I think it is an interesting idea: I quite like it, though it may may be complex to define and maintain. I think we should do, or at least study, this in a follow-up. Could you open an issue so that this is tracked?
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.
You'd also need to have uniform data to begin with. When I started contributing to MDN, all the reference to Chrome version numbers were 3 digits ("39.0"). Chrome doesn't do it that way and as far as I can tell never did. I've been trying to correct to 2 digits ("39") wherever I can, but right now it's a mix.
compat-data-schema.md
Outdated
… | ||
} | ||
|
||
We are using semantic versioning, so the version is a `string` containing three |
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.
Should link to http://semver.org/ - actually, IMO, we should link instead of including the three bullets below. Either we are semver, in which case the definitions must be the same, and by duplicating it we just allow for incompatibility to creep in. Or we are not, in which case we shouldn't say we are.
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.
Good point.
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.
Fixed.
compat-data.schema.json
Outdated
}, | ||
"required": ["Chrome", "Opera", "Edge", "Firefox", "Firefox for Android"], | ||
"additionalProperties": false | ||
"additionalProperties": true |
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.
Why true
?
(I feel like being restrictive now makes it easier for us to be less restrictive in future without breaking compat.)
Also, I wonder if we could usefully add "additionalProperties": false
to some of the other definitions.
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.
This came from a comment from @stephaniehobson on dev-mdc. If some browser (like Firefox OS) become deprecated, we can just ignore it, without having to fix the schema (and all the data)
Practically I know that other browser vendors (especially on mobile) are interested to contribute, so having an open list, allow them to come and make the PR.
For more "additionalProperties": false. Seems like a good idea.
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.
So, I've kept the "additionalProperties": true there.
I've added several "additionalProperties": false to the schema, and that's was a really good thing: I found 4 (trivial) errors in the compat data we had, and fixed them.
compat-data.schema.json
Outdated
"type": "object", | ||
"properties": { | ||
"Basic support": { "$ref": "#/definitions/feature" } | ||
"support": { "$ref": "#/definitions/subfeature" } |
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.
should this be "basic_support"
?
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.
Yes, I initially thought this was a merge error of my side, and it should be "basic_support". This line (98) is in fact redundant (the "required" and "additional_properties" deal with it), but it makes more clear to call explicitly "basic_support"
compat-data.schema.json
Outdated
] | ||
}, | ||
|
||
|
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.
extra blank line
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.
Fixed
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.
I think the stuff in the docs about "support" versus "basic" versus "basic_support" should be cleared up.
I'd like to understand better the reasoning behind "additionalProperties": true, and it looks to me like the schema has "support" when it should be "basic_support".
I'd like us to consider defining and enforcing version syntax for different browsers, because I think not doing this will give us headaches in the future. But that's more of a feature request than a bug.
But I think in general, it looks really good! 👍
the version of schema used inside the file. | ||
|
||
{ | ||
"version": "1.0.0", |
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.
It seems like "version" could easily be the name of an identifier. For example manifest.json has a version
key that will appear as an identifier in the data (not at the top-level, but we could imagine this happening).
Should we call it __compat_version
? Alternatively we could shift the data down a level, and have the top-level look like:
{
"version": "1.2.3",
"data": {...}
}
That seems less hacky, but introduces another level of nesting, and we already have a lot of that.
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.
This is a good point. I don't like "__*" even if we are using it once, so I like the "data" idea. It also allows to extend this in the feature (if needed). I will apply this.
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.
Done.
So I have fixed all comments but:
I think in both cases, not limiting it now will allow us to see if it is a problem, or if new browsers are coming often, or if we let too many errors through because of not having things enforced at the schema level, … What do you think, @wbamberg ? |
On this, actually, I'm torn. On the one hand, I agree that it will be complicated and potentially time-consuming to define version number schemas for the different browsers. And I really don't want to block this PR any longer (and neither do you I guess). On the other hand, if this is a thing we might want to do, it would be a breaking change and might invalidate existing data. So is it unwise to not examine it before landing, just so we meet an essentially artificial deadline?
This I'd like to argue with a bit more. It's easy to add new browsers, if we want to. On the other hand,
I think this is backwards. It's easy to change the schema to be more forgiving. It's hard to change it to be stricter. |
I filed issue #168 for the version validation. I will think more about whether or not this is blocking us. I agree that This is amazing work and a massive PR. I would like to split it in several parts though (and make nicer commits [not 250+]):
We can control with travis.yml when we want to validate what for the CI test not to fail and for 3 and 4 we are blocked on updating kumascript, so that can't be done now but only soon. Will's WebExtension data is already ready to be merged, so we will need 1 for it. |
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.
Also, are you validating the format of version numbers? I couldn't find it if you are. Chrome needs to be two digits. When I first started contributing to MDN I noticed that they tended to be three digits, "39.0" for example. All of Google's own web pages would just use "39". I've been changing them for about a year now.
alternate names, as well as notes. | ||
|
||
The currently accepted browser identifiers are: | ||
* `"webview_android"`, Webview, the former stock browser on Android, |
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.
Actually, it's the browser bundled with Android for use in native and hybrid apps. Since Android 4.4 (KitKat) it has been based on the Chromium open source project, the same project on which Chrome is built.
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.
Hey @jpmedley. I suggested that we should validate version numbers, here: #86 (review), and Florian just filed an issue for it: #168. I'm sure it would be great to get your input into what the format should be for Chrome.
If we make |
... without adding a new version to the data API. Sorry, that was unclear. |
@stephaniehobson "additional_properties": false means we have to change the minor version of the version number each time we add a browser. E.g. "3.0.0" -> "3.1.0". (Files with the schema 3.0.0 are still valid in 3.1.0, but not the opposite. So here are the arguments:
Side point:
|
No description provided.