Skip to content

Add webview support data to web-features #3553

@tonypconway

Description

@tonypconway

Hi all, sorry it's taken me a few days to get this written up.

Problem

web-features does not currently include data concerning the feature support of webviews. There are a subset of features in Baseline - both newly and widely available - that are not supported by the webview that corresponds to the browsers they are based on (Chrome Android and iOS Safari).

Webview developers thus have two possible negative outcomes when they try to use Baseline:

  • They trust Baseline statuses for features and end up implementing something that doesn’t actually work in the webview they are targeting.
  • They are aware of the inconsistencies and consequently avoid using Baseline and have to depend on the same cognitively challenging workflow as before where they spend a lot of time looking at support tables. They probably, as a result, avoid using newer features for the same reason that other web developers did before, i.e. too difficult to get a simple go/no-go decision for a feature.

I’ve created a sheet that lists out all the features and their statuses as outlined below based on a module that supplements web-features with BCD webview support data.

Proposal - Add webview data to web-features JSON

Adding webview support to web-features would make it significantly easier for technical writers and tools teams to indicate whether a feature is supported or not in webview.
We should add a new webview_support objects alongside the existing support objects in the web-feature JSON output that explains the level of webview support for a given feature. There are a few different ways we could do this.

Feature level data

Based on my research, features exist in different states that we should reflect in the output data, broken out by android and ios support:

  • Equivalent - Chrome Android and/or Safari iOS do not support the feature and their corresponding webviews have the same level of support for all supported BCD keys in that feature, supported or not.
    • It might make sense to break this out into two statuses (Equivalent-supported, equivalent-unsupported), or replace it with high, low, false based on the feature-level support.
  • Partial - Chrome Android and/or Safari iOS support the feature, and their corresponding webviews support a subset of the supported BCD keys but not all of them.
  • Unsupported - Chrome Android and/or Safari iOS support the feature, but the webview does not support any of the keys.

In addition, the current data has an ambiguous status that indicates none of the above apply - usually it applies to features where the webview supports more keys than the corresponding browser. Someone with more expertise would need to look at these and tell me what I’m not understanding!

BCD-key level data

In addition, we should add webview_support to each BCD key in the by_compat_key support object where we can.

It might also be worth including a gap if there’s a gap of more than e.g. 1 month between the release date of the webview version and browser version that first supported a feature.

Format

Output should look something like:

"feature-id": {
  ...
  "status": {
    "baseline": "high",
    "support": { ... } // browsers listed here
    "webview_support": {
      "all": "equivalent",
      "android": "equivalent",
      "ios": "equivalent",
    }
    "by_compat_key": {
      "mdn.browser.compat.key": {
        "baseline": "high",
        "support": { ... },
        "webview_support": {
          "android": "120",
          "ios": "15.4"
        }
      }
    }
  }
}

Implementation details

My work in web-features-plus-webview is based on copying the logic of compute-baseline as possible - i.e. treating partial_implementation and the presence of other such properties as unsupported - without directly editing compute-baseline. I think it would be prudent to update compute-baseline to include a utility for calculating support for webviews and then mediating that to an overall status. This could be optional when using compute-baseline in isolation, but always used in the web-features build process.

Overrides for non-BCD features

Some web-features do not have any BCD keys, and are hard coded in a web-features .yml file - specifically image formats (avif, webp) and HTTP2 and HTTP3. At the moment, I have these set up as overrides indicating full support which are inserted and returned before the usual calculations take place. It would be worth discussing if there’s a more sustainable way to do this, either by hardcoding the same info into the .yml files or updating BCD to include these features.

Other webviews

The above suggestions are based on Android and iOS webviews because they have comprehensive data in @mdn/browser-compat-data. Other webviews will need more research to be fully supported, potentially involving testing or contributions from the vendors themselves:

  • Windows Webview2 - this support article from MS details the differences between Webview2 and Edge. It looks like we could probably handle this as an overrides subset and then copy the rest from Edge, but someone with more insight into Windows and webviews should weigh in.
  • Popular Chinese super-apps - we should try to get folks from Tencent (WeChat), Alibaba (Alipay), Baidu and so on to contribute data on their underlying Chromium versions and what the feature delta is where possible.
  • FB/Instagram - likewise, it would be valuable to get definitive statements from Meta on their support levels. I may have a contact here, but any Meta folks reading this, please reach out!

Metadata

Metadata

Assignees

No one assigned

    Labels

    schemaSchema changes, proposals, and bugs

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions