Skip to content

Reporting API - Dictionary reports not Report.body objects#43195

Open
hamishwillee wants to merge 12 commits intomdn:mainfrom
hamishwillee:report_api_general_changes
Open

Reporting API - Dictionary reports not Report.body objects#43195
hamishwillee wants to merge 12 commits intomdn:mainfrom
hamishwillee:report_api_general_changes

Conversation

@hamishwillee
Copy link
Collaborator

@hamishwillee hamishwillee commented Feb 23, 2026

The Reporting API changed such that ReportBody and Report are now dictionaries, and so (at least in theory) are all the derived report classes.

Note

In fact the specs and implementations are all over the place.

  • The base spec uses dictionaries, but some of the derived objects in related specs have been updated to use dictionaries and some have not.
  • The implementations use the interfaces. Except for the COEPViolationReport which defines an un-named report object that derives from nothing.

Anyway, the intent of the spec is clear, and there is evidence of interest to migrate. BCD suggested I just document as dictionaries, and that is certainly cleaner than trying to keep the story in an intermediate state.

This updates all the report objects into dictionaries, removing all inheritence. This is inline with MDN ways-of-working when a dictionary object is needed.

Todo:

  • InterventionReport
  • DeprecationReport
  • COEPViolationReport
  • CSPViolationReport
  • IntegrityViolationReport
  • SecurityPolicyViolationEvent - maybe
  • crash?
  • permissions-policy-violation
  • Reporting API

NOTE, where possible, have removed separate pages for property docs. Pointless in most of these (just repetetive). Have kept them where useful.

Note BCD links depend on mdn/browser-compat-data#27047

Related to

@github-actions github-actions bot added Content:WebAPI Web API docs size/l [PR only] 501-1000 LoC changed labels Feb 23, 2026
@hamishwillee hamishwillee changed the title Report api general changes Reporting API - Dictionary reports not Report.body objects Feb 23, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Feb 23, 2026

Preview URLs (41 pages)
External URLs (3)

URL: /en-US/docs/Web/API/DeprecationReport
Title: DeprecationReport


URL: /en-US/docs/Web/API/InterventionReport
Title: InterventionReport

(comment last updated: 2026-03-06 01:25:04)

@github-actions github-actions bot added size/xl [PR only] >1000 LoC changed Content:HTTP HTTP docs Content:Security Security docs and removed size/l [PR only] 501-1000 LoC changed labels Feb 23, 2026
@hamishwillee hamishwillee mentioned this pull request Feb 24, 2026
6 tasks
@hamishwillee hamishwillee force-pushed the report_api_general_changes branch from 6712f41 to d3f89bc Compare March 2, 2026 05:31
@hamishwillee hamishwillee marked this pull request as ready for review March 2, 2026 05:32
@hamishwillee hamishwillee requested review from a team as code owners March 2, 2026 05:32
@hamishwillee hamishwillee requested review from pepelsbey and removed request for a team March 2, 2026 05:32
### Reporting deprecated features

In our [deprecation_report.html](https://mdn.github.io/dom-examples/reporting-api/deprecation_report.html) example, we create a simple reporting observer to observe usage of deprecated features on our web page:
This example shows how to observe `"deprecation"` reports within a page that triggers them using a {{domxref("ReportingObserver")}}.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Note, new example is much easier to trigger and can be done inline.

@github-actions github-actions bot added the merge conflicts 🚧 [PR only] label Mar 2, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2026

This pull request has merge conflicts that must be resolved before it can be merged.

@hamishwillee hamishwillee force-pushed the report_api_general_changes branch from d3f89bc to d665bde Compare March 2, 2026 23:09
@github-actions github-actions bot removed the merge conflicts 🚧 [PR only] label Mar 2, 2026
@sideshowbarker sideshowbarker removed request for a team March 3, 2026 04:56
@github-actions
Copy link
Contributor

github-actions bot commented Mar 6, 2026

This pull request has merge conflicts that must be resolved before it can be merged.

@github-actions github-actions bot added the merge conflicts 🚧 [PR only] label Mar 6, 2026
@hamishwillee hamishwillee force-pushed the report_api_general_changes branch from d665bde to eaa4bb0 Compare March 6, 2026 01:07
@github-actions github-actions bot removed the merge conflicts 🚧 [PR only] label Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:HTTP HTTP docs Content:Security Security docs Content:WebAPI Web API docs size/xl [PR only] >1000 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant