Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 32 additions & 1 deletion docs/customData.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,38 @@
"items": {
"$ref": "#/definitions/references"
}
}
},
"browsers": {
"type": "array",
"description": "Supported browsers",
"items": {
"type": "string",
"pattern": "(E|FFA|FF|SM|S|CA|C|IE|O)([\\d|\\.]+)?",
"patternErrorMessage": "Browser item must follow the format of `${browser}${version}`. `browser` is one of:\n- E: Edge\n- FF: Firefox\n- FM: Firefox Android\n- S: Safari\n- SM: Safari on iOS\n- C: Chrome\n- CM: Chrome on Android\n- IE: Internet Explorer\n- O: Opera"
}
},
"baseline": {
"type": "object",
"description": "Baseline information for the feature",
"properties": {
"status": {
"type": "string",
"description": "Baseline status",
"enum": ["high", "low", "false"]
},
"baseline_low_date": {
"type": "string",
"description": "Date when the feature became newly supported in all major browsers",
"pattern": "^\\d{4}-\\d{2}-\\d{2}$",
"patternErrorMessage": "Date must be in the format of `YYYY-MM-DD`"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've analyzed the browsers.html-data.json file from the @vscode/web-custom-data package and found the elements with values like ≤2020-07-28 instead of just 2020-07-28 in the baseline_low_date and baseline_high_date fields.

@aeschli JFYI.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@FluorescentHallucinogen Thanks for looking into this and catching this. Lets file this directly to against https://github.com/microsoft/vscode-custom-data

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

},
"baseline_high_date": {
"type": "string",
"description": "Date when the feature became widely supported in all major browsers",
"pattern": "^\\d{4}-\\d{2}-\\d{2}$",
"patternErrorMessage": "Date must be in the format of `YYYY-MM-DD`"
}
}
}
}
},
Expand Down
16 changes: 15 additions & 1 deletion src/htmlLanguageTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,9 @@ export interface ITagData {
description?: string | MarkupContent;
attributes: IAttributeData[];
references?: IReference[];
void?: boolean
void?: boolean;
browsers?: string[];
status?: BaselineStatus;
}

export interface IAttributeData {
Expand All @@ -169,12 +171,16 @@ export interface IAttributeData {
valueSet?: string;
values?: IValueData[];
references?: IReference[];
browsers?: string[];
status?: BaselineStatus;
}

export interface IValueData {
name: string;
description?: string | MarkupContent;
references?: IReference[];
browsers?: string[];
status?: BaselineStatus;
}

export interface IValueSet {
Expand All @@ -189,6 +195,14 @@ export interface HTMLDataV1 {
valueSets?: IValueSet[];
}

export interface BaselineStatus {
baseline: Baseline;
baseline_low_date?: string;
baseline_high_date?: string;
}

export type Baseline = false | 'low' | 'high';

export interface IHTMLDataProvider {
getId(): string;
isApplicable(languageId: string): boolean;
Expand Down
Loading