@@ -9,16 +9,6 @@ const failed = [];
99for ( const key in features ) {
1010 let feature : FeatureDataPlusWebview = features [ key ] ;
1111
12- if ( feature . kind === 'moved' ) {
13- //console.info('[Baseline] Feature has moved to following redirect.', key, feature.redirect_target);
14- feature = features [ feature . redirect_target ] ;
15- }
16-
17- if ( feature . kind == 'split' ) {
18- // Skip split features for now
19- continue
20- }
21-
2212 let webviewBaseline : WebViewStatus = "unknown" ;
2313 // Default to today if unknown because that's when we "worked it out"
2414 let last_test_date = new Date ( ) . toISOString ( ) . split ( 'T' ) [ 0 ] ;
@@ -55,32 +45,52 @@ for (const key in features) {
5545 const notes = { } ;
5646
5747 try {
58- webviewBaseline = feature . webview_support . all ;
59- const setVersion = ( platform , sub , support ) => {
60- if ( support ) {
48+ const fullStatus = feature . webview_support . all ;
49+
50+ if ( fullStatus === 'supported' ) {
51+ webviewBaseline = true ;
52+ } else {
53+ webviewBaseline = false ;
54+ }
55+
56+ const setVersionWebView = ( platform , sub , support ) => {
57+ if ( support === 'supported' ) {
6158 stats [ platform ] [ sub ] = {
62- [ support ] : 'y'
59+ "*" : 'y'
6360 } ;
6461 } else {
6562 // The feature is not fully baseline but some keys might not apply to baseline
66- let anySupported = false ;
67- const unsupportedKeys = feature . webview_support [ `${ platform } _unsupported_compat_features` ] ;
68- if ( anySupported ) {
63+ const unsupportedKeys = feature . webview_support [ `${ sub } _unsupported_compat_features` ] ;
64+ if ( support === 'partial' ) {
6965 stats [ platform ] [ sub ] = {
7066 "*" : 'a' ,
7167 } ;
72- notes [ platform ] = unsupportedKeys . join ( ', ' ) ;
68+ if ( unsupportedKeys . length > 0 ) {
69+ notes [ platform ] = unsupportedKeys . join ( ', ' ) ;
70+ }
7371 } else {
7472 stats [ platform ] [ sub ] = {
75- "u " : 'n'
73+ "* " : 'n'
7674 } ;
7775 }
7876 }
7977 }
8078
81- setVersion ( 'wkwebview' , 'ios' ,
79+ const setVersion = ( platform , sub , support ) => {
80+ if ( support ) {
81+ stats [ platform ] [ sub ] = {
82+ [ support ] : 'y'
83+ } ;
84+ } else {
85+ stats [ platform ] [ sub ] = {
86+ '*' : 'n'
87+ }
88+ }
89+ }
90+
91+ setVersionWebView ( 'wkwebview' , 'ios' ,
8292 feature . webview_support . ios ) ;
83- setVersion ( 'androidwebview' , 'android' ,
93+ setVersionWebView ( 'androidwebview' , 'android' ,
8494 feature . webview_support . android ) ;
8595 setVersion ( 'chrome_android' , 'android' ,
8696 feature . status . support . chrome_android ) ;
@@ -95,6 +105,11 @@ for (const key in features) {
95105 failed . push ( key ) ;
96106 }
97107
108+ if ( ! feature . name ) {
109+ console . warn ( "[Baseline] Missing name for" , key ) ;
110+ continue ;
111+ }
112+
98113 baseline . push ( {
99114 title : feature . name ,
100115 slug : 'web-feature-' + key ,
@@ -107,7 +122,7 @@ for (const key in features) {
107122 links : { } ,
108123 baseline : {
109124 webviewBaseline,
110- baseline : feature . status . baseline ,
125+ baseline : feature . status ? .baseline ,
111126 }
112127 } ) ;
113128}
0 commit comments