Packages

jsdom

31.0.1 · 13 Nov 2026MIT166.8M / weekRepositoryHomepagenpmAtom feed

Upgrading jsdom From 16.5.0 to 31.0.1

55 releases in betweenevery note read

Other targets from 16.5.0Newest 16.x16.7.0
  1. 16.5.0yours
  2. 5 releases
  3. 17.0.0major
  4. 18.0.0major
  5. 3 releases
  6. 19.0.0major
  7. 20.0.0major
  8. 3 releases
  9. 21.0.0major
  10. 3 releases
  11. 22.0.0major
  12. 1 release
  13. 23.0.0major
  14. 3 releases
  15. 24.0.0major
  16. 4 releases
  17. 25.0.0major
  18. 1 release
  19. 26.0.0major
  20. 1 release
  21. 27.0.0major
  22. 5 releases
  23. 28.0.0major
  24. 1 release
  25. 29.0.0major
  26. 4 releases
  27. 30.0.0major
  28. 5 releases
  29. 31.0.0major
  30. 31.0.1target

Start here

Before you upgrade

Tick each one off as you go
  • Breaking31.0.0
  • Breaking31.0.0
  • Breaking31.0.0
  • Breaking29.0.0
  • Breaking27.0.0
  • Breaking26.0.0
  • Breaking23.0.0
  • Breaking22.0.0
  • Breaking22.0.0
  • Breaking20.0.0

Release by release

  1. 31.0.1

    13 Nov 20263 fixes
    • Fixed

      Fixed element.tabIndex handling of invalid and out-of-range tabindex="" values to use the element's default instead of returning zero or wrapping. Values with trailing non-digits now use their leading integer, so tabindex="1e2" yields 1 instead of 100.

    • Fixed

      Fixed CSS ident() results containing spaces or leading digits losing their required escaping during serialization and variable substitution.

    • Fixed

      Fixed 'max-lines' values combining an integer and auto to serialize with the integer first, such as 3 auto.

  2. 31.0.0

    Migration needed5 Nov 20262 new · 12 fixes
    • Breaking

      Changed the optional canvas and image decoding backend from canvas to @napi-rs/canvas. Install @napi-rs/canvas v1.0.13 or later in the v1.x series alongside jsdom; installing canvas alone no longer enables this support. The new backend provides prebuilt Skia binaries on supported platforms, and rendering and encoded image bytes can differ. Projects using native canvas objects or custom font registration should follow the canvas migration guidance. Added WebP serialization through canvas.toDataURL() and canvas.toBlob(). Fixed image loading to wait for decoding before firing load, discard obsolete source requests, avoid refetching when dimensions change, and prevent failed images from drawing stale contents. Fixed canvas context and serialization behavior, including unsupported context types, read-only ctx.canvas, image-drawing exceptions, MIME type and quality normalization, and asynchronous null results from canvas.toBlob() for empty canvases or encoding failures.

    • Breaking

      Changed CSS parsing, selector matching, and computed styles to use a new integrated implementation, with substantially expanded support and faster selector queries and repeated style reads. This includes cascade layers, nesting, @scope, custom-property substitution and registration through @property and CSS.registerProperty(), typed attr(), conditional if(), shadow-tree styling with :host, ::slotted(), and ::part(), pseudo-element computed styles, and constructable stylesheets with document.adoptedStyleSheets and shadowRoot.adoptedStyleSheets. Fixed numerous cascade, shorthand, serialization, and default-style issues; computed declarations now stay live across DOM and stylesheet changes. CSS serialization and computed values can differ from previous releases.

    • Breaking

      Changed HTML and XML parsing to pause at blocking scripts until their required resources are ready. The JSDOM constructor, JSDOM.fromURL(), and JSDOM.fromFile() can now return partially parsed documents. Wait for DOMContentLoaded for the finished tree, or the window's load event for load-delaying resources, checking document.readyState first in case the event has already fired. XML syntax errors encountered after asynchronous parsing resumes are reported through the virtual console as "xml-parsing" errors.

    • New

      Added window.reportError(), which dispatches an error event and reports uncanceled errors to the virtual console.

  3. 30.1.3

    15 Oct 202613 fixes
    • Fixed

      Fixed slowdowns when focusing elements and running interaction tests, which regressed in v30.1.2.

    • Fixed

      Fixed XMLHttpRequest reusing credentials supplied to xhr.open() after cross-origin redirects, including in response to authentication challenges from the destination.

    • Fixed

      Fixed XMLHttpRequest incorrectly sending and accepting cookies after cross-origin redirects back to the document's origin when xhr.withCredentials is false.

    • Fixed

      Fixed exceptions from malformed CSS math functions, such as calc(0px - @submenu_space), while parsing documents, stylesheets, and style declarations.

  4. 30.1.2

    4 Oct 202612 fixes
    • Fixed

      Fixed severe slowdowns when building large DOM trees, including SVG charts with D3, which regressed in v30.1.0.

    • Fixed

      Fixed exponentially slow reads of empty inherited CSS custom properties in deeply nested documents, and custom properties incorrectly inheriting past an initial reset.

    • Fixed

      Fixed getComputedStyle() returning stale results after editing stylesheet declarations, selectors, or media queries, including in imported stylesheets.

    • Fixed

      Fixed selector matching and computed styles after changes to form control checkedness, indeterminacy, selection, values, and validity, including during form resets and canceled clicks.

  5. 30.1.1

    22 Sep 202613 fixes
    • Fixed

      Fixed spurious window blur and focusout events and incorrect event.relatedTarget values when focusing an element after removing the previously focused element, which regressed in v30.1.0.

    • Fixed

      Fixed focus and blur behavior across frames, and focusing the document's viewport through document.documentElement.focus().

    • Fixed

      Fixed focus targets removed or disabled by blur listeners becoming active, and text selections made by focus and blur listeners being overwritten.

    • Fixed

      Fixed element.focus() incorrectly focusing disabled form controls and <input type="hidden"> elements with tabindex="".

  6. 30.1.0

    17 Sep 20263 new · 59 fixes
    • New

      Added named access to elements on document, such as document.myForm for <form name="myForm">.

    • New

      Added QuotaExceededError, including its use for storage quota errors and oversized crypto.getRandomValues() requests.

    • New

      Added support for the relaxed DOM naming rules when creating elements, attributes, and document types.

    • Fixed

      Fixed element.querySelectorAll() returning no matches when the first part of the selector matches the element itself, which regressed in v30.0.0.

  7. 30.0.1

    29 Jul 20261 new · 1 fix
    • New

      Sped up up range operations on large documents

    • Fixed

      Fixed getComputedStyle() with calc() and other functions throwing an exception, which regressed in v30.0.0.

  8. 30.0.0

    27 Jul 20262 new · 3 fixes
    • New

      Added CSS.escape() and CSS.supports() functions.

    • New

      Added 'background-position-x' and 'background-position-y' CSS properties.

    • Fixed

      Fixed getComputedStyle() to convert length values into pixels.

    • Fixed

      Fixed CSS function serialization, e.g., in the return value of getPropertyValue().

    • Fixed

      Fixed the type of error thrown by document.evaluate()

61 other lines we could not sort, mostly version bumps
  • Improved performance of computed style reads, selector matching, CSS variable substitution, CSS shorthand updates, and focus handling on pages with many style rules.

    31.0.1
  • Improved performance when building detached DOM trees and reading node.isConnected.

    31.0.1
  • Improved performance of getComputedStyle() and computed CSS property reads, including with stylesheets containing attribute selectors. (@scttcper, @asamuzaK)

    30.1.3
  • Updated URLs to support Unicode v18.0.0 in internationalized domain names.

    30.1.2
  • Reduced package size and memory use for CSS property definitions.

    30.1.2
  • Improved performance of DOM construction, tree mutations, range operations, and live collection access, especially on large documents. (@scttcper, @erezrokah)

    30.1.0
  • Improved performance of getComputedStyle(), style changes, and CSS serialization. (@scttcper, @jhult)

    30.1.0
  • Improved performance of event dispatch, form control and label lookups, and updates to <select> elements and radio button groups.

    30.1.0
  • Reduced memory use when creating and working with DOM nodes, attributes, event listeners, and mutation observers.

    30.1.0
  • Changed window.close() to preserve access to the document and its DOM through retained references.

    30.1.0

2 internal lines (docs, tests, tooling) left out.

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.