@@ -2,7 +2,7 @@ import { Temporal } from "@js-temporal/polyfill";
22import { Browser } from "../browser-compat-data/browser.js" ;
33import { Compat , defaultCompat } from "../browser-compat-data/compat.js" ;
44import { feature } from "../browser-compat-data/feature.js" ;
5- import { browsers , allBrowsers } from "./core-browser-set.js" ;
5+ import { browsers , webViews } from "./core-browser-set.js" ;
66import {
77 parseRangedDateString ,
88 toHighDate ,
@@ -16,8 +16,7 @@ import {
1616} from "./support.js" ;
1717
1818// Include this in the public API
19- export { identifiers as coreBrowserSet , allIdentifiers } from "./core-browser-set.js" ;
20- export { allBrowsers } from "./core-browser-set.js" ;
19+ export { identifiers as coreBrowserSet , webViews } from "./core-browser-set.js" ;
2120export { parseRangedDateString } from "./date-utils.js" ;
2221
2322interface Logger {
@@ -51,6 +50,7 @@ interface SupportDetails {
5150 baseline_high_date : BaselineDate ;
5251 discouraged : boolean ;
5352 support : Map < Browser , InitialSupport | undefined > ;
53+ ecosystem_support : Map < Browser , InitialSupport | undefined > ;
5454 toJSON : ( ) => string ;
5555}
5656
@@ -60,6 +60,7 @@ interface SupportStatus {
6060 baseline_low_date : string ;
6161 baseline_high_date ?: string ;
6262 support : Record < string , string > ;
63+ ecosystem_support ?: Record < string , string > ;
6364}
6465
6566/**
@@ -114,16 +115,11 @@ export function computeBaseline(
114115 : compatKeys ;
115116
116117 const statuses = keys . map ( ( key ) => calculate ( key , compat ) ) ;
117- // For baseline status, use only core browsers; for support map, include all browsers (including webviews)
118- const supportForBaseline = collateSupport (
119- statuses . map ( ( status ) => status . supportForBaseline ) ,
120- ) ;
121118 const support = collateSupport ( statuses . map ( ( status ) => status . support ) ) ;
122-
123- //console.debug(support);
119+ const ecosystem_support = collateSupport ( statuses . map ( ( status ) => status . ecosystem_support ) ) ;
124120
125121 const keystoneDate = findKeystoneDate (
126- [ ...supportForBaseline . values ( ) ] ,
122+ statuses . flatMap ( ( s ) => [ ...s . support . values ( ) ] ) ,
127123 ) ;
128124 const discouraged = statuses . some ( ( s ) => s . discouraged ) ;
129125 const { baseline, baseline_low_date, baseline_high_date } =
@@ -135,6 +131,7 @@ export function computeBaseline(
135131 baseline_high_date,
136132 discouraged,
137133 support,
134+ ecosystem_support,
138135 toJSON : function ( ) {
139136 return jsonify ( this ) ;
140137 } ,
@@ -151,7 +148,8 @@ function calculate(compatKey: string, compat: Compat) {
151148 return {
152149 discouraged : f . deprecated ?? false ,
153150 supportForBaseline : support ( f , browsers ( compat ) ) ,
154- support : support ( f , allBrowsers ( compat ) ) ,
151+ support : support ( f , browsers ( compat ) ) ,
152+ ecosystem_support : support ( f , webViews ( compat ) ) ,
155153 } ;
156154}
157155
@@ -294,21 +292,28 @@ function findKeystoneDate(
294292function jsonify ( status : SupportDetails ) : string {
295293 const { baseline_low_date, baseline_high_date } = status ;
296294 const support : Record < string , string > = { } ;
295+ const ecosystem_support : Record < string , string > = { } ;
297296
298297 for ( const [ browser , initialSupport ] of status . support . entries ( ) ) {
299298 if ( initialSupport !== undefined ) {
300- //console.debug(`Browser ${browser} has initial support:`, initialSupport);
301299 support [ browser . id ] = initialSupport . text ;
302300 }
303301 }
304302
303+ for ( const [ browser , initialSupport ] of status . ecosystem_support . entries ( ) ) {
304+ if ( initialSupport !== undefined ) {
305+ ecosystem_support [ browser . id ] = initialSupport . text ;
306+ }
307+ }
308+
305309 if ( status . baseline === "high" ) {
306310 return JSON . stringify (
307311 {
308312 baseline : status . baseline ,
309313 baseline_low_date,
310314 baseline_high_date,
311315 support,
316+ ecosystem_support
312317 } ,
313318 undefined ,
314319 2 ,
@@ -321,6 +326,7 @@ function jsonify(status: SupportDetails): string {
321326 baseline : status . baseline ,
322327 baseline_low_date,
323328 support,
329+ ecosystem_support
324330 } ,
325331 undefined ,
326332 2 ,
@@ -331,6 +337,7 @@ function jsonify(status: SupportDetails): string {
331337 {
332338 baseline : status . baseline ,
333339 support,
340+ ecosystem_support
334341 } ,
335342 undefined ,
336343 2 ,
0 commit comments