jsdom v16.0.0 Release Notes

Release Date: 2020-01-11 // over 4 years ago
  • ๐Ÿš€ For this release we'd like to welcome @pmdartus to the core team. Among other work, he's driven the heroic effort of constructor prototype and reform in jsdom and its dependencies over the last few months, to allow us to move away from shared constructors and prototypes, and set the groundwork for custom elements support (coming soon!).

    ๐Ÿ’ฅ Breaking changes:

    • ๐Ÿ‘ Node v10 is now the minimum supported version.
    • The dom.runVMScript() API has been replaced with the more general dom.getInternalVMContext() API.
    • ๐ŸŒ Each jsdom Window now creates new instances of all the web platform globals. That is, our old shared constructor and prototypes caveat is no longer in play.
    • Each jsdom Window now exposes all JavaScript-spec-defined globals uniformly. When runScripts is disabled, it exposes them as aliases of the ones from the outer Node.js environment. Whereas when runScripts is enabled, it exposes fresh copies of each global from the new scripting environment. (Previously, a few typed array classes would always be aliased, and with runScripts disabled, the other classes would not be exposed at all.)

    Other changes:

    • โž• Added the AbstractRange, Range, StaticRange, Selection, and window.getSelection() APIs.
    • โž• Added working constructors for Comment, Text, and DocumentFragment.
    • โž• Added valueAsDate, valueAsNumber, stepUp() and stepDown() to <input> elements. (kraynel)
    • โž• Added window.origin.
    • โœ‚ Removed document.origin.
    • ๐Ÿ›  Fixed <template> to work correctly inside XML documents.
    • ๐Ÿ›  Fixed some bugs which would cause jsdom to choose the wrong character encoding because it was failing to detect <meta charset> or <meta http-equiv="charset"> elements.
    • ๐Ÿ›  Fixed input.type to default to "text". (connormeredith)
    • ๐Ÿ›  Fixed incorrect validation errors for <input> with fractional values for their step="" attribute. (kontomondo)
    • ๐Ÿ›  Fixed incorrect validation errors on readonly <input> elements.
    • ๐Ÿ›  Fixed <input type="email" multiple pattern="..."> validation.
    • ๐Ÿ›  Fixed fileReader.readAsDataURL() to always base64-encode the result. (ytetsuro)
    • ๐Ÿ›  Fixed inserting <img> elements into documents without a browsing context to no longer crash when the canvas package is installed.
    • ๐Ÿ›  Fixed a memory leak when using window.setTimeout() or window.setInterval().
    • ๐Ÿ‘Œ Improved the performance of getComputedStyle(). (eps1lon)