jsdom
31.0.1 · 13 Nov 2026MIT166.8M / weekRepositoryHomepagenpmAtom feed
Upgrading jsdom From 2.0.0 to 3.0.0
1 release in betweenevery note read
- 1
- change to make
- 0
- advisories fixed
- 2
- new
- 2
- fixes
Before you upgrade
Tick each one off as you go- Breaking3.0.0
Release by release
- Breaking
Removed all traces of entities, entity types, notations, default attributes, and CDATA sections.
- New
Introduced a new "virtual console" abstraction for capturing console output from inside the page. See the readme for more information. Note that
console.errorwill no longer contribute to the (non-standard, and likely dying in the future)window.errorsarray. - New
Added the named
new Image(width, height)constructor. - Fixed
Fixed an exception when using
querySelectorwith selectors likediv:last-child > span[title]. - Fixed
Fixed a variety of accessors on
Node,Element,Attr, andDocument; some were removed that were nonstandard (especially setters); others were updated to reflect the spec; etc.
- Breaking
11 other lines we could not sort, mostly version bumps
- 3.0.0
By default documents now use
about:blankas their URL, instead of trying to infer some type of file URL from the call site (in Node.js) or usinglocation.href(in browsers). - 3.0.0
Differentiated between XML and HTML documents better, for example in how they handle the casing of tag names and attributes.
- 3.0.0
Updated
DOMImplementationto mostly work per-spec, including removingaddFeatureandremoveFeaturemethods, theownerDocumentproperty, and makinghasFeaturealways returntrue. - 3.0.0
Re-did the
CharacterDataimplementation to follow the algorithms in the DOM Standard; this notably removes a few exceptions that were previously thrown. - 3.0.0
Re-did
Comment,Text, andProcessingInstructionto follow the DOM Standard and derive fromCharacterData. - 3.0.0
Re-did
DocumentTypeto follow the DOM Standard and be much simpler, notably removing notations, entities, and default attributes. - 3.0.0
Re-did name/qname validation, which is done by various APIs, to work with the xml-name-validator package and some centralized algorithms.
- 3.0.0
Made the XML parser at least somewhat aware of processing instructions.
- 3.0.0
Cleaned up doctype parsing and association between doctypes and documents. More exotic doctypes should parse better now.
- 3.0.0
document.contentTypenow is generally inferred from the parsing mode of the document.
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.