Breaking changes
Both breaking changes affect Node.js only. Browser builds are unaffected, and no public API
was removed.
jsdomis replaced by@xmldom/xmldom. The Node build only ever used jsdom for three XML DOM globals (DOMParser,XMLSerializeranddocument.implementation), a small fraction of what a full HTML browser emulation provides. It now uses@xmldom/xmldom, a small, pure-JavaScript XML DOM. Install@xmldom/xmldomalongsidewsand dropjsdom. Upgrading without it fails at import withERR_MODULE_NOT_FOUND. See the README.Builder.h()parses its argument as XML rather than HTML under Node. XHTML-IM content must now be well-formed XML, for example<br/>rather than<br>. Markup that is not well-formed yields an empty element instead of being error corrected.
Features
- Add a Node-only XEP-0114 external component transport. Connect as a
jabber:component:acceptcomponent over a raw TCP stream by passing theprotocol: 'component'option and atcp://host:portservice URL. The transport uses thesaxesstreaming XML parser, an optional peer dependency that is resolved on first use, so applications that only speak BOSH or WebSocket do not need it installed. - Add
Connection.addProtocol(name, transport)for registering an additional transport, which is how the component transport is made selectable without the browser build depending on it. - Add
Strophe.getNamespace(elem), a transport-agnostic accessor that resolves an element's namespace from eithernamespaceURIor anxmlnsattribute. - Add a project logo and brand assets.
Fixes
- Fix: match handlers by namespace regardless of how the stanza DOM was built. Handlers registered with a namespace (such as
addHandler(cb, NS.PUBSUB, 'iq', 'set')) silently failed to match stanzas that carry their namespace onnamespaceURIrather than in anxmlnsattribute, which is how the component transport builds them. Matching now reads both, so a handler may now fire on stanzas where it previously stayed silent.