Packages

rrdom

2.2.0 · 24 Oct 2026MIT3.7M / weekRepositoryHomepagenpmAtom feed

Your version

2.0.0

major1 Jun 2026Where it was published

2.2.0 is the newest release of 2.x.

In short

4 breaking6 new13 fixed1 internal

  • breaking

    Distributed files have new filenames, paths and extensions. Important: If you reference distributed files or types directly, you might have to update your paths/filenames. E.g. you import from rrweb/typings/... or rrdom/es. However you run import rrweb from 'rrweb' you won't notice a difference with this change. If you include rrweb files directly in a script tag, you might have to update that path to include a the .umd.cjs files instead. All .js files now use ES modules which can be used in modern browsers, node.js and bundlers that support ES modules. All npm packages now also ship .cjs and .umd.cjs files. The .umd.cjs files are CommonJS modules that bundle all files together to make it easy to ship one file to browser environments (similar to the previous .js files). The .cjs files are CommonJS modules that can be used in older Node.js environments. Types should be better defined in package.json and if you need specific types they might be exported from new packages (for example PlayerMachineState and SpeedMachineState are now exported from @rrweb/replay). Check the package.json's main and exports field for the available files.

  • breaking

    Improve performance by 80% in a super large benchmark case.

  • breaking

    Move shared rrweb event and recorder types into the new @rrweb/types package.

  • breaking

    Move browser-only rrdom features into the new rrdom package.

Release note

Major Changes

  • breaking

    Distributed files have new filenames, paths and extensions. Important: If you reference distributed files or types directly, you might have to update your paths/filenames. E.g. you import from rrweb/typings/... or rrdom/es. However you run import rrweb from 'rrweb' you won't notice a difference with this change. If you include rrweb files directly in a script tag, you might have to update that path to include a the .umd.cjs files instead. All .js files now use ES modules which can be used in modern browsers, node.js and bundlers that support ES modules. All npm packages now also ship .cjs and .umd.cjs files. The .umd.cjs files are CommonJS modules that bundle all files together to make it easy to ship one file to browser environments (similar to the previous .js files). The .cjs files are CommonJS modules that can be used in older Node.js environments. Types should be better defined in package.json and if you need specific types they might be exported from new packages (for example PlayerMachineState and SpeedMachineState are now exported from @rrweb/replay). Check the package.json's main and exports field for the available files.

  • breaking

    Improve performance by 80% in a super large benchmark case.

    1. Refactor: change the data structure of childNodes from array to linked list

    2. Improve the performance of the "contains" function. New algorithm will reduce the complexity from O(n) to O(logn)

  • breaking

    Move shared rrweb event and recorder types into the new @rrweb/types package.

  • breaking

    Move browser-only rrdom features into the new rrdom package.

Minor Changes

  • Support top-layer <dialog> components. Fixes #1381.

  • Add support for recording cross-origin iframes via recordCrossOriginIframes.

  • Add support for recording and replaying constructable adoptedStyleSheets, including stylesheet mutations, replace/replaceSync, shadow roots, iframes, live mode, and virtual DOM replay.

  • Add support for recording and replaying media playbackRate changes.

  • Add the fast-forward virtual DOM optimization for replay.

Patch Changes

  • Ignore invalid DOM attributes when diffing

  • Rrdom bugs

    1. Fix a bug in the diff algorithm.

    2. Omit the 'srcdoc' attribute of iframes to avoid overwriting content.

  • Support loop in RRMediaElement

  • Refactor all suffix of bundled scripts with commonjs module from 'js' to cjs #1087.

  • If RRNode appends a single child twice, children of the node will become an infinite link list.

  • Improve rrdom robustness #1091.

  • NodeType enum was moved from rrweb-snapshot to @rrweb/types
    The following types where moved from rrweb-snapshot to @rrweb/types: documentNode, documentTypeNode, legacyAttributes, textNode, cdataNode, commentNode, elementNode, serializedNode, serializedNodeWithId, serializedElementNodeWithId, serializedTextNodeWithId, IMirror, INode, mediaAttributes, attributes and DataURLOptions

  • Scrolling may not be applied when fast-forwarding

  • Provide a /umd/ output folder alongside the /dist/ one so that we can serve UMD (Universal Module Definition) files with a .js extension, without upsetting expectations set by package.json that all .js files in /dist/ are modules

  • Fix replay of delayed inlined stylesheet links by updating the existing link/style node attributes instead of adding a child node, and preserve mirror metadata when replacing rrdom nodes.

  • Fix iframe reload and rrdom diff issues by handling negative and unserialized node ids correctly.

  • Fix fast-forward replay so canvas image data inside iframes is restored when rebuilding through the virtual DOM path.

  • Remove children from Document nodes even when the document is not in the mirror.

  • Switch CSSOM usage to the rrweb-owned rrweb-cssom package.