TypeScript-DOM-lib-generator icon indicating copy to clipboard operation
TypeScript-DOM-lib-generator copied to clipboard

[WebRTC] A lot of metrics are missing

Open henbos opened this issue 2 years ago • 3 comments

If you look at RTCStats and its subdirectory you'll notice the metrics are very much not up to date.

For example RTCOutboundRtpStreamStats in dom.generated.d.ts appears to be missing 20-30 or so metrics compared to the spec. This is not a case of "not implemented by more than one browser", as we can see in the Web Platform Tests dashboard there are a lot of metrics implemented by multiple browsers that are not present here.

I don't know how the generator works, but it's worth noting that WebRTC stats do not have a WebIDL definition in the Chromium code base since these metrics objects are JS dictionaries that get converted from lower layer C++ classes so this is automatic.

henbos avatar Jul 27 '22 07:07 henbos

@aboba FYI

henbos avatar Jul 27 '22 07:07 henbos

This generator uses https://github.com/mdn/browser-compat-data (bcd) for them. Perhaps this one: https://github.com/mdn/browser-compat-data/blob/499d5fa0371c2919eb3caf43bc11b2805ae99772/api/RTCRtpStreamStats.json

If the data is wrong in bcd these must be corrected or added. Then this generator will add them into dom.generated.d.ts

HolgerJeromin avatar Jul 27 '22 08:07 HolgerJeromin

BCD indeed is used for interfaces, but dictionaries are manually managed because it's not straightforward to map them to BCD.

https://github.com/microsoft/TypeScript-DOM-lib-generator/blob/321faea739848ceade8d40aa5db16fadf8cd25c2/inputfiles/removedTypes.jsonc#L468-L507

PR welcome.

saschanaz avatar Aug 04 '22 07:08 saschanaz