History: ConverseJS
Source of version: 2 (current)
Copy to clipboard
ConverseJS is the web based XMPP client entirely written mainly in Javascript. It is used by Tiki to provide the webchat feature. This library was added into Tiki as third part library and managed by __composer__ build tool with help of supplementary repository asset-packagist.org.
!! Workarounds
!!! bootstrap.native
ConverseJS bundle a library called __bootstrap.native__. TikiWiki also uses the same library to show dropdows, buttons and modal forms. The problem is this library is loaded twice and causes a lot of conflicts and strange behaviors in Tiki interface.
There is no easy workaround to this problem. Actually, a patch was written to completely remove __bootstrap.native__ from ConverseJS and force to use the __bootstrap.native__ loaded by Tiki. This patch should be updated whenever ConverseJS is updated, otherwise it will not be applied by __composer__ correctly.
The patch file, as of Tiki 20.x, is located at -+installer/composer-patches/jcbrand-conversejs_remove-native-javascript-for-bootstrap.patch+-.
* https://gitlab.com/tikiwiki/tiki/blob/20.x/installer/composer-patches/jcbrand-conversejs_remove-native-javascript-for-bootstrap.patch
!!! assets_path
ConverseJS has an option called __assets_path__, used to inform the base url from where assets will be loaded. The problem it works just for resources loaded by Javascript only. Other resources loaded from CSS files are hardcoded to load from __/dist/__, that will never work on Tiki. The workaround to this problem was creating a new stylesheet to override ConverseJS definitions for all resources loaded from __/dist/__ URL. This file needs to be reviewed whenever ConverseJS is updated.
* https://gitlab.com/tikiwiki/tiki/blob/20.x/lib/xmpp/css/conversejs.css
!! Installing/Updating
1. Install the ConverseJS using the composer tool
{CODE()}
composer require -d vendor_bundled npm-asset/converse.js:5.0.5 --ignore-platform-reqs
{CODE}
2. Manually create a patch to remove bootstrap.native from ConverseJS
3. Check every place in conversejs.css where resource are loaded from __/dist/__ and override it in __lib/xmpp/css/conversejs.css__