-
-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* css feedback * rework * custom props and units * note * Add queries for all functions and all properties * Fix bug with all properties query * Normalize non-custom properties to lowercase * Add query for all Blink Features For @supports and a number of other things * Create keyword_totals.sql * Create vendor_prefix_summary.sql * Create meta_shorthand_first_pages.sql * spaces for tabs * Update sql/2020/01_CSS/vendor_prefix_summary.sql Co-authored-by: Rick Viscomi <[email protected]> * Update sql/2020/01_CSS/vendor_prefix_summary.sql Co-authored-by: Rick Viscomi <[email protected]> * Update meta_longhand_first_distribution.sql * Avoid counting vendor prefix functions and keywords when value.length > 1000 * Create repetition.sql * Update repetition.sql * Improve repetition query * Update vendor_prefix_summary.sql * Update sass_nesting.sql * Update all_features.sql Query the summary table instead * Update sql/2020/01_CSS/vendor_prefix_summary.sql * support AST >= 100KB for color/gradient queries * gradient adoption * gradient hints Co-authored-by: Rick Viscomi <[email protected]> Co-authored-by: Rick Viscomi <[email protected]>
- Loading branch information
1 parent
3f222c5
commit b269c2e
Showing
26 changed files
with
1,049 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
SELECT | ||
client, | ||
feature, | ||
num_urls AS freq, | ||
total_urls AS total, | ||
pct_urls AS pct_pages | ||
FROM | ||
`httparchive.blink_features.usage` | ||
WHERE | ||
yyyymmdd = '20200801' | ||
ORDER BY | ||
pct_pages DESC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#standardSQL | ||
CREATE TEMPORARY FUNCTION getProperties(css STRING) RETURNS ARRAY<STRING> LANGUAGE js AS ''' | ||
try { | ||
function compute() { | ||
let ret = {}; | ||
walkDeclarations(ast, ({property, value}) => { | ||
if (value.length > 1000 || !value.includes("(") || !value.includes(")")) { | ||
return; | ||
} | ||
for (let {name} of extractFunctionCalls(value)) { | ||
incrementByKey(ret, name); | ||
} | ||
}); | ||
return sortObject(ret); | ||
} | ||
let ast = JSON.parse(css); | ||
let props = compute(ast); | ||
return Object.entries(props).flatMap(([prop, freq]) => { | ||
return Array(freq).fill(prop); | ||
}); | ||
} | ||
catch (e) { | ||
return []; | ||
} | ||
''' | ||
OPTIONS (library="gs://httparchive/lib/css-utils.js"); | ||
|
||
SELECT | ||
* | ||
FROM ( | ||
SELECT | ||
client, | ||
prop, | ||
COUNT(DISTINCT page) AS pages, | ||
COUNT(0) AS freq, | ||
SUM(COUNT(0)) OVER (PARTITION BY client) AS total, | ||
COUNT(0) / SUM(COUNT(0)) OVER (PARTITION BY client) AS pct | ||
FROM | ||
`httparchive.almanac.parsed_css`, | ||
UNNEST(getProperties(css)) AS prop | ||
WHERE | ||
date = '2020-08-01' | ||
GROUP BY | ||
client, | ||
prop) | ||
WHERE | ||
pages >= 1000 | ||
ORDER BY | ||
pct DESC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#standardSQL | ||
CREATE TEMPORARY FUNCTION getProperties(css STRING) RETURNS ARRAY<STRING> LANGUAGE js AS ''' | ||
try { | ||
function compute(ast) { | ||
let ret = {}; | ||
walkDeclarations(ast, ({property, value}) => { | ||
if (!property.startsWith("--")) { // Custom props are case sensitive | ||
property = property.toLowerCase(); | ||
} | ||
incrementByKey(ret, property); | ||
}); | ||
return sortObject(ret); | ||
} | ||
let ast = JSON.parse(css); | ||
let props = compute(ast); | ||
return Object.entries(props).flatMap(([prop, freq]) => { | ||
return Array(freq).fill(prop); | ||
}); | ||
} | ||
catch (e) { | ||
return []; | ||
} | ||
''' | ||
OPTIONS (library="gs://httparchive/lib/css-utils.js"); | ||
|
||
SELECT | ||
* | ||
FROM ( | ||
SELECT | ||
client, | ||
prop, | ||
COUNT(DISTINCT page) AS pages, | ||
COUNT(0) AS freq, | ||
SUM(COUNT(0)) OVER (PARTITION BY client) AS total, | ||
COUNT(0) / SUM(COUNT(0)) OVER (PARTITION BY client) AS pct | ||
FROM | ||
`httparchive.almanac.parsed_css`, | ||
UNNEST(getProperties(css)) AS prop | ||
WHERE | ||
date = '2020-08-01' | ||
GROUP BY | ||
client, | ||
prop) | ||
WHERE | ||
pages >= 1000 | ||
ORDER BY | ||
pct DESC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.