GithubHelp home page GithubHelp logo

mdn / browsercompat Goto Github PK

View Code? Open in Web Editor NEW
22.0 22.0 15.0 3.4 MB

API for browser compatibility data on developer.mozilla.org

License: Mozilla Public License 2.0

Makefile 0.21% Python 86.50% CSS 0.07% HTML 8.95% JavaScript 4.27%
python unmaintained

browsercompat's Introduction

MDN Web Docs on Github

👋 Welcome, Bienvenida, 欢迎, Bienvenue, いらっしゃいませ, Receber, Добро пожаловать, 환영합니다, მოგესალმებით

github-profile

Welcome to the mdn repository which we use to track MDN team work. The MDN teams public projects are here, where you can view current and upcoming tasks.

This repository is also used for requests and contains issue templates for the following processes:

Invited experts

Joshua Chen

  • GitHub
  • Invited expert: JavaScript

Hidde de Vries

  • GitHub
  • Invited expert: Accessibility

Scott O'Hara

  • GitHub
  • Invited expert: Accessibility

André Jaenisch

Mendy Berger

NOTE: If you wish to nominate someone to be considered as an invited expert, start by filing an issue in this repository.

browsercompat's People

Contributors

darkwing avatar groovecoder avatar jwhitlock avatar matonanthony avatar stephaniehobson avatar trevorhobson avatar willkg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

browsercompat's Issues

/api/browsers/ should redirect to /api/browsers

JSON API specifies that resource URIs do not end in a slash, but other client libraries assume they do. The API router should redirect to the slash less version instead of returning 404 Not Found

JSON API representations should always be resource, then links

In the following JSON API representation, the links section appears before the resource section. The order should be:

  • resource
  • linked if included
  • links if included
  • meta if included

This will help keep the documentation consistent.

{
    "links": {
        "browsers.history": {
            "type": "historical browsers", 
            "href": "https://protected-atoll-9623.herokuapp.com/api/historical-browsers/{browsers.history}"
        }, 
        "browsers.versions": {
            "type": "browser versions", 
            "href": "https://protected-atoll-9623.herokuapp.com/api/browser-versions/{browsers.versions}"
        }, 
        "browsers.history_current": {
            "type": "historical browsers", 
            "href": "https://protected-atoll-9623.herokuapp.com/api/historical-browsers/{browsers.history_current}"
        }
    }, 
    "browsers": {
        "id": "1", 
        "slug": "firefox-mobile", 
        "icon": null, 
        "name": {
            "en": "Firefox Mobile"
        }, 
        "note": null, 
        "links": {
            "history": [
                "1"
            ], 
            "history_current": "1", 
            "versions": [
                "1", 
                "11", 
                "16", 
                "21", 
                "22", 
                "30", 
                "38", 
                "43", 
                "47", 
                "55", 
                "58", 
                "59", 
                "60", 
                "61", 
                "67", 
                "72", 
                "88", 
                "91", 
                "92", 
                "96", 
                "100", 
                "101", 
                "105", 
                "106", 
                "113", 
                "123", 
                "127", 
                "128", 
                "149", 
                "154", 
                "155", 
                "161", 
                "198", 
                "205", 
                "223", 
                "246", 
                "253", 
                "256", 
                "259", 
                "306", 
                "307", 
                "346", 
                "362"
            ]
        }
    }
}

Add real representations to docs

To ensure that the documentation keeps in sync with the API, real representations generated from sample data should be used in the docs.

API root should be sorted

The API root view should be sorted by function and/or alphabetically. The current representation is:

{
    "historical-browser-versions": "http://localhost:8000/api/historical-browser-versions", 
    "historical-browsers": "http://localhost:8000/api/historical-browsers", 
    "browser-versions": "http://localhost:8000/api/browser-versions", 
    "browsers": "http://localhost:8000/api/browsers", 
    "users": "http://localhost:8000/api/users"
}

Add pagination

JSON API does not suggest a pagination scheme, except to say that any pagination metadata can be placed in the meta section. The documented pagination scheme is:

{
    "browsers": [],
    "links": {},
    "meta": {
        "pagination": {
            "browsers": {
                "prev": null,
                "next": "https://api.compat.mozilla.org/browsers?page=2&per_page=10",
                "pages": 2,
                "per_page": 10,
                "total": 14,
            }
        }
    }
}

Expand flags for features and browser support

According to this mailing list thread, feature.maturity is not sufficient:

https://groups.google.com/forum/#!topic/mozilla.dev.mdn/hKh9Ib7nQgY

Instead, a set of flags should be used:

  • feature.experimental - The spec is not ratified, such as CSS Transitions, ES6, and DOM Living Standard
  • feature.standard - The feature is described in a standards-track spec
  • feature.stable - The feature is considered stable
  • browser-version-feature.prefix - A prefix associated with this feature
  • browser-version-feature.prefix-mandatory - True if the prefix is required when using the feature
  • browser-version-feature.alternative-name - An alternative name associated with this feature
  • browser-version-feature.alternative-name-mandatory - True if the alternative name is required to use this feature
  • browser-version-feature.requires-config - configuration string (i.e. "media.peerconnection.enabled=on") required to enable the feature
  • browser-version-feature.default-config - configuration string (i.e. "media.peerconnection.enabled=off") that the browser ships with

Add dash in resource names for JSON API representation

In the following sample output, spaces should not be used in resource names, but instead should be separated with dashes. Specifically:

  • browser versions should be browser-versions
  • historical browser versions should be historical-browser-versions
{
    "browser versions": {
        "id": "1", 
        "version": "", 
        "release_day": null, 
        "retirement_day": null, 
        "status": "unknown", 
        "release_notes_uri": null, 
        "note": null, 
        "order": 0, 
        "links": {
            "browser": "1", 
            "history_current": "1", 
            "history": [
                "1"
            ]
        }
    }, 
    "links": {
        "browser versions.browser": {
            "type": "browsers", 
            "href": "https://protected-atoll-9623.herokuapp.com/api/browsers/{browser versions.browser}"
        }, 
        "browser versions.history": {
            "type": "historical browser versions", 
            "href": "https://protected-atoll-9623.herokuapp.com/api/historical-browser-versions/{browser versions.history}"
        }, 
        "browser versions.history_current": {
            "type": "historical browser versions", 
            "href": "https://protected-atoll-9623.herokuapp.com/api/historical-browser-versions/{browser versions.history_current}"
        }
    }
}

Add caching

Anonymous reads of a resource, list of resources, or a view with a warm cache should result in no database queries. Updates should invalidate and/or update the cache.

Underlines appear in resource attribute names

In the sample JSON API representation below, attribute names include underscores (release_day, retirement_day). The docs state that attribute names use dashes instead. Either the API representation or the docs should be corrected.

{
    "browser versions": {
        "id": "1", 
        "version": "", 
        "release_day": null, 
        "retirement_day": null, 
        "status": "unknown", 
        "release_notes_uri": null, 
        "note": null, 
        "order": 0, 
        "links": {
            "browser": "1", 
            "history_current": "1", 
            "history": [
                "1"
            ]
        }
    }, 
    "links": {
        "browser versions.browser": {
            "type": "browsers", 
            "href": "https://protected-atoll-9623.herokuapp.com/api/browsers/{browser versions.browser}"
        }, 
        "browser versions.history": {
            "type": "historical browser versions", 
            "href": "https://protected-atoll-9623.herokuapp.com/api/historical-browser-versions/{browser versions.history}"
        }, 
        "browser versions.history_current": {
            "type": "historical browser versions", 
            "href": "https://protected-atoll-9623.herokuapp.com/api/historical-browser-versions/{browser versions.history_current}"
        }
    }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.