-
Notifications
You must be signed in to change notification settings - Fork 177
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
Import mdn/browser-compat-data. Fix #102 #105
Conversation
build/generate_browserjs.js
Outdated
|
||
var { buildPropertiesWithMDNData } = require('./mdn-data-importer') | ||
const { buildPropertiesWithMDNData } = require('./mdn-data-importer') | ||
const { addBCPDataToProperties } = require('./mdn-browser-compat-data-importer') |
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.
BCP
?
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.
Yeah it should be BCD. Thanks.
* } | ||
* } => "FF6" | ||
*/ | ||
function supportToShortCompatString(support, browserAbbrev) { |
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 doesn't completely handle cases with more complex data, for example when a feature is behind a flag this would think it's supported:
{
"support": {
"chrome": [
{
"version_added": "67",
"flags": [
{
"type": "preference",
"name": "Enable Experimental Web Platform Features",
"value_to_set": "true"
}
]
}
]
}
}
Or when a feature was removed:
{
"support": {
"firefox": [
{
"version_added": "51",
"version_removed": "54"
}
]
}
}
Maybe acceptable for an MVP, not sure :)
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.
@connorshea I opened #107 for that.
function addBrowserCompatDataToProperties(atdirectives, pseudoclasses, pseudoelements, properties) { | ||
atdirectives.forEach(item => { | ||
if (bcd.css['at-rules'][item.name.slice(1)]) { | ||
const matchingBCPItem = bcd.css['at-rules'][item.name.slice(1)] |
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's also a bunch of BCP
in this file :)
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.
@connorshea You are right. Originally wanted to call it browser-compat-property.
@aeschli I updated the PR to use One thing I left out is dropping Opera. browser-compat-data also has data for mobile browser supports such as Safari iOS, FF Android, etc. However I don't want to include all browser compat data to clutter the completion item's doc. |
mdn/browser-compat-data
as a dev dependencyCosmetics:
/build
the same style