Skip to content

Release 4.0.0 (2026-11-02)

Latest

Choose a tag to compare

@krdlab krdlab released this 02 Nov 04:29
2482d9b

direct-js@4.0.0 has been released with the following changes.

Breaking changes

  • Requires node >= 20. Node.js 18 is no longer supported. The npm >= 10 requirement is unchanged.
  • The XML validator for styled notes has been reimplemented with @xmldom/xmldom, with the schema built into the library. libxmljs is no longer a dependency, so direct-js no longer needs a native addon to be built or downloaded as a prebuilt binary.
  • The validator is stricter than before. The following are now rejected:
    • DOCTYPE declarations
    • Prefixed namespace declarations, including unused ones
    • xml:space="default" (only preserve is accepted where xml:space is allowed)
    • A version attribute on the note element whose value is not exactly 1. Values previously treated as 1, such as +1, 01, and " 1 ", are now rejected.
    • A url attribute on a link element that contains a space. As before, the URL must be URL-encoded, and an IDN must be converted to Punycode.
  • Some validation error messages have been reworded, including the message of failed validateXml results and the ValidationError messages of the note APIs. validateXml still returns { ok: true } on success and { ok: false, errorType, message } on failure, and the set of errorType values is unchanged. Do not depend on the exact message text.
  • lib/note-richtext.v1.xsd and lib/xml.xsd are no longer included in the package because the schema is built into the library.

Fixes

  • The 100,000-byte size limit for styled note content is now enforced using the UTF-8 byte length rather than the character count.

Notes

  • hubot-direct@5.0.0 depends on this version (direct-js >=4 <5). If you use direct-js through hubot-direct, upgrade hubot-direct to 5.0.0.