Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

Improvements to the report format #2759

Closed
foolip opened this issue Mar 24, 2023 · 0 comments
Closed

Improvements to the report format #2759

foolip opened this issue Mar 24, 2023 · 0 comments

Comments

@foolip
Copy link
Owner

foolip commented Mar 24, 2023

Braindump at the request of @jugglinmike and @lolaodelola. @ddbeck @Elchi3 @queengooborg FYI.

This is the structure of mdn-bcd-collector reports currently:

{
    "__version": "6.2.7",
    "results": {
        "https://mdn-bcd-collector.appspot.com/tests/": [
            {
                "exposure": "ServiceWorker",
                "name": "api.AbortController.AbortController",
                "result": true
            },
            {
                "exposure": "SharedWorker",
                "name": "api.AbortController.AbortController",
                "result": false
            },
            {
                "exposure": "Window",
                "name": "api.AbortController.AbortController",
                "result": true
            },
            {
                "exposure": "Worker",
                "name": "api.AbortController.AbortController",
                "result": true
            },
            {
                "exposure": "Window",
                "message": "threw TypeError: Failed to construct 'Notification': Illegal constructor. Use ServiceWorkerRegistration.showNotification() instead.",
                "name": "api.Notification.actions",
                "result": null
            },
            {
                "exposure": "Worker",
                "message": "threw TypeError: Failed to construct 'Notification': Illegal constructor. Use ServiceWorkerRegistration.showNotification() instead.",
                "name": "api.Notification.actions",
                "result": null
            }
        ]
    },
    "userAgent": "Mozilla/5.0 (Linux; Android 10; SM-G960U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Mobile Safari/537.36"
}

A few things that could be improved:

  • https://mdn-bcd-collector.appspot.com/tests/ as a key isn't really needed. Originally it was to test using both HTTP and HTTPS and combine results, but that's long time. The update-bcd script only uses the Object.values(report.results), not the keys.
  • Nothing allows mapping results for api.Document.mozCancelFullScreen to api.Document.exitFullscreen will an alternative_name. Handle prefixes and alternative names #431 remains unsolved.
  • There can be multiple results for a single path, leaving it to update-bcd to combine them. To allow moving update-bcd to BCD itself and consuming reports without much knowledge of the collector, it might be better to combine/map results when producing reports, not when consuming them.
  • The reports could probably be more compact if represented as a tree, more like BCD.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant