sentry-javascript
sentry-javascript copied to clipboard
Add DOM node counts to replay SDK
We currently show a DOM node count in the UI, but it's calculated on the frontend/UI side which is quite expensive.
We should instead calculate this on SDK (source) by either:
-
document.querySelectorAll('*') -
record.mirror.idNodeMap
The former include elements that replay does not capture (meta, script and svg). The latter includes text nodes. I think using the rrweb mirror makes more sense since we would then be reporting what we are recording in the replay. It is also currently what we show in the replay details by the frontend.