Skip to content

Commit

Permalink
update compat-table (note: css nesting changed)
Browse files Browse the repository at this point in the history
  • Loading branch information
evanw committed Aug 13, 2023
1 parent eb667c3 commit 71f4a5a
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 24 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ compat-table: esbuild
node --enable-source-maps compat-table/out.js

update-compat-table: esbuild
cd compat-table && npm update --silent
cd compat-table && npm i @mdn/browser-compat-data@latest caniuse-lite@latest --silent
./esbuild compat-table/src/index.ts --bundle --platform=node --external:./compat-table/repos/* --outfile=compat-table/out.js --log-level=warning --sourcemap
node --enable-source-maps compat-table/out.js --update

Expand Down
16 changes: 8 additions & 8 deletions compat-table/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions compat-table/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"githubDependencies": {
"kangax/compat-table": "61b6d112578c21827e702360553424b4effabdaa",
"williamkapke/node-compat-table": "b11fbdb3e6c6d5fffbf4688d830c7453eb64cff7"
"kangax/compat-table": "c7a5c7ea7a8628c90532f0b331ac0929501b1898",
"williamkapke/node-compat-table": "6631ac5cc8a2e9adb8f71abb536fec87554fa0e6"
},
"dependencies": {
"@mdn/browser-compat-data": "5.3.2",
"@mdn/browser-compat-data": "5.3.9",
"@types/caniuse-lite": "1.0.1",
"@types/node": "20.3.2",
"caniuse-lite": "1.0.30001508"
"caniuse-lite": "1.0.30001519"
}
}
1 change: 0 additions & 1 deletion compat-table/src/caniuse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ const jsFeatures: Record<string, JSFeature> = {

const cssFeatures: Record<string, CSSFeature> = {
'css-matches-pseudo': 'IsPseudoClass',
'css-nesting': 'Nesting',
}

const cssPrefixFeatures: Record<string, CSSProperty> = {
Expand Down
8 changes: 5 additions & 3 deletions compat-table/src/mdn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const cssFeatures: Partial<Record<CSSFeature, string | string[]>> = {
'css.types.color.rgba.float_values',
'css.types.color.rgba.space_separated_parameters',
],
Nesting: 'css.selectors.nesting',
}

const cssPrefixFeatures: Record<string, CSSProperty> = {
Expand Down Expand Up @@ -95,10 +96,11 @@ const addFeatures = <F extends string>(map: SupportMap<F>, features: Partial<Rec
if (engine) {
const entries = support[env as BrowserName]!

for (const { flags, version_added, version_removed } of Array.isArray(entries) ? entries : [entries]) {
for (const { flags, version_added, version_removed, partial_implementation } of Array.isArray(entries) ? entries : [entries]) {
if (typeof version_added === 'string' && isSemver.test(version_added)) {
// The feature isn't considered to be supported if it was removed or if it requires a flag
const isSupported = !version_removed || !flags
// The feature isn't considered to be supported if it was removed,
// if it requires a flag, or if it's only partially-implemented
const isSupported = (!version_removed || !flags) && !partial_implementation
const maxVersion = maxVersions[engine]
if (
!maxVersion ||
Expand Down
8 changes: 1 addition & 7 deletions internal/compat/css_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,7 @@ var cssTable = map[CSSFeature]map[Engine][]versionRange{
Opera: {{start: v{53, 0, 0}}},
Safari: {{start: v{12, 1, 0}}},
},
Nesting: {
Chrome: {{start: v{112, 0, 0}}},
Edge: {{start: v{112, 0, 0}}},
IOS: {{start: v{16, 5, 0}}},
Opera: {{start: v{98, 0, 0}}},
Safari: {{start: v{16, 5, 0}}},
},
Nesting: {},
RebeccaPurple: {
Chrome: {{start: v{38, 0, 0}}},
Edge: {{start: v{12, 0, 0}}},
Expand Down

0 comments on commit 71f4a5a

Please sign in to comment.