api.PerformanceObserver.observe - Missing options data
Nobody has claimed this yet.
- Dominant language
- JSON
- Stars
- 5.8k
- Forks
- 2.6k
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 186
Description
Original title: PerformanceObserver.observe(): compatibility table is misleading — does not distinguish Level 1 (entryTypes) vs Level 2 (type+buffered) syntax, caused production breakage
MDN URL
https://developer.mozilla.org/en-US/docs/Web/API/PerformanceObserver/observe
What specific section or headline is this issue about?
Code example and Browser compatibility table
What information was incorrect, unhelpful, or incomplete?
The code example uses the Level 2 syntax ({ type, buffered }) without any warning:
observer.observe({ type: "resource", buffered: true });
This throws a runtime TypeError on older browsers (e.g. Android 9 WebView, iOS 12 Safari) that only support the Level 1 syntax ({ entryTypes: [...] }).
Additionally, the Browser Compatibility table shows observe() is supported from Safari 11 / iOS 11, but this only reflects support for the Level 1 signature. The Level 2 signature ({ type, buffered }) has a narrower support range that is not separately represented in the table.
The combination of a Level 2 example and a table that appears to show broad support is misleading.
What did you expect to see?
Either:
- The example uses the safer Level 1 syntax (entryTypes), or shows both syntaxes with a feature-detect fallback
- A compatibility warning noting that { type, buffered } requires Level 2 support (not available in Safari < 14, Chrome WebView < ~73)
- Separate BCD entries for the type and buffered options so developers can see the real support range
Do you have any supporting links, references, or citations?
- Performance Timeline Level 2 spec: https://w3c.github.io/performance-timeline/#dom-performanceobserver-observe
- Live reproduction: https://7fznjs.csb.app/
Do you have anything more you want to share?
Reproduction steps (verified on Android 9):
- Start an Android 9 emulator (API 28) via Android Studio AVD Manager
- Open https://7fznjs.csb.app/ in the browser
- Inspect via chrome://inspect on desktop Chrome
- Error in Console: "Uncaught TypeError: Failed to execute 'observe' on 'PerformanceObserver': required member entryTypes is undefined."
Environment: Android 9 (PSR1.210301.009.B1), WebView Chrome 66.0.3359.158
iOS 12 was also affected — confirmed at the time via a real enterprise device — but cannot be re-verified now as iOS 12 simulators require Xcode 13 (incompatible with newer macOS), and cloud platforms like BrowserStack no longer support iOS 12.
This issue caused a production white screen in an enterprise app. The misleading compatibility table was the primary reason the bug went unnoticed during development.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the PerformanceObserver.observe MDN page's code example and Browser compatibility table, then inspect the repository's existing compatibility data for this API and its options. Compare the Level 1 and Level 2 behavior with the linked specification and reproduction; done means the example and compatibility information no longer imply that both syntaxes have the same browser support.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100