Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

fix(bcd): Prioritize current support using a ranking system #5946

Merged
merged 5 commits into from
Apr 19, 2022

Conversation

danielhjacobs
Copy link
Contributor

@danielhjacobs danielhjacobs commented Apr 10, 2022

Summary

Fixes #5945

Problem

Current support is defined as the most recent support item:

However, look at innerHeight for Firefox on https://developer.mozilla.org/en-US/docs/Web/API/Window/innerHeight#browser_compatibility. It's had full support since version 1, but a removed note in effect from version 4-24. Because that item is newer and was removed, it looks like it has no support.

Solution

Rank the support items as follows:

  • Active items (version_removed === null)
    • Full support without limitation (i.e. only version_added)
    • Full support with only version_added and notes
    • Full support with altname/prefix
    • Partial support
    • Support with flags
    • No support
  • Inactive items (version_removed !== null)

Screenshots

Before

support_none_full

After

support_full

@danielhjacobs danielhjacobs force-pushed the current_support branch 2 times, most recently from 4f33aae to d7edb59 Compare April 13, 2022 14:09
@danielhjacobs
Copy link
Contributor Author

danielhjacobs commented Apr 13, 2022

I've done the prioritization of support. As was expected, it is complex. If there are preferences for rewriting things a certain way, let me know. I did it with many return statements so that in most cases, not all the finds need to be run for each cell. I could have done a let with a return at the end, but I tend to like returning early for efficiency. Returning early also lets the checks be less complex, since things that would have been caught by an earlier find don't need to be rechecked that they don't exist in a later find.

Copy link
Contributor

@caugner caugner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall, just a few nits.

@danielhjacobs danielhjacobs changed the title BCD: Current support may not be most recent support item fix(bcd): Current support should be prioritized based on a ranking system Apr 18, 2022
@danielhjacobs danielhjacobs changed the title fix(bcd): Current support should be prioritized based on a ranking system fix(bcd): Prioritize current support using a ranking system Apr 19, 2022
@caugner caugner merged commit bb77441 into mdn:main Apr 19, 2022
@danielhjacobs danielhjacobs deleted the current_support branch April 19, 2022 23:08
@caugner caugner added 🧑‍🤝‍🧑 community contributions by our wonderful community browser-compat issues related to the browser compatibility data tables (BCD) labels May 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
browser-compat issues related to the browser compatibility data tables (BCD) 🧑‍🤝‍🧑 community contributions by our wonderful community
Projects
Development

Successfully merging this pull request may close these issues.

BCD: The assumption about currentSupport being the most recent support item is faulty
2 participants