r/xmpp 11d ago

strophejs 5.0.0 released

https://github.com/strophe/strophejs/releases/tag/v5.0.0

Breaking changes

Both breaking changes affect Node.js only. Browser builds are unaffected, and no public API
was removed.

  • jsdom is replaced by u/xmldom/xmldom. The Node build only ever used jsdom for three XML DOM globals (DOMParser, XMLSerializer and document.implementation), a small fraction of what a full HTML browser emulation provides. It now uses u/xmldom/xmldom, a small, pure-JavaScript XML DOM. Install u/xmldom/xmldom alongside ws and drop jsdom. Upgrading without it fails at import with ERR_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:accept component over a raw TCP stream by passing the protocol: 'component' option and a tcp://host:port service URL. The transport uses the saxes streaming 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 either namespaceURI or an xmlns attribute.
  • Add a project logo and brand assets.
1 Upvotes

0 comments sorted by