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
Addition of a new schema #170
Conversation
fe9f18c
to
f2b8d97
Compare
…est on several entries to make migration easier
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 I would like to land this initial schema as is now. I opened #173 to change additionalProperties to false for compat_block and there are a few other open issues, but I don't think these block the initial landing. Let's get familiar with the new schema some more by landing it and iterating on the smaller issues we identified.
Will, this makes travis also test the new WebExtension JSON that landed yesterday with the new schema. What do you think about merging 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.
There are quite a few comments on the doc, some of which seem like errors, and some of which are just extra clarifications.
I'm wondering even whether we should have a doc at this level of detail: it's easy for it to get out of step with the schema, and the schema is really the source of truth. We could have a much shorter overview doc, and leave the details to the schema.
But I do think maybe we should have a "Checklist for reviewers" doc, that covers anything not enforced by the schema.
There are a couple of comments on the schema itself, but in general it's looking good! I'd also like to register my discomfort at including HTML and KS macro calls in notes.
@@ -0,0 +1,365 @@ | |||
# The browser-compat-data JSON format |
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 this doc could do with a copy-edit, but that can be done in a follow-up.
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 the README should be updated to point to this document: at the moment it documents the old schema.
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 created issue #177 for the copy-edit part.
I updated the README file to link to the compat-data-schema.md instead of the description of the old schema.
compat-data-schema.md
Outdated
browser-compat-data JSON format. Nevertheless there are constraints that cannot | ||
be described inside a schema, and won't be checked by automated tests. We tried | ||
to mark such cases in the following text with a __Not enforced by the | ||
schema__ notice. |
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 notice is not actually used anywhere.
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.
compat-data-schema.md
Outdated
by making it easy to maintain by humans. | ||
|
||
### Schema versioning | ||
There one single information that is tied to each file, and is mandatory. It is |
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.
There are actually 2 pieces of mandatory data at the top level (version and 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.
Fixed.
compat-data-schema.md
Outdated
The hierarchy of identifiers is not defined inside the schema. It is a | ||
convention of the project using the schema. | ||
|
||
In the MDN browser-compat case, it is: |
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'm not sure we should say this. It's already out of date :). We could just say "for example" instead, or omit 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.
To avoid any confusion, I removed it (there is an theoretical example a few lines before)
explained in the previous paragraph, any feature has at least one sub-feature | ||
called `'basic_support'`, but it may many more. | ||
|
||
A sub-feature may have three properties. |
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.
Let's be clear which are optional and which are mandatory (as we just discussed, perhaps "support" is mandatory and the other two are optional).
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.md
Outdated
Compatibility information is stored in a `"support"` field. It may consist of the | ||
following properties: | ||
|
||
#### `"version_added"` |
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.
Could note that this is the only mandatory property.
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.md
Outdated
|
||
Each `string` that contains a human-readable description of the sub-feature. The | ||
`<code>` and `<a>`, as well as the macros `{{cssxref}}`, `{{HTMLElement}}`, | ||
`{{htmlattrxref}}`, and `{{domxref}}` can be used. See the localization section |
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.
See comments above about 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.
Yep, same: KS macros should have been removed. This part is fixed.
`text-align` property is identified by `css.properties.text-align`. | ||
|
||
The strings of an identifier are not intended to be displayed and are therefore | ||
not translatable. |
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.
Could note somewhere that identitifers can't contain dots.
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 that technically they can (not saying it is a good idea to do it)
compat-data.schema.json
Outdated
"Safari Mobile": { "$ref": "#/definitions/support_statement" }, | ||
"Servo": { "$ref": "#/definitions/support_statement" }, | ||
"desc": { "type": ["string"] }, | ||
"support": { "$ref": "#/definitions/compat_block" }, |
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.
As discussed, we could make "support" mandatory.
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
"additionalProperties": false | ||
}, | ||
|
||
"feature_set": { | ||
"compat_block": { |
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.
Very much a nit, but it helps readability if you swap this and "subfeature", so I can read it all the way from the bottom up, going from a reference to its definition.
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.
So I made the requested changes except:
(Note that one comment seems to be not fixed, because I fixed it by updating the text below) @wbamberg @Elchi3 I think this is ready for a new round of review. |
Thanks for all those fixes @teoli2003 , it looks great.
Sounds good.
You are right. We talked about this a couple of days ago and I see @Elchi3 filed an issue for it: #167. I saw some regexps in the schema and thought this had made its way into the schema already, but I was mistaken :). |
This is the first PR resulting in the division of PR #86.
Renaming of the old schema
Adding the new schema
Adding the docs for the new schema
Dividing the travis tests so that it will be easier to merge future PR for the migration of the existing data.