Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Clarifying the caniuse key #1631

Closed
autonome opened this issue Aug 20, 2024 · 1 comment · Fixed by #1677
Closed

Clarifying the caniuse key #1631

autonome opened this issue Aug 20, 2024 · 1 comment · Fixed by #1677
Labels
documentation Improvements or additions to documentation

Comments

@autonome
Copy link
Collaborator

The contribution guide says the caniuse is optional, but nothing else really.

We should explain:

  • why it's there
  • what it is (or could be) used for
  • reasons to add it or not
@ddbeck ddbeck added the documentation Improvements or additions to documentation label Aug 26, 2024
@ddbeck
Copy link
Collaborator

ddbeck commented Aug 26, 2024

I need to turn this into a PR but…

  • The caniuse key says that this feature is (approximately) the same as the corresponding caniuse feature.
  • Use the caniuse key when:
    • You want the headline status for the feature to appear on caniuse.
    • The high-level feature is roughly equivalent to the caniuse feature(s) or a strict superset of the caniuse feature(s), subject to the caveats below.
  • Don't use the caniuse key when:
    • The caniuse key is merely related (e.g., in grid.yml, don't set caniuse: css-subgrid) or not at all related.
    • The headline status (not the overall, not per-key status) would not be accurate with respect to the table on caniuse (e.g., caniuse says a feature is unsupported in a core browser set browser, but the web-features status is Baseline).
    • The status's first-supported version number differs from caniuse's by more than one year before 2020 or at all from 2020. This means there's a major disagreement—and a likely error—in BCD or caniuse's data.
  • Additional notes:
    • Use compute_from to improve the correspondence of a feature's headline status with respect to the caniuse feature.

      But don't forget to use your judgement! Caniuse isn't perfect. Don't use compute_from in a way that would not make sense if the corresponding caniuse key didn't exist (e.g., pins support to before support for some essential key in the feature). In such situations, it's better to comment out the caniuse and make a TODO comment or open an issue about why you did it.

    • If you see a <1 year pre-2020 discrepancy between caniuse and a computed status, make a note of it in Historical investigations: caniuse and BCD mismatches #1499.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants