jsdom v7.0.0 Release Notes

  • ๐Ÿš€ This major release has as its headlining feature a completely re-written XMLHttpRequest implementation, in a heroic effort by @nicolashenry. It includes a number of other smaller improvements and fixes. The breaking changes are highlighted in bold below.

    • Node.js 4.0 onward is now required, as we have begun using ES2015 features only present there.
    • Completely re-implemented XMLHttpRequest and related classes (nicolashenry):
      • Includes support for Blob, File, FileList, FileReader, FormData, ProgressEvent, and the supporting XMLHttpRequestUpload, and XMLHttpRequestEventTarget interfaces.
      • Includes support for synchronous XHRs.
      • Adds some new request-management abilities, documented in the readme. In short, the pool, agentOptions, and userAgent options are new, and resource loads can now be aborted.
      • These implementations are extremely complete and standards-compliant, passing 136 newly-introduced web platform tests.
    • โž• Added document.charset, an alias for document.characterSet.
    • โž• Added HTMLTemplateElement.prototype.content, for getting the contents of a <template> element as a document fragment. (rickychien)
    • ๐Ÿ“œ Implemented "loose" cookie parsing, giving correct execution of code like document.cookie = "foo".
    • Several fixes related to event dispatching and creation, including the addition of Event.prototype.stopImmediatePropagation and the constants NONE, CAPTURING_PHASE, AT_TARGET, and BUBBLING_PHASE. This accounted for another 15 newly-passing web platform tests. (nicolashenry)
    • ๐Ÿ›  Fixed document.styleSheets to correctly track the removal of stylesheets from the document. (AVGP)
    • ๐Ÿ›  Fixed the created jsdom lifecycle callback receiving a different window object than the loaded or done callbacks when scripting was enabled.
    • Invalid URLs are no longer allowed when creating a jsdom document; the URL must be parseable, or an error will be thrown.
    • ๐Ÿšš The { omitJsdomErrors } option of the virtual console has moved; it is no longer provided when creating the virtual console, but instead when calling sendTo.